Compare commits

...

2 Commits

Author SHA1 Message Date
lq
26e6f4e6d1 Merge branch 'main' of http://shu.sheziwanglo.cn:3000/wulongxiao/_xiaofang 2024-12-12 20:01:23 +08:00
lq
0e0fe09cbc Language传入 2024-12-12 19:58:55 +08:00
4 changed files with 225 additions and 193 deletions

View File

@ -1,170 +1,182 @@
[
{
"ID": 8000,
"Note": "主持人",
"Name": "2001,8001|2002,8001|2003,80022",
"ActionMode": 0,
"Group": -1,
"GroupLeader": 3,
"IsLeadingNPC": 0,
"ICON": "ICON_312",
"WeightLimit": -1,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b013.Prefeb"
},
{
"ID": 8001,
"Note": "总指挥",
"Name": "2001,8001|2002,8001|2003,80010",
"ActionMode": 2,
"Group": -1,
"GroupLeader": 2,
"IsLeadingNPC": 0,
"ICON": "ICON_313",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b001.Prefeb"
},
{
"ID": 8002,
"Note": "抢险救援组",
"Name": "2001,8001|2002,8001|2003,80011",
"ActionMode": 2,
"Group": 8003,
"GroupLeader": 0,
"IsLeadingNPC": 0,
"ICON": "ICON_314",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b002.Prefeb"
},
{
"ID": 8003,
"Note": "(组长)抢险救援组",
"Name": "2001,8001|2002,8001|2003,80012",
"ActionMode": 2,
"Group": -1,
"GroupLeader": 1,
"IsLeadingNPC": 0,
"ICON": "ICON_315",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b003.Prefeb"
},
{
"ID": 8004,
"Note": "医疗救护组",
"Name": "2001,8001|2002,8001|2003,80013",
"ActionMode": 2,
"Group": 8005,
"GroupLeader": 0,
"IsLeadingNPC": 0,
"ICON": "ICON_316",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b004.Prefeb"
},
{
"ID": 8005,
"Note": "(组长)医疗救护组",
"Name": "2001,8001|2002,8001|2003,80014",
"ActionMode": 2,
"Group": -1,
"GroupLeader": 1,
"IsLeadingNPC": 0,
"ICON": "ICON_317",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b005.Prefeb"
},
{
"ID": 8006,
"Note": "疏散引导组1",
"Name": "2001,8001|2002,8001|2003,80015",
"ActionMode": 1,
"Group": 8001,
"GroupLeader": 0,
"IsLeadingNPC": 1,
"ICON": "ICON_318",
"WeightLimit": -1,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b006.Prefeb"
},
{
"ID": 8007,
"Note": "疏散引导组2",
"Name": "2001,8001|2002,8001|2003,80016",
"ActionMode": 1,
"Group": 8001,
"GroupLeader": 0,
"IsLeadingNPC": 1,
"ICON": "ICON_319",
"WeightLimit": -1,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b007.Prefeb"
},
{
"ID": 8008,
"Note": "后勤保障组",
"Name": "2001,8001|2002,8001|2003,80017",
"ActionMode": 2,
"Group": 8009,
"GroupLeader": 0,
"IsLeadingNPC": 0,
"ICON": "ICON_320",
"WeightLimit": 12,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b008.Prefeb"
},
{
"ID": 8009,
"Note": "(组长)后勤保障组",
"Name": "2001,8001|2002,8001|2003,80018",
"ActionMode": 2,
"Group": -1,
"GroupLeader": 1,
"IsLeadingNPC": 0,
"ICON": "ICON_321",
"WeightLimit": 12,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b009.Prefeb"
},
{
"ID": 8010,
"Note": "搜寻组",
"Name": "2001,8001|2002,8001|2003,80019",
"ActionMode": 2,
"Group": 8001,
"GroupLeader": 0,
"IsLeadingNPC": 0,
"ICON": "ICON_322",
"WeightLimit": 6,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b010.Prefeb"
},
{
"ID": 8011,
"Note": "学生寝室长",
"Name": "2001,8001|2002,8001|2003,80021",
"ActionMode": 1,
"Group": 8001,
"GroupLeader": 0,
"IsLeadingNPC": 1,
"ICON": "ICON_323",
"WeightLimit": -1,
"Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b012.Prefeb"
}
{
"ID": "8000",
"Note": "主持人",
"Name": "2001,1,8000|2001,2,8000|2001,6,8000",
"ActionMode": "0",
"Group": "-1",
"GroupLeader": "3",
"IsLeadingNPC": "0",
"ICON": "ICON_312",
"WeightLimit": "-1",
"Stats": "-1",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b013.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8001",
"Note": "总指挥",
"Name": "2001,1,8001|2001,2,8001|2001,6,8001",
"ActionMode": "2",
"Group": "-1",
"GroupLeader": "2",
"IsLeadingNPC": "0",
"ICON": "ICON_313",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b001.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8002",
"Note": "抢险救援组",
"Name": "2001,1,8002|2001,2,8002|2001,6,8002",
"ActionMode": "2",
"Group": "8003",
"GroupLeader": "0",
"IsLeadingNPC": "0",
"ICON": "ICON_314",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b002.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8003",
"Note": "(组长)抢险救援组",
"Name": "2001,1,8003|2001,2,8003|2001,6,8003",
"ActionMode": "2",
"Group": "-1",
"GroupLeader": "1",
"IsLeadingNPC": "0",
"ICON": "ICON_315",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b003.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8004",
"Note": "医疗救护组",
"Name": "2001,1,8004|2001,2,8004|2001,6,8004",
"ActionMode": "2",
"Group": "8005",
"GroupLeader": "0",
"IsLeadingNPC": "0",
"ICON": "ICON_316",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b004.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8005",
"Note": "(组长)医疗救护组",
"Name": "2001,1,8005|2001,2,8005|2001,6,8005",
"ActionMode": "2",
"Group": "-1",
"GroupLeader": "1",
"IsLeadingNPC": "0",
"ICON": "ICON_317",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b005.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8006",
"Note": "疏散引导组1",
"Name": "2001,1,8005|2001,2,8005|2001,6,8999",
"ActionMode": "1",
"Group": "8001",
"GroupLeader": "0",
"IsLeadingNPC": "1",
"ICON": "ICON_318",
"WeightLimit": "-1",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b006.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8007",
"Note": "疏散引导组2",
"Name": "2002,1,8007|2002,2,8007|2002,3,8999",
"ActionMode": "2",
"Group": "8001",
"GroupLeader": "0",
"IsLeadingNPC": "1",
"ICON": "ICON_319",
"WeightLimit": "-1",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b007.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8008",
"Note": "后勤保障组",
"Name": "2001,1,8008|2001,2,8008|2001,6,8008",
"ActionMode": "2",
"Group": "8009",
"GroupLeader": "0",
"IsLeadingNPC": "0",
"ICON": "ICON_320",
"WeightLimit": "10",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b008.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8009",
"Note": "(组长)后勤保障组",
"Name": "2001,1,8009|2001,2,8009|2001,6,8009",
"ActionMode": "2",
"Group": "-1",
"GroupLeader": "1",
"IsLeadingNPC": "0",
"ICON": "ICON_321",
"WeightLimit": "10",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b009.Prefeb",
"ManageLevel": "-1"
},
{
"ID": "8010",
"Note": "搜寻组",
"Name": "2001,1,8010|2001,2,8010|2001,6,8010",
"ActionMode": "2",
"Group": "8001",
"GroupLeader": "0",
"IsLeadingNPC": "0",
"ICON": "ICON_322",
"WeightLimit": "5",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b010.Prefeb",
"ManageLevel": "1|2|3|4|5"
},
{
"ID": "8011",
"Note": "学生寝室长",
"Name": "2002,1,8011|2002,2,8011|2002,3,8999",
"ActionMode": "1",
"Group": "8001",
"GroupLeader": "0",
"IsLeadingNPC": "1",
"ICON": "ICON_323",
"WeightLimit": "-1",
"Stats": "1,6.5|2,1.8|3,1|6,100",
"Skills": "4001,-1|4003,202|4005,-1",
"ResPath": "\\ASSETS\\b012.Prefeb",
"ManageLevel": "-1"
}
]

