浏览代码

SOs for menus and levels and adding scenes

/main
Unknown 4 年前
当前提交
1cc14a04
共有 25 个文件被更改,包括 606 次插入192 次删除
  1. 106
      UOP1_Project/Assets/Scenes/MainMenu.unity
  2. 362
      UOP1_Project/Assets/Scenes/ScenesLoader.unity
  3. 10
      UOP1_Project/ProjectSettings/EditorBuildSettings.asset
  4. 8
      UOP1_Project/Assets/Scriptable Objects.meta
  5. 8
      UOP1_Project/Assets/Scripts/Scriptable Objects.meta
  6. 8
      UOP1_Project/Assets/Scripts/Scriptable Objects/Events.meta
  7. 8
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement.meta
  8. 14
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/GameScene.cs
  9. 11
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/GameScene.cs.meta
  10. 9
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Level.cs
  11. 11
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Level.cs.meta
  12. 15
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Menu.cs
  13. 11
      UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Menu.cs.meta
  14. 8
      UOP1_Project/Assets/Scriptable Objects/Levels.meta
  15. 19
      UOP1_Project/Assets/Scriptable Objects/Levels/Level1.asset
  16. 8
      UOP1_Project/Assets/Scriptable Objects/Levels/Level1.asset.meta
  17. 19
      UOP1_Project/Assets/Scriptable Objects/Levels/Level2.asset
  18. 8
      UOP1_Project/Assets/Scriptable Objects/Levels/Level2.asset.meta
  19. 19
      UOP1_Project/Assets/Scriptable Objects/Levels/MainMenu.asset
  20. 8
      UOP1_Project/Assets/Scriptable Objects/Levels/MainMenu.asset.meta
  21. 17
      UOP1_Project/Assets/Scriptable Objects/sceneDB.asset
  22. 8
      UOP1_Project/Assets/Scriptable Objects/sceneDB.asset.meta
  23. 103
      UOP1_Project/Assets/LoadingManager.cs

106
UOP1_Project/Assets/Scenes/MainMenu.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 403475996}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_Father: {fileID: 1228641980}
m_RootOrder: 1
m_Father: {fileID: 2140469183}
m_RootOrder: 2
m_AnchoredPosition: {x: 91, y: -104.3}
m_AnchoredPosition: {x: 0, y: -72}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &403475998

m_TargetGraphic: {fileID: 403475999}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 11400000, guid: 95eb00b1852501648b8f37799fcd78f7, type: 2}
m_MethodName: Raise
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &403475999
MonoBehaviour:
m_ObjectHideFlags: 0

- component: {fileID: 1228641982}
- component: {fileID: 1228641981}
m_Layer: 5
m_Name: Text
m_Name: GameTitle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

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:
- {fileID: 1967191111}
- {fileID: 403475997}
m_Children: []
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -49, y: 49}
m_SizeDelta: {x: 703.1399, y: 131.83873}
m_Pivot: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 703.1399, y: 131.83875}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1228641981
MonoBehaviour:
m_ObjectHideFlags: 0

m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 48
m_FontStyle: 0
m_BestFit: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 80
m_Alignment: 0

m_GameObject: {fileID: 1577385651}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
--- !u!114 &1577385653
MonoBehaviour:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1967191110}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_Father: {fileID: 1228641980}
m_RootOrder: 0
m_Father: {fileID: 2140469183}
m_RootOrder: 1
m_AnchoredPosition: {x: 91, y: -43}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1967191112

m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName:
- m_Target: {fileID: 11400000, guid: 31d49a74dcfce42488af012acaf74bdb, type: 2}
m_MethodName: Raise
m_ObjectArgumentAssemblyTypeName:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:

- component: {fileID: 2140469182}
- component: {fileID: 2140469181}
- component: {fileID: 2140469180}
- component: {fileID: 2140469184}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged

m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1228641980}
- {fileID: 1967191111}
- {fileID: 403475997}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &2140469184
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2140469179}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8ade5a748610bf348a549932627f98d1, type: 3}
m_Name:
m_EditorClassIdentifier:
LoadOnStart: 0
onGameStart: {fileID: 0}
scenesData: {fileID: 0}

362
UOP1_Project/Assets/Scenes/ScenesLoader.unity


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

debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &19435162
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 19435163}
- component: {fileID: 19435164}
m_Layer: 0
m_Name: LoadingManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &19435163
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19435162}
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 &19435164
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19435162}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1672132dae377874db68251b10915ac3, type: 3}
m_Name:
m_EditorClassIdentifier:
loadingInterface: {fileID: 363619424}
loadingProgressBar: {fileID: 841012435}
--- !u!1 &264133876
GameObject:
m_ObjectHideFlags: 0

m_GameObject: {fileID: 264133876}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018,
type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
--- !u!114 &264133878
MonoBehaviour:
m_ObjectHideFlags: 0

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 &363619424
GameObject:

- component: {fileID: 363619425}
- component: {fileID: 363619427}
- component: {fileID: 363619426}
- component: {fileID: 363619428}
m_Layer: 5
m_Name: LoadingInterface
m_TagString: Untagged

