GQ_Communicate/GQ_URP/GQ/Assets/script/日历/CalendarScript.cs

73 lines
1.2 KiB
C#

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()
{
}
/// <summary>
/// 初始化显隐按钮
/// </summary>
public void init()
{
text.text = "打开日历";
zCalendar.Hide();
}
/// <summary>
/// 点击显隐按钮
/// </summary>
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);
}
}