浏览代码

Added the event for editor initializer and updated prefabs to ref it

/main
Amel Negra 4 年前
当前提交
d00568b8
共有 5 个文件被更改,包括 49 次插入0 次删除
  1. 18
      UOP1_Project/Assets/Prefabs/GameplayEssentials/LocationEditorInitializer.prefab
  2. 2
      UOP1_Project/Assets/Prefabs/GameplayEssentials/MenuEditorInitializer.prefab
  3. 5
      UOP1_Project/Assets/Scripts/SceneManagement/EditorInitialisationLoader.cs
  4. 16
      UOP1_Project/Assets/ScriptableObjects/EventChannels/OnEditorInitializer.asset
  5. 8
      UOP1_Project/Assets/ScriptableObjects/EventChannels/OnEditorInitializer.asset.meta

18
UOP1_Project/Assets/Prefabs/GameplayEssentials/LocationEditorInitializer.prefab


m_Component:
- component: {fileID: 40564194958535909}
- component: {fileID: 40564194958535908}
- component: {fileID: 7222522106795826365}
m_Layer: 0
m_Name: LocationEditorInitializer
m_TagString: EditorOnly

- {fileID: 11400000, guid: c2119785ce96367428081d6eee0d932b, type: 2}
- {fileID: 11400000, guid: a9c92d087d242344388972b3d1c4aaae, type: 2}
targetFramerate: 0
_OnEditorInitializer: {fileID: 11400000, guid: 13c350be03ed8f54cbc7630aa33b3d7b,
type: 2}
--- !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:
_OnEditorInitializer: {fileID: 11400000, guid: 13c350be03ed8f54cbc7630aa33b3d7b,
type: 2}
_OnSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2}

2
UOP1_Project/Assets/Prefabs/GameplayEssentials/MenuEditorInitializer.prefab


persistentScenes:
- {fileID: 11400000, guid: c2119785ce96367428081d6eee0d932b, type: 2}
targetFramerate: 0
_OnEditorInitializer: {fileID: 11400000, guid: 13c350be03ed8f54cbc7630aa33b3d7b,
type: 2}

5
UOP1_Project/Assets/Scripts/SceneManagement/EditorInitialisationLoader.cs


public GameSceneSO[] persistentScenes;
public int targetFramerate = 0; // For debugging purposes
[Header("Broadcasting on")]
[SerializeField] private VoidEventChannelSO _OnEditorInitializer = default;
private void Start()
{
Application.targetFrameRate = targetFramerate; // For debugging purposes

else
{
SceneManager.LoadSceneAsync(persistentScenes[j].scenePath, LoadSceneMode.Additive);
//Inform that we are pressing play from a location or menu
_OnEditorInitializer.RaiseEvent();
}
}
}

16
UOP1_Project/Assets/ScriptableObjects/EventChannels/OnEditorInitializer.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: 7fafac715ff920c4383fed91a38a351e, type: 3}
m_Name: OnEditorInitializer
m_EditorClassIdentifier:
description: Raised when user presses play from any scene, used to raise the OnSceneReady
event

8
UOP1_Project/Assets/ScriptableObjects/EventChannels/OnEditorInitializer.asset.meta


fileFormatVersion: 2
guid: 13c350be03ed8f54cbc7630aa33b3d7b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存