Beispiel #1
0
    // Token: 0x06000A48 RID: 2632 RVA: 0x0003F7F4 File Offset: 0x0003D9F4
    public static void RemoveItemsFromInventory()
    {
        FileBasedPrefs.SetInt("EMFReaderInventory", FileBasedPrefs.GetInt("EMFReaderInventory", 0) - PlayerPrefs.GetInt("currentEMFReaderAmount"));
        FileBasedPrefs.SetInt("FlashlightInventory", FileBasedPrefs.GetInt("FlashlightInventory", 0) - PlayerPrefs.GetInt("currentFlashlightAmount"));
        FileBasedPrefs.SetInt("CameraInventory", FileBasedPrefs.GetInt("CameraInventory", 0) - PlayerPrefs.GetInt("currentCameraAmount"));
        FileBasedPrefs.SetInt("LighterInventory", FileBasedPrefs.GetInt("LighterInventory", 0) - PlayerPrefs.GetInt("currentLighterAmount"));
        FileBasedPrefs.SetInt("CandleInventory", FileBasedPrefs.GetInt("CandleInventory", 0) - PlayerPrefs.GetInt("currentCandleAmount"));
        FileBasedPrefs.SetInt("UVFlashlightInventory", FileBasedPrefs.GetInt("UVFlashlightInventory", 0) - PlayerPrefs.GetInt("currentUVFlashlightAmount"));
        FileBasedPrefs.SetInt("CrucifixInventory", FileBasedPrefs.GetInt("CrucifixInventory", 0) - PlayerPrefs.GetInt("currentCrucifixAmount"));
        FileBasedPrefs.SetInt("DSLRCameraInventory", FileBasedPrefs.GetInt("DSLRCameraInventory", 0) - PlayerPrefs.GetInt("currentDSLRCameraAmount"));
        FileBasedPrefs.SetInt("EVPRecorderInventory", FileBasedPrefs.GetInt("EVPRecorderInventory", 0) - PlayerPrefs.GetInt("currentEVPRecorderAmount"));
        FileBasedPrefs.SetInt("SaltInventory", FileBasedPrefs.GetInt("SaltInventory", 0) - PlayerPrefs.GetInt("currentSaltAmount"));
        FileBasedPrefs.SetInt("SageInventory", FileBasedPrefs.GetInt("SageInventory", 0) - PlayerPrefs.GetInt("currentSageAmount"));
        FileBasedPrefs.SetInt("TripodInventory", FileBasedPrefs.GetInt("TripodInventory", 0) - PlayerPrefs.GetInt("currentTripodAmount"));
        FileBasedPrefs.SetInt("StrongFlashlightInventory", FileBasedPrefs.GetInt("StrongFlashlightInventory", 0) - PlayerPrefs.GetInt("currentStrongFlashlightAmount"));
        FileBasedPrefs.SetInt("MotionSensorInventory", FileBasedPrefs.GetInt("MotionSensorInventory", 0) - PlayerPrefs.GetInt("currentMotionSensorAmount"));
        FileBasedPrefs.SetInt("SoundSensorInventory", FileBasedPrefs.GetInt("SoundSensorInventory", 0) - PlayerPrefs.GetInt("currentSoundSensorAmount"));
        int value = FileBasedPrefs.GetInt("SanityPillsInventory", 0) - PlayerPrefs.GetInt("currentSanityPillsAmount");

        value = Mathf.Clamp(value, 0, 1000);
        FileBasedPrefs.SetInt("SanityPillsInventory", value);
        FileBasedPrefs.SetInt("ThermometerInventory", FileBasedPrefs.GetInt("ThermometerInventory", 0) - PlayerPrefs.GetInt("currentThermometerAmount"));
        FileBasedPrefs.SetInt("GhostWritingBookInventory", FileBasedPrefs.GetInt("GhostWritingBookInventory", 0) - PlayerPrefs.GetInt("currentGhostWritingBookAmount"));
        FileBasedPrefs.SetInt("IRLightSensorInventory", FileBasedPrefs.GetInt("IRLightSensorInventory", 0) - PlayerPrefs.GetInt("currentIRLightSensorAmount"));
        FileBasedPrefs.SetInt("ParabolicMicrophoneInventory", FileBasedPrefs.GetInt("ParabolicMicrophoneInventory", 0) - PlayerPrefs.GetInt("currentParabolicMicrophoneAmount"));
        FileBasedPrefs.SetInt("GlowstickInventory", FileBasedPrefs.GetInt("GlowstickInventory", 0) - PlayerPrefs.GetInt("currentGlowstickAmount"));
        FileBasedPrefs.SetInt("HeadMountedCameraInventory", FileBasedPrefs.GetInt("HeadMountedCameraInventory", 0) - PlayerPrefs.GetInt("currentHeadMountedCameraAmount"));
        InventoryManager.ResetTemporaryInventory();
    }
