Esempio n. 1
0
 private void Exit()
 {
     this.isLoadingBackToMenu = true;
     FileBasedPrefs.SetInt("StayInServerRoom", 1);
     if (PhotonNetwork.playerList.Length == 1)
     {
         FileBasedPrefs.SetInt("PlayerDied", 1);
         FileBasedPrefs.SetInt("MissionStatus", 1);
         FileBasedPrefs.SetInt("StayInServerRoom", 1);
         ExitLevel.CheckMissions();
         ExitLevel.CheckExp(true);
         ExitLevel.CheckChallenges(true);
         InventoryManager.RemoveItemsFromInventory();
     }
     else
     {
         FileBasedPrefs.SetInt("MissionStatus", 2);
     }
     if (XRDevice.isPresent)
     {
         this.loadLevel.levelName = "Menu_New";
         this.loadLevel.Trigger();
         return;
     }
     PhotonNetwork.LoadLevel("Menu_New");
 }
Esempio n. 2
0
 private void Exit()
 {
     if (GameController.instance)
     {
         GameController.instance.isLoadingBackToMenu = true;
     }
     if (PhotonNetwork.isMasterClient)
     {
         this.view.RPC("SyncPhotoValue", PhotonTargets.AllBuffered, new object[]
         {
             EvidenceController.instance.totalEvidenceFoundInPhotos
         });
     }
     if (GameController.instance.isTutorial)
     {
         FileBasedPrefs.SetInt("MissionStatus", 3);
         FileBasedPrefs.SetInt("setupPhase", 0);
         FileBasedPrefs.SetInt("completedTraining", 1);
         FileBasedPrefs.SetInt("StayInServerRoom", 0);
         if (MissionGhostType.instance)
         {
             MissionGhostType.instance.CheckMissionComplete();
         }
     }
     else if (!GameController.instance.myPlayer.player.isDead)
     {
         FileBasedPrefs.SetInt("MissionStatus", 1);
         FileBasedPrefs.SetInt("StayInServerRoom", 1);
         ExitLevel.CheckMissions();
         ExitLevel.CheckExp(false);
         ExitLevel.CheckChallenges(false);
         if (!this.itemSpawner.hasSpawnedOtherItems)
         {
             DailyChallengesController.Instance.ChangeChallengeProgression(ChallengeType.completeWithDefaultItems, 1);
         }
     }
     else
     {
         FileBasedPrefs.SetInt("PlayerDied", 1);
         FileBasedPrefs.SetInt("MissionStatus", 1);
         FileBasedPrefs.SetInt("StayInServerRoom", 1);
         ExitLevel.CheckMissions();
         ExitLevel.CheckExp(true);
         ExitLevel.CheckChallenges(true);
         InventoryManager.RemoveItemsFromInventory();
     }
     base.StartCoroutine(this.LoadLevelAfterDelay());
 }