浏览代码

Location loader now sets the active scene

/main
Unknown 4 年前
当前提交
e2782b21
共有 3 个文件被更改,包括 96 次插入514 次删除
  1. 272
      UOP1_Project/Assets/Scenes/LoadingTest/Beach.unity
  2. 237
      UOP1_Project/Assets/Scenes/LoadingTest/Forest.unity
  3. 101
      UOP1_Project/Assets/Scripts/LocationLoader.cs

272
UOP1_Project/Assets/Scenes/LoadingTest/Beach.unity


m_Children:
- {fileID: 2020721999}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &135922106
MonoBehaviour:

m_LocalScale: {x: 5.7737727, y: 1.8967, z: 4.9019}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: -3.5180001, y: 26.323002, z: -19.474}
--- !u!1 &353533559
GameObject:

m_LocalScale: {x: 4.8320527, y: 1, z: 4.9019}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &358843509
GameObject:

m_LocalScale: {x: 7.8816566, y: 6.5043144, z: 2.0265193}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 21
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 0}
--- !u!1 &395747637
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &695792052
GameObject:

m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 25
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &710639994
MonoBehaviour:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &802198071
PrefabInstance:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 16
value: 15
objectReference: {fileID: 0}
- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &826602623
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &847350330
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 847350331}
m_Layer: 0
m_Name: CastCentreLow
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &847350331
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847350330}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.05, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &955504286
GameObject:

m_LocalScale: {x: 4.66705, y: 1, z: 4.9019}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1057381576
GameObject:

m_LocalScale: {x: 6.068361, y: 6.5043144, z: 0.65092325}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 20
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: -34.734, z: 0}
--- !u!1 &1069143686
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1069947040
GameObject:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 17
value: 16
objectReference: {fileID: 0}
- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}

serializedVersion: 2
m_Size: {x: 4.9118204, y: 4.1104574, z: 4.8376255}
m_Center: {x: 0.3429799, y: 2.037253, z: 0.10196686}
--- !u!1 &1297158708
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1297158709}
m_Layer: 0
m_Name: CastCentreHigh
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1297158709
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1297158708}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.35, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1303725911
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 9.785265, y: 1.1941, z: 1.4703052}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1424964852
GameObject:

m_LocalScale: {x: 11.689932, y: 6.5043144, z: 2.0265193}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 19
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1502793900
GameObject:

- {fileID: 2049112421}
- {fileID: 233317033}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1502793903
MonoBehaviour:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1545926751
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1545926752}
m_Layer: 0
m_Name: CastCentreMid
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1545926752
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1545926751}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.75, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 3
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1559010558
GameObject:

m_LocalScale: {x: 4.66705, y: 1, z: 4.9019}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 22
m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 12.259001}
--- !u!1 &1567022179
GameObject:

m_LocalScale: {x: 5.7737727, y: 1.8967, z: 4.9019}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 14
--- !u!1 &1724036686
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1724036688}
- component: {fileID: 1724036687}
m_Layer: 0
m_Name: InputReader
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1724036687
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1724036686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 143f1e276019d54448855eb41708d190, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1724036688
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1724036686}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1809933188
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 18
value: 17
objectReference: {fileID: 0}
- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1961065791
MonoBehaviour:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 13
objectReference: {fileID: 0}
- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: inputReader
value:
objectReference: {fileID: 1724036687}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: jumpStrength
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: airMomentumMultiplier
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentre
value:
objectReference: {fileID: 847350331}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentreLow
value:
objectReference: {fileID: 847350331}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
- target: {fileID: 211818859182309264, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
propertyPath: castCentreHigh
propertyPath: gameplayCamera
objectReference: {fileID: 1297158709}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentreMid
value:
objectReference: {fileID: 1545926752}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: jumpMultiplier
value: 5
objectReference: {fileID: 0}
objectReference: {fileID: 1961065790}
- target: {fileID: 3341179906418240709, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_TagString
value: Player
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 13400000, guid: a16d1d43f142a5e46bd94366df8b3456,
type: 2}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Radius
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_RootOrder
value: 24
value: 23
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8355259865850373509, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 1d7422898f87f524194c0b5cf921fef8, type: 2}
--- !u!1 &3341179907149091244 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3341179906418240709, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
m_PrefabInstance: {fileID: 3341179907149091243}
m_PrefabAsset: {fileID: 0}
--- !u!143 &3341179907149091245
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3341179907149091244}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 1.75
m_Radius: 0.4
m_SlopeLimit: 30
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0.875, z: 0}

