浏览代码

to do added

/main
Amel Negra 4 年前
当前提交
d78abfcb
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 10
      UOP1_Project/Assets/Scripts/SceneManagement/EditorInitialisationLoader.cs

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


public class EditorInitialisationLoader : MonoBehaviour
{
#if UNITY_EDITOR
public GameSceneSO[] persistentScenes;
public GameSceneSO[] scenesToLoad;
//add bool and access it from other script
[Header("Broadcasting on")]
[SerializeField] private VoidEventChannelSO _OnEditorInitializer = default;

for (int i = 0; i < SceneManager.sceneCount; ++i)
{
Scene scene = SceneManager.GetSceneAt(i);
for (int j = 0; j < persistentScenes.Length; ++j)
if (scene.path == persistentScenes[j].scenePath)
for (int j = 0; j < scenesToLoad.Length; ++j)
if (scene.path == scenesToLoad[j].scenePath)
SceneManager.LoadSceneAsync(persistentScenes[j].scenePath, LoadSceneMode.Additive);
SceneManager.LoadSceneAsync(scenesToLoad[j].scenePath, LoadSceneMode.Additive);
//Inform that we are pressing play from a location or menu
_OnEditorInitializer.RaiseEvent();
}

正在加载...
取消
保存