Beispiel #2
0
    public static long GetLong(string key)
    {
        int lowBits  = FileBasedPrefs.GetInt(key + "_lowBits");
        int highBits = FileBasedPrefs.GetInt(key + "_highBits");

        // unsigned, to prevent loss of sign bit.
        ulong ret = (uint)highBits;

        ret = (ret << 32);
        return((long)(ret | (ulong)(uint)lowBits));
    }
Beispiel #3
0
 // Token: 0x06000A3A RID: 2618 RVA: 0x0003F204 File Offset: 0x0003D404
 public void UpdateTotalText()
 {
     for (int i = 0; i < this.players.Count; i++)
     {
         if (this.players[i].isLocalPlayer)
         {
             this.totalText.text = (FileBasedPrefs.GetInt(this.itemName + "Inventory", 0) - this.players[i].currentAmount).ToString();
             return;
         }
     }
 }
Beispiel #4
0
 // Token: 0x06000804 RID: 2052 RVA: 0x0002FF54 File Offset: 0x0002E154
 private void Completed()
 {
     if (!this.completed)
     {
         this.completed = true;
         PlayerPrefs.SetInt("challenge" + this.dailyChallengeID + "Completed", 1);
         FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) + this.myChallenge.reward);
         this.progressionValue = this.myChallenge.progressionMaxValue;
         PlayerPrefs.SetInt("challenge" + this.dailyChallengeID + "Progression", this.progressionValue);
     }
 }
 public void LoadLevel()
 {
     Load.SetActive(true);
     if (FileBasedPrefs.HasKey("CurrentScene"))
     {
         StartCoroutine(LoadingScreen(FileBasedPrefs.GetInt("CurrentScene")));
     }
     else
     {
         StartCoroutine(LoadingScreen(1));
     }
 }
Beispiel #6
0
    // Token: 0x06000AB8 RID: 2744 RVA: 0x00042990 File Offset: 0x00040B90
    public void UpdateExperience()
    {
        int num = 100 - (100 - ((Mathf.FloorToInt((float)(FileBasedPrefs.GetInt("myTotalExp", 0) / 100)) + 1) * 100 - FileBasedPrefs.GetInt("myTotalExp", 0)));

        this.experienceText.text = string.Concat(new object[]
        {
            LocalisationSystem.GetLocalisedValue("Menu_Experience"),
            ": ",
            num,
            "XP"
        });
    }
Beispiel #7
0
 // Token: 0x06000A12 RID: 2578 RVA: 0x0003E34F File Offset: 0x0003C54F
 private void Awake()
 {
     if (FileBasedPrefs.GetInt("PlayerDied", 0) == 1)
     {
         InventoryManager.RemoveItemsFromInventory();
     }
     else
     {
         this.failureMessage.enabled = false;
     }
     FileBasedPrefs.SetInt("PlayerDied", 0);
 }
Beispiel #8
0
 // Token: 0x06000AEF RID: 2799 RVA: 0x000446D8 File Offset: 0x000428D8
 public void BuyButton()
 {
     if (FileBasedPrefs.GetInt("PlayersMoney", 0) >= this.currentItem.cost)
     {
         FileBasedPrefs.SetInt(this.currentItem.itemName + "Inventory", FileBasedPrefs.GetInt(this.currentItem.itemName + "Inventory", 0) + 1);
         FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) - this.currentItem.cost);
         this.UpdatePlayerMoneyText();
         this.currentItem.amountOwnedText.text = LocalisationSystem.GetLocalisedValue("Store_Owned") + ": " + FileBasedPrefs.GetInt(this.currentItem.itemName + "Inventory", 0);
         DailyChallengesController.Instance.ChangeChallengeProgression(ChallengeType.BuyAnItem, 1);
     }
     AntiCheatSystem.CheckPlayerMoney(FileBasedPrefs.GetInt("PlayersMoney", 0));
 }
