2024-11-25 17:15:16 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
using System.Linq;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
using TMPro;
|
|
|
|
|
using Unity.VisualScripting;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
2024-12-05 17:56:33 +08:00
|
|
|
|
using static Unity.VisualScripting.FlowStateWidget;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
public class SelectScenePanel : MonoBehaviour
|
|
|
|
|
{
|
2024-11-28 22:02:35 +08:00
|
|
|
|
[Header("<22><><EFBFBD><EFBFBD>")]
|
|
|
|
|
public GameObject scenePrefab;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼԤ<CDBC><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public Transform sceneList;//Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
public GameObject schoolPrefab;//ѧУ<D1A7><D0A3>ťԤ<C5A5><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public Transform schoolList;//ѧУԤ<D0A3><D4A4><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
public GameObject eventPrefab;//<2F>¼<EFBFBD><C2BC><EFBFBD>ťԤ<C5A5><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public Transform eventList;//ѧУԤ<D0A3><D4A4><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public GameObject incidentPrefab;//<2F>¼<EFBFBD><C2BC><EFBFBD>ťԤ<C5A5><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public Transform incidentList;//ѧУԤ<D0A3><D4A4><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public ToggleGroup schoolGroup;//ѧУToggleGroup
|
|
|
|
|
public ToggleGroup sceneGroup;//<2F><><EFBFBD><EFBFBD>ToggleGroup
|
|
|
|
|
public ToggleGroup eventGroup;//<2F>¼<EFBFBD>ToggleGroup
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public ToggleGroup incidentGroup;//<2F>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ToggleGroup
|
2024-11-25 17:15:16 +08:00
|
|
|
|
public GameObject scoolSelectBtn;//ѧУѡ<D0A3><D1A1><EFBFBD><EFBFBD>ť
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public GameObject sceneLable;//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public GameObject schoolChoiceLable;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-11-25 17:15:16 +08:00
|
|
|
|
public GameObject eventChoiceLable;//<2F>¼<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public GameObject incidentLable;//<2F>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-05 15:39:10 +08:00
|
|
|
|
public Button randomEventBtn;//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>ť
|
|
|
|
|
[Header("<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>")] public Text text20008;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
public Text title;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public List<SchoolInfo> schoolInfoList = new List<SchoolInfo>();//ѧУ<D1A7><D0A3>Ϣ
|
|
|
|
|
public List<EventInfo> eventInfoList = new List<EventInfo>();//<2F>¼<EFBFBD><C2BC><EFBFBD>Ϣ
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public List<IncidentInfo> incidentInfos = new List<IncidentInfo>();//<2F>¼<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>Ϣ
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public List<SceneItem> sceneItemList = new List<SceneItem>();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
public List<Toggle> difficultyList = new List<Toggle>();//<2F><>Ϸ<EFBFBD>Ѷ<EFBFBD>
|
2024-11-27 02:11:27 +08:00
|
|
|
|
public Button continueBtn;
|
2024-12-05 15:39:10 +08:00
|
|
|
|
public List<Toggle> scenetoggleList = new List<Toggle>();
|
2024-12-05 20:33:37 +08:00
|
|
|
|
public List<Toggle> schooltoggleList = new List<Toggle>();
|
2024-12-01 19:27:05 +08:00
|
|
|
|
public List<Toggle> eventToggleList = new List<Toggle>();
|
2024-12-04 22:58:31 +08:00
|
|
|
|
public List<Toggle> evnetsceneList = new List<Toggle>();
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
2024-11-29 14:44:18 +08:00
|
|
|
|
public ToggleGroup toggleGroup;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
[Header("<22><><EFBFBD><EFBFBD>")]
|
2024-11-30 16:19:19 +08:00
|
|
|
|
public DatePanel datePanel;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
public int schoolId;
|
|
|
|
|
public string schoolName;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
public int scnenId;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public string sceneName;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
public int eventId;
|
|
|
|
|
public string eventName;
|
|
|
|
|
public string difficulty;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public string isBuy;
|
2024-12-05 15:39:10 +08:00
|
|
|
|
public bool isSure;//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB>ť
|
2024-11-30 23:32:17 +08:00
|
|
|
|
public JSONReader jsonReader;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
sceneLable.gameObject.SetActive(true);
|
2024-11-25 17:15:16 +08:00
|
|
|
|
schoolChoiceLable.gameObject.SetActive(true);
|
|
|
|
|
eventChoiceLable.gameObject.SetActive(false);
|
2024-12-05 17:56:33 +08:00
|
|
|
|
incidentLable.gameObject.SetActive(false);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
InstantiateScenePrefab();
|
|
|
|
|
InstantiateSchoolPrefab();
|
2024-12-05 17:56:33 +08:00
|
|
|
|
SetEventToggleOpenorClose(incidentInfos);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
continueBtn.onClick.AddListener(OnClickContinueBtn);
|
2024-12-05 15:39:10 +08:00
|
|
|
|
SetFirstChoise(scenetoggleList);
|
2024-11-29 14:44:18 +08:00
|
|
|
|
SetToggleOpenorClose(sceneItemList);//δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
SetScloolToggleOpenorClose(schoolInfoList);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
IsClick();
|
2024-12-05 23:10:33 +08:00
|
|
|
|
if(Input.GetKeyDown(KeyCode.A))
|
|
|
|
|
{
|
|
|
|
|
SelectEvnentBtn();
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD>س<EFBFBD><D8B3><EFBFBD>ѡ<EFBFBD><D1A1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public void InstantiateScenePrefab()
|
|
|
|
|
{
|
2024-12-01 17:51:09 +08:00
|
|
|
|
foreach (var sceneData in jsonReader.sceneDictionary)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
Debug.Log("iiiiiiiiiiiiiii");
|
2024-11-28 22:02:35 +08:00
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(scenePrefab, sceneList);
|
|
|
|
|
SceneItem item = slot.GetComponent<SceneItem>();
|
2024-12-01 17:51:09 +08:00
|
|
|
|
switch (sceneData.Value.Type)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
item.sceneName.text = "ѧУ";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: // ҽԺ
|
|
|
|
|
item.sceneName.text = "ҽԺ";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
item.sceneName.text = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> Type <20><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD> 1, 2, 3 <20><>
|
|
|
|
|
Debug.LogError("δ֪<CEB4>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
item.sceneId = sceneData.Value.ID;
|
|
|
|
|
item.sceneType = sceneData.Value.Type;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
if (item.IsOpen)
|
|
|
|
|
{
|
|
|
|
|
item.maskImage.gameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.maskImage.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
|
|
|
|
toggle.group = sceneGroup;
|
2024-12-05 15:39:10 +08:00
|
|
|
|
scenetoggleList.Add(toggle); // ʹ<><CAB9> Add() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Toggle Ԫ<><D4AA>
|
2024-11-28 22:02:35 +08:00
|
|
|
|
sceneItemList.Add(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-01 17:51:09 +08:00
|
|
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>ѧУѡ<D0A3><D1A1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>жϳ<D0B6><CFB3><EFBFBD><EFBFBD><EFBFBD>Id<49><64><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
public void InstantiateSchoolPrefab()
|
|
|
|
|
{
|
2024-11-28 11:56:28 +08:00
|
|
|
|
for (int i = 0; i < 6; i++)
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(schoolPrefab, schoolList);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
SchoolInfo item = slot.GetComponent<SchoolInfo>();
|
|
|
|
|
item.schoolName.text = "<22><>ɽ<EFBFBD><C9BD>ѧ";
|
|
|
|
|
item.schoolId = i;
|
2024-11-27 02:11:27 +08:00
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
2024-11-28 22:02:35 +08:00
|
|
|
|
toggle.group = schoolGroup;
|
2024-12-05 17:56:33 +08:00
|
|
|
|
schooltoggleList.Add(toggle);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
schoolInfoList.Add(item);
|
2024-11-27 02:11:27 +08:00
|
|
|
|
}
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-05 17:56:33 +08:00
|
|
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ͼ<EFBFBD><CDBC>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>(<28><>ѡ<EFBFBD><D1A1><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD>)
|
|
|
|
|
public void InstantiateEventPrefab()
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
foreach (var sceneData in jsonReader.eventDictionary)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList);
|
|
|
|
|
EventInfo item = slot.GetComponent<EventInfo>();
|
|
|
|
|
item.eventId = sceneData.Value.ID;
|
2024-12-05 23:10:33 +08:00
|
|
|
|
|
2024-12-05 17:56:33 +08:00
|
|
|
|
item.eventName.text = sceneData.Value.Note;
|
|
|
|
|
if (item.IsOpen)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
item.maskImage.gameObject.SetActive(false);
|
2024-12-01 22:36:41 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
item.maskImage.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
|
|
|
|
toggle.group = eventGroup;
|
|
|
|
|
evnetsceneList.Add(toggle); // ʹ<><CAB9> Add() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Toggle Ԫ<><D4AA>
|
|
|
|
|
eventInfoList.Add(item);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
2024-12-05 17:56:33 +08:00
|
|
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ѡ<EFBFBD><D1A1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
public void InstantiateIncidentPrefab(int eventId)
|
|
|
|
|
{
|
2024-12-05 20:33:37 +08:00
|
|
|
|
foreach (var eventData in jsonReader.incidentSiteDictionary)
|
|
|
|
|
{
|
|
|
|
|
if (eventData.Key == eventId)
|
|
|
|
|
{
|
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(incidentPrefab, incidentList);
|
|
|
|
|
IncidentInfo item = slot.GetComponent<IncidentInfo>();
|
|
|
|
|
item.incidentText.text = eventData.Value.Note;
|
|
|
|
|
item.incidentID = eventData.Value.ID;
|
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
|
|
|
|
// <20><> Toggle <20><><EFBFBD>ӵ<EFBFBD> ToggleGroup <20><>
|
|
|
|
|
toggle.group = eventGroup;
|
|
|
|
|
toggle.isOn = false;
|
|
|
|
|
incidentInfos.Add(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-05 17:56:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-01 17:51:09 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void InstantiateEventPrefab(int id)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// ͨ<><CDA8> id <20><>ȡ<EFBFBD><C8A1>Ӧ<EFBFBD><D3A6> sceneData
|
|
|
|
|
if (jsonReader.sceneDictionary.TryGetValue(id, out var sceneData))
|
|
|
|
|
{
|
|
|
|
|
// <20><> IncidentType <20><><EFBFBD><EFBFBD> '|' <20>ָ<EFBFBD><D6B8><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string[] incidentIds = sceneData.IncidentType.Split('|');
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> id
|
|
|
|
|
foreach (string incidentIdStr in incidentIds)
|
|
|
|
|
{
|
|
|
|
|
// ת<><D7AA><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>Ϊ int <20><><EFBFBD><EFBFBD>
|
|
|
|
|
if (int.TryParse(incidentIdStr, out int incidentId))
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> incidentId <20><>ȡ<EFBFBD><C8A1>Ӧ<EFBFBD><D3A6><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if (jsonReader.eventDictionary.TryGetValue(incidentId, out var eventData))
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>紴<EFBFBD><E7B4B4> UI <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>
|
2024-12-05 17:56:33 +08:00
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList);
|
|
|
|
|
EventInfo item = slot.GetComponent<EventInfo>();
|
|
|
|
|
item.eventId = eventData.ID;
|
|
|
|
|
item.eventName.text = eventData.Note;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
|
|
|
|
|
if (item.IsOpen)
|
|
|
|
|
{
|
|
|
|
|
item.maskImage.gameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.maskImage.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
2024-12-02 00:35:53 +08:00
|
|
|
|
toggle.group = sceneGroup;
|
2024-12-05 17:56:33 +08:00
|
|
|
|
eventInfoList.Add(item);
|
2024-12-01 17:51:09 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogWarning($"No event found for Incident ID {incidentId}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogWarning($"Invalid Incident ID format: {incidentIdStr}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogWarning($"No scene data found for ID {id}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-28 22:02:35 +08:00
|
|
|
|
//ѧУѡ<D0A3><D1A1>
|
2024-11-25 17:15:16 +08:00
|
|
|
|
public void SelectSchoolBtn()
|
|
|
|
|
{
|
2024-12-05 20:33:37 +08:00
|
|
|
|
if (isSure)
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
2024-12-05 15:39:10 +08:00
|
|
|
|
SchoolInfo gameObject = GetComponentInChildren<SchoolInfo>();
|
|
|
|
|
foreach (SchoolInfo item in schoolInfoList)
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
2024-12-05 15:39:10 +08:00
|
|
|
|
if (item.gameObject.transform.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
this.schoolId = item.schoolId;
|
|
|
|
|
this.schoolName = item.schoolName.text;
|
|
|
|
|
title.text = item.schoolName.text;
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
2024-12-05 15:39:10 +08:00
|
|
|
|
Debug.Log("###############1:" + this.schoolId);
|
|
|
|
|
Debug.Log("###############2:" + this.schoolName);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public void SelectSceneBtn()
|
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
bool sceneSelected = false; // <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
foreach (SceneItem item in sceneItemList)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD>鵱ǰ<E9B5B1><C7B0> Toggle <20>Ƿ<EFBFBD><C7B7><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
if (item.gameObject.transform.GetComponent<Toggle>().isOn)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
// <20><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
this.sceneName = item.sceneName.text; // <20><>ȡ Text <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|
|
|
|
this.scnenId = item.sceneId;
|
2024-12-05 20:33:37 +08:00
|
|
|
|
Debug.Log("------------this.scnenId:" + this.scnenId);
|
2024-12-05 17:56:33 +08:00
|
|
|
|
|
|
|
|
|
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.sceneId.ToString();
|
|
|
|
|
sceneSelected = true;
|
|
|
|
|
break; // <20>ҵ<EFBFBD>ѡ<EFBFBD>еij<D0B5><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ѭ<EFBFBD><D1AD>
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
2024-12-05 17:56:33 +08:00
|
|
|
|
}
|
|
|
|
|
Debug.Log("---------------" + this.scnenId);
|
|
|
|
|
Debug.Log("###############3:" + this.schoolId);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F>¼<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public void SelectEvnentBtn()
|
|
|
|
|
{
|
|
|
|
|
bool eventSelected = false; // <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
foreach (EventInfo item in eventInfoList)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD>鵱ǰ<E9B5B1><C7B0> Toggle <20>Ƿ<EFBFBD><C7B7><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
if (item.gameObject.transform.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
this.eventName = item.eventName.text; // <20><>ȡ Text <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
2024-12-05 23:10:33 +08:00
|
|
|
|
this.eventId = item.eventId;
|
|
|
|
|
EventData eventData = jsonReader.GetEvenById(this.eventId);
|
|
|
|
|
InstantiateIncidentPrefab(2001);
|
2024-12-01 04:58:16 +08:00
|
|
|
|
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.eventId.ToString();
|
2024-11-30 23:32:17 +08:00
|
|
|
|
Debug.Log(this.eventName);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
eventSelected = true;
|
|
|
|
|
break; // <20>ҵ<EFBFBD>ѡ<EFBFBD>еij<D0B5><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ѭ<EFBFBD><D1AD>
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
2024-11-25 17:15:16 +08:00
|
|
|
|
//<2F>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>Ѷ<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public void SelectEvent()
|
|
|
|
|
{
|
|
|
|
|
EventInfo eventInfo = GetComponentInChildren<EventInfo>();
|
2024-11-28 22:02:35 +08:00
|
|
|
|
foreach (EventInfo item in eventInfoList)
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
if (item.gameObject.transform.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
this.eventId = item.eventId;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
this.eventName = item.eventName.text;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 22:36:41 +08:00
|
|
|
|
Debug.Log("%%%%%%%%%%%%%1:" + this.eventId);
|
2024-11-30 23:32:17 +08:00
|
|
|
|
Debug.Log("%%%%%%%%%%%%%2:" + this.eventName);
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
|
|
|
|
public void OnRandomEventClick()
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>һ<EFBFBD><D2BB><EFBFBD>¼<EFBFBD>
|
2024-12-05 15:39:10 +08:00
|
|
|
|
if (eventInfoList.Count > 1)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
|
|
|
|
int randomIndex = Random.Range(0, eventInfoList.Count);
|
|
|
|
|
|
|
|
|
|
// ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65>ѡ<EFBFBD><D1A1>״̬
|
|
|
|
|
foreach (Toggle toggle in eventToggleList)
|
|
|
|
|
{
|
|
|
|
|
// <20>ȼ<EFBFBD><C8BC><EFBFBD>toggle<6C>Ƿ<EFBFBD>Ϊnull
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
|
|
|
|
toggle.isOn = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 19:27:05 +08:00
|
|
|
|
Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent<EventInfo>());
|
2024-11-28 22:02:35 +08:00
|
|
|
|
// ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
2024-12-05 17:56:33 +08:00
|
|
|
|
if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent<IncidentInfo>().isOpen != false)
|
2024-11-28 22:02:35 +08:00
|
|
|
|
{
|
|
|
|
|
eventToggleList[randomIndex].isOn = true;
|
|
|
|
|
this.eventName = eventInfoList[randomIndex].eventName.text; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Debug.Log("<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>: " + this.eventName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogWarning("<22><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> Toggle Ϊ null<6C><6C>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-05 15:39:10 +08:00
|
|
|
|
randomEventBtn.gameObject.SetActive(false);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
Debug.LogWarning("<22>¼<EFBFBD><C2BC>б<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-25 17:15:16 +08:00
|
|
|
|
//<2F><>Ϸ<EFBFBD>Ѷ<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public void SelsctDifficulty()
|
|
|
|
|
{
|
2024-11-25 17:27:33 +08:00
|
|
|
|
auth_createTemplate auth_CreateTemplate = new auth_createTemplate();
|
2024-11-28 11:56:28 +08:00
|
|
|
|
foreach (Toggle item in difficultyList)
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
if (item.isOn)
|
|
|
|
|
{
|
|
|
|
|
this.difficulty = item.transform.parent.GetComponentInChildren<Text>().text;
|
2024-11-25 17:27:33 +08:00
|
|
|
|
auth_CreateTemplate.mode = this.difficulty;//<2F><><EFBFBD>ṹ<EFBFBD>塰<EFBFBD>Ѷȡ<D1B6><C8A1><EFBFBD>ֵ
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-25 17:27:33 +08:00
|
|
|
|
//Debug.Log("%%%%%%%%%%%%%3:" + this.difficulty);
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
2024-11-25 17:15:16 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>
|
2024-11-27 02:11:27 +08:00
|
|
|
|
public void OnClickContinueBtn()
|
2024-11-25 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
SelectSchoolBtn();
|
2024-11-28 22:02:35 +08:00
|
|
|
|
SelectSceneBtn();
|
2024-12-01 17:51:09 +08:00
|
|
|
|
InstantiateEventPrefab(this.scnenId);
|
2024-12-05 15:39:10 +08:00
|
|
|
|
SetFirstChoise(scenetoggleList);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
if (continueBtn.interactable)
|
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
sceneLable.gameObject.SetActive(false);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
schoolChoiceLable.gameObject.SetActive(false);
|
|
|
|
|
eventChoiceLable.gameObject.SetActive(true);
|
2024-12-05 17:56:33 +08:00
|
|
|
|
incidentLable.gameObject.SetActive(true);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("û<><C3BB>ѡ<EFBFBD><EFBFBD><F1B3A1BE><EFBFBD>ѧУ<D1A7><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>");
|
|
|
|
|
}
|
2024-11-28 11:56:28 +08:00
|
|
|
|
}
|
2024-12-02 19:40:49 +08:00
|
|
|
|
|
2024-11-25 17:15:16 +08:00
|
|
|
|
//<2F>ύ<EFBFBD><E1BDBB>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
|
|
|
|
public void SubmitBtn()
|
|
|
|
|
{
|
|
|
|
|
SelectEvent();
|
|
|
|
|
SelsctDifficulty();
|
2024-12-05 23:10:33 +08:00
|
|
|
|
//SelectEvnentBtn();
|
2024-11-30 16:19:19 +08:00
|
|
|
|
SetDataPanelInfo();
|
2024-11-25 17:15:16 +08:00
|
|
|
|
this.gameObject.SetActive(false);
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
|
2024-11-30 16:19:19 +08:00
|
|
|
|
//<2F>رհ<D8B1>ť
|
|
|
|
|
public void OnClickCloseBtn()
|
|
|
|
|
{
|
2024-12-05 20:33:37 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>б<EFBFBD>
|
|
|
|
|
eventInfoList.Clear();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|
|
|
|
foreach (Transform child in eventList)
|
|
|
|
|
{
|
|
|
|
|
Destroy(child.gameObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
eventToggleList.Clear();
|
|
|
|
|
eventId = -1;
|
|
|
|
|
eventName = string.Empty;
|
2024-12-01 22:36:41 +08:00
|
|
|
|
if (schoolChoiceLable.gameObject.active == false)
|
2024-12-01 19:27:05 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
sceneLable.gameObject.SetActive(true);
|
2024-12-01 19:27:05 +08:00
|
|
|
|
schoolChoiceLable.gameObject.SetActive(true);
|
2024-12-05 17:56:33 +08:00
|
|
|
|
eventChoiceLable.gameObject.SetActive(false);
|
|
|
|
|
incidentLable.gameObject.SetActive(false);
|
2024-12-01 19:27:05 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
transform.gameObject.SetActive(false);
|
|
|
|
|
}
|
2024-11-30 16:19:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-11-27 02:11:27 +08:00
|
|
|
|
//ͨ<><CDA8><EFBFBD>ж<EFBFBD>Toggle<6C><65>IsOn<4F>Ƿ<C7B7><F1B1BBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϼ<D0B6><CFBC><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD>Ƿ<EFBFBD><C7B7>û<EFBFBD>
|
|
|
|
|
public void IsClick()
|
|
|
|
|
{
|
|
|
|
|
bool anyToggleSelected = false;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>鳡<EFBFBD><E9B3A1>ѡ<EFBFBD><D1A1>
|
2024-12-05 15:39:10 +08:00
|
|
|
|
foreach (Toggle toggle in scenetoggleList)
|
2024-11-27 02:11:27 +08:00
|
|
|
|
{
|
|
|
|
|
if (toggle.isOn)
|
|
|
|
|
{
|
|
|
|
|
anyToggleSelected = true;
|
2024-11-28 22:02:35 +08:00
|
|
|
|
break; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Toggle <20><>ѡ<EFBFBD>У<EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
|
2024-11-27 02:11:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 17:51:09 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD> Toggle <20><>ѡ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD> ContinueBtn <20>Ƿ<EFBFBD><C7B7>ɽ<EFBFBD><C9BD><EFBFBD>
|
2024-11-27 02:11:27 +08:00
|
|
|
|
if (continueBtn != null)
|
|
|
|
|
{
|
|
|
|
|
continueBtn.interactable = anyToggleSelected; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>е<EFBFBD> Toggle<6C><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<F2B2BBBF><C9BD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("ContinueBtn <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-29 14:44:18 +08:00
|
|
|
|
|
2024-12-01 04:58:16 +08:00
|
|
|
|
//Ĭ<><C4AC>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Toggle
|
2024-12-01 17:51:09 +08:00
|
|
|
|
public void SetFirstChoise(List<Toggle> toggles)
|
2024-11-29 14:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65><EFBFBD><EFBFBD>ѡ<EFBFBD>е<EFBFBD>һ<EFBFBD><D2BB>
|
2024-12-01 17:51:09 +08:00
|
|
|
|
if (toggles.Count() > 0)
|
2024-11-29 14:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
toggles[0].isOn = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-01 22:36:41 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>toggle
|
2024-11-29 14:44:18 +08:00
|
|
|
|
public void SetToggleOpenorClose(List<SceneItem> sceneItems)
|
|
|
|
|
{
|
|
|
|
|
foreach (SceneItem item in sceneItems)
|
|
|
|
|
{
|
2024-12-01 22:36:41 +08:00
|
|
|
|
if (item.IsOpen == false)
|
2024-11-29 14:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().interactable = false;
|
|
|
|
|
if (item.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().isOn = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().interactable = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-30 16:19:19 +08:00
|
|
|
|
//ѧУToggle
|
2024-11-29 14:44:18 +08:00
|
|
|
|
public void SetScloolToggleOpenorClose(List<SchoolInfo> sceneItems)
|
|
|
|
|
{
|
|
|
|
|
foreach (SchoolInfo item in sceneItems)
|
|
|
|
|
{
|
|
|
|
|
if (item.isOpen == false)
|
|
|
|
|
{
|
2024-12-01 04:58:16 +08:00
|
|
|
|
item.GetComponent<Toggle>().interactable = true;
|
2024-11-29 14:44:18 +08:00
|
|
|
|
if (item.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().isOn = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().interactable = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-30 16:19:19 +08:00
|
|
|
|
//<2F>¼<EFBFBD>Toggle
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public void SetEventToggleOpenorClose(List<IncidentInfo> sceneItems)
|
2024-11-29 14:44:18 +08:00
|
|
|
|
{
|
2024-12-05 17:56:33 +08:00
|
|
|
|
foreach (IncidentInfo item in sceneItems)
|
2024-11-29 14:44:18 +08:00
|
|
|
|
{
|
|
|
|
|
if (item.isOpen == false)
|
|
|
|
|
{
|
2024-12-01 04:58:16 +08:00
|
|
|
|
item.GetComponent<Toggle>().interactable = true;
|
2024-11-29 14:44:18 +08:00
|
|
|
|
if (item.GetComponent<Toggle>().isOn)
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().isOn = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.GetComponent<Toggle>().interactable = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-30 16:19:19 +08:00
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void SetDataPanelInfo()
|
|
|
|
|
{
|
|
|
|
|
datePanel.SchoolText.text = schoolName;
|
|
|
|
|
datePanel.PlaceText.text = eventName;
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|