private void MenuSceneLoadedFresh()
 {
     ModelSaberAPI.HashAllAvatars();
     PluginUI.OnLoad();
     InGameOnlineController.OnLoad();
     SpectatingController.OnLoad();
     GetUserInfo.UpdateUserInfo();
 }
Example #2
0
        public void Awake()
        {
            if (Instance != this)
            {
                Instance = this;
                DontDestroyOnLoad(this);

                Client.ClientCreated += ClientCreated;
                _currentScene         = SceneManager.GetActiveScene();
            }
        }
Example #3
0
        public void Awake()
        {
            if (Instance != this)
            {
                Instance = this;
                DontDestroyOnLoad(this);

                Client.Instance.PlayerInfoUpdateReceived -= PacketReceived;
                Client.Instance.PlayerInfoUpdateReceived += PacketReceived;
                _currentScene = SceneManager.GetActiveScene().name;
            }
        }
Example #4
0
        private void MenuSceneLoadedFresh()
        {
            ModelSaberAPI.HashAllAvatars();
            PluginUI.OnLoad();
            InGameOnlineController.OnLoad();
            SpectatingController.OnLoad();
            GetUserInfo.UpdateUserInfo();

            if (joinAfterRestart)
            {
                joinAfterRestart = false;
                SharedCoroutineStarter.instance.StartCoroutine(PluginUI.instance.JoinGameWithSecret(joinSecret));
                joinSecret = string.Empty;
            }
        }
Example #5
0
        private void ActiveSceneChanged(Scene from, Scene to)
        {
#if DEBUG
            Misc.Logger.Info($"Active scene changed from \"{from.name}\" to \"{to.name}\"");
#endif
            if (from.name == "EmptyTransition" && to.name == "Menu")
            {
                PluginUI.OnLoad();
                InGameOnlineController.OnLoad(to);
                SpectatingController.OnLoad();
            }
            else
            {
                InGameOnlineController.Instance?.ActiveSceneChanged(from, to);
                if (Config.Instance.SpectatorMode)
                {
                    SpectatingController.Instance?.ActiveSceneChanged(from, to);
                }
            }
        }