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

90 lines
2.5 KiB
C#
Raw Normal View History

2024-12-09 14:20:37 +08:00
using JetBrains.Annotations;
2024-11-29 09:47:47 +08:00
using System.Collections;
using System.Collections.Generic;
using TMPro;
2024-11-29 09:47:47 +08:00
using UnityEngine;
2024-12-24 19:28:00 +08:00
using UnityEngine.SceneManagement;
2024-11-29 09:47:47 +08:00
using UnityEngine.UI;
public class DatePanel : MonoBehaviour
{
[Header("<22><><EFBFBD><EFBFBD>")]
public Button calendarBtn; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
public GameObject calendarPanel; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-11-30 23:32:17 +08:00
public GameObject submitPanel;//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Toggle preservationToggle;//<2F><><EFBFBD><EFBFBD>Toggle
2024-11-30 15:11:53 +08:00
public Text SchoolText; //<2F>¹<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ı<EFBFBD>
public Text PlaceText; //<2F>¹ʵص<CAB5><D8B5>ı<EFBFBD>
public Text NumberText; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
public InputField submitInputField;
public Text submitText;
public Text inputText;
public Text dataText;
2024-12-23 17:19:50 +08:00
public string placeId;
2024-12-18 10:22:19 +08:00
public Panel panel;
2024-12-11 16:36:27 +08:00
public createTemplateInterface createTemplateInterface=new createTemplateInterface();
2024-11-29 09:47:47 +08:00
// Start is called before the first frame update
void Start()
{
// ȷ<><C8B7><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1><EFBFBD><EFBFBD><EFBFBD>ǹرյ<D8B1>
calendarPanel.SetActive(false);
2024-11-30 23:32:17 +08:00
preservationToggle.isOn = false;
2024-11-29 09:47:47 +08:00
}
// Update is called once per frame
void Update()
{
}
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ/<2F><><EFBFBD><EFBFBD>
public void ClickCalendarBtn()
{
// <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>״̬
bool isActive = calendarPanel.activeSelf;
calendarPanel.SetActive(!isActive);
}
//<2F><EFBFBD><E1BDBB>ť
2024-11-30 23:32:17 +08:00
public void OnClickSubmitPanel()
2024-12-07 17:47:46 +08:00
{
2024-12-23 17:19:50 +08:00
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = placeId;
2024-12-12 19:14:48 +08:00
if(preservationToggle.isOn)
2024-12-11 16:36:27 +08:00
{
createTemplateInfo.Instance.auth_CreateTemplate.isTemplate = "0";
}
else
{
createTemplateInfo.Instance.auth_CreateTemplate.isTemplate = "1";
}
2024-12-18 10:22:19 +08:00
panel.UploadData();
Debug.LogError("+++++++++");
2024-12-12 19:14:48 +08:00
createTemplateInterface.createTemplate(dataText.text);
2024-12-28 21:42:16 +08:00
SceneManager.LoadScene("yhj");
2024-11-30 23:32:17 +08:00
}
//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD>ť
2024-11-30 23:32:17 +08:00
public void OnClickSurePanel()
{
submitPanel.gameObject.SetActive(false);
}
2024-12-12 19:14:48 +08:00
//<2F>ж<EFBFBD><D0B6>Ƿ񱣴<C7B7>Ϊģ<CEAA><C4A3>
public void OnClickSureToggle()
{
if (preservationToggle.isOn == true)
{
submitPanel.gameObject.SetActive(true);
submitText.text = "<22><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>" + dataText.text;
if (inputText == null)
{
createTemplateInfo.Instance.auth_CreateTemplate.templateName = submitInputField.text;
}
else
{
createTemplateInfo.Instance.auth_CreateTemplate.templateName = inputText.text;
}
}
}
2024-11-29 09:47:47 +08:00
}