private void SceneLoaded(Scene to, LoadSceneMode mode) { Logger.Debug($"Scene loaded: \"{to.name}\""); if (to.name == "MenuCore") { PluginUI.Init(); GameController.Init(to); LeaderboardController.Init(to); Controllers.PlayerController.Init(to); VoiceChatWorker.Init(); } try { if (to.name == "MenuCore" && SteamAPI.getLobbyID().m_SteamID > 0) { Logger.Debug("Creating new lobby"); SteamAPI.CreateLobby(!Config.Instance.IsPublic); Controllers.PlayerController.Instance.DestroyAvatars(); } } catch (Exception e) { Logger.Error(e); } }
private void SceneLoaded(Scene to, LoadSceneMode mode) { try { if (to.name == "Menu" && SteamAPI.getLobbyID().m_SteamID > 0) { Logger.Debug("Creating new lobby"); SteamAPI.CreateLobby(!Config.Instance.IsPublic); Controllers.PlayerController.Instance.DestroyAvatars(); } } catch (Exception e) { Logger.Error(e); } }