View File

@ -296,10 +296,18 @@ public class JSONReader : MonoBehaviour
}
//设置UI文本的方法
public void SetUIText(Text text, int id)
public string SetUIText(int id)
{
Language languageinfo = GetLanguageByID(id);
text.text = languageinfo.Text;
Language info = null;
if (LanguageDictionary.TryGetValue(id, out info))
{
return info.Text;
}
else
{
Debug.Log($"No Language found with ID: {id}");
return null;
}
}
}

View File

@ -137,7 +137,7 @@ public class Panel : MonoBehaviour
}
}
//动态加载职责
public void DynamicLoadingDuty(int id)
public void DynamicLoadingDuty(int id,int idcidentId)
{
if (selectScenePanel.difficultyToRoles.ContainsKey(id))
{
@ -152,30 +152,42 @@ public class Panel : MonoBehaviour
{
var npcInfo = jsonReader1.npcDictionary[roleId];
// 创建DutyItem实例
GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount);
DutyItem dutyItem = item.GetComponent<DutyItem>();
Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>();
dutuybutton.onClick.AddListener(() =>
string[] roleLimitSections = npcData.Name.Split('|');
foreach(string plopleInfo in roleLimitSections)
{
OnDutyItemClicked(item, Color.red, selectedDuty);
if(dutyItem.dutyNameText.text=="Ö÷³ÖÈË")
string[] peopleLimit = plopleInfo.Split(',');
if (peopleLimit[0] == idcidentId.ToString() && peopleLimit[1]==id.ToString())
{
peopleList.Clear();
foreach (Transform child in sceneCount)
GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount);
DutyItem dutyItem = item.GetComponent<DutyItem>();
Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>();
string showText = jsonReader1.SetUIText(int.Parse(peopleLimit[2]));
dutuybutton.onClick.AddListener(() =>
{
Destroy(child.gameObject);
}
Debug.Log("ÎÞÐèÖ¸¶¨Î»ÖÃ");
OnDutyItemClicked(item, Color.red, selectedDuty);
if(dutyItem.dutyNameText.text=="Ö÷³ÖÈË")
{
peopleList.Clear();
foreach (Transform child in sceneCount)
{
Destroy(child.gameObject);
}
Debug.Log("ÎÞÐèÖ¸¶¨Î»ÖÃ");
}
else
{
SetScene(dutyItem.dutyId);
}
});
dutyItem.dutyNameText.text = showText;
dutyItem.leader = npcData.GroupLeader;
dutyItem.dutyId = npcData.ID;
peopleList.Add(item);
}
else
{
SetScene(dutyItem.dutyId);
}
});
dutyItem.dutyNameText.text = npcData.Note;
dutyItem.leader = npcData.GroupLeader;
dutyItem.dutyId = npcData.ID;
peopleList.Add(item);
}
}
}
}

View File

@ -447,7 +447,7 @@ public class SelectScenePanel : MonoBehaviour
DisableUIInteraction();
panel.DynamicLoadingPeople();
panel.DynamicLoadingScene();
panel.DynamicLoadingDuty(this.difficultyId);
panel.DynamicLoadingDuty(this.difficultyId,this.idcidentId);
isSure = true;
}