Beispiel #9
0
        private static void lobbyActions()
        {
            GUI.SetNextControlName("changename");
            playerNickName = GUI.TextArea(new Rect(320f, 25f, 200f, 20f), playerNickName);
            if (GUI.Button(new Rect(320f, 45f, 200f, 20f), "Change Name"))
            {
                GUI.FocusControl("changename");
                PhotonNetwork.NickName = playerNickName;
            }

            if (GUI.Button(new Rect(320f, 145f, 200f, 20f), "Force Start"))
            {
                Main.serverManager.StartGame();
            }

            if (GUI.Button(new Rect(520f, 50f, 200f, 20f), "Add 100$"))
            {
                FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) + 100);
            }
            if (GUI.Button(new Rect(520f, 75f, 200f, 20f), "Add 1 Level"))
            {
                FileBasedPrefs.SetInt("myTotalExp", FileBasedPrefs.GetInt("myTotalExp", 0) + 100);
            }
            playerReach = GUI.HorizontalSlider(new Rect(320, 200f, 200f, 20f), (float)((int)playerReach), 1.6f, 16f);
            GUI.Label(new Rect(10f, 160f, 200, 20f), "Reach: " + (int)playerReach);
            if (GUI.Button(new Rect(320f, 225f, 200f, 20f), "Click to change reach"))
            {
                MyPlayer = Main.GetLocalPlayer();
                MyPlayer.field_Public_PCPropGrab_0.field_Private_Single_0 = playerReach;
            }
            //GUI.Label(new Rect(920f, 0f, 200f, 20f), "Join Room:");
            //roomName = GUI.TextArea(new Rect(920f, 25f, 200f, 20f), roomName);
            //steamID = GUI.TextArea(new Rect(920f, 50f, 200f, 20f), steamID);
            //if (GUI.Button(new Rect(920f, 75f, 200f, 20f), "Join Room by Name"))
            //{
            //    PhotonNetwork.JoinRoom(roomName);
            //}
            //if (GUI.Button(new Rect(920f, 100f, 200f, 20f), "Join Room by ID"))
            //{
            //    object[] FriendIDList;

            //    bool test = PhotonNetwork.FindFriends(new string[]
            //    {
            //            steamID
            //    });
            //    MelonLogger.Log("steamID = " + steamID);
            //    //foreach (FriendInfo friendInfo in PhotonNetwork.Friends)
            //    //{
            //    //PhotonNetwork.JoinRoom(friendInfo.Room);
            //    //}
            //}
        }
 public void Start()
 {
     //OnClick_Play();
     Debug.Log("Start");
     if (FileBasedPrefs.GetInt("ComingFromRestart") == 1)
     {
         UIManager.Instance.mainMenu.gameObject.SetActive(false);
         // Invoke("DisableMenu",0.5f);
         allRooms.SetActive(true);
         FileBasedPrefs.SetInt("ComingFromRestart", 0);
     }
     //SoundManager.Instance.gameMusics[0].Play();
 }
    public void removeKey(GameObject pressedKey)
    {
        pressedKey.GetComponent <SpriteRenderer>().enabled = true;
        SoundManager.Instance.gameSounds[13].Play();
        if (!keys.Contains(pressedKey))
        {
            keys.Clear();
            keys.AddRange(keysDuplicate);
            count = 0;
            foreach (GameObject item in keysDuplicate)
            {
                item.GetComponent <SpriteRenderer>().enabled = false;
            }
            pressedKey.GetComponent <SpriteRenderer>().enabled = false;
        }
        else
        {
            count++;
            keys.Remove(pressedKey);
            if (count >= 8)
            {
                prize.SetActive(true);



                if (FileBasedPrefs.HasKey("bigPuzzCount"))
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1);
                }
                else
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", 1);
                }
                Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount"));
                if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8)
                {
                    SteamHandler.instance.SetAch(SteamACH);
                }



                examine.SetActive(false);
                navigate.SetActive(true);
                bothash.DialogueM.Instance.sentence = Dialogues.sentences;
                bothash.DialogueM.Instance.Avatar   = character;
                bothash.DialogueM.Instance.Audio    = Dialogues.Audios;
                bothash.DialogueM.Instance.startDialogue();
                currRoom.SetActive(false);
            }
        }
    }
