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-06 15:43:36 +08:00
|
|
|
|
public Button submitBtn;
|
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-12-06 11:37:41 +08:00
|
|
|
|
public Panel panel;
|
|
|
|
|
public int schoolId { get; set; }
|
|
|
|
|
public string schoolName { get; set; }
|
|
|
|
|
public int scnenId { get; set; }
|
|
|
|
|
public string sceneName { get; set; }
|
|
|
|
|
public int eventId { get; set; }
|
|
|
|
|
public string eventName { get; set; }
|
2024-12-07 16:18:15 +08:00
|
|
|
|
public int idcidentId{ get; set; }
|
|
|
|
|
public string idcidentName{ get; set; }
|
2024-12-06 11:37:41 +08:00
|
|
|
|
public string difficulty { get; set; }
|
|
|
|
|
public string isBuy { get; set; }
|
2024-12-09 11:09:39 +08:00
|
|
|
|
public bool isSure { get; set; } = false;//<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-06 15:43:36 +08:00
|
|
|
|
IsSubmit();
|
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
|
|
|
|
{
|
|
|
|
|
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-07 16:18:15 +08:00
|
|
|
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>¼<EFBFBD><C2BC>ص<EFBFBD>
|
2024-12-05 17:56:33 +08:00
|
|
|
|
public void InstantiateIncidentPrefab(int eventId)
|
|
|
|
|
{
|
2024-12-05 20:33:37 +08:00
|
|
|
|
foreach (var eventData in jsonReader.incidentSiteDictionary)
|
|
|
|
|
{
|
|
|
|
|
if (eventData.Key == eventId)
|
|
|
|
|
{
|
2024-12-09 09:53:48 +08:00
|
|
|
|
//Debug.Log("<<<<<<<<<<<<<<<<<eventId" + eventData.Key);
|
2024-12-05 20:33:37 +08:00
|
|
|
|
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><>
|
2024-12-06 15:43:36 +08:00
|
|
|
|
toggle.group = incidentGroup;
|
2024-12-05 20:33:37 +08:00
|
|
|
|
toggle.isOn = false;
|
2024-12-09 09:53:48 +08:00
|
|
|
|
eventToggleList.Add(toggle);
|
2024-12-05 20:33:37 +08:00
|
|
|
|
incidentInfos.Add(item);
|
2024-12-07 17:47:46 +08:00
|
|
|
|
if (incidentInfos.Count > 1)
|
|
|
|
|
{
|
2024-12-08 14:13:31 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>
|
2024-12-07 17:47:46 +08:00
|
|
|
|
}
|
2024-12-05 20:33:37 +08:00
|
|
|
|
}
|
2024-12-06 15:43:36 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
2024-12-07 16:18:15 +08:00
|
|
|
|
toggle.onValueChanged.AddListener((isSelected) =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (isSelected)
|
|
|
|
|
{
|
|
|
|
|
this.idcidentName = item.incidentText.text;
|
|
|
|
|
string[] difficulty = eventData.Value.Difficulty.Split('|');
|
|
|
|
|
|
|
|
|
|
// ȷ<><C8B7>difficultyList<73><74>difficulty<74>ij<EFBFBD><C4B3><EFBFBD>ƥ<EFBFBD><C6A5>
|
|
|
|
|
for (int i = 0; i < difficultyList.Count && i < difficulty.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
Toggle item = difficultyList[i]; // <20><>ȡ<EFBFBD><C8A1>Ӧ<EFBFBD><D3A6>Toggle
|
|
|
|
|
DifficultyInfo difficultyInfo = item.gameObject.GetComponent<DifficultyInfo>();
|
|
|
|
|
|
|
|
|
|
if (difficultyInfo == null)
|
|
|
|
|
{
|
|
|
|
|
difficultyInfo = item.gameObject.AddComponent<DifficultyInfo>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><>ÿ<EFBFBD><C3BF>Toggle<6C><65><EFBFBD>ò<EFBFBD>ͬ<EFBFBD><CDAC>difficultyֵ
|
|
|
|
|
difficultyInfo.difficulty = int.Parse(difficulty[i]);
|
|
|
|
|
|
|
|
|
|
// <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>Ѷ<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Debug.Log($"Toggle {i} - Difficulty: {difficultyInfo.difficulty}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-05 20:33:37 +08:00
|
|
|
|
}
|
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)
|
|
|
|
|
{
|
2024-12-07 16:18:15 +08:00
|
|
|
|
text20008.text = sceneName;
|
2024-12-01 17:51:09 +08:00
|
|
|
|
// ͨ<><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)
|
|
|
|
|
{
|
2024-12-09 09:53:48 +08:00
|
|
|
|
//Debug.Log("incidentIdStr" + incidentIdStr);
|
2024-12-01 17:51:09 +08:00
|
|
|
|
// ת<><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>
|
2024-12-06 11:37:41 +08:00
|
|
|
|
EventData eventData=jsonReader.GetEvenById(incidentId);
|
|
|
|
|
Debug.Log("eventData.ID:" + eventData.ID);
|
|
|
|
|
Debug.Log("eventData.DisasterLocation:" + eventData.DisasterLocation);
|
|
|
|
|
string[] incidentIds2 = eventData.DisasterLocation.Split('|');
|
|
|
|
|
GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList);
|
|
|
|
|
EventInfo item = slot.GetComponent<EventInfo>();
|
|
|
|
|
item.eventId = eventData.ID;
|
|
|
|
|
item.eventName.text = eventData.Note;
|
|
|
|
|
if (item.IsOpen)
|
2024-12-01 17:51:09 +08:00
|
|
|
|
{
|
2024-12-06 11:37:41 +08:00
|
|
|
|
item.maskImage.gameObject.SetActive(false);
|
2024-12-01 17:51:09 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-06 11:37:41 +08:00
|
|
|
|
item.maskImage.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
Toggle toggle = slot.GetComponent<Toggle>();
|
|
|
|
|
if (toggle != null)
|
|
|
|
|
{
|
2024-12-06 15:43:36 +08:00
|
|
|
|
toggle.group = eventGroup;
|
2024-12-06 11:37:41 +08:00
|
|
|
|
eventInfoList.Add(item);
|
2024-12-06 15:43:36 +08:00
|
|
|
|
evnetsceneList.Add(toggle);
|
2024-12-01 17:51:09 +08:00
|
|
|
|
}
|
2024-12-07 17:47:46 +08:00
|
|
|
|
//<2F><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>¼<EFBFBD>
|
2024-12-06 11:37:41 +08:00
|
|
|
|
toggle.onValueChanged.AddListener((isSelected) =>
|
|
|
|
|
{
|
|
|
|
|
if (isSelected) // ֻ<>е<EFBFBD>Toggle<6C><65>ѡ<EFBFBD><D1A1>ʱ<EFBFBD><CAB1><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>SelectEventBtn
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>б<EFBFBD>
|
|
|
|
|
incidentInfos.Clear();
|
|
|
|
|
foreach (Transform child in incidentList)
|
|
|
|
|
{
|
|
|
|
|
Destroy(child.gameObject);
|
|
|
|
|
}
|
|
|
|
|
this.eventName = item.eventName.text; // <20><>ȡ Text <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|
|
|
|
this.eventId = item.eventId;
|
|
|
|
|
EventData eventData = jsonReader.GetEvenById(this.eventId);
|
|
|
|
|
foreach (string disasterLocation in incidentIds2)
|
|
|
|
|
{
|
2024-12-09 09:53:48 +08:00
|
|
|
|
//Debug.Log("disasterLocation>>>>>>>"+ disasterLocation);
|
2024-12-06 11:37:41 +08:00
|
|
|
|
InstantiateIncidentPrefab(int.Parse(disasterLocation));
|
2024-12-06 15:43:36 +08:00
|
|
|
|
OnRandomEventClick();
|
2024-12-06 11:37:41 +08:00
|
|
|
|
}
|
|
|
|
|
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.eventId.ToString();
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-12-01 17:51:09 +08:00
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
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
|
|
|
|
{
|
2024-12-06 15:43:36 +08:00
|
|
|
|
|
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-06 15:43:36 +08:00
|
|
|
|
Debug.LogWarning("ֻ<><D6BB>һ<EFBFBD><D2BB><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
2024-12-05 15:39:10 +08:00
|
|
|
|
randomEventBtn.gameObject.SetActive(false);
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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-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-06 15:43:36 +08:00
|
|
|
|
SetFirstChoise(evnetsceneList);
|
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-11-30 16:19:19 +08:00
|
|
|
|
SetDataPanelInfo();
|
2024-11-25 17:15:16 +08:00
|
|
|
|
this.gameObject.SetActive(false);
|
2024-12-06 11:37:41 +08:00
|
|
|
|
panel.gameObject.SetActive(true);
|
2024-12-09 09:53:48 +08:00
|
|
|
|
DisableUIInteraction();
|
2024-12-09 11:09:39 +08:00
|
|
|
|
isSure = true;
|
2024-11-25 17:15:16 +08:00
|
|
|
|
}
|
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>Ϣ
|
2024-12-06 11:37:41 +08:00
|
|
|
|
evnetsceneList.Clear();
|
2024-12-05 20:33:37 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
2024-12-09 09:53:48 +08:00
|
|
|
|
bool anyToggleSelected = true;
|
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-06 15:43:36 +08:00
|
|
|
|
//ͨ<><CDA8><EFBFBD>ж<EFBFBD>EventSceneList<73><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IsOn<4F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ύ<EFBFBD><E1BDBB>ť<EFBFBD>Ƿ<EFBFBD><C7B7>û<EFBFBD>
|
|
|
|
|
public void IsSubmit()
|
|
|
|
|
{
|
|
|
|
|
bool anyToggleSelected = false;
|
|
|
|
|
bool anyeventSelected = false;
|
2024-12-07 17:47:46 +08:00
|
|
|
|
bool isOk = false;
|
2024-12-09 09:53:48 +08:00
|
|
|
|
//Debug.Log("evnetsceneList>>>>"+ evnetsceneList.Count());
|
2024-12-06 15:43:36 +08:00
|
|
|
|
// <20><><EFBFBD>鳡<EFBFBD><E9B3A1>ѡ<EFBFBD><D1A1>
|
|
|
|
|
foreach (Toggle toggle in evnetsceneList)
|
|
|
|
|
{
|
|
|
|
|
if (toggle.isOn)
|
|
|
|
|
{
|
|
|
|
|
anyToggleSelected = true;
|
|
|
|
|
break; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Toggle <20><>ѡ<EFBFBD>У<EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-09 11:09:39 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ѡ<EFBFBD><D1A1>
|
2024-12-06 15:43:36 +08:00
|
|
|
|
foreach (Toggle toggle in eventToggleList)
|
|
|
|
|
{
|
2024-12-08 14:13:31 +08:00
|
|
|
|
Debug.LogError("<22>¼<EFBFBD>ѡ<EFBFBD><D1A1>:" + anyToggleSelected);
|
2024-12-06 15:43:36 +08:00
|
|
|
|
if (toggle.isOn)
|
|
|
|
|
{
|
|
|
|
|
anyeventSelected = true;
|
2024-12-08 14:13:31 +08:00
|
|
|
|
|
2024-12-06 15:43:36 +08:00
|
|
|
|
break; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Toggle <20><>ѡ<EFBFBD>У<EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-09 09:53:48 +08:00
|
|
|
|
Debug.Log(submitBtn != null && anyToggleSelected == true && anyeventSelected == true);
|
2024-12-06 15:43:36 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD> Toggle <20><>ѡ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD> ContinueBtn <20>Ƿ<EFBFBD><C7B7>ɽ<EFBFBD><C9BD><EFBFBD>
|
|
|
|
|
if (submitBtn != null && anyToggleSelected == true&& anyeventSelected==true)
|
|
|
|
|
{
|
2024-12-08 14:13:31 +08:00
|
|
|
|
Debug.LogError("<22>ύ<EFBFBD><E1BDBB>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>");
|
2024-12-07 17:47:46 +08:00
|
|
|
|
isOk = true;
|
|
|
|
|
submitBtn.interactable = isOk; // <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>
|
2024-12-06 15:43:36 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-07 17:47:46 +08:00
|
|
|
|
submitBtn.interactable = isOk;
|
2024-12-06 15:43:36 +08:00
|
|
|
|
Debug.LogWarning("<22>ύ<EFBFBD><E1BDBB>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
2024-12-07 16:18:15 +08:00
|
|
|
|
datePanel.SchoolText.text = sceneName;
|
|
|
|
|
datePanel.PlaceText.text = idcidentName;
|
2024-11-30 16:19:19 +08:00
|
|
|
|
}
|
2024-12-09 09:53:48 +08:00
|
|
|
|
|
|
|
|
|
//<2F><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>
|
|
|
|
|
public void DisableUIInteraction()
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65>ť
|
|
|
|
|
foreach (Toggle toggle in scenetoggleList)
|
|
|
|
|
{
|
|
|
|
|
toggle.interactable = false; // <20><><EFBFBD><EFBFBD>ToggleΪ<65><CEAA><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ѧУѡ<D0A3><D1A1><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65>ť
|
|
|
|
|
foreach (Toggle toggle in schooltoggleList)
|
|
|
|
|
{
|
|
|
|
|
toggle.interactable = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65>ť
|
|
|
|
|
foreach (Toggle toggle in eventToggleList)
|
|
|
|
|
{
|
|
|
|
|
toggle.interactable = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>Toggle<6C><65>ť
|
|
|
|
|
foreach (Toggle toggle in evnetsceneList)
|
|
|
|
|
{
|
|
|
|
|
toggle.interactable = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD>ť
|
|
|
|
|
continueBtn.interactable = false;
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB>ť
|
|
|
|
|
submitBtn.interactable = false;
|
|
|
|
|
}
|
2024-11-28 22:02:35 +08:00
|
|
|
|
}
|