Tz2/Assets/GameAssets/UI/ECP/Script/ToggleArrowControl.cs

38 lines
950 B
C#

using System.Collections;
using System.Collections.Generic;
using Framework.Manager;
using UnityEngine;
using UnityEngine.UI;
public class ToggleArrowControl : MonoBehaviour
{
private Toggle toggle;
private GameObject arrowright;
private GameObject arrowdwon;
void Start()
{
toggle = GetComponent<Toggle>();
arrowright = transform.GetChild(2).gameObject;
arrowdwon = transform.GetChild(3).gameObject;
toggle.onValueChanged.AddListener((s) =>
{
if (toggle.isOn)
{
arrowright.SetActive(false);
arrowdwon.SetActive(true);
TutorialGuideManager.Instance.TriggerNextGuide(toggle.name);
}
else
{
arrowdwon.SetActive(false);
arrowright.SetActive(true);
}
});
}
// Update is called once per frame
void Update()
{
}
}