Beispiel #12
0
 // Token: 0x0600075C RID: 1884 RVA: 0x0002AFFC File Offset: 0x000291FC
 private void Awake()
 {
     GameController.instance = this;
     this.view = base.GetComponent <PhotonView>();
     if (FileBasedPrefs.GetInt("isTutorial", 0) == 0)
     {
         this.levelDifficulty = (Contract.LevelDifficulty)FileBasedPrefs.GetInt("LevelDifficulty", 0);
     }
     else
     {
         this.levelDifficulty = Contract.LevelDifficulty.Amateur;
     }
     FileBasedPrefs.SetInt("PlayerDied", 0);
 }
Beispiel #13
0
 // Token: 0x06000AD5 RID: 2773 RVA: 0x00043A64 File Offset: 0x00041C64
 private void AssignNewPlayerSpot(PhotonPlayer photonPlayer)
 {
     if (PhotonNetwork.player == photonPlayer && MainManager.instance != null && MainManager.instance.localPlayer != null)
     {
         this.view.RPC("SetPlayerInformation", PhotonTargets.AllBufferedViaServer, new object[]
         {
             photonPlayer,
             this.myCharacterIndex,
             Mathf.FloorToInt((float)(FileBasedPrefs.GetInt("myTotalExp", 0) / 100)),
             MainManager.instance.localPlayer.view.viewID
         });
     }
     this.UpdateUI();
 }
Beispiel #14
0
    public static long GetLong(string key, long defaultValue)
    {
        int lowBits, highBits;

        SplitLong(defaultValue, out lowBits, out highBits);
        lowBits  = FileBasedPrefs.GetInt(key + "_lowBits", lowBits);
        highBits = FileBasedPrefs.GetInt(key + "_highBits", highBits);

        // unsigned, to prevent loss of sign bit.
        ulong ret = (uint)highBits;

        ret = (ret << 32);
        return((long)(ret | (ulong)(uint)lowBits));
    }
Beispiel #15
0
 //! Initializes variables when the world is loaded.
 private void Init()
 {
     ;
     if (FileBasedPrefs.GetInt(stateManager.worldName + "payloadRequired") != 0)
     {
         payloadRequired = FileBasedPrefs.GetInt(stateManager.worldName + "payloadRequired");
     }
     if (FileBasedPrefs.GetInt(stateManager.worldName + "day") != 0)
     {
         day = FileBasedPrefs.GetInt(stateManager.worldName + "day");
     }
     gameTime    = FileBasedPrefs.GetFloat(stateManager.worldName + "gameTime");
     initialized = true;
 }
 //! Moves the player to their previous location when a game is loaded.
 private void MovePlayerToSavedLocation()
 {
     if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
     {
         transform.position = PlayerPrefsX.GetPersistentVector3(stateManager.worldName + "playerPosition");
         money = PlayerPrefs.GetInt(stateManager.worldName + "money");
     }
     else
     {
         transform.position = PlayerPrefsX.GetVector3(stateManager.worldName + "playerPosition");
         money = FileBasedPrefs.GetInt(stateManager.worldName + "money");
     }
     movedPlayer = true;
 }
    // Update is called once per frame
    void Update()
    {
        if (_totalEyesDroped <= listOfPuzzlePieces.Count && !_isPuzzleCompleted)
        {
            _totalEyesDroped = 0;
            foreach (var item in listOfPuzzlePieces)
            {
                if (item.enabled)
                {
                    ++_totalEyesDroped;
                    //Debug.Log(string.Format("FOUNT {0}", _totalEyesDroped));
                }
            }

            if (_totalEyesDroped >= listOfPuzzlePieces.Count)
            {
                Debug.Log("WON");
                RewardObject.SetActive(true);
                _isRewardProcessed = true;
                _isPuzzleCompleted = true;
                SteamHandler.instance.SetAch(SteamACH2);
                if (FileBasedPrefs.HasKey("bigPuzzCount"))
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1);
                }
                else
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", 1);
                }
                Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount"));
                if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8)
                {
                    SteamHandler.instance.SetAch(SteamACH);
                }
                buffaloHead.SetActive(true);
            }
        }
        else if (!_isRewardProcessed)
        {
            _isRewardProcessed = true;
            RewardObject.SetActive(true);
        }


        /* else if(_isRewardProcessed && !_rewardCollected)
         * {
         *  RewardObject.SetActive(true);
         * } */
    }
