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

49 lines
1.2 KiB
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 GameObject submitPanel;//模板面板
public Toggle preservationToggle;//保存Toggle
public Text SchoolText; //事故校区文本
public Text PlaceText; //事故地点文本
public Text NumberText; //参与人数文本
// Start is called before the first frame update
void Start()
{
// 确保初始时面板是关闭的
calendarPanel.SetActive(false);
preservationToggle.isOn = false;
}
// Update is called once per frame
void Update()
{
}
// 切换日历面板显示/隐藏
public void ClickCalendarBtn()
{
// 切换日历面板的激活状态
bool isActive = calendarPanel.activeSelf;
calendarPanel.SetActive(!isActive);
}
public void OnClickSubmitPanel()
{
if(preservationToggle.isOn==true)
{
submitPanel.gameObject.SetActive(true);
}
}
public void OnClickSurePanel()
{
submitPanel.gameObject.SetActive(false);
}
}