Пример #1
0
        private void BSEvents_menuSceneActive()
        {
            if (Config.instance.ShowNowPlaying)
            {
                NowPlaying.OnLoad();
            }
            _sceneDidTransition = true;

            StartCoroutine(LoadAudioClip());
        }
Пример #2
0
        internal static void OnLoad()
        {
            if (instance)
            {
                return;
            }

            instance = new GameObject("NowPlaying").AddComponent <NowPlaying>();
            DontDestroyOnLoad(instance);
            SceneManager.activeSceneChanged += instance.OnActiveSceneChanged;
            Logger.Log("Created NowPlaying object.");
        }
Пример #3
0
 private void OnDestroy()
 {
     SceneManager.activeSceneChanged -= instance.OnActiveSceneChanged;
     instance = null;
 }