63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
|
using System;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class EnvArgsChanger : MonoBehaviour
|
||
|
{
|
||
|
public GameObject DataTransfer;
|
||
|
|
||
|
[Header("EnemyNum")]
|
||
|
public Text EnemyNumText;
|
||
|
public InputField EnemyNumInput;
|
||
|
|
||
|
[Header("TimeLimit")]
|
||
|
public Text TimeLimText;
|
||
|
public InputField TimelimInput;
|
||
|
|
||
|
[Header("Decision Period")]
|
||
|
public Slider DecisionPeriodSlide;
|
||
|
public Text DecisionPeriodDataText;
|
||
|
public Toggle TakeActionsBetweenDecisionsToggle;
|
||
|
|
||
|
|
||
|
public void onEnemynumValueChanged()
|
||
|
{
|
||
|
// enemy total num value control
|
||
|
if (EnemyNumInput.GetComponent<InputField>().text == "" || EnemyNumInput.GetComponent<InputField>().text.Contains("-"))
|
||
|
{
|
||
|
EnemyNumText.color = Color.gray;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
EnemyNumText.color = Color.yellow;
|
||
|
DataTransfer.GetComponent<StartSeneData>().EnemyNum = Math.Abs(int.Parse(EnemyNumInput.GetComponent<InputField>().text));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void onTimeValueChanged()
|
||
|
{
|
||
|
// time limit value control
|
||
|
if (TimelimInput.GetComponent<InputField>().text == "" || TimelimInput.GetComponent<InputField>().text.Contains("-"))
|
||
|
{
|
||
|
TimeLimText.color = Color.gray;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
TimeLimText.color = Color.yellow;
|
||
|
DataTransfer.GetComponent<StartSeneData>().Timelim = Math.Abs(int.Parse(TimelimInput.GetComponent<InputField>().text));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void onDPSlideValueChanged()
|
||
|
{
|
||
|
// DecisionPeriod(DP) value Control
|
||
|
DataTransfer.GetComponent<StartSeneData>().DecisionPeriod = (int)(DecisionPeriodSlide.GetComponent<Slider>().value);
|
||
|
DecisionPeriodDataText.text = DataTransfer.GetComponent<StartSeneData>().DecisionPeriod.ToString();
|
||
|
}
|
||
|
public void onABDToggleChanged()
|
||
|
{
|
||
|
// Actions Between Decisions(ABD) Toggle Control
|
||
|
DataTransfer.GetComponent<StartSeneData>().ActionsBetweenDecisions = TakeActionsBetweenDecisionsToggle.isOn;
|
||
|
}
|
||
|
}
|