浏览代码

Now possible to start the game from any scene

/main
Unknown 4 年前
当前提交
a72a0657
共有 12 个文件被更改,包括 351 次插入42 次删除
  1. 117
      UOP1_Project/Assets/Scenes/LoadingTest/Beach.unity
  2. 89
      UOP1_Project/Assets/Scenes/LoadingTest/Forest.unity
  3. 71
      UOP1_Project/Assets/Scenes/MainMenu.unity
  4. 12
      UOP1_Project/Assets/Scripts/SceneManagement/LevelEnd.cs
  5. 6
      UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs
  6. 45
      UOP1_Project/Assets/Prefabs/EditorInitializer.prefab
  7. 7
      UOP1_Project/Assets/Prefabs/EditorInitializer.prefab.meta
  8. 8
      UOP1_Project/Assets/Scripts/SceneManagement.meta
  9. 27
      UOP1_Project/Assets/Scripts/SceneManagement/LoadSceneLoader.cs
  10. 11
      UOP1_Project/Assets/Scripts/SceneManagement/LoadSceneLoader.cs.meta
  11. 0
      /UOP1_Project/Assets/Scripts/SceneManagement/LevelEnd.cs
  12. 0
      /UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs

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


m_Children:
- {fileID: 2020721999}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
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: 12
m_RootOrder: 13
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: 10
m_RootOrder: 11
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: 20
m_RootOrder: 21
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: 7
m_RootOrder: 8
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: 24
m_RootOrder: 25
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: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &802198071
PrefabInstance:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 15
value: 16
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: 6
m_RootOrder: 7
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_RootOrder: 6
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: 9
m_RootOrder: 10
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: 19
m_RootOrder: 20
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: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1069947040
GameObject:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 16
value: 17
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!1001 &1266664886
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 40564194958535835, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_Name
value: EditorInitializer
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54d1f8b93400ea64d97c276fab375df3, type: 3}
--- !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: 11
m_RootOrder: 12
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: 18
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1502793900
GameObject:

- {fileID: 2049112421}
- {fileID: 233317033}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
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: 22
m_RootOrder: 23
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: 21
m_RootOrder: 22
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: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: -3.5180001, y: 26.324001, z: 28.011002}
--- !u!1001 &1809933188
PrefabInstance:

- target: {fileID: 384383464925863578, guid: 1ebb75c12ef91014e94524019e01192d,
type: 3}
propertyPath: m_RootOrder
value: 17
value: 18
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: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1961065791
MonoBehaviour:

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

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

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


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

type: 3}
m_PrefabInstance: {fileID: 184231677}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &189225303
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 40564194958535835, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_Name
value: EditorInitializer
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54d1f8b93400ea64d97c276fab375df3, type: 3}
--- !u!1001 &189634697
PrefabInstance:
m_ObjectHideFlags: 0

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

- {fileID: 1796791819}
- {fileID: 1817861492}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
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: 7
m_RootOrder: 8
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: 5
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: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &861031599
PrefabInstance:

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

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

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

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

71
UOP1_Project/Assets/Scenes/MainMenu.unity


m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2

debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &107902538
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 40564194958535835, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_Name
value: EditorInitializer
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54d1f8b93400ea64d97c276fab375df3, type: 3}
--- !u!1 &384578945
GameObject:
m_ObjectHideFlags: 0

12
UOP1_Project/Assets/Scripts/SceneManagement/LevelEnd.cs


using UnityEngine;
/// <summary>
/// This class detecs when the level(Location) ends
/// </summary>
/// <summary>
/// This class detecs when the level(Location) ends
/// </summary>
public class LevelEnd : MonoBehaviour
public class LevelEnd : MonoBehaviour
{
public LoadEvent onLevelEnd;
public GameScene[] locationsToLoad;

{
onLevelEnd.Raise(locationsToLoad, showLoadScreen);
}
}
}
}
}

6
UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs


private void Start()
{
LoadMainMenu();
if(SceneManager.GetActiveScene().name == "ScenesLoader")
{
LoadMainMenu();
}
}
private void LoadMainMenu()

if (showLoadingScreen)
{
//Show the progress bar and track progress if loadScreen is true
loadingInterface.SetActive(true);
StartCoroutine(TrackLoadingProgress());
}
else

45
UOP1_Project/Assets/Prefabs/EditorInitializer.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &40564194958535835
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 40564194958535909}
- component: {fileID: 40564194958535908}
m_Layer: 0
m_Name: EditorInitializer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &40564194958535909
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 40564194958535835}
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: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &40564194958535908
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 40564194958535835}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afdc0d26809578642bceb401301d2a8a, type: 3}
m_Name:
m_EditorClassIdentifier:

7
UOP1_Project/Assets/Prefabs/EditorInitializer.prefab.meta


fileFormatVersion: 2
guid: 54d1f8b93400ea64d97c276fab375df3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scripts/SceneManagement.meta


fileFormatVersion: 2
guid: 26591c04f99d3164cab8d592f8b74ac8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

27
UOP1_Project/Assets/Scripts/SceneManagement/LoadSceneLoader.cs


using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// This class contains method to allow starting the game from any scene
/// </summary>
public class LoadSceneLoader : MonoBehaviour
{
void Start()
{
#if UNITY_EDITOR
if (SceneManager.sceneCount > 0)
{
for (int i = 0; i < SceneManager.sceneCount; ++i)
{
Scene scene = SceneManager.GetSceneAt(i);
if (scene.name == "ScenesLoader")
{
return;
}
}
SceneManager.LoadSceneAsync("ScenesLoader", LoadSceneMode.Additive);
}
#endif
}
}

11
UOP1_Project/Assets/Scripts/SceneManagement/LoadSceneLoader.cs.meta


fileFormatVersion: 2
guid: afdc0d26809578642bceb401301d2a8a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/UOP1_Project/Assets/Scripts/LevelEnd.cs → /UOP1_Project/Assets/Scripts/SceneManagement/LevelEnd.cs

/UOP1_Project/Assets/Scripts/LocationLoader.cs → /UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs

正在加载...
取消
保存