237
UOP1_Project/Assets/Scenes/LoadingTest/Forest.unity


m_Children:
- {fileID: 2020721999}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &135922106
MonoBehaviour:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &409237701
GameObject:

- {fileID: 1796791819}
- {fileID: 1817861492}
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &420735686
PrefabInstance:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &781665590
PrefabInstance:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &826602623
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &847350330
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 847350331}
m_Layer: 0
m_Name: CastCentreLow
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &847350331
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847350330}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.05, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &861031599

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1154278837
PrefabInstance:

type: 3}
m_PrefabInstance: {fileID: 1286523620}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1297158708
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1297158709}
m_Layer: 0
m_Name: CastCentreHigh
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1297158709
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1297158708}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.35, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1347505615
PrefabInstance:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1545926751
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1545926752}
m_Layer: 0
m_Name: CastCentreMid
m_TagString: Untagged
m_Icon: {fileID: 7422848464349959988, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1545926752
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1545926751}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.75, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1961901426}
m_RootOrder: 3
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1578311887
PrefabInstance:

type: 3}
m_PrefabInstance: {fileID: 1693924506}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1724036686
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1724036688}
- component: {fileID: 1724036687}
m_Layer: 0
m_Name: InputReader
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1724036687
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1724036686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 143f1e276019d54448855eb41708d190, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1724036688
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1724036686}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1755042372
PrefabInstance:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1961065791
MonoBehaviour:

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: inputReader
value:
objectReference: {fileID: 1724036687}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: jumpStrength
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: airMomentumMultiplier
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentre
value:
objectReference: {fileID: 847350331}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentreLow
value:
objectReference: {fileID: 847350331}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
- target: {fileID: 211818859182309264, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
propertyPath: castCentreHigh
value:
objectReference: {fileID: 1297158709}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: castCentreMid
propertyPath: gameplayCamera
objectReference: {fileID: 1545926752}
- target: {fileID: 3341179906418240708, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: jumpMultiplier
value: 5
objectReference: {fileID: 0}
objectReference: {fileID: 1961065790}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 13400000, guid: a16d1d43f142a5e46bd94366df8b3456,
type: 2}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240730, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Radius
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3341179906418240731, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8355259865850373509, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 1d7422898f87f524194c0b5cf921fef8, type: 2}
--- !u!1 &3341179907149091244 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3341179906418240709, guid: 0fa393e1e37bc9e4e829c25a9452bcd3,
type: 3}
m_PrefabInstance: {fileID: 3341179907149091243}
m_PrefabAsset: {fileID: 0}
--- !u!143 &3341179907149091245
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3341179907149091244}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 1.75
m_Radius: 0.4
m_SlopeLimit: 30
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0.875, z: 0}

101
UOP1_Project/Assets/Scripts/LocationLoader.cs