Beispiel #18
0
 // Token: 0x06000A13 RID: 2579 RVA: 0x0003E380 File Offset: 0x0003C580
 private void Start()
 {
     if (FileBasedPrefs.GetInt("setupPhase", 0) == 1 && FileBasedPrefs.GetInt("LevelDifficulty", 0) == 0)
     {
         FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) + 10);
         this.rewardMessage.text = LocalisationSystem.GetLocalisedValue("Failure_ContractPay") + ": $10";
     }
     else
     {
         this.rewardMessage.text = LocalisationSystem.GetLocalisedValue("Failure_ContractPay") + ": $0";
     }
     FileBasedPrefs.SetInt("setupPhase", 0);
     this.storeManager.UpdatePlayerMoneyText();
     FileBasedPrefs.SetInt("MissionStatus", 0);
 }
Beispiel #19
0
 // Token: 0x06000AEE RID: 2798 RVA: 0x000445C4 File Offset: 0x000427C4
 public void ItemButtonPress(StoreItem item)
 {
     this.currentItem = item;
     for (int i = 0; i < this.itemCards.Length; i++)
     {
         this.itemCards[i].SetActive(false);
     }
     this.currentItem.description.SetActive(true);
     this.currentItem.amountOwnedText.text = LocalisationSystem.GetLocalisedValue("Store_Owned") + ": " + FileBasedPrefs.GetInt(this.currentItem.itemName + "Inventory", 0);
     if (Mathf.FloorToInt((float)(FileBasedPrefs.GetInt("myTotalExp", 0) / 100)) < item.requiredLevel && this.storeSDKManager.storeBranchType != StoreSDKManager.StoreBranchType.youtube)
     {
         this.currentItem.buyButton.interactable = false;
         this.currentItem.buyButtonText.color    = new Color32(50, 50, 50, 119);
         this.currentItem.amountOwnedText.text   = LocalisationSystem.GetLocalisedValue("Experience_Required") + item.requiredLevel;
     }
 }
Beispiel #20
0
 // Token: 0x06000A7A RID: 2682 RVA: 0x000412C4 File Offset: 0x0003F4C4
 private void OnJoinedLobby()
 {
     if (FileBasedPrefs.GetInt("StayInServerRoom", 0) == 1)
     {
         FileBasedPrefs.SetInt("StayInServerRoom", 0);
         RoomOptions roomOptions = new RoomOptions
         {
             IsOpen     = true,
             IsVisible  = (PlayerPrefs.GetInt("isPublicServer") == 1),
             MaxPlayers = 4,
             PlayerTtl  = 2000
         };
         PhotonNetwork.JoinOrCreateRoom(PlayerPrefs.GetString("ServerName"), roomOptions, TypedLobby.Default);
         return;
     }
     this.LoadRewardScreens();
 }
    /*
     * -------SOUNDS-------
     * 0 - step
     * 1 - lose
     * 2 - buttonclick
     * 3 - win
     * 4 - player takes kill
     * 5 - goal
     * 6 - 4 or 8 Roll
     * 7 - player gets killed
     * 8 - dice roll
     */

    private void Awake()
    {
        Instance = this;
        if (FileBasedPrefs.HasKey("sound"))
        {
            Sound = FileBasedPrefs.GetInt("sound");
            SoundsOnOff();
        }

        if (FileBasedPrefs.HasKey("music"))
        {
            Music = FileBasedPrefs.GetInt("music");
            MusicsOnOff();
        }

        //gameMusics[Music].Play();
    }
