数据串联

This commit is contained in:
lq 2024-12-01 22:36:41 +08:00
parent c28cca2d95
commit 44ea8baf75
6 changed files with 173 additions and 78 deletions

View File

@ -0,0 +1,12 @@
[
{
"ID": 2001,
"Note": "厨房起火",
"Name": 2001,
"Scene": 9003,
"Position": "36,1,2",
"Volume": -1,
"Difficulty": "1|2|6",
"SpecialEvent": "-1,-1,-1,-1|1,50,10,20|1,50,20,20"
}
]

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1efa4372b10d4294199638c49173ff4c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2243,6 +2243,7 @@ MonoBehaviour:
scene: scene:
managerPanel1: {fileID: 617308873} managerPanel1: {fileID: 617308873}
jsonReader1: {fileID: 1417128757} jsonReader1: {fileID: 1417128757}
selectScenePanel: {fileID: 1138062886}
--- !u!1 &625672672 --- !u!1 &625672672
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2372,6 +2373,17 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 6740850324693622956, guid: a15ee694d5f79864d816998fae77116d, type: 3} m_CorrespondingSourceObject: {fileID: 6740850324693622956, guid: a15ee694d5f79864d816998fae77116d, type: 3}
m_PrefabInstance: {fileID: 1677529559} m_PrefabInstance: {fileID: 1677529559}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!114 &654779790 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7468736064578063281, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
m_PrefabInstance: {fileID: 865567720}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &666058189 --- !u!1 &666058189
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2501,7 +2513,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -193.59004, y: 309.8263} m_AnchoredPosition: {x: -193.59004, y: 309.8263}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 388.1544, y: 58.599}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &667280288 --- !u!114 &667280288
MonoBehaviour: MonoBehaviour:
@ -5650,6 +5662,10 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 618256459} m_TransformParent: {fileID: 618256459}
m_Modifications: m_Modifications:
- target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: title
value:
objectReference: {fileID: 654779790}
- target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: MainPanel propertyPath: MainPanel
value: value:
@ -5728,11 +5744,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 1834 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 1577.3936 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -5788,39 +5804,39 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063766935916, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063766935916, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 543.7644 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063812420174, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -55 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 917 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736063881909988, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -53.335 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064052287372, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064052287372, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: eventName propertyPath: eventName
@ -5854,6 +5870,10 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -62 value: -62
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064052287473, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7468736064090762255, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064090762255, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: eventName propertyPath: eventName
value: value:
@ -5880,12 +5900,16 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 564.5 value: 206
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064090762355, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -62 value: -62
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064090762356, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7468736064179597218, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064179597218, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0
@ -5912,51 +5936,51 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 917 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064250338014, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -343.34674 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 334.1322 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064349377664, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -55 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 753.3966 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064407837105, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -55 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064424568481, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064424568481, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
@ -6020,7 +6044,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736064580561832, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736064580561832, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: -1792 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065055436938, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065055436938, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -6044,35 +6068,35 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 124.5 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065668749935, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -55 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 917 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065685524838, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -1328.051 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7468736065685524839, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} - target: {fileID: 7468736065685524839, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
@ -8729,6 +8753,7 @@ MonoBehaviour:
eventJsonFile: {fileID: 4900000, guid: 2ef075e4830019a42b84d8d05d13d81c, type: 3} eventJsonFile: {fileID: 4900000, guid: 2ef075e4830019a42b84d8d05d13d81c, type: 3}
matialJsonFile: {fileID: 4900000, guid: d98cb351d1a87dc4887a37106b9745d4, type: 3} matialJsonFile: {fileID: 4900000, guid: d98cb351d1a87dc4887a37106b9745d4, type: 3}
sceneJsonFile: {fileID: 4900000, guid: 06c09fd1c8b0a0a45951a1065189d922, type: 3} sceneJsonFile: {fileID: 4900000, guid: 06c09fd1c8b0a0a45951a1065189d922, type: 3}
incidentSiteJosnFile: {fileID: 4900000, guid: 1efa4372b10d4294199638c49173ff4c, type: 3}
--- !u!4 &1417128758 --- !u!4 &1417128758
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -9548,7 +9573,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1600693806 --- !u!224 &1600693806
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -9,11 +9,13 @@ public class JSONReader : MonoBehaviour
public TextAsset eventJsonFile; public TextAsset eventJsonFile;
public TextAsset matialJsonFile; public TextAsset matialJsonFile;
public TextAsset sceneJsonFile; public TextAsset sceneJsonFile;
public TextAsset incidentSiteJosnFile;
public Dictionary<int, NPCData> npcDictionary = new Dictionary<int, NPCData>(); public Dictionary<int, NPCData> npcDictionary = new Dictionary<int, NPCData>();
public Dictionary<int, LocationData> locationDictionary = new Dictionary<int, LocationData>(); public Dictionary<int, LocationData> locationDictionary = new Dictionary<int, LocationData>();
public Dictionary<int, EventData> eventDictionary = new Dictionary<int, EventData>(); public Dictionary<int, EventData> eventDictionary = new Dictionary<int, EventData>();
public Dictionary<int, MatialData> matialDictionary = new Dictionary<int, MatialData>(); public Dictionary<int, MatialData> matialDictionary = new Dictionary<int, MatialData>();
public Dictionary<int, SceneData> sceneDictionary = new Dictionary<int, SceneData>(); public Dictionary<int, SceneData> sceneDictionary = new Dictionary<int, SceneData>();
public Dictionary<int, IncidentSite> incidentSiteDictionary = new Dictionary<int, IncidentSite>();
void Awake() void Awake()
{ {
@ -23,16 +25,11 @@ public class JSONReader : MonoBehaviour
eventDictionary = EventParseJSON(eventJsonFile.text); eventDictionary = EventParseJSON(eventJsonFile.text);
matialDictionary = MatialParseJSON(matialJsonFile.text); matialDictionary = MatialParseJSON(matialJsonFile.text);
sceneDictionary = SceneParseJSON(sceneJsonFile.text); sceneDictionary = SceneParseJSON(sceneJsonFile.text);
foreach (var npc in sceneDictionary) incidentSiteDictionary = IncidentSiteParseJSON(incidentSiteJosnFile.text);
foreach (var npc in locationDictionary)
{ {
Debug.Log($"Scene ID: {npc.Value.ID}"); //.Log($"Scene ID: {npc.Value.ID}");
Debug.Log($"Scene Name: {npc.Value.Name}"); //Debug.Log("===========================");
Debug.Log($"Scene Type: {npc.Value.Type}");
Debug.Log($"Incident Type: {npc.Value.IncidentType}");
Debug.Log($"Object List: {npc.Value.ObjList}");
Debug.Log($"Area List: {npc.Value.AreaList}");
Debug.Log($"Storeroom: {npc.Value.Storeroom}");
Debug.Log("===========================");
} }
//´òÓ¡ NPC Êý¾Ý //´òÓ¡ NPC Êý¾Ý
@ -109,6 +106,19 @@ public class JSONReader : MonoBehaviour
return locationDictionary; return locationDictionary;
} }
public Dictionary<int, IncidentSite> IncidentSiteParseJSON(string json)
{
IncidentSite[] locationArray = JsonHelper.FromJson<IncidentSite>(json);
Dictionary<int, IncidentSite> locationDictionary = new Dictionary<int, IncidentSite>();
foreach (var location in locationArray)
{
locationDictionary[location.ID] = location;
}
return locationDictionary;
}
// ´òÓ¡ NPC Êý¾Ý // ´òÓ¡ NPC Êý¾Ý
//void PrintNPCData(Dictionary<int, NPCData> npcDictionary) //void PrintNPCData(Dictionary<int, NPCData> npcDictionary)
//{ //{
@ -232,5 +242,17 @@ public class SceneData
public string AreaList; public string AreaList;
public int Storeroom; public int Storeroom;
} }
[System.Serializable]
public class IncidentSite
{
public int ID;
public string Note;
public int Name;
public int Scene;
public string Position;
public int Volume;
public string Difficulty;
public string SpecialEvent;
}