[SerializeField] private LoadEvent _loadEvent = default;
//List of the scenes to load and track progress
private List<AsyncOperation> _scenesToLoad = new List<AsyncOperation>();
private List<AsyncOperation> _scenesToLoadAsyncOperations = new List<AsyncOperation>();
//Keep track of the scene we want to set as active (for lighting/skybox)
private GameScene _activeScene;
private void OnEnable()
{

LoadScenes(mainMenuScenes, false);
}
/// <summary> This function loads the scenes passed as array parameter </summary>
public void LoadScenes(GameScene[] locationsToLoad, bool showLoadingScreen)
{
//Add all current open scenes to unload list
AddScenesToUnload();
/// <summary> This function loads the scenes passed as array parameter </summary>
public void LoadScenes(GameScene[] locationsToLoad, bool showLoadingScreen)
{
//Add all current open scenes to unload list
AddScenesToUnload();
_activeScene = locationsToLoad[0];
for (int i = 0; i < locationsToLoad.Length; ++i)
{
String currentSceneName = locationsToLoad[i].sceneName;
if (!CheckLoadState(currentSceneName))
{
//Add the scene to the list of scenes to load asynchronously in the background
_scenesToLoadAsyncOperations.Add(SceneManager.LoadSceneAsync(currentSceneName, LoadSceneMode.Additive));
}
}
_scenesToLoadAsyncOperations[0].completed += SetActiveScene;
if (showLoadingScreen)
{
//Show the progress bar and track progress if loadScreen is true
StartCoroutine(TrackLoadingProgress());
}
else
{
//Clear the scenes to load
_scenesToLoadAsyncOperations.Clear();
}
for (int i = 0; i < locationsToLoad.Length; ++i)
{
String currentSceneName = locationsToLoad[i].sceneName;
if (!CheckLoadState(currentSceneName))
{
//Add the scene to the list of scenes to load asynchronously in the background
_scenesToLoad.Add(SceneManager.LoadSceneAsync(currentSceneName, LoadSceneMode.Additive));
}
}
//Show the progress bar and track progress if loadScreen is true
if (showLoadingScreen)
{
StartCoroutine(LoadingScreen());
}
else
{
//Clear the scenes to load
_scenesToLoad.Clear();
}
//Unload the scenes
UnloadScenes();
//Unload the scenes
UnloadScenes();
private void SetActiveScene(AsyncOperation asyncOp)
{
SceneManager.SetActiveScene(SceneManager.GetSceneByName(_activeScene.sceneName));
}
public void AddScenesToUnload()
{
if (SceneManager.sceneCount > 0)

/// <summary> This function update loading progress </summary>
IEnumerator LoadingScreen()
IEnumerator TrackLoadingProgress()
{
float totalProgress = 0;
//When the scene reaches 0.9f, it means that it is loaded

//Reset the progress for the new values
totalProgress = 0;
//Iterate through all the scenes to load
for (int i = 0; i < _scenesToLoad.Count; ++i)
{
Debug.Log("Scene" + i + " :" + _scenesToLoad[i].isDone + "progress = " + _scenesToLoad[i].progress);
//Adding the scene progress to the total progress
totalProgress += _scenesToLoad[i].progress;
}
//the fillAmount for all scenes, so we devide the progress by the number of scenes to load
loadingProgressBar.fillAmount = totalProgress / _scenesToLoad.Count;
Debug.Log("progress bar" + loadingProgressBar.fillAmount + "and value =" + totalProgress / _scenesToLoad.Count);
//Reset the progress for the new values
totalProgress = 0;
//Iterate through all the scenes to load
for (int i = 0; i < _scenesToLoadAsyncOperations.Count; ++i)
{
Debug.Log("Scene" + i + " :" + _scenesToLoadAsyncOperations[i].isDone + "progress = " + _scenesToLoadAsyncOperations[i].progress);
//Adding the scene progress to the total progress
totalProgress += _scenesToLoadAsyncOperations[i].progress;
}
//the fillAmount for all scenes, so we devide the progress by the number of scenes to load
loadingProgressBar.fillAmount = totalProgress / _scenesToLoadAsyncOperations.Count;
Debug.Log("progress bar" + loadingProgressBar.fillAmount + "and value =" + totalProgress / _scenesToLoadAsyncOperations.Count);
//Clear the scenes to load
_scenesToLoad.Clear();
//Hide progress bar when loading is done
loadingInterface.SetActive(false);
//Clear the scenes to load
_scenesToLoadAsyncOperations.Clear();
//Hide progress bar when loading is done
loadingInterface.SetActive(false);
}
public void ExitGame()

正在加载...
取消
保存