Merge branch 'main' of http://shu.sheziwanglo.cn:3000/wulongxiao/_xiaofang
This commit is contained in:
commit
12d9d8e1ec
@ -60,7 +60,8 @@ public class NpcList//NPC
|
|||||||
{
|
{
|
||||||
public string npcId;//NPC编号--------------------------------必须
|
public string npcId;//NPC编号--------------------------------必须
|
||||||
public string areaId;//区域编号------------------------------必须
|
public string areaId;//区域编号------------------------------必须
|
||||||
public int birthAreaId;//数量--------------------------------必须
|
public int num;//数量--------------------------------必须
|
||||||
|
public int isHere;//是否归属
|
||||||
}
|
}
|
||||||
public class MaterialList//设备器材列表
|
public class MaterialList//设备器材列表
|
||||||
{
|
{
|
||||||
|
@ -327,7 +327,6 @@ public class Panel : MonoBehaviour
|
|||||||
string difficultyId = roleLimits[1];
|
string difficultyId = roleLimits[1];
|
||||||
string roleId = roleLimits[2]; // 职业ID
|
string roleId = roleLimits[2]; // 职业ID
|
||||||
int minRequired = int.Parse(roleLimits[3]); // 最低要求人数
|
int minRequired = int.Parse(roleLimits[3]); // 最低要求人数
|
||||||
Debug.LogError("SceneId+" + selectScenePanel.idcidentId);
|
|
||||||
if (accidentLocationId == selectScenePanel.idcidentId.ToString() && roleId == id.ToString() && difficultyId == selectScenePanel.difficultyId.ToString())
|
if (accidentLocationId == selectScenePanel.idcidentId.ToString() && roleId == id.ToString() && difficultyId == selectScenePanel.difficultyId.ToString())
|
||||||
{
|
{
|
||||||
GameObject item = GameObject.Instantiate<GameObject>(scenePrefab, sceneCount);
|
GameObject item = GameObject.Instantiate<GameObject>(scenePrefab, sceneCount);
|
||||||
@ -486,7 +485,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId);
|
|||||||
selectedInfo.name = name;
|
selectedInfo.name = name;
|
||||||
selectedInfo.peopleId = peopleItem.peopleId;
|
selectedInfo.peopleId = peopleItem.peopleId;
|
||||||
isPersonSelected = true; // 选择了人员
|
isPersonSelected = true; // 选择了人员
|
||||||
Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.peopleId);
|
|
||||||
}
|
}
|
||||||
else if (buttonText != null && buttonText.tag == Tags.scene) // 获取标签为场景的信息
|
else if (buttonText != null && buttonText.tag == Tags.scene) // 获取标签为场景的信息
|
||||||
{
|
{
|
||||||
@ -495,7 +493,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId);
|
|||||||
selectedInfo.scene = scene;
|
selectedInfo.scene = scene;
|
||||||
selectedInfo.sceneId= sceneItem.sceneId;
|
selectedInfo.sceneId= sceneItem.sceneId;
|
||||||
isSceneSelected = true; // 选择了场景
|
isSceneSelected = true; // 选择了场景
|
||||||
Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.sceneId);
|
|
||||||
}
|
}
|
||||||
else if (buttonText != null && buttonText.tag == Tags.duty) // 获取标签为职责的信息
|
else if (buttonText != null && buttonText.tag == Tags.duty) // 获取标签为职责的信息
|
||||||
{
|
{
|
||||||
@ -514,7 +511,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId);
|
|||||||
dutyId = item.dutyId;
|
dutyId = item.dutyId;
|
||||||
selectedInfo.duty = duty;
|
selectedInfo.duty = duty;
|
||||||
selectedInfo.dutyId = dutyId.ToString();
|
selectedInfo.dutyId = dutyId.ToString();
|
||||||
Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.dutyId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,8 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
SetNpcType();
|
redistributeBtn.interactable = false;
|
||||||
|
//SetNpcType();
|
||||||
//nonZeroAreas= GetNonZeroNpcRatioAreas();
|
//nonZeroAreas= GetNonZeroNpcRatioAreas();
|
||||||
jc = JuesechoicePop.GetComponent<JueseChoicePop>();
|
jc = JuesechoicePop.GetComponent<JueseChoicePop>();
|
||||||
CountsubmitBtn.onClick.AddListener(Submit);
|
CountsubmitBtn.onClick.AddListener(Submit);
|
||||||
@ -79,12 +80,18 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
//上传数据
|
//上传数据
|
||||||
public void totalSubmit()
|
public void totalSubmit()
|
||||||
{
|
{
|
||||||
NpcList nPC = new NpcList();
|
|
||||||
|
|
||||||
nPC.npcId = npcType;
|
|
||||||
nPC.areaId = roleid;
|
|
||||||
createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List<NpcList>();
|
createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List<NpcList>();
|
||||||
createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC);
|
foreach(var npcInfo in personnelItems)
|
||||||
|
{
|
||||||
|
Debug.LogError("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||||
|
NpcList nPC = new NpcList();
|
||||||
|
nPC.npcId = npcInfo.npcId.ToString();
|
||||||
|
nPC.areaId = npcInfo.sceneId.ToString();
|
||||||
|
nPC.isHere=npcInfo.isHere;
|
||||||
|
nPC.num = npcInfo.NpcNum;
|
||||||
|
|
||||||
|
createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC);
|
||||||
|
}
|
||||||
panel.panelToggle[3].interactable = true; // 启用第二个Toggle
|
panel.panelToggle[3].interactable = true; // 启用第二个Toggle
|
||||||
panel.panelToggle[3].gameObject.transform.GetComponent<Image>().sprite = panel.toggleImage[1];
|
panel.panelToggle[3].gameObject.transform.GetComponent<Image>().sprite = panel.toggleImage[1];
|
||||||
panel.panelToggle[4].interactable = true; // 启用第三个Toggle
|
panel.panelToggle[4].interactable = true; // 启用第三个Toggle
|
||||||
@ -143,6 +150,7 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
item.SetInfo(kvp.Value.ToString()); // 更新UI显示
|
item.SetInfo(kvp.Value.ToString()); // 更新UI显示
|
||||||
item.NpcNum = kvp.Value; // 更新Npc数量
|
item.NpcNum = kvp.Value; // 更新Npc数量
|
||||||
|
|
||||||
item.personnelImage.gameObject.SetActive(true); // 显示图标
|
item.personnelImage.gameObject.SetActive(true); // 显示图标
|
||||||
Debug.Log($"Scene ID: {kvp.Key}, Assigned NPC Count: {kvp.Value}");
|
Debug.Log($"Scene ID: {kvp.Key}, Assigned NPC Count: {kvp.Value}");
|
||||||
}
|
}
|
||||||
@ -168,7 +176,8 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
int sceneId = item.sceneId; // 使用 PersonnelItem 的 sceneId
|
int sceneId = item.sceneId; // 使用 PersonnelItem 的 sceneId
|
||||||
float ratio = float.Parse(parts[4]); // 第五项是分配比例
|
float ratio = float.Parse(parts[4]); // 第五项是分配比例
|
||||||
|
item.npcId = int.Parse(parts[2]);
|
||||||
|
item .isHere=int.Parse(parts[3]);
|
||||||
if (!sceneRatios.ContainsKey(sceneId))
|
if (!sceneRatios.ContainsKey(sceneId))
|
||||||
{
|
{
|
||||||
sceneRatios.Add(sceneId, ratio);
|
sceneRatios.Add(sceneId, ratio);
|
||||||
@ -400,7 +409,6 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//设置文字颜色
|
//设置文字颜色
|
||||||
public void OnSceneItemClicked(GameObject clickedItem, Color color, GameObject select)
|
public void OnSceneItemClicked(GameObject clickedItem, Color color, GameObject select)
|
||||||
{
|
{
|
||||||
|
@ -383,7 +383,6 @@ public class SelectScenePanel : MonoBehaviour
|
|||||||
toggle.isOn = false;
|
toggle.isOn = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent<EventInfo>());
|
|
||||||
// 选中随机事件
|
// 选中随机事件
|
||||||
if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent<IncidentInfo>().isOpen != false)
|
if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent<IncidentInfo>().isOpen != false)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@ public class PersonnelItem : MonoBehaviour
|
|||||||
public Text sceneText;
|
public Text sceneText;
|
||||||
public Image personnelImage;
|
public Image personnelImage;
|
||||||
public Text personnelNum;
|
public Text personnelNum;
|
||||||
|
public int npcId;
|
||||||
public int sceneId;
|
public int sceneId;
|
||||||
public int Num = 0;
|
public int Num = 0;
|
||||||
public int NpcNum = 0;
|
public int NpcNum = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user