m_IsActive: 1
m_IsActive: 0
--- !u!224 &363619425
RectTransform:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363619424}
m_CullTransparentMesh: 0
--- !u!114 &363619428
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363619424}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e72f0bf25bcf9874bbeb271ccae55dde, type: 3}
m_Name:
m_EditorClassIdentifier:
loadingInterface: {fileID: 363619424}
loadingProgressBar: {fileID: 841012435}
scenesData: {fileID: 11400000, guid: 3cbb90f50a82e01409b7c5fc69f1d429, type: 2}
--- !u!1 &447650313
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 447650316}
- component: {fileID: 447650314}
m_Layer: 0
m_Name: GameExit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &447650314
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 447650313}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cb8658de1ad97b4eb747df35933650f, type: 3}
m_Name:
m_EditorClassIdentifier:
Event: {fileID: 11400000, guid: 95eb00b1852501648b8f37799fcd78f7, type: 2}
Response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1904845807}
m_MethodName: ExitGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!4 &447650316
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 447650313}
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: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &841012433
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 841012433}
m_CullTransparentMesh: 0
--- !u!1 &938380541
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 938380544}
- component: {fileID: 938380545}
m_Layer: 0
m_Name: LoadNextLevelWithProgress
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &938380544
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 938380541}
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: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &938380545
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 938380541}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cb8658de1ad97b4eb747df35933650f, type: 3}
m_Name:
m_EditorClassIdentifier:
Event: {fileID: 11400000, guid: 31d49a74dcfce42488af012acaf74bdb, type: 2}
Response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 363619424}
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
- m_Target: {fileID: 363619428}
m_MethodName: UpdateProgress
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
--- !u!1 &1387982339
GameObject:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 363619425}
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

--- !u!1 &1694358576
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1694358579}
- component: {fileID: 1694358577}
m_Layer: 0
m_Name: LoadNextLevel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1694358577
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1694358576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cb8658de1ad97b4eb747df35933650f, type: 3}
m_Name:
m_EditorClassIdentifier:
Event: {fileID: 11400000, guid: d166670d1b4b0af4b969be97d28317e4, type: 2}
Response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000, guid: 3cbb90f50a82e01409b7c5fc69f1d429, type: 2}
m_MethodName: NextLevel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!4 &1694358579
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1694358576}
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: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1904845806
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1904845808}
- component: {fileID: 1904845807}
- component: {fileID: 1904845809}
m_Layer: 0
m_Name: MainMenuLoader
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1904845807
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1904845806}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8ade5a748610bf348a549932627f98d1, type: 3}
m_Name:
m_EditorClassIdentifier:
LoadOnStart: 0
onGameStart: {fileID: 11400000, guid: 652ff0e2a34af0246b658aed07ec44a3, type: 2}
--- !u!4 &1904845808
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1904845806}
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: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1904845809
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1904845806}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cb8658de1ad97b4eb747df35933650f, type: 3}
m_Name:
m_EditorClassIdentifier:
Event: {fileID: 11400000, guid: 652ff0e2a34af0246b658aed07ec44a3, type: 2}
Response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000, guid: 3cbb90f50a82e01409b7c5fc69f1d429, type: 2}
m_MethodName: LoadMainMenu
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2

10
UOP1_Project/ProjectSettings/EditorBuildSettings.asset


serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: d1c3109bdb54ad54c8a2b2838528e640
path: Assets/Scenes/Level1.unity
guid: 1f93ce2ec2bb43b4ab2a18ad18a50967
- enabled: 1
path: Assets/Scenes/MainMenu.unity
guid: df490f8a21305b549b67b8301af79724
- enabled: 1
path: Assets/Scenes/ScenesLoader.unity
guid: e8df4c5a458acc5489b2865e6b789224
m_configObjects: {}

8
UOP1_Project/Assets/Scriptable Objects.meta


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

8
UOP1_Project/Assets/Scripts/Scriptable Objects.meta


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

8
UOP1_Project/Assets/Scripts/Scriptable Objects/Events.meta


fileFormatVersion: 2
guid: 39e6bddc8d2c1a3488856d3243fc2eb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement.meta


fileFormatVersion: 2
guid: 74ae68dae9a134b4b91341fc3bbaec01
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/GameScene.cs


using UnityEngine;
public class GameScene : ScriptableObject
{
[Header("Information")]
public string sceneName;
public string shortDescription;
[Header("Sounds")]
public AudioClip music;
[Range(0.0f, 1.0f)]
public float musicVolume;
}

11
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/GameScene.cs.meta


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

9
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Level.cs


using UnityEngine;
[CreateAssetMenu(fileName = "NewLevel", menuName = "Scene Data/Level")]
public class Level : GameScene
{
//Settings specific to level only
[Header("Level specific")]
public int enemiesCount;
}

11
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Level.cs.meta


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

15
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Menu.cs


using UnityEngine;
public enum Type
{
Main_Menu,
Pause_Menu
}
[CreateAssetMenu(fileName = "NewMenu", menuName = "Scene Data/Menu")]
public class Menu : GameScene
{
//Settings specific to menu only
[Header("Menu specific")]
public Type type;
}

