Beispiel #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();
     }
 }
Beispiel #2
0
 protected override void OnPanelDisable()
 {
     pagesSelection = null;
     head           = null;
     left           = null;
     rect           = null;
     right          = null;
     RebindPage     = 0;
     RebindLabels   = null;
     Settings.Apply();
     VideoSettings.Apply();
     if (Application.loadedLevelName == "menu")
     {
         AnarchyManager.MainMenu.EnableImmediate();
     }
 }
Beispiel #3
0
 protected override void OnPanelDisable()
 {
     UIManager.HUDScaleGUI.Value = (float)System.Math.Round(UIManager.HUDScaleGUI.Value, 2);
     pagesSelection = null;
     head           = null;
     left           = null;
     rect           = null;
     right          = null;
     RebindPage     = 0;
     RebindLabels   = null;
     Settings.Apply();
     VideoSettings.Apply();
     if (Application.loadedLevelName == "menu")
     {
         AnarchyManager.MainMenu.EnableImmediate();
     }
     PhotonNetwork.SetModProperties();
 }
Beispiel #4
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();
            }
        }