View File

@ -57,6 +57,7 @@ public class Panel : MonoBehaviour
public Dictionary<string, List<SelectedInfo>> sceneDataDictionary = new Dictionary<string, List<SelectedInfo>>();//不同的场景存取不同的人员数据 public Dictionary<string, List<SelectedInfo>> sceneDataDictionary = new Dictionary<string, List<SelectedInfo>>();//不同的场景存取不同的人员数据
public ManagerPanel managerPanel1; public ManagerPanel managerPanel1;
public JSONReader jsonReader1; public JSONReader jsonReader1;
public SelectScenePanel selectScenePanel;
private bool isPersonSelected = false; // 标志是否选择了人员 private bool isPersonSelected = false; // 标志是否选择了人员
private bool isDutySelected = false; // 标志是否选择了职责 private bool isDutySelected = false; // 标志是否选择了职责
private bool isSceneSelected = false; // 标志是否选择了场景 private bool isSceneSelected = false; // 标志是否选择了场景
@ -93,14 +94,37 @@ public class Panel : MonoBehaviour
//动态加载职责 //动态加载职责
public void DynamicLoadingDuty() public void DynamicLoadingDuty()
{ {
Debug.Log("||||||||||||||||||||||||||||"+ selectScenePanel.eventId);
foreach (var npcData in jsonReader1.npcDictionary) foreach (var npcData in jsonReader1.npcDictionary)
{ {
GameObject item = GameObject.Instantiate<GameObject>(dutyPrefab, dutyCount); string[] nameSections = npcData.Value.Name.Split('|');
foreach (var section in nameSections)
{
string[] sectionParts = section.Split(',');
if (int.Parse(sectionParts[0])== 2001)
{
int key = int.Parse(sectionParts[1]);
if (jsonReader1.npcDictionary.ContainsKey(key))
{
var npcInfo = jsonReader1.npcDictionary[key];
// 在此处可以使用npcInfo做进一步的处理
Debug.Log("Found NPC: " + npcInfo.Name);
// 创建DutyItem实例
GameObject item = GameObject.Instantiate(dutyPrefab, dutyCount);
DutyItem dutyItem = item.GetComponent<DutyItem>(); DutyItem dutyItem = item.GetComponent<DutyItem>();
dutyItem.dutyNameText.text = npcData.Value.Note; dutyItem.dutyNameText.text = npcData.Value.Note;
dutyItem.leader = npcData.Value.GroupLeader; dutyItem.leader = npcData.Value.GroupLeader;
//Debug.Log("$$$$$$$$$$$$$$" + dutyItem.dutyNameText.text); peopleList.Add(item);
peopleList.Add(item);// 将每个实例化的角色添加到列表中 }
}
//GameObject item = GameObject.Instantiate<GameObject>(dutyPrefab, dutyCount);
//DutyItem dutyItem = item.GetComponent<DutyItem>();
//dutyItem.dutyNameText.text = npcData.Value.Note;
//dutyItem.leader = npcData.Value.GroupLeader;
//peopleList.Add(item);// 将每个实例化的角色添加到列表中
}
} }
} }

View File

@ -27,7 +27,7 @@ public class SelectScenePanel : MonoBehaviour
public List<SceneItem> sceneItemList = new List<SceneItem>();//场景信息 public List<SceneItem> sceneItemList = new List<SceneItem>();//场景信息
public List<Toggle> difficultyList = new List<Toggle>();//游戏难度 public List<Toggle> difficultyList = new List<Toggle>();//游戏难度
public Button continueBtn; public Button continueBtn;
public List<Toggle> toggleList=new List<Toggle>(); public List<Toggle> toggleList = new List<Toggle>();
public List<Toggle> eventToggleList = new List<Toggle>(); public List<Toggle> eventToggleList = new List<Toggle>();
//public Toggle[] toggleList; //public Toggle[] toggleList;
public Toggle[] schooltoggleList; public Toggle[] schooltoggleList;
@ -52,7 +52,7 @@ public class SelectScenePanel : MonoBehaviour
eventChoiceLable.gameObject.SetActive(false); eventChoiceLable.gameObject.SetActive(false);
InstantiateScenePrefab(); InstantiateScenePrefab();
InstantiateSchoolPrefab(); InstantiateSchoolPrefab();
InstantiateIncidentPrefab(); InstantiateIncidentPrefab(2001);
SetEventToggleOpenorClose(eventInfoList); SetEventToggleOpenorClose(eventInfoList);
continueBtn.onClick.AddListener(OnClickContinueBtn); continueBtn.onClick.AddListener(OnClickContinueBtn);
SetFirstChoise(toggleList); SetFirstChoise(toggleList);
@ -140,12 +140,12 @@ public class SelectScenePanel : MonoBehaviour
} }
//动态加载事件选择预制体 //动态加载事件选择预制体
public void InstantiateIncidentPrefab() public void InstantiateIncidentPrefab(int eventId)
{ {
foreach(var eventData in jsonReader.eventDictionary) foreach (var eventData in jsonReader.incidentSiteDictionary)
{
if(eventData.Key==eventId)
{ {
GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList); GameObject slot = GameObject.Instantiate<GameObject>(eventPrefab, eventList);
EventInfo item = slot.GetComponent<EventInfo>(); EventInfo item = slot.GetComponent<EventInfo>();
item.eventName.text = eventData.Value.Note; item.eventName.text = eventData.Value.Note;
@ -155,14 +155,19 @@ public class SelectScenePanel : MonoBehaviour
if (toggle != null) if (toggle != null)
{ {
// 将 Toggle 添加到 ToggleGroup 中 // 将 Toggle 添加到 ToggleGroup 中
toggle.group = schoolGroup; toggle.group = eventGroup;
toggle.isOn = false; toggle.isOn = false;
// 将 Toggle 添加到 schooltoggleList 中 // 将 Toggle 添加到 schooltoggleList 中
// 将 SchoolInfo 对象添加到 schoolInfos 列表中 // 将 SchoolInfo 对象添加到 schoolInfos 列表中
eventInfoList.Add(item); eventInfoList.Add(item);
Debug.Log("!!!!!!!!!!!!!!!!!!!!!"+eventInfoList.Count); Debug.Log("!!!!!!!!!!!!!!!!!!!!!" + eventInfoList.Count);
}
}
else
{
break;
} }
} }
} }
@ -297,7 +302,7 @@ public class SelectScenePanel : MonoBehaviour
this.eventName = item.eventName.text; this.eventName = item.eventName.text;
} }
} }
Debug.Log("%%%%%%%%%%%%%1:"+ this.eventId); Debug.Log("%%%%%%%%%%%%%1:" + this.eventId);
Debug.Log("%%%%%%%%%%%%%2:" + this.eventName); Debug.Log("%%%%%%%%%%%%%2:" + this.eventName);
} }
@ -321,7 +326,7 @@ public class SelectScenePanel : MonoBehaviour
} }
Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent<EventInfo>()); Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent<EventInfo>());
// 选中随机事件 // 选中随机事件
if (eventToggleList[randomIndex] != null&& eventToggleList[randomIndex].GetComponent<EventInfo>().isOpen!=false) if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent<EventInfo>().isOpen != false)
{ {
eventToggleList[randomIndex].isOn = true; eventToggleList[randomIndex].isOn = true;
this.eventName = eventInfoList[randomIndex].eventName.text; // 设置随机选择的事件名称 this.eventName = eventInfoList[randomIndex].eventName.text; // 设置随机选择的事件名称
@ -388,7 +393,7 @@ public class SelectScenePanel : MonoBehaviour
//关闭按钮 //关闭按钮
public void OnClickCloseBtn() public void OnClickCloseBtn()
{ {
if (schoolChoiceLable.gameObject.active==false) if (schoolChoiceLable.gameObject.active == false)
{ {
foreach (Transform child in sceneList) foreach (Transform child in sceneList)
{ {
@ -413,7 +418,7 @@ public class SelectScenePanel : MonoBehaviour
// 检查场景选择 // 检查场景选择
foreach (Toggle toggle in toggleList) foreach (Toggle toggle in toggleList)
{ {
Debug.Log("++++++++++++++++++++++++="+toggleList.Count()); Debug.Log("++++++++++++++++++++++++=" + toggleList.Count());
if (toggle.isOn) if (toggle.isOn)
{ {
anyToggleSelected = true; anyToggleSelected = true;
@ -450,7 +455,7 @@ public class SelectScenePanel : MonoBehaviour
{ {
foreach (SceneItem item in sceneItems) foreach (SceneItem item in sceneItems)
{ {
if (item.IsOpen==false) if (item.IsOpen == false)
{ {
item.GetComponent<Toggle>().interactable = false; item.GetComponent<Toggle>().interactable = false;
if (item.GetComponent<Toggle>().isOn) if (item.GetComponent<Toggle>().isOn)