using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using ZTools; public class CalendarScript : MonoBehaviour, IPointerClickHandler { public static CalendarScript Inst; public ZCalendar zCalendar; public Text text; public void OnPointerClick(PointerEventData eventData) { clickzCalendar(); } void Awake() { Inst = this; } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } /// /// 初始化显隐按钮 /// public void init() { text.text = "打开日历"; zCalendar.Hide(); } /// /// 点击显隐按钮 /// public void clickzCalendar() { if (text.text == "关闭日历") { zCalendar.Hide(); text.text = "打开日历"; } else { zCalendar.Show(); text.text = "关闭日历"; } } public void open() { init(); gameObject.SetActive(true); } public void close() { gameObject.SetActive(false); } }