Beispiel #22
0
    public void LoadGame()  //30 переменных
    {
        // SteamAchiments.main.LockAchiv("ACH_TRAVEL_FAR_ACCUM");
        MatchThree.main.LifeDays   = FileBasedPrefs.GetInt("LifeDays");
        MatchThree.main.TimeHour   = FileBasedPrefs.GetInt("TimeHour");
        MatchThree.main.TimeMinute = FileBasedPrefs.GetInt("TimeMinute");
        LastNalogDay = FileBasedPrefs.GetInt("LastNalogDay");

        MatchThree.main.eat     = FileBasedPrefs.GetInt("eat");
        MatchThree.main.energy  = FileBasedPrefs.GetInt("energy");
        MatchThree.main.coffee  = FileBasedPrefs.GetInt("coffee");
        MatchThree.main.hygiene = FileBasedPrefs.GetInt("hygiene");
        MatchThree.main.money   = FileBasedPrefs.GetInt("money");

        MatchThree.main.coffeevarka = FileBasedPrefs.GetBool("coffeevarka");
        MatchThree.main.multvarka   = FileBasedPrefs.GetBool("multvarka");
        MatchThree.main.icebox      = FileBasedPrefs.GetBool("icebox");
        MatchThree.main.shower      = FileBasedPrefs.GetBool("shower");
        MatchThree.main.bed         = FileBasedPrefs.GetBool("bed");
        MatchThree.main.computer    = FileBasedPrefs.GetBool("computer");

        flowchart.SetBooleanVariable("FirstKitchen", FileBasedPrefs.GetBool("FirstKitchen"));
        flowchart.SetBooleanVariable("FirstShower", FileBasedPrefs.GetBool("FirstShower"));
        flowchart.SetBooleanVariable("FirstBed", FileBasedPrefs.GetBool("FirstBed"));
        flowchart.SetBooleanVariable("Firstcabinet", FileBasedPrefs.GetBool("Firstcabinet"));

        flowchart.SetBooleanVariable("HaveCompDialog", FileBasedPrefs.GetBool("HaveCompDialog")); // Показывался ли диалог со сломаным пк

        IncriseMoney = FileBasedPrefs.GetFloat("IncriseMoney");                                   // общее увеличение доходв от компа
        // Налоги
        Nalogi        = FileBasedPrefs.GetFloat("Nalogi");
        NDS           = FileBasedPrefs.GetFloat("NDS");
        Priceincrease = FileBasedPrefs.GetFloat("Priceincrease");
        Rentincrease  = FileBasedPrefs.GetFloat("Rentincrease");
        //продукты
        numproducts = FileBasedPrefs.GetInt("numproducts"); // число продуктов в холодильнике
        numcoffee   = FileBasedPrefs.GetInt("numcoffee");   // число кофе в холодильнике
        //Statistic
        MovesinGame = FileBasedPrefs.GetInt("MovesinGame"); // ходов стелано в последней игре
        GameWins    = FileBasedPrefs.GetInt("GameWins");    // игр выйграно
        MoneyProfit = FileBasedPrefs.GetInt("MoneyProfit"); // денег заработано
        MoneyOutgo  = FileBasedPrefs.GetInt("MoneyOutgo");  // денег потрачено

        ChangeBG.main.UpdateStatusDevice();
    }
