diff --git a/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json b/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json new file mode 100644 index 00000000..aa2116d3 --- /dev/null +++ b/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json @@ -0,0 +1,12 @@ +[ + { + "ID": 2001, + "Note": "鍘ㄦ埧璧风伀", + "Name": 2001, + "Scene": 9003, + "Position": "36,1,2", + "Volume": -1, + "Difficulty": "1|2|6", + "SpecialEvent": "-1,-1,-1,-1|1,50,10,20|1,50,20,20" + } +] \ No newline at end of file diff --git a/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json.meta b/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json.meta new file mode 100644 index 00000000..995309cf --- /dev/null +++ b/xiaofang/Assets/Resources/JsonAsset/IncidentSite .json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1efa4372b10d4294199638c49173ff4c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Scenes/Schedule_03.unity b/xiaofang/Assets/Scenes/Schedule_03.unity index eaf9d9ac..625c9d1f 100644 --- a/xiaofang/Assets/Scenes/Schedule_03.unity +++ b/xiaofang/Assets/Scenes/Schedule_03.unity @@ -2243,6 +2243,7 @@ MonoBehaviour: scene: managerPanel1: {fileID: 617308873} jsonReader1: {fileID: 1417128757} + selectScenePanel: {fileID: 1138062886} --- !u!1 &625672672 GameObject: m_ObjectHideFlags: 0 @@ -2372,6 +2373,17 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 6740850324693622956, guid: a15ee694d5f79864d816998fae77116d, type: 3} m_PrefabInstance: {fileID: 1677529559} m_PrefabAsset: {fileID: 0} +--- !u!114 &654779790 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7468736064578063281, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + m_PrefabInstance: {fileID: 865567720} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &666058189 GameObject: m_ObjectHideFlags: 0 @@ -2501,7 +2513,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -193.59004, y: 309.8263} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 388.1544, y: 58.599} m_Pivot: {x: 0, y: 1} --- !u!114 &667280288 MonoBehaviour: @@ -5650,6 +5662,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 618256459} m_Modifications: + - target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + propertyPath: title + value: + objectReference: {fileID: 654779790} - target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: MainPanel value: @@ -5728,11 +5744,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_SizeDelta.x - value: 1834 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_SizeDelta.y - value: 1577.3936 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_LocalPosition.x @@ -5788,39 +5804,39 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736063766935916, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 543.7644 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -55 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 917 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -53.335 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064052287372, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: eventName @@ -5854,6 +5870,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: -62 objectReference: {fileID: 0} + - target: {fileID: 7468736064052287473, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7468736064090762255, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: eventName value: @@ -5880,12 +5900,16 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 564.5 + value: 206 objectReference: {fileID: 0} - target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y value: -62 objectReference: {fileID: 0} + - target: {fileID: 7468736064090762356, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7468736064179597218, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -5912,51 +5936,51 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 917 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -343.34674 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 334.1322 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -55 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 753.3966 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -55 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736064424568481, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target @@ -6020,7 +6044,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736064580561832, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_SizeDelta.x - value: -1792 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065055436938, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y @@ -6044,35 +6068,35 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 124.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -55 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.x - value: 917 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_AnchoredPosition.y - value: -1328.051 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7468736065685524839, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: m_IsActive @@ -8729,6 +8753,7 @@ MonoBehaviour: eventJsonFile: {fileID: 4900000, guid: 2ef075e4830019a42b84d8d05d13d81c, type: 3} matialJsonFile: {fileID: 4900000, guid: d98cb351d1a87dc4887a37106b9745d4, type: 3} sceneJsonFile: {fileID: 4900000, guid: 06c09fd1c8b0a0a45951a1065189d922, type: 3} + incidentSiteJosnFile: {fileID: 4900000, guid: 1efa4372b10d4294199638c49173ff4c, type: 3} --- !u!4 &1417128758 Transform: m_ObjectHideFlags: 0 @@ -9548,7 +9573,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1600693806 RectTransform: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/JSONReader/JSONReader.cs b/xiaofang/Assets/Script/JSONReader/JSONReader.cs index 738df86b..41e6ca2f 100644 --- a/xiaofang/Assets/Script/JSONReader/JSONReader.cs +++ b/xiaofang/Assets/Script/JSONReader/JSONReader.cs @@ -9,11 +9,13 @@ public class JSONReader : MonoBehaviour public TextAsset eventJsonFile; public TextAsset matialJsonFile; public TextAsset sceneJsonFile; + public TextAsset incidentSiteJosnFile; public Dictionary npcDictionary = new Dictionary(); public Dictionary locationDictionary = new Dictionary(); public Dictionary eventDictionary = new Dictionary(); public Dictionary matialDictionary = new Dictionary(); public Dictionary sceneDictionary = new Dictionary(); + public Dictionary incidentSiteDictionary = new Dictionary(); void Awake() { @@ -23,16 +25,11 @@ public class JSONReader : MonoBehaviour eventDictionary = EventParseJSON(eventJsonFile.text); matialDictionary = MatialParseJSON(matialJsonFile.text); sceneDictionary = SceneParseJSON(sceneJsonFile.text); - foreach (var npc in sceneDictionary) + incidentSiteDictionary = IncidentSiteParseJSON(incidentSiteJosnFile.text); + foreach (var npc in locationDictionary) { - Debug.Log($"Scene ID: {npc.Value.ID}"); - Debug.Log($"Scene Name: {npc.Value.Name}"); - Debug.Log($"Scene Type: {npc.Value.Type}"); - Debug.Log($"Incident Type: {npc.Value.IncidentType}"); - Debug.Log($"Object List: {npc.Value.ObjList}"); - Debug.Log($"Area List: {npc.Value.AreaList}"); - Debug.Log($"Storeroom: {npc.Value.Storeroom}"); - Debug.Log("==========================="); + //.Log($"Scene ID: {npc.Value.ID}"); + //Debug.Log("==========================="); } //打印 NPC 数据 @@ -109,6 +106,19 @@ public class JSONReader : MonoBehaviour return locationDictionary; } + public Dictionary IncidentSiteParseJSON(string json) + { + IncidentSite[] locationArray = JsonHelper.FromJson(json); + Dictionary locationDictionary = new Dictionary(); + + foreach (var location in locationArray) + { + locationDictionary[location.ID] = location; + } + + return locationDictionary; + } + // 打印 NPC 数据 //void PrintNPCData(Dictionary npcDictionary) //{ @@ -232,5 +242,17 @@ public class SceneData public string AreaList; public int Storeroom; } +[System.Serializable] +public class IncidentSite +{ + public int ID; + public string Note; + public int Name; + public int Scene; + public string Position; + public int Volume; + public string Difficulty; + public string SpecialEvent; +} diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index 924647f2..c559cc1d 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -57,6 +57,7 @@ public class Panel : MonoBehaviour public Dictionary> sceneDataDictionary = new Dictionary>();//不同的场景存取不同的人员数据 public ManagerPanel managerPanel1; public JSONReader jsonReader1; + public SelectScenePanel selectScenePanel; private bool isPersonSelected = false; // 标志是否选择了人员 private bool isDutySelected = false; // 标志是否选择了职责 private bool isSceneSelected = false; // 标志是否选择了场景 @@ -93,14 +94,37 @@ public class Panel : MonoBehaviour //动态加载职责 public void DynamicLoadingDuty() { + Debug.Log("||||||||||||||||||||||||||||"+ selectScenePanel.eventId); foreach (var npcData in jsonReader1.npcDictionary) { - GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount); - DutyItem dutyItem = item.GetComponent(); - dutyItem.dutyNameText.text = npcData.Value.Note; - dutyItem.leader = npcData.Value.GroupLeader; - //Debug.Log("$$$$$$$$$$$$$$" + dutyItem.dutyNameText.text); - peopleList.Add(item);// 将每个实例化的角色添加到列表中 + string[] nameSections = npcData.Value.Name.Split('|'); + foreach (var section in nameSections) + { + string[] sectionParts = section.Split(','); + if (int.Parse(sectionParts[0])== 2001) + { + int key = int.Parse(sectionParts[1]); + if (jsonReader1.npcDictionary.ContainsKey(key)) + { + var npcInfo = jsonReader1.npcDictionary[key]; + // 在此处可以使用npcInfo做进一步的处理 + Debug.Log("Found NPC: " + npcInfo.Name); + + // 创建DutyItem实例 + GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount); + DutyItem dutyItem = item.GetComponent(); + dutyItem.dutyNameText.text = npcData.Value.Note; + dutyItem.leader = npcData.Value.GroupLeader; + peopleList.Add(item); + } + } + //GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount); + //DutyItem dutyItem = item.GetComponent(); + //dutyItem.dutyNameText.text = npcData.Value.Note; + //dutyItem.leader = npcData.Value.GroupLeader; + //peopleList.Add(item);// 将每个实例化的角色添加到列表中 + } + } } diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 12c39741..aae68203 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -27,7 +27,7 @@ public class SelectScenePanel : MonoBehaviour public List sceneItemList = new List();//场景信息 public List difficultyList = new List();//游戏难度 public Button continueBtn; - public List toggleList=new List(); + public List toggleList = new List(); public List eventToggleList = new List(); //public Toggle[] toggleList; public Toggle[] schooltoggleList; @@ -52,13 +52,13 @@ public class SelectScenePanel : MonoBehaviour eventChoiceLable.gameObject.SetActive(false); InstantiateScenePrefab(); InstantiateSchoolPrefab(); - InstantiateIncidentPrefab(); + InstantiateIncidentPrefab(2001); SetEventToggleOpenorClose(eventInfoList); continueBtn.onClick.AddListener(OnClickContinueBtn); SetFirstChoise(toggleList); SetToggleOpenorClose(sceneItemList);//未购买无法选择 SetScloolToggleOpenorClose(schoolInfoList); - + } // Update is called once per frame @@ -140,29 +140,34 @@ public class SelectScenePanel : MonoBehaviour } //动态加载事件选择预制体 - public void InstantiateIncidentPrefab() + public void InstantiateIncidentPrefab(int eventId) { - foreach(var eventData in jsonReader.eventDictionary) + foreach (var eventData in jsonReader.incidentSiteDictionary) { - - - GameObject slot = GameObject.Instantiate(eventPrefab, eventList); - EventInfo item = slot.GetComponent(); - item.eventName.text = eventData.Value.Note; - item.eventId = eventData.Value.ID; - Toggle toggle = slot.GetComponent(); - - if (toggle != null) + if(eventData.Key==eventId) { + GameObject slot = GameObject.Instantiate(eventPrefab, eventList); + EventInfo item = slot.GetComponent(); + item.eventName.text = eventData.Value.Note; + item.eventId = eventData.Value.ID; + Toggle toggle = slot.GetComponent(); + + if (toggle != null) + { // 将 Toggle 添加到 ToggleGroup 中 - toggle.group = schoolGroup; + toggle.group = eventGroup; toggle.isOn = false; // 将 Toggle 添加到 schooltoggleList 中 // 将 SchoolInfo 对象添加到 schoolInfos 列表中 eventInfoList.Add(item); - Debug.Log("!!!!!!!!!!!!!!!!!!!!!"+eventInfoList.Count); + Debug.Log("!!!!!!!!!!!!!!!!!!!!!" + eventInfoList.Count); + } + } + else + { + break; } } } @@ -297,14 +302,14 @@ public class SelectScenePanel : MonoBehaviour this.eventName = item.eventName.text; } } - Debug.Log("%%%%%%%%%%%%%1:"+ this.eventId); + Debug.Log("%%%%%%%%%%%%%1:" + this.eventId); Debug.Log("%%%%%%%%%%%%%2:" + this.eventName); } //随机事件 public void OnRandomEventClick() { - + // 随机选择一个事件 if (eventInfoList.Count > 0) { @@ -321,7 +326,7 @@ public class SelectScenePanel : MonoBehaviour } Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent()); // 选中随机事件 - if (eventToggleList[randomIndex] != null&& eventToggleList[randomIndex].GetComponent().isOpen!=false) + if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent().isOpen != false) { eventToggleList[randomIndex].isOn = true; this.eventName = eventInfoList[randomIndex].eventName.text; // 设置随机选择的事件名称 @@ -388,7 +393,7 @@ public class SelectScenePanel : MonoBehaviour //关闭按钮 public void OnClickCloseBtn() { - if (schoolChoiceLable.gameObject.active==false) + if (schoolChoiceLable.gameObject.active == false) { foreach (Transform child in sceneList) { @@ -402,7 +407,7 @@ public class SelectScenePanel : MonoBehaviour { transform.gameObject.SetActive(false); } - + } //通过判断Toggle的IsOn是否被打开来判断继续按钮是否置灰 @@ -413,7 +418,7 @@ public class SelectScenePanel : MonoBehaviour // 检查场景选择 foreach (Toggle toggle in toggleList) { - Debug.Log("++++++++++++++++++++++++="+toggleList.Count()); + Debug.Log("++++++++++++++++++++++++=" + toggleList.Count()); if (toggle.isOn) { anyToggleSelected = true; @@ -436,7 +441,7 @@ public class SelectScenePanel : MonoBehaviour public void SetFirstChoise(List toggles) { // 获取ToggleGroup中的所有Toggle - + // 如果有Toggle,则选中第一个 if (toggles.Count() > 0) @@ -445,12 +450,12 @@ public class SelectScenePanel : MonoBehaviour } } - //场景toggle + //场景toggle public void SetToggleOpenorClose(List sceneItems) { foreach (SceneItem item in sceneItems) { - if (item.IsOpen==false) + if (item.IsOpen == false) { item.GetComponent().interactable = false; if (item.GetComponent().isOn) @@ -464,7 +469,7 @@ public class SelectScenePanel : MonoBehaviour } } - + } //学校Toggle