疏散人群公布修改
This commit is contained in:
parent
96ba512839
commit
7f831f0862
@ -641,7 +641,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 560.5, y: -109}
|
||||
m_AnchoredPosition: {x: 560.5, y: -44}
|
||||
m_SizeDelta: {x: 1121, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5900002971599260725
|
||||
|
@ -2138,7 +2138,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &618256459
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2253,9 +2253,9 @@ MonoBehaviour:
|
||||
jsonReader1: {fileID: 1417128757}
|
||||
selectScenePanel: {fileID: 7468736064579811982}
|
||||
datePanel: {fileID: 468742199}
|
||||
--- !u!1 &621287106 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 51007377463830338, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
--- !u!224 &621287107 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 51007377463830339, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
m_PrefabInstance: {fileID: 1799705458}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &625672672
|
||||
@ -10051,7 +10051,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2102021660636739381, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: -361.72
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2102021660636739381, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
@ -10140,7 +10140,7 @@ PrefabInstance:
|
||||
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: sceneCount
|
||||
value:
|
||||
objectReference: {fileID: 621287106}
|
||||
objectReference: {fileID: 621287107}
|
||||
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: scenePrefab
|
||||
value:
|
||||
@ -10149,6 +10149,10 @@ PrefabInstance:
|
||||
propertyPath: selectScene
|
||||
value:
|
||||
objectReference: {fileID: 7468736064579811982}
|
||||
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: jueseChoicePanel
|
||||
value:
|
||||
objectReference: {fileID: 1799705462}
|
||||
- target: {fileID: 4764228630647718977, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@ -10167,19 +10171,19 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 190.05
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -23.991
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630805767484, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_Name
|
||||
@ -10187,7 +10191,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630805767484, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228630805767485, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
@ -10275,59 +10279,59 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631245731675, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 249.00002
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631278755135, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 629.702
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 133.7755
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -39.08695
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 58.95
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -23.991
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 495.9265
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -39.08695
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9196293257107006892, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
@ -10360,6 +10364,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: da23ef65e616ad3499db22bf6ad52794, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1799705462 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 9196293257107006892, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||
m_PrefabInstance: {fileID: 1799705458}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1809649275
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -14657,9 +14666,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736063934366934}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 334.1322, y: -55}
|
||||
m_SizeDelta: {x: 187, y: 110}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064122132329
|
||||
@ -14940,9 +14949,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736063934366934}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 753.3966, y: -55}
|
||||
m_SizeDelta: {x: 187, y: 110}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064198941274
|
||||
@ -15700,7 +15709,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 3.3229}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1834, y: 1070}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064579811972
|
||||
GameObject:
|
||||
@ -15722,7 +15731,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &7468736064579811982
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -16180,9 +16189,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736063934366934}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 543.7644, y: -55}
|
||||
m_SizeDelta: {x: 187, y: 110}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064659112359
|
||||
@ -16386,9 +16395,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736064579811971}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 917, y: -53.335}
|
||||
m_SizeDelta: {x: 1834, y: 106.67}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064728012045
|
||||
@ -16548,9 +16557,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736063934366934}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 124.5, y: -55}
|
||||
m_SizeDelta: {x: 187, y: 110}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064820222392
|
||||
@ -16961,9 +16970,9 @@ RectTransform:
|
||||
m_Father: {fileID: 7468736064579811971}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 917, y: -588.33496}
|
||||
m_SizeDelta: {x: 1834, y: 498.685}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7468736064937661071
|
||||
|
@ -20,7 +20,8 @@ public class EvacuationPanel : MonoBehaviour
|
||||
public GameObject classPrefab;
|
||||
public GameObject classCount;//
|
||||
public GameObject scenePrefab;//区域预制体
|
||||
public GameObject sceneCount;//区域预制体的容器
|
||||
public Transform sceneCount;//ÇøÓòÔ¤ÖÆÌåµÄÈÝÆ÷
|
||||
public GameObject jueseChoicePanel;
|
||||
public Transform content;
|
||||
public Text topText;
|
||||
private GameObject selectedScene = null;//当前选中场景
|
||||
@ -211,21 +212,21 @@ public class EvacuationPanel : MonoBehaviour
|
||||
}
|
||||
|
||||
//清除
|
||||
private void ClearData()
|
||||
{
|
||||
jc.classItem.isSet = false;
|
||||
foreach (var item in classItemList)
|
||||
{
|
||||
item.isSet = false;
|
||||
item.setClassItem("");
|
||||
}
|
||||
jc.classMate.isBeSet = false;
|
||||
foreach(var item in jc.classMateList)
|
||||
{
|
||||
item.isBeSet = false;
|
||||
item.setName();
|
||||
}
|
||||
}
|
||||
//private void ClearData()
|
||||
//{
|
||||
// jc.classItem.isSet = false;
|
||||
// foreach (var item in classItemList)
|
||||
// {
|
||||
// item.isSet = false;
|
||||
// item.setClassItem("");
|
||||
// }
|
||||
// jc.classMate.isBeSet = false;
|
||||
// foreach(var item in jc.classMateList)
|
||||
// {
|
||||
// item.isBeSet = false;
|
||||
// item.setName();
|
||||
// }
|
||||
//}
|
||||
|
||||
//判断NPC的比例字段,列出分配比例不为0的所有区域名称。
|
||||
public List<int> GetNonZeroNpcRatioAreas()
|
||||
@ -321,7 +322,22 @@ public class EvacuationPanel : MonoBehaviour
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
OnSceneItemClicked(item, Color.yellow, selectedScene);
|
||||
LoadManagedArea(selectScene.difficultyId, personnelItem.sceneId);
|
||||
foreach (Transform child in sceneCount)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
LocationData locationData = js.GetAreaDateById(personnelItem.sceneId);
|
||||
if(locationData.Level.ToString() != "0")
|
||||
{
|
||||
GameObject levelItem = GameObject.Instantiate<GameObject>(scenePrefab, sceneCount);
|
||||
Button levelBtn = levelItem.transform.Find("chooseBtn2").GetComponent<Button>();
|
||||
levelBtn.onClick.AddListener(() =>
|
||||
{
|
||||
jueseChoicePanel.gameObject .SetActive(true);
|
||||
});
|
||||
ClassItem classItem = levelItem.GetComponent<ClassItem>();
|
||||
classItem.classname.text = locationData.Level.ToString();
|
||||
}
|
||||
});
|
||||
//Debug.Log("New PersonnelItem created. SceneId: " + personnelItem.sceneId + ", Num: " + personnelItem.Num);
|
||||
personnelItems.Add(personnelItem);
|
||||
@ -498,29 +514,4 @@ public class EvacuationPanel : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
//动态加载分管区域预制体
|
||||
public void LoadManagedArea(int targetKey,int sceneId)
|
||||
{
|
||||
// 确保字典中有数据
|
||||
if (selectScene.difficultyToRoles.Count == 0)
|
||||
{
|
||||
Debug.Log("The dictionary is empty.");
|
||||
return;
|
||||
}
|
||||
// 判断字典中是否包含目标Key
|
||||
if (selectScene.difficultyToRoles.ContainsKey(targetKey))
|
||||
{
|
||||
// 获取目标Key对应的Value值
|
||||
List<string> roles = selectScene.difficultyToRoles[targetKey];
|
||||
foreach (var role in roles)
|
||||
{
|
||||
//if(sceneId=)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"The key {targetKey} does not exist in the dictionary.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -257,12 +257,16 @@ public class SelectScenePanel : MonoBehaviour
|
||||
//点击继续按钮后更换场景图片及名称
|
||||
public void InstantiateEventPrefab(int id)
|
||||
{
|
||||
// 清空事件列表
|
||||
incidentInfos.Clear();
|
||||
foreach (Transform child in incidentList)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
// 更新场景名称
|
||||
text20008.text = sceneName;
|
||||
|
||||
// 通过 id 获取对应的 sceneData
|
||||
if (jsonReader.sceneDictionary.TryGetValue(id, out var sceneData))
|
||||
{
|
||||
@ -272,54 +276,63 @@ public class SelectScenePanel : MonoBehaviour
|
||||
// 遍历每个分隔出来的 id
|
||||
foreach (string incidentIdStr in incidentIds)
|
||||
{
|
||||
//Debug.Log("incidentIdStr" + incidentIdStr);
|
||||
// 转换字符串为 int 类型
|
||||
if (int.TryParse(incidentIdStr, out int incidentId))
|
||||
{
|
||||
// 根据 incidentId 获取对应的事件数据
|
||||
EventData eventData=jsonReader.GetEvenById(incidentId);
|
||||
EventData eventData = jsonReader.GetEvenById(incidentId);
|
||||
string[] incidentIds2 = eventData.DisasterLocation.Split('|');
|
||||
|
||||
// 动态加载 slot
|
||||
GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList);
|
||||
EventInfo item = slot.GetComponent<EventInfo>();
|
||||
item.eventId = eventData.ID;
|
||||
item.eventName.text = eventData.Note;
|
||||
if (item.IsOpen)
|
||||
{
|
||||
item.maskImage.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.maskImage.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
// 显示或隐藏遮罩
|
||||
item.maskImage.gameObject.SetActive(!item.IsOpen);
|
||||
|
||||
// 获取 Toggle 组件并配置
|
||||
Toggle toggle = slot.GetComponent<Toggle>();
|
||||
if (toggle != null)
|
||||
{
|
||||
toggle.group = eventGroup;
|
||||
eventInfoList.Add(item);
|
||||
evnetsceneList.Add(toggle);
|
||||
}
|
||||
//添加点击事件
|
||||
toggle.onValueChanged.AddListener((isSelected) =>
|
||||
{
|
||||
if (isSelected) // 只有当Toggle被选中时,才调用SelectEventBtn
|
||||
|
||||
// 添加点击事件
|
||||
toggle.onValueChanged.AddListener((isSelected) =>
|
||||
{
|
||||
// 清空事件列表
|
||||
incidentInfos.Clear();
|
||||
foreach (Transform child in incidentList)
|
||||
if (isSelected) // 只有当Toggle被选中时,才调用逻辑
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
// 清空事件列表
|
||||
incidentInfos.Clear();
|
||||
foreach (Transform child in incidentList)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
// 加载事件数据
|
||||
this.eventName = item.eventName.text; // 获取 Text 组件的文本
|
||||
this.eventId = item.eventId;
|
||||
EventData selectedEventData = jsonReader.GetEvenById(this.eventId);
|
||||
|
||||
foreach (string disasterLocation in incidentIds2)
|
||||
{
|
||||
InstantiateIncidentPrefab(int.Parse(disasterLocation));
|
||||
OnRandomEventClick();
|
||||
}
|
||||
|
||||
// 设置模板信息
|
||||
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.eventId.ToString();
|
||||
}
|
||||
this.eventName = item.eventName.text; // 获取 Text 组件的文本
|
||||
this.eventId = item.eventId;
|
||||
EventData eventData = jsonReader.GetEvenById(this.eventId);
|
||||
foreach (string disasterLocation in incidentIds2)
|
||||
{
|
||||
InstantiateIncidentPrefab(int.Parse(disasterLocation));
|
||||
OnRandomEventClick();
|
||||
}
|
||||
createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.eventId.ToString();
|
||||
});
|
||||
if (toggle.isOn)
|
||||
{
|
||||
// 模拟触发点击事件
|
||||
toggle.onValueChanged.Invoke(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -333,6 +346,7 @@ public class SelectScenePanel : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//事件及难度选择
|
||||
public void SelectEvent()
|
||||
{
|
||||
@ -353,7 +367,6 @@ public class SelectScenePanel : MonoBehaviour
|
||||
// 随机选择一个事件
|
||||
if (eventInfoList.Count > 1)
|
||||
{
|
||||
|
||||
int randomIndex = Random.Range(0, eventInfoList.Count);
|
||||
// 取消所有Toggle的选中状态
|
||||
foreach (Toggle toggle in eventToggleList)
|
||||
@ -370,6 +383,7 @@ public class SelectScenePanel : MonoBehaviour
|
||||
{
|
||||
eventToggleList[randomIndex].isOn = true;
|
||||
this.eventName = eventInfoList[randomIndex].eventName.text; // 设置随机选择的事件名称
|
||||
this.eventId = eventInfoList[randomIndex].eventId; // 更新事件 ID
|
||||
Debug.Log("已选择随机事件: " + this.eventName);
|
||||
}
|
||||
else
|
||||
|
@ -354,7 +354,7 @@ GameObject:
|
||||
- component: {fileID: 8299270741119412921}
|
||||
- component: {fileID: 8299270741119412922}
|
||||
m_Layer: 5
|
||||
m_Name: chooseBtn (1)
|
||||
m_Name: chooseBtn2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -13,41 +13,37 @@ public class ClassItem : MonoBehaviour
|
||||
public GameObject JuesechoicePop;
|
||||
public bool isSet = false;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
NoSelectedBtn.onClick.AddListener(OpenJueseChoicePop);
|
||||
//SelectedBtn.onClick.AddListener(OpenJueseChoicePop);
|
||||
setClassItem("");
|
||||
}
|
||||
public void setClassItem(string s)
|
||||
{
|
||||
if(!isSet)
|
||||
{
|
||||
NoSelectedBtn.gameObject.SetActive(true);
|
||||
SelectedBtn.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//NoSelectedBtn.gameObject.SetActive(true);
|
||||
//SelectedBtn.gameObject.SetActive(false);
|
||||
//void Start()
|
||||
//{
|
||||
// NoSelectedBtn.onClick.AddListener(OpenJueseChoicePop);
|
||||
// setClassItem("");
|
||||
//}
|
||||
//public void setClassItem(string s)
|
||||
//{
|
||||
// if(!isSet)
|
||||
// {
|
||||
// NoSelectedBtn.gameObject.SetActive(true);
|
||||
// SelectedBtn.gameObject.SetActive(false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //NoSelectedBtn.gameObject.SetActive(true);
|
||||
// //SelectedBtn.gameObject.SetActive(false);
|
||||
|
||||
SelectedBtn.gameObject.SetActive(true);
|
||||
SelectedBtntext.text = s;
|
||||
NoSelectedBtn.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
void OpenJueseChoicePop()
|
||||
{
|
||||
JuesechoicePop.SetActive(true);
|
||||
JueseChoicePop jueseChoicePop = JuesechoicePop.GetComponent<JueseChoicePop>();
|
||||
jueseChoicePop.SetClassItem(this);
|
||||
|
||||
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
// SelectedBtn.gameObject.SetActive(true);
|
||||
// SelectedBtntext.text = s;
|
||||
// NoSelectedBtn.gameObject.SetActive(false);
|
||||
// }
|
||||
//}
|
||||
//void OpenJueseChoicePop()
|
||||
//{
|
||||
// JuesechoicePop.SetActive(true);
|
||||
// JueseChoicePop jueseChoicePop = JuesechoicePop.GetComponent<JueseChoicePop>();
|
||||
// jueseChoicePop.SetClassItem(this);
|
||||
//}
|
||||
//// Update is called once per frame
|
||||
//void Update()
|
||||
//{
|
||||
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
@ -17,39 +17,39 @@ public class ClassMate : MonoBehaviour
|
||||
public bool isBeSet = false;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
button.onClick.AddListener(Click);
|
||||
s = classmatename.text;
|
||||
}
|
||||
//void Start()
|
||||
//{
|
||||
// button.onClick.AddListener(Click);
|
||||
// s = classmatename.text;
|
||||
//}
|
||||
|
||||
public void Click()
|
||||
{
|
||||
if(isBeSet == false)
|
||||
{
|
||||
jueseChoicePop.SetClassMate(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//jueseChoicePop.ChangeClassMate();
|
||||
}
|
||||
//public void Click()
|
||||
//{
|
||||
// if(isBeSet == false)
|
||||
// {
|
||||
// jueseChoicePop.SetClassMate(this);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //jueseChoicePop.ChangeClassMate();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
public void SetJc(JueseChoicePop jc)
|
||||
{
|
||||
jueseChoicePop = jc;
|
||||
}
|
||||
//public void SetJc(JueseChoicePop jc)
|
||||
//{
|
||||
// jueseChoicePop = jc;
|
||||
//}
|
||||
|
||||
public void setName()
|
||||
{
|
||||
classmatename.text = s;
|
||||
}
|
||||
//public void setName()
|
||||
//{
|
||||
// classmatename.text = s;
|
||||
//}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//// Update is called once per frame
|
||||
//void Update()
|
||||
//{
|
||||
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ public class JueseChoicePop : MonoBehaviour
|
||||
|
||||
public List<ClassMate> classMateList = new List<ClassMate> ();
|
||||
|
||||
//public string s;
|
||||
// Start is called before the first frame update
|
||||
public string s;
|
||||
//Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
this.gameObject.SetActive(false);
|
||||
@ -43,18 +43,17 @@ public class JueseChoicePop : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
public void SetClass()
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
GameObject item = GameObject.Instantiate<GameObject>(classmatePrefab, content);
|
||||
|
||||
|
||||
ClassMate classMate = item.GetComponent<ClassMate>();
|
||||
classMateList.Add(classMate);
|
||||
classMate.SetJc(this);
|
||||
|
||||
//classMate.SetJc(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,12 +63,12 @@ public class JueseChoicePop : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
public void SetClassMate(ClassMate classMate,string a = "")
|
||||
public void SetClassMate(ClassMate classMate, string a = "")
|
||||
{
|
||||
classMate.isBeSet = true;
|
||||
classItem.isSet = true;
|
||||
this.classMate = classMate;
|
||||
classItem.setClassItem(classMate.classmatename.text);
|
||||
//classItem.setClassItem(classMate.classmatename.text);
|
||||
//s = classMate.classmatename.text;
|
||||
this.classMate.classmatename.text = classMate.classmatename.text + "(" + classItem.classname.text + ")";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user