Beispiel #23
0
 // Token: 0x06000A7F RID: 2687 RVA: 0x00041494 File Offset: 0x0003F694
 private void LoadRewardScreens()
 {
     if (this.ranOnce)
     {
         return;
     }
     this.ranOnce = true;
     if (PlayerPrefs.GetString("ErrorMessage") != string.Empty)
     {
         Debug.LogError("Disconnect Error: " + PlayerPrefs.GetString("ErrorMessage"));
         this.ResetSettings(true);
         this.ErrorScreen.SetActive(true);
         base.gameObject.SetActive(false);
     }
     else if (PlayerPrefs.GetInt("PhotoSensitivityWarning") != 3)
     {
         this.ResetSettings(true);
         this.PhotoWarningScreen.SetActive(true);
         base.gameObject.SetActive(false);
     }
     else if (FileBasedPrefs.GetInt("MissionStatus", 0) == 1)
     {
         this.ResetSettings(true);
         this.RewardScreen.SetActive(true);
         base.gameObject.SetActive(false);
     }
     else if (FileBasedPrefs.GetInt("MissionStatus", 0) == 3)
     {
         this.ResetSettings(true);
         this.TrainingScreen.SetActive(true);
         base.gameObject.SetActive(false);
     }
     else if (FileBasedPrefs.GetInt("MissionStatus", 0) == 2)
     {
         this.ResetSettings(false);
         this.FailureScreen.SetActive(true);
         base.gameObject.SetActive(false);
     }
     if (PhotonNetwork.inRoom)
     {
         this.serverScreen.SetActive(true);
         this.serverManager.EnableMasks(false);
     }
 }
Beispiel #24
0
 // Token: 0x060007FD RID: 2045 RVA: 0x0002FC68 File Offset: 0x0002DE68
 private void Start()
 {
     if (FileBasedPrefs.GetInt("isTutorial", 0) == 1)
     {
         GameController.instance.OnGhostSpawned.AddListener(new UnityAction(this.GhostSpawned));
         GameController.instance.isTutorial = true;
         this.missionWhiteBoard.SetActive(false);
         this.tutorialWhiteBoard.SetActive(true);
         SetupPhaseController.instance.BeginHuntingPhase();
         this.tvLight.enabled   = true;
         this.tvLight.intensity = 0.4f;
         this.trainingTVCanvas.gameObject.SetActive(true);
         Object.Destroy(this.tvRemote);
         this.trainingRemote.enabled = true;
         for (int i = 0; i < this.probes.Length; i++)
         {
             this.probes[i].RenderProbe();
         }
         for (int j = 0; j < this.slides.Length; j++)
         {
             this.slides[j].SetActive(false);
         }
         this.slides[0].SetActive(true);
         if (XRDevice.isPresent)
         {
             this.VRControls.SetActive(true);
             VRTK_DeviceFinder.Headsets headsetType = VRTK_DeviceFinder.GetHeadsetType(true);
             if (headsetType == VRTK_DeviceFinder.Headsets.OculusRift)
             {
                 this.OculusControls.SetActive(true);
                 return;
             }
             if (headsetType == VRTK_DeviceFinder.Headsets.Vive)
             {
                 this.ViveControls.SetActive(true);
                 return;
             }
         }
         else
         {
             this.NonVRControls.SetActive(true);
         }
     }
 }
    public void passData(GameObject objToPass)
    {
        if (!firstPassed)
        {
            first       = objToPass;
            firstPassed = true;
            //first.GetComponent<SpriteRenderer>().enabled = true;
            //first.SetActive(false);
            SoundManager.Instance.gameSounds[6].Play();
        }
        else if (first.GetComponent <SpriteRenderer>().sprite.name != objToPass.GetComponent <SpriteRenderer>().sprite.name)
        {
            second      = objToPass;
            firstPassed = false;
            //second.GetComponent<SpriteRenderer>().enabled = true;
            SoundManager.Instance.gameSounds[6].Play();
            Vector3 temp = first.transform.position;
            first.transform.position  = second.transform.position;
            second.transform.position = temp;
            first.GetComponent <photo>().check();
            second.GetComponent <photo>().check();
            if (counter == 11)
            {
                prize.SetActive(true);
                if (FileBasedPrefs.HasKey("bigPuzzCount"))
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1);
                }
                else
                {
                    FileBasedPrefs.SetInt("bigPuzzCount", 1);
                }
                Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount"));
                if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8)
                {
                    SteamHandler.instance.SetAch(SteamACH);
                }



                block.SetActive(false);
            }
        }
    }
