ソースコード
using System.Collections.Generic; using UnityEngine.SceneManagement; namespace Kogane { public static class KoganeSceneManager { public static bool IsLoaded( string sceneName ) { var sceneCount = SceneManager.sceneCount; for ( var i = 0; i < sceneCount; i++ ) { var scene = SceneManager.GetSceneAt( i ); if ( scene.name == sceneName && scene.isLoaded ) return true; } return false; } } }
使用例
Debug.Log( KoganeSceneManager.IsLoaded( "SampleScene" ) );