Ciro Continisio
4 年前
当前提交
7eee90e5
共有 17 个文件被更改,包括 271 次插入 和 461 次删除
-
22UOP1_Project/Assets/Scenes/Locations/Beach.unity
-
22UOP1_Project/Assets/Scenes/Locations/Glade.unity
-
287UOP1_Project/Assets/Scenes/Menus/MainMenu.unity
-
62UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
-
8UOP1_Project/Assets/Scripts/Editor/SceneSelector/SceneSelector.Helper.cs
-
51UOP1_Project/Assets/Scripts/Editor/SceneSelector/SceneSelector.cs
-
11UOP1_Project/Assets/Scripts/SceneManagement/InitializationLoader.cs
-
3UOP1_Project/Assets/Scripts/SceneManagement/SceneLoader.cs
-
52UOP1_Project/Assets/Prefabs/Gameplay/EditorInitializer.prefab
-
38UOP1_Project/Assets/Scripts/SceneManagement/EditorColdStartup.cs
-
17UOP1_Project/Assets/Scripts/SceneManagement/EditorColdStartup.cs.meta
-
7UOP1_Project/Assets/Prefabs/Gameplay/MenuEditorInitializer.prefab.meta
-
51UOP1_Project/Assets/Prefabs/Gameplay/MenuEditorInitializer.prefab
-
49UOP1_Project/Assets/Prefabs/Gameplay/SceneStartup.prefab
-
37UOP1_Project/Assets/Scripts/SceneManagement/SceneReadyBroadcaster.cs
-
15UOP1_Project/Assets/Scripts/SceneManagement/SceneReadyBroadcaster.cs.meta
-
0/UOP1_Project/Assets/Prefabs/Gameplay/EditorInitializer.prefab.meta
22
UOP1_Project/Assets/Scenes/Locations/Glade.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
62
UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
%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: 7222522106795826365} |
|||
m_Layer: 0 |
|||
m_Name: EditorInitializer |
|||
m_TagString: EditorOnly |
|||
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 &7222522106795826365 |
|||
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: ca77942077a1ca846af4cc29b07958a8, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
_thisSceneSO: {fileID: 0} |
|||
_persistentManagersSO: {fileID: 11400000, guid: c2119785ce96367428081d6eee0d932b, |
|||
type: 2} |
|||
_loadSceneEventChannel: |
|||
m_AssetGUID: 00e3063edc5902e40832ea618644c597 |
|||
m_SubObjectName: |
|||
m_SubObjectType: |
|
|||
using UnityEngine; |
|||
using UnityEngine.AddressableAssets; |
|||
using UnityEngine.ResourceManagement.AsyncOperations; |
|||
using UnityEngine.ResourceManagement.ResourceProviders; |
|||
using UnityEngine.SceneManagement; |
|||
|
|||
/// <summary>
|
|||
/// Allows a "cold start" in the editor, when pressing Play and not passing from the Initialisation scene.
|
|||
/// </summary>
|
|||
public class EditorColdStartup : MonoBehaviour |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
[SerializeField] private GameSceneSO _thisSceneSO = default; |
|||
[SerializeField] private GameSceneSO _persistentManagersSO = default; |
|||
[SerializeField] private AssetReference _loadSceneEventChannel = default; |
|||
|
|||
private void Start() |
|||
{ |
|||
if (!SceneManager.GetSceneByName(_persistentManagersSO.sceneReference.editorAsset.name).isLoaded) |
|||
{ |
|||
_persistentManagersSO.sceneReference.LoadSceneAsync(LoadSceneMode.Additive, true).Completed += LoadEventChannel; |
|||
} |
|||
} |
|||
|
|||
private void LoadEventChannel(AsyncOperationHandle<SceneInstance> obj) |
|||
{ |
|||
_loadSceneEventChannel.LoadAssetAsync<LoadEventChannelSO>().Completed += ReloadScene; |
|||
} |
|||
|
|||
private void ReloadScene(AsyncOperationHandle<LoadEventChannelSO> obj) |
|||
{ |
|||
LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_loadSceneEventChannel.Asset; |
|||
loadEventChannelSO.RaiseEvent(new GameSceneSO[] { _thisSceneSO }); |
|||
|
|||
SceneManager.UnloadSceneAsync(_thisSceneSO.sceneReference.editorAsset.name); |
|||
} |
|||
#endif
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ca77942077a1ca846af4cc29b07958a8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: |
|||
- _onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2} |
|||
- _thisSceneSO: {instanceID: 0} |
|||
- _persistentManagersSO: {fileID: 11400000, guid: c2119785ce96367428081d6eee0d932b, |
|||
type: 2} |
|||
- _loadSceneEventChannel: {fileID: 11400000, guid: 00e3063edc5902e40832ea618644c597, |
|||
type: 2} |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 0fa3e82c4006e714e8023cbf85cc999e |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: MenuEditorInitializer |
|||
m_TagString: EditorOnly |
|||
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: |
|||
scenesToLoad: |
|||
- {fileID: 11400000, guid: c2119785ce96367428081d6eee0d932b, type: 2} |
|||
targetFramerate: 0 |
|||
_isEditorInitializerMode: 0 |
|||
_OnEditorInitializer: {fileID: 11400000, guid: 13c350be03ed8f54cbc7630aa33b3d7b, |
|||
type: 2} |
|
|||
%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: 7222522106795826365} |
|||
m_Layer: 0 |
|||
m_Name: SceneStartup |
|||
m_TagString: EditorOnly |
|||
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 &7222522106795826365 |
|||
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: ca77942077a1ca846af4cc29b07958a8, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
_onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2} |
|||
_fakeLoadRequestChannel: {fileID: 11400000, guid: ca26ef526e415174a9309ac5cf5a1ce5, |
|||
type: 2} |
|||
_thisSceneSO: {fileID: 0} |
|
|||
using UnityEditor; |
|||
using UnityEngine; |
|||
using UnityEngine.ResourceManagement.AsyncOperations; |
|||
using UnityEngine.ResourceManagement.ResourceProviders; |
|||
using UnityEngine.SceneManagement; |
|||
|
|||
/// <summary>
|
|||
/// This class manages the case we are in editor and we want to press play from any scene
|
|||
/// It takes care of telling the SpawnSystem that the scene is ready since we pressed play from it
|
|||
/// and it is therefore already loaded
|
|||
/// </summary>
|
|||
public class SceneReadyBroadcaster : MonoBehaviour |
|||
{ |
|||
[SerializeField] private VoidEventChannelSO _onSceneReady = default; |
|||
#if UNITY_EDITOR
|
|||
[Header("Editor cold-startup settings")] |
|||
[SerializeField] private GameSceneSO _thisSceneSO = default; |
|||
[SerializeField] private GameSceneSO _persistentManagersScene = default; |
|||
[SerializeField] private LoadEventChannelSO _loadSceneEventChannel = default; |
|||
#endif
|
|||
|
|||
private void Start() |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
_persistentManagersScene.sceneReference.LoadSceneAsync(LoadSceneMode.Additive, true).Completed += ReloadScene; |
|||
#endif
|
|||
|
|||
_onSceneReady.RaiseEvent(); |
|||
} |
|||
|
|||
private void ReloadScene(AsyncOperationHandle<SceneInstance> obj) |
|||
{ |
|||
_loadSceneEventChannel.RaiseEvent(new GameSceneSO[] { _thisSceneSO }); |
|||
|
|||
SceneManager.UnloadSceneAsync(_thisSceneSO.sceneReference.editorAsset.name); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ca77942077a1ca846af4cc29b07958a8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: |
|||
- _onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2} |
|||
- _fakeLoadRequestChannel: {fileID: 11400000, guid: 00e3063edc5902e40832ea618644c597, |
|||
type: 2} |
|||
- _thisSceneSO: {instanceID: 0} |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue