HKMBFZ/Assets/Scripts/Szz_Scripts/UI/MyToggleState.cs

37 lines
741 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// toggleÏà¹ØµÄ״̬¹ÜÀí
/// </summary>
public class MyToggleState : MonoBehaviour
{
public TextMeshProUGUI myName;
public TextMeshProUGUI myTime;
public TextMeshProUGUI myEvent;
Toggle t;
// Start is called before the first frame update
void Start()
{
t=GetComponent<Toggle>();
}
public void OnToggleChange(bool value)
{
if (value)
{
myName.color = Color.black;
myTime.color = Color.black;
}
else
{
myName.color = Color.white;
myTime.color = Color.white;
}
}
}