using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using System; using UnityEngine.UI; public class UIManager : MonoBehaviour { /// /// 时刻 /// [SerializeField] TextMeshProUGUI text1; /// /// 时间 /// [SerializeField] TextMeshProUGUI text2; /// /// 切换到智慧运维 /// [Header("Btn_古泉站")] public Button btn1; void Start() { text1.text = DateTime.Now.ToShortTimeString(); text2.text = DateTime.Now.ToLongDateString(); InvokeRepeating("UpdateTime", 1, 1); BtnEvent(); } void Update() { } void UpdateTime() { text1.text = DateTime.Now.ToShortTimeString(); text2.text = DateTime.Now.ToLongDateString(); //print("更新了时间"); } void BtnEvent() { btn1.onClick.AddListener(() => { Invoke("InvokeSetActive",1f); }); } void InvokeSetActive() { //GameObject go1 = transform.Find("Panel_智慧运维").gameObject; //GameObject go2 = transform.Find("Panel_安徽省地图").gameObject; //go1.SetActive(true); //go2.SetActive(false); } }