using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class LoadDirChanger : MonoBehaviour
{
    public InputField LoadDirDateTextBox;
    public InputField LoadDirTimeTextBox;
    public Toggle Toggle;
    public GameObject DataTransfer;


    public void OnDirToggleChanged()
    {
        // if loadDirToggle is on then turn off the input text boxs.
        LoadDirDateTextBox.interactable = Toggle.isOn;
        LoadDirTimeTextBox.interactable = Toggle.isOn;
        // if loadDirToggle is off set loaddirs as 0.
        if (!Toggle.isOn)
        {
            DataTransfer.GetComponent<StartSeneData>().LoadDirDate = "0";
            DataTransfer.GetComponent<StartSeneData>().LoadDirTime = "0";
        }
    }

    public void OnDateValueChanged()
    {
        string input = LoadDirDateTextBox.GetComponent<InputField>().text;
        DataTransfer.GetComponent<StartSeneData>().LoadDirDate = input;
    }
    public void OnTimeValueChanged()
    {
        string input = LoadDirTimeTextBox.GetComponent<InputField>().text;
        DataTransfer.GetComponent<StartSeneData>().LoadDirTime = input;
    }
}