Beispiel #26
0
 // Token: 0x06000A77 RID: 2679 RVA: 0x000410D8 File Offset: 0x0003F2D8
 private void OnLeftRoom()
 {
     if (FileBasedPrefs.GetInt("StayInServerRoom", 0) == 0)
     {
         if (XRDevice.isPresent)
         {
             this.localPlayer = Object.Instantiate <GameObject>(this.vrPlayerModel, this.spawns[Random.Range(0, this.spawns.Count)].position, Quaternion.identity).GetComponent <Player>();
         }
         else
         {
             this.localPlayer = Object.Instantiate <GameObject>(this.pcPlayerModel, this.spawns[Random.Range(0, this.spawns.Count)].position, Quaternion.identity).GetComponent <Player>();
             this.pcManager.SetValues();
         }
     }
     if (FileBasedPrefs.GetInt("MissionStatus", 0) == 3)
     {
         this.LoadRewardScreens();
     }
 }
    void IntTests()
    {
        FileBasedPrefs.SetInt("test", 1);

        if (!FileBasedPrefs.GetInt("test").Equals(1))
        {
            Debug.LogException(new System.Exception("SetIntFailed"));
            return;
        }

        FileBasedPrefs.SetInt("test", 2);

        if (!FileBasedPrefs.GetInt("test").Equals(2))
        {
            Debug.LogException(new System.Exception("ReplaceIntFailed"));
            return;
        }

        if (!FileBasedPrefs.HasKeyForInt("test"))
        {
            Debug.LogException(new System.Exception("HasKeyForIntFailed"));
            return;
        }

        FileBasedPrefs.DeleteInt("test");

        if (!FileBasedPrefs.GetInt("test").Equals(0))
        {
            Debug.LogException(new System.Exception("DeleteIntFailed"));
            return;
        }

        FileBasedPrefs.SetInt("test", 333);

        if (!FileBasedPrefs.GetInt("test").Equals(333))
        {
            Debug.LogException(new System.Exception("ReplaceIntFailed"));
            return;
        }

        Debug.Log("Int Tests Passed");
    }
    //! Loads data from .sav file.
    private void LoadDataFromFile()
    {
        inventory = new InventorySlot[16];
        int count = 0;

        while (count <= 15)
        {
            inventory[count] = gameObject.AddComponent <InventorySlot>();
            string countType = FileBasedPrefs.GetString(stateManager.worldName + "inventory" + ID + "slot" + count + "type");
            if (!countType.Equals(""))
            {
                inventory[count].typeInSlot   = FileBasedPrefs.GetString(stateManager.worldName + "inventory" + ID + "slot" + count + "type");
                inventory[count].amountInSlot = FileBasedPrefs.GetInt(stateManager.worldName + "inventory" + ID + "slot" + count + "amount");
            }
            count++;
        }
        originalID   = ID;
        initialized  = true;
        maxStackSize = ID.Equals("Rocket") ? 100000 : 1000;
    }
Beispiel #29
0
 //! Called once per frame by unity engine.
 public void Update()
 {
     if (!playerController.stateManager.Busy() == true && loadedValues == false)
     {
         Dictionary <string, int> pd = new Dictionary <string, int>();
         foreach (KeyValuePair <string, int> i in priceDictionary)
         {
             if (FileBasedPrefs.GetInt(i.Key) != 0)
             {
                 pd.Add(i.Key, FileBasedPrefs.GetInt(i.Key));
             }
             else
             {
                 pd.Add(i.Key, i.Value);
             }
         }
         priceDictionary = pd;
         loadedValues    = true;
     }
 }
Beispiel #30
0
        IEnumerator waitForAnim()
        {
            yield return(new WaitForSeconds(0.4f));

            SteamHandler.instance.SetAch(SteamACH1);
            OpenBox.SetActive(true);
            if (FileBasedPrefs.HasKey("bigPuzzCount"))
            {
                FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1);
            }
            else
            {
                FileBasedPrefs.SetInt("bigPuzzCount", 1);
            }
            Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount"));
            if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8)
            {
                SteamHandler.instance.SetAch(SteamACH);
            }

            FileBasedPrefs.SetString(this.gameObject.name, "Done");
            puzzleBox.SetActive(false);
        }