Esempio n. 1
0
        public BeatSaberScene GetCurrentScene()
        {
            if (_gameScenesManager.IsSceneInStack("GameCore"))
            {
                return(BeatSaberScene.Game);
            }
            if (_gameScenesManager.IsSceneInStack("BeatmapEditor"))
            {
                return(BeatSaberScene.BeatmapEditor);
            }
            if (_gameScenesManager.IsSceneInStack("MainMenu"))
            {
                return(BeatSaberScene.MainMenu);
            }
            if (_gameScenesManager.IsSceneInStack("HealthWarning"))
            {
                return(BeatSaberScene.HealthWarning);
            }

            return(BeatSaberScene.Unknown);
        }
Esempio n. 2
0
        public static bool IsSceneInStackAndActive(this GameScenesManager gameScenesManager, string sceneName)
        {
            if (!gameScenesManager.IsSceneInStack(sceneName))
            {
                return(false);
            }

            Scene scene = SceneManager.GetSceneByName(sceneName);

            if (!scene.IsValid())
            {
                return(false);
            }

            return(scene.GetRootGameObjects().First().activeInHierarchy);
        }