_xiaofang/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs

35 lines
824 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DatePanel : MonoBehaviour
{
[Header("组件")]
public Button calendarBtn; // 日历按钮
public GameObject calendarPanel; // 日历面板
public Text SchoolText; //事故校区文本
public Text PlaceText; //事故地点文本
public Text NumberText; //参与人数文本
// Start is called before the first frame update
void Start()
{
// 确保初始时面板是关闭的
calendarPanel.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
// 切换日历面板显示/隐藏
public void ClickCalendarBtn()
{
// 切换日历面板的激活状态
bool isActive = calendarPanel.activeSelf;
calendarPanel.SetActive(!isActive);
}
}