11
UOP1_Project/Assets/Scripts/Scriptable Objects/SceneManagement/Menu.cs.meta


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

8
UOP1_Project/Assets/Scriptable Objects/Levels.meta


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

19
UOP1_Project/Assets/Scriptable Objects/Levels/Level1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8db63739a6674d74e8e232347422172f, type: 3}
m_Name: Level1
m_EditorClassIdentifier:
sceneName: Level1
shortDescription: The level to find X
music: {fileID: 0}
musicVolume: 0
enemiesCount: 0

8
UOP1_Project/Assets/Scriptable Objects/Levels/Level1.asset.meta


fileFormatVersion: 2
guid: 2f386bbc670c05145834a0f9c7d55798
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

19
UOP1_Project/Assets/Scriptable Objects/Levels/Level2.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8db63739a6674d74e8e232347422172f, type: 3}
m_Name: Level2
m_EditorClassIdentifier:
sceneName: Level1
shortDescription: Find Y
music: {fileID: 0}
musicVolume: 0
enemiesCount: 0

8
UOP1_Project/Assets/Scriptable Objects/Levels/Level2.asset.meta


fileFormatVersion: 2
guid: d102ba8fe3b291249aeb9de4b95c1904
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

19
UOP1_Project/Assets/Scriptable Objects/Levels/MainMenu.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3546e1f9ebb6f054fb677b86f543542b, type: 3}
m_Name: MainMenu
m_EditorClassIdentifier:
sceneName: MainMenu
shortDescription: The main menu of the game
music: {fileID: 0}
musicVolume: 0
type: 0

8
UOP1_Project/Assets/Scriptable Objects/Levels/MainMenu.asset.meta


fileFormatVersion: 2
guid: 431ff81b74b48fb4d9301fb76ca633dd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

17
UOP1_Project/Assets/Scriptable Objects/sceneDB.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7fc45397100a9f4d91861b943fccfc5, type: 3}
m_Name: sceneDB
m_EditorClassIdentifier:
levels: []
menus: []
CurrentLevelIndex: 1

8
UOP1_Project/Assets/Scriptable Objects/sceneDB.asset.meta


fileFormatVersion: 2
guid: 3cbb90f50a82e01409b7c5fc69f1d429
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

103
UOP1_Project/Assets/LoadingManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class LoadingManager : MonoBehaviour
{
public GameObject loadingInterface;
public Image loadingProgressBar;
//List of the scenes to load
List<AsyncOperation> scenesToLoad = new List<AsyncOperation>();
//List of the scenes name to load and unload
//Scenes to load and unload should be added/Removed to/from the list before calling load and unload methods
List<string> scenesToLoadNames = new List<string>();
List<string> scenesToUnLoadNames = new List<string>();
void Start()
{
StartMainMenu();
}
public void StartMainMenu()
{
scenesToLoadNames.Add("MainMenu");
LoadScenes(false);
}
public void StartLevel()
{
ShowLoadingScreen(true);
scenesToLoadNames.Add("Level1");
LoadScenes(true);
scenesToUnLoadNames.Add("MainMenu");
UnloadScenes();
}
public void LoadScenes(bool EnableLoadingBar)
{
for (int i = 0; i < scenesToLoad.Count; ++i)
{
//Add the scene to the list of scenes to load asynchronously in the background
scenesToLoad.Add(SceneManager.LoadSceneAsync(scenesToLoadNames[i], LoadSceneMode.Additive));
//Remove scene from list of scenes to load
scenesToLoadNames.Remove(scenesToUnLoadNames[i]);
}
//Track the progress for the bar
if (EnableLoadingBar)
{
StartCoroutine(LoadingScreen());
}
}
public void UnloadScenes()
{
for (int i = 0; i < scenesToLoad.Count; ++i)
{
//Add the scene to the list of scenes to unload asynchronously in the background
SceneManager.UnloadSceneAsync(scenesToUnLoadNames[i]);
//Remove scene from list of scenes to unload
scenesToUnLoadNames.Remove(scenesToUnLoadNames[i]);
}
}
public void ShowLoadingScreen(bool state)
{
loadingInterface.SetActive(state);
}
IEnumerator LoadingScreen()
{
float totalProgress = 0, newProgress = 0;
//When the scene reaches 0.9f, it means that it is loaded
//The remaining 0.1f are for the integration
while (totalProgress <= 0.9f)
{
//Get the latest progress value
totalProgress = newProgress;
//Reset the progress for the new values
newProgress = 0;
//Iterate through all the scenes to load
for (int i = 0; i < scenesToLoad.Count; ++i)
{
Debug.Log("check loading of scene " + i + " :" + scenesToLoad[i].isDone + "progress scene" + scenesToLoad[i].progress);
//Adding the scene progress to the total progress
newProgress += 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);
}
yield return null;
}
//Hide progress bar when loading is done
ShowLoadingScreen(false);
}
public void ExitGame()
{
Application.Quit();
}
}
正在加载...
取消
保存