Compare commits

..

No commits in common. "26e6f4e6d1815ccc2d06517941a5f6ed25aac79f" and "7464bc59ce512ca5fc7c8235e2204fa115225162" have entirely different histories.

4 changed files with 193 additions and 225 deletions

View File

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

View File

@ -296,18 +296,10 @@ public class JSONReader : MonoBehaviour
} }
//设置UI文本的方法 //设置UI文本的方法
public string SetUIText(int id) public void SetUIText(Text text, int id)
{ {
Language info = null; Language languageinfo = GetLanguageByID(id);
if (LanguageDictionary.TryGetValue(id, out info)) text.text = languageinfo.Text;
{
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,int idcidentId) public void DynamicLoadingDuty(int id)
{ {
if (selectScenePanel.difficultyToRoles.ContainsKey(id)) if (selectScenePanel.difficultyToRoles.ContainsKey(id))
{ {
@ -152,18 +152,9 @@ public class Panel : MonoBehaviour
{ {
var npcInfo = jsonReader1.npcDictionary[roleId]; var npcInfo = jsonReader1.npcDictionary[roleId];
// 创建DutyItem实例 // 创建DutyItem实例
string[] roleLimitSections = npcData.Name.Split('|');
foreach(string plopleInfo in roleLimitSections)
{
string[] peopleLimit = plopleInfo.Split(',');
if (peopleLimit[0] == idcidentId.ToString() && peopleLimit[1]==id.ToString())
{
GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount); GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount);
DutyItem dutyItem = item.GetComponent<DutyItem>(); DutyItem dutyItem = item.GetComponent<DutyItem>();
Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>(); Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>();
string showText = jsonReader1.SetUIText(int.Parse(peopleLimit[2]));
dutuybutton.onClick.AddListener(() => dutuybutton.onClick.AddListener(() =>
{ {
OnDutyItemClicked(item, Color.red, selectedDuty); OnDutyItemClicked(item, Color.red, selectedDuty);
@ -181,15 +172,12 @@ public class Panel : MonoBehaviour
SetScene(dutyItem.dutyId); SetScene(dutyItem.dutyId);
} }
}); });
dutyItem.dutyNameText.text = showText; dutyItem.dutyNameText.text = npcData.Note;
dutyItem.leader = npcData.GroupLeader; dutyItem.leader = npcData.GroupLeader;
dutyItem.dutyId = npcData.ID; dutyItem.dutyId = npcData.ID;
peopleList.Add(item); peopleList.Add(item);
} }
} }
}
}
} }
} }
//动态加载场景 //动态加载场景

View File

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