Example #1
0
 private void OnLevelWasLoaded(int id)
 {
     if (Application.loadedLevelName == "menu")
     {
         if (!Background.Active)
         {
             Background.Enable();
         }
         if (Chat != null && Chat.Active)
         {
             Chat.Disable();
             Chat.Clear();
         }
         if (Log != null && Log.Active)
         {
             Log.Disable();
             Log.Clear();
         }
         DestroyMainScene();
         GameModes.ResetOnLoad();
         Network.BanList.Save();
         Anarchy.Skins.Humans.HumanSkin.Storage.Clear();
     }
     else
     {
         if (Background.Active)
         {
             Background.Disable();
         }
         if (Application.loadedLevelName != "characterCreation" && Application.loadedLevelName != "SnapShot" && PhotonNetwork.inRoom)
         {
             if (Chat != null && !Chat.Active)
             {
                 Chat.Enable();
             }
             if (Log != null && !Log.Active)
             {
                 Log.Enable();
             }
         }
     }
     if (Pause != null)
     {
         Pause.Continue();
     }
     Settings.Apply();
     VideoSettings.Apply();
     if (PauseWindow.Active)
     {
         PauseWindow.DisableImmediate();
     }
 }
Example #2
0
        private void OnLevelWasLoaded(int id)
        {
            if (Application.loadedLevelName == "menu")
            {
                if (!Background.IsActive)
                {
                    Background.Enable();
                }

                if (Chat != null && Chat.IsActive)
                {
                    Chat.Disable();
                    Chat.Clear();
                }

                if (Log != null && Log.IsActive)
                {
                    Log.Disable();
                    Log.Clear();
                }
                DestroyMainScene();
                GameModes.ResetOnLoad();
                Network.BanList.Save();
                Skins.Humans.HumanSkin.Storage.Clear();
            }
            else
            {
                if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
                {
                    SingleRunStats.Reset();
                }
                if (Background.IsActive)
                {
                    Background.Disable();
                }

                if (Application.loadedLevelName != "characterCreation" && Application.loadedLevelName != "SnapShot" &&
                    PhotonNetwork.inRoom)
                {
                    if (Chat != null && !Chat.IsActive)
                    {
                        Chat.Enable();
                    }

                    if (Log != null && !Log.IsActive)
                    {
                        Log.Enable();
                    }
                }
            }

            PhotonNetwork.player.SetCustomProperties(new ExitGames.Client.Photon.Hashtable {
                { PhotonPlayerProperty.anarchyFlags, 0 }, { PhotonPlayerProperty.anarchyAbuseFlags, 0 }
            });
            PhotonNetwork.SetModProperties();

            Pause?.Continue();
            Settings.Apply();
            VideoSettings.Apply();
            if (PauseWindow.IsActive)
            {
                PauseWindow.DisableImmediate();
            }
            if (StatsPanel.IsActive)
            {
                StatsPanel.DisableImmediate();
            }
        }