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,8001|2002,8001|2003,80010",
"Name": "2001,1,8001|2001,2,8001|2001,6,8001", "ActionMode": 2,
"ActionMode": "2", "Group": -1,
"Group": "-1", "GroupLeader": 2,
"GroupLeader": "2", "IsLeadingNPC": 0,
"IsLeadingNPC": "0", "ICON": "ICON_313",
"ICON": "ICON_313", "WeightLimit": 6,
"WeightLimit": "5", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Stats": "1,6.5|2,1.8|3,1|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,
{ "Note": "抢险救援组",
"ID": "8002", "Name": "2001,8001|2002,8001|2003,80011",
"Note": "抢险救援组", "ActionMode": 2,
"Name": "2001,1,8002|2001,2,8002|2001,6,8002", "Group": 8003,
"ActionMode": "2", "GroupLeader": 0,
"Group": "8003", "IsLeadingNPC": 0,
"GroupLeader": "0", "ICON": "ICON_314",
"IsLeadingNPC": "0", "WeightLimit": 6,
"ICON": "ICON_314", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"WeightLimit": "5", "Skills": "4001,-1|4003,202|4005,-1",
"Stats": "1,6.5|2,1.8|3,1|6,100", "ResPath": "\\ASSETS\\b002.Prefeb"
"Skills": "4001,-1|4003,202|4005,-1", },
"ResPath": "\\ASSETS\\b002.Prefeb", {
"ManageLevel": "-1" "ID": 8003,
}, "Note": "(组长)抢险救援组",
{ "Name": "2001,8001|2002,8001|2003,80012",
"ID": "8003", "ActionMode": 2,
"Note": "(组长)抢险救援组", "Group": -1,
"Name": "2001,1,8003|2001,2,8003|2001,6,8003", "GroupLeader": 1,
"ActionMode": "2", "IsLeadingNPC": 0,
"Group": "-1", "ICON": "ICON_315",
"GroupLeader": "1", "WeightLimit": 6,
"IsLeadingNPC": "0", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"ICON": "ICON_315", "Skills": "4001,-1|4003,202|4005,-1",
"WeightLimit": "5", "ResPath": "\\ASSETS\\b003.Prefeb"
"Stats": "1,6.5|2,1.8|3,1|6,100", },
"Skills": "4001,-1|4003,202|4005,-1", {
"ResPath": "\\ASSETS\\b003.Prefeb", "ID": 8004,
"ManageLevel": "-1" "Note": "医疗救护组",
}, "Name": "2001,8001|2002,8001|2003,80013",
{ "ActionMode": 2,
"ID": "8004", "Group": 8005,
"Note": "医疗救护组", "GroupLeader": 0,
"Name": "2001,1,8004|2001,2,8004|2001,6,8004", "IsLeadingNPC": 0,
"ActionMode": "2", "ICON": "ICON_316",
"Group": "8005", "WeightLimit": 6,
"GroupLeader": "0", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"IsLeadingNPC": "0", "Skills": "4001,-1|4003,202|4005,-1",
"ICON": "ICON_316", "ResPath": "\\ASSETS\\b004.Prefeb"
"WeightLimit": "5", },
"Stats": "1,6.5|2,1.8|3,1|6,100", {
"Skills": "4001,-1|4003,202|4005,-1", "ID": 8005,
"ResPath": "\\ASSETS\\b004.Prefeb", "Note": "(组长)医疗救护组",
"ManageLevel": "-1" "Name": "2001,8001|2002,8001|2003,80014",
}, "ActionMode": 2,
{ "Group": -1,
"ID": "8005", "GroupLeader": 1,
"Note": "(组长)医疗救护组", "IsLeadingNPC": 0,
"Name": "2001,1,8005|2001,2,8005|2001,6,8005", "ICON": "ICON_317",
"ActionMode": "2", "WeightLimit": 6,
"Group": "-1", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"GroupLeader": "1", "Skills": "4001,-1|4003,202|4005,-1",
"IsLeadingNPC": "0", "ResPath": "\\ASSETS\\b005.Prefeb"
"ICON": "ICON_317", },
"WeightLimit": "5", {
"Stats": "1,6.5|2,1.8|3,1|6,100", "ID": 8006,
"Skills": "4001,-1|4003,202|4005,-1", "Note": "疏散引导组1",
"ResPath": "\\ASSETS\\b005.Prefeb", "Name": "2001,8001|2002,8001|2003,80015",
"ManageLevel": "-1" "ActionMode": 1,
}, "Group": 8001,
{ "GroupLeader": 0,
"ID": "8006", "IsLeadingNPC": 1,
"Note": "疏散引导组1", "ICON": "ICON_318",
"Name": "2001,1,8005|2001,2,8005|2001,6,8999", "WeightLimit": -1,
"ActionMode": "1", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Group": "8001", "Skills": "4001,-1|4003,202|4005,-1",
"GroupLeader": "0", "ResPath": "\\ASSETS\\b006.Prefeb"
"IsLeadingNPC": "1", },
"ICON": "ICON_318", {
"WeightLimit": "-1", "ID": 8007,
"Stats": "1,6.5|2,1.8|3,1|6,100", "Note": "疏散引导组2",
"Skills": "4001,-1|4003,202|4005,-1", "Name": "2001,8001|2002,8001|2003,80016",
"ResPath": "\\ASSETS\\b006.Prefeb", "ActionMode": 1,
"ManageLevel": "-1" "Group": 8001,
}, "GroupLeader": 0,
{ "IsLeadingNPC": 1,
"ID": "8007", "ICON": "ICON_319",
"Note": "疏散引导组2", "WeightLimit": -1,
"Name": "2002,1,8007|2002,2,8007|2002,3,8999", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"ActionMode": "2", "Skills": "4001,-1|4003,202|4005,-1",
"Group": "8001", "ResPath": "\\ASSETS\\b007.Prefeb"
"GroupLeader": "0", },
"IsLeadingNPC": "1", {
"ICON": "ICON_319", "ID": 8008,
"WeightLimit": "-1", "Note": "后勤保障组",
"Stats": "1,6.5|2,1.8|3,1|6,100", "Name": "2001,8001|2002,8001|2003,80017",
"Skills": "4001,-1|4003,202|4005,-1", "ActionMode": 2,
"ResPath": "\\ASSETS\\b007.Prefeb", "Group": 8009,
"ManageLevel": "-1" "GroupLeader": 0,
}, "IsLeadingNPC": 0,
{ "ICON": "ICON_320",
"ID": "8008", "WeightLimit": 12,
"Note": "后勤保障组", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Name": "2001,1,8008|2001,2,8008|2001,6,8008", "Skills": "4001,-1|4003,202|4005,-1",
"ActionMode": "2", "ResPath": "\\ASSETS\\b008.Prefeb"
"Group": "8009", },
"GroupLeader": "0", {
"IsLeadingNPC": "0", "ID": 8009,
"ICON": "ICON_320", "Note": "(组长)后勤保障组",
"WeightLimit": "10", "Name": "2001,8001|2002,8001|2003,80018",
"Stats": "1,6.5|2,1.8|3,1|6,100", "ActionMode": 2,
"Skills": "4001,-1|4003,202|4005,-1", "Group": -1,
"ResPath": "\\ASSETS\\b008.Prefeb", "GroupLeader": 1,
"ManageLevel": "-1" "IsLeadingNPC": 0,
}, "ICON": "ICON_321",
{ "WeightLimit": 12,
"ID": "8009", "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"Note": "(组长)后勤保障组", "Skills": "4001,-1|4003,202|4005,-1",
"Name": "2001,1,8009|2001,2,8009|2001,6,8009", "ResPath": "\\ASSETS\\b009.Prefeb"
"ActionMode": "2", },
"Group": "-1", {
"GroupLeader": "1", "ID": 8010,
"IsLeadingNPC": "0", "Note": "搜寻组",
"ICON": "ICON_321", "Name": "2001,8001|2002,8001|2003,80019",
"WeightLimit": "10", "ActionMode": 2,
"Stats": "1,6.5|2,1.8|3,1|6,100", "Group": 8001,
"Skills": "4001,-1|4003,202|4005,-1", "GroupLeader": 0,
"ResPath": "\\ASSETS\\b009.Prefeb", "IsLeadingNPC": 0,
"ManageLevel": "-1" "ICON": "ICON_322",
}, "WeightLimit": 6,
{ "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
"ID": "8010", "Skills": "4001,-1|4003,202|4005,-1",
"Note": "搜寻组", "ResPath": "\\ASSETS\\b010.Prefeb"
"Name": "2001,1,8010|2001,2,8010|2001,6,8010", },
"ActionMode": "2", {
"Group": "8001", "ID": 8011,
"GroupLeader": "0", "Note": "学生寝室长",
"IsLeadingNPC": "0", "Name": "2001,8001|2002,8001|2003,80021",
"ICON": "ICON_322", "ActionMode": 1,
"WeightLimit": "5", "Group": 8001,
"Stats": "1,6.5|2,1.8|3,1|6,100", "GroupLeader": 0,
"Skills": "4001,-1|4003,202|4005,-1", "IsLeadingNPC": 1,
"ResPath": "\\ASSETS\\b010.Prefeb", "ICON": "ICON_323",
"ManageLevel": "1|2|3|4|5" "WeightLimit": -1,
}, "Stats": "1,4.5|2,2|3,1|4,0|5,0|6,100",
{ "Skills": "4001,-1|4003,202|4005,-1",
"ID": "8011", "ResPath": "\\ASSETS\\b012.Prefeb"
"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,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,42 +152,30 @@ public class Panel : MonoBehaviour
{ {
var npcInfo = jsonReader1.npcDictionary[roleId]; var npcInfo = jsonReader1.npcDictionary[roleId];
// 创建DutyItem实例 // 创建DutyItem实例
string[] roleLimitSections = npcData.Name.Split('|'); GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount);
foreach(string plopleInfo in roleLimitSections) DutyItem dutyItem = item.GetComponent<DutyItem>();
Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>();
dutuybutton.onClick.AddListener(() =>
{ {
OnDutyItemClicked(item, Color.red, selectedDuty);
string[] peopleLimit = plopleInfo.Split(','); if(dutyItem.dutyNameText.text=="Ö÷³ÖÈË")
if (peopleLimit[0] == idcidentId.ToString() && peopleLimit[1]==id.ToString())
{ {
GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount); peopleList.Clear();
DutyItem dutyItem = item.GetComponent<DutyItem>(); foreach (Transform child in sceneCount)
Button dutuybutton = item.transform.Find("TextBtn").GetComponent<Button>();
string showText = jsonReader1.SetUIText(int.Parse(peopleLimit[2]));
dutuybutton.onClick.AddListener(() =>
{ {
OnDutyItemClicked(item, Color.red, selectedDuty); Destroy(child.gameObject);
if(dutyItem.dutyNameText.text=="Ö÷³ÖÈË") }
{ Debug.Log("ÎÞÐèÖ¸¶¨Î»ÖÃ");
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(); DisableUIInteraction();
panel.DynamicLoadingPeople(); panel.DynamicLoadingPeople();
panel.DynamicLoadingScene(); panel.DynamicLoadingScene();
panel.DynamicLoadingDuty(this.difficultyId,this.idcidentId); panel.DynamicLoadingDuty(this.difficultyId);
isSure = true; isSure = true;
} }