Version: 2022.2
언어: 한국어

EditorSceneManager.sceneManagerSetupRestored

매뉴얼로 전환

설명

This can be useful to get notified when the SceneManager's scenes are replaced with a set of new scenes from calls to RestoreSceneManagerSetup.

Use the scenes argument to check what scenes has just been opened.

See Also: SceneManagerSetupRestoredCallback.

using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;

[InitializeOnLoad] class CheckRestoredScenes { static CheckRestoredScenes() { EditorSceneManager.sceneManagerSetupRestored += OnSceneManagerSetupRestored; }

static void OnSceneManagerSetupRestored(Scene[] scenes) { Debug.Log("OnSceneManagerSetupRestored: restored " + scenes.Length); } }