private void GameOver() { showAd = true; GameOverPanel.SetActive(true); powerPanel.SetActive(false); ProtectedPrefs.SetInt("Coins", lcoin + coin); goCoin.text = "Coins: " + coin.ToString(); goScore.text = "Score: " + Controller.Distance.ToString("f0") + "0"; if (Controller.Distance > ProtectedPrefs.GetFloat("HighScore")) { ProtectedPrefs.SetFloat("HighScore", Controller.Distance); } if (ProtectedPrefs.HasKey("HighScore")) { goBScore.text = "Best Score: " + ProtectedPrefs.GetFloat("HighScore").ToString("f0") + "0"; } else { goBScore.text = "Best Score: " + Controller.Distance.ToString("f0") + "0"; } if (FB.IsLoggedIn) { #if !UNITY_EDITOR StartCoroutine(Facebook.Unity.FBManager.SetScore()); #endif } }
void Load() { DaysCount = ProtectedPrefs.GetInt("DaysCount"); if (ProtectedPrefs.HasKey("LastGiftDateTime")) { LastGiftDateTime = DateTime.Parse(ProtectedPrefs.GetString("LastGiftDateTime")); } }
public void GetLamp() { if (ProtectedPrefs.HasKey("mLamp")) { lCount = ProtectedPrefs.GetInt("mLamp"); } else { lCount = 0; } itemAbsorb.getLamp = false; lamlCount.text = lCount.ToString(); }
void Start() { //ProtectedPrefs.SetInt("Coins", 50000000); animationManager = this.GetComponent <AnimationManager>(); store = false; curObjectNumber = 0; knifSelect = capSelect = otherSelect = false; if (!ProtectedPrefs.HasKey("Characters")) { ProtectedPrefs.SetInt("Characters", 0); ProtectedPrefs.SetInt("Cap", 0); ProtectedPrefs.SetInt("Character1", 1); ProtectedPrefs.SetInt("Cap1", 1); } }
void Start() { instance = this; check = false; if (ProtectedPrefs.HasKey("login")) { lg = ProtectedPrefs.GetInt("login"); } if (lg == 0) { login = false; } else { login = true; } }
void Start() { fb = false; if (ProtectedPrefs.HasKey("Mute")) { if (ProtectedPrefs.GetInt("Mute") == 0) { bAudio.mute = true; muteBtn.SetActive(true); uMuteBtn.SetActive(false); } else { bAudio.mute = false; uMuteBtn.SetActive(true); muteBtn.SetActive(false); } } }
void Start() { freecoin = false; if (ProtectedPrefs.HasKey("Coins")) { coinsc2 = ProtectedPrefs.GetInt("Coins"); } else { coinsc2 = 0; } BookCount = ProtectedPrefs.GetInt("mBook"); GoldCount = ProtectedPrefs.GetInt("mGold"); EmeraldCount = ProtectedPrefs.GetInt("mEmerald"); PipeCount = ProtectedPrefs.GetInt("mPipe"); bonuseNumber = Random.Range(0, 7); switch (bonuseNumber) { case 1: bonusName = "Take 250 coins"; break; case 2: bonusName = "Take 3 books"; break; case 3: bonusName = "Take 2 pipes"; break; case 4: bonusName = "Take 4 emeralds"; break; case 5: bonusName = "Take 2 golds"; break; default: bonusName = "Take 100 coins"; break; } }
void Start() { coin = 0; changeScorecolor = false; distance.color = new Color(1, 1, 1, 1); pause = false; showAd = false; al = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioListener>(); al.enabled = true; if (ProtectedPrefs.HasKey("Coins")) { lcoin = ProtectedPrefs.GetInt("Coins"); } else { lcoin = 0; } GetLamp(); sl = saveButton.GetComponent <Image>(); }
void Start() { doubleCoin = false; cointimer = 0f; if (!ProtectedPrefs.HasKey("mBook")) { ProtectedPrefs.SetInt("mBook", 0); } if (!ProtectedPrefs.HasKey("mPipe")) { ProtectedPrefs.SetInt("mPipe", 0); } if (!ProtectedPrefs.HasKey("mEmerald")) { ProtectedPrefs.SetInt("mEmerald", 0); } if (!ProtectedPrefs.HasKey("mGold")) { ProtectedPrefs.SetInt("mGold", 0); } if (!ProtectedPrefs.HasKey("mKalyan")) { ProtectedPrefs.SetInt("mKalyan", 0); } if (!ProtectedPrefs.HasKey("mLamp")) { ProtectedPrefs.SetInt("mLamp", 0); } if (!ProtectedPrefs.HasKey("mRubin")) { ProtectedPrefs.SetInt("mRubin", 0); } if (!ProtectedPrefs.HasKey("mUrna")) { ProtectedPrefs.SetInt("mUrna", 0); } if (!ProtectedPrefs.HasKey("mVaza")) { ProtectedPrefs.SetInt("mVaza", 0); } }
void Awake() { if (!ProtectedPrefs.HasKey("mb")) { ProtectedPrefs.SetInt("mb", 0); } if (!ProtectedPrefs.HasKey("mp")) { ProtectedPrefs.SetInt("mp", 0); } if (!ProtectedPrefs.HasKey("me")) { ProtectedPrefs.SetInt("me", 0); } if (!ProtectedPrefs.HasKey("mg")) { ProtectedPrefs.SetInt("mg", 0); } if (!ProtectedPrefs.HasKey("mk")) { ProtectedPrefs.SetInt("mk", 0); } if (!ProtectedPrefs.HasKey("mr")) { ProtectedPrefs.SetInt("mr", 0); } if (!ProtectedPrefs.HasKey("mu")) { ProtectedPrefs.SetInt("mu", 0); } if (!ProtectedPrefs.HasKey("mv")) { ProtectedPrefs.SetInt("mv", 0); } if (!ProtectedPrefs.HasKey("cc")) { ProtectedPrefs.SetInt("cc", 0); } }
IEnumerator Background() { yield return(new WaitForSeconds(.1f)); go = new GameObject("Audio Background"); sourcebg = go.AddComponent <AudioSource>(); sourcebg.clip = backgroundClip; sourcebg.volume = 0.5f; sourcebg.loop = true; if (ProtectedPrefs.HasKey("Mute")) { if (ProtectedPrefs.GetInt("Mute") == 0) { sourcebg.mute = true; } else { sourcebg.mute = false; } } sourcebg.Play(); }
void Update() { if (Input.GetKey(KeyCode.Escape)) { mainPanel.SetActive(false); quitPanel.SetActive(true); fbWindow.SetActive(false); fbNotLog.SetActive(false); leaderBoard.SetActive(false); storeWindow.SetActive(false); cameraSecond.SetActive(false); iapPanel.SetActive(false); } if (!Facebook.Unity.FBManager.login) { fbWindow.SetActive(false); } else { fbNotLog.SetActive(false); } if (ProtectedPrefs.GetInt("bunner") == 0) { tnoAds.text = "999000"; } else { tnoAds.text = "Full!"; } if (ProtectedPrefs.HasKey("Coins")) { coins.text = ProtectedPrefs.GetInt("Coins").ToString(); } if (ProtectedPrefs.HasKey("m_LvL")) { magLevel = ProtectedPrefs.GetInt("m_LvL"); } else { magLevel = 0; magnetP.fillAmount = 0f; tMagnit.text = "750"; } if (magLevel == 1) { magnetP.fillAmount = 0.2f; tMagnit.text = "2 500"; } else if (magLevel == 2) { magnetP.fillAmount = 0.4f; tMagnit.text = "5 000"; } else if (magLevel == 3) { magnetP.fillAmount = 0.6f; tMagnit.text = "7 500"; } else if (magLevel == 4) { magnetP.fillAmount = 0.8f; tMagnit.text = "10 000"; } else if (magLevel == 5) { magnetP.fillAmount = 1f; tMagnit.text = "Full!"; } if (ProtectedPrefs.HasKey("b_LvL")) { botLevel = ProtectedPrefs.GetInt("b_LvL"); } else { botLevel = 0; ShouseP.fillAmount = 0f; tShouses.text = "750"; } if (botLevel == 1) { ShouseP.fillAmount = 0.2f; tShouses.text = "2 500"; } else if (botLevel == 2) { ShouseP.fillAmount = 0.4f; tShouses.text = "5 000"; } else if (botLevel == 3) { ShouseP.fillAmount = 0.6f; tShouses.text = "7 500"; } else if (botLevel == 4) { ShouseP.fillAmount = 0.8f; tShouses.text = "10 000"; } else if (botLevel == 5) { ShouseP.fillAmount = 1f; tShouses.text = "Full!"; } if (ProtectedPrefs.HasKey("k_LvL")) { koverLevel = ProtectedPrefs.GetInt("k_LvL"); } else { koverLevel = 0; KoverP.fillAmount = 0f; tKover.text = "750"; } if (koverLevel == 1) { KoverP.fillAmount = 0.2f; tKover.text = "2 500"; } else if (koverLevel == 2) { KoverP.fillAmount = 0.4f; tKover.text = "5 000"; } else if (koverLevel == 3) { KoverP.fillAmount = 0.6f; tKover.text = "7 500"; } else if (koverLevel == 4) { KoverP.fillAmount = 0.8f; tKover.text = "10 000"; } else if (koverLevel == 5) { KoverP.fillAmount = 1f; tKover.text = "Full!"; } if (ProtectedPrefs.HasKey("d_LvL")) { dcLevel = ProtectedPrefs.GetInt("d_LvL"); } else { dcLevel = 0; dcP.fillAmount = 0f; tdoublecoin.text = "750"; } if (dcLevel == 1) { dcP.fillAmount = 0.2f; tdoublecoin.text = "2 500"; } else if (dcLevel == 2) { dcP.fillAmount = 0.4f; tdoublecoin.text = "5 000"; } else if (dcLevel == 3) { dcP.fillAmount = 0.6f; tdoublecoin.text = "7 500"; } else if (dcLevel == 4) { dcP.fillAmount = 0.8f; tdoublecoin.text = "10 000"; } else if (dcLevel == 5) { dcP.fillAmount = 1f; tdoublecoin.text = "Full!"; } }
void Update() { if (Input.GetKey(KeyCode.Escape)) { CloseStore(); } if (store) { if (curObjectNumber < 0) { curObjectNumber = 0; } if (ProtectedPrefs.GetInt("Characters") == 2 && ProtectedPrefs.GetInt("Cap") == 0) { caps[0].SetActive(false); capChar3.SetActive(true); } else { capChar3.SetActive(false); } if (!charSelect) { if (ProtectedPrefs.GetInt("Player") == 1) { characters[0].SetActive(true); characters[1].SetActive(false); characters[2].SetActive(false); characters[3].SetActive(false); bear.SetActive(false); jacket[0].SetActive(false); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(false); belt[2].SetActive(false); MaskAnonim.SetActive(false); } else if (ProtectedPrefs.GetInt("Player") == 2) { characters[0].SetActive(false); characters[1].SetActive(true); characters[2].SetActive(false); characters[3].SetActive(false); bear.SetActive(true); jacket[0].SetActive(false); jacket[1].SetActive(true); belt[0].SetActive(true); belt[1].SetActive(false); belt[2].SetActive(false); MaskAnonim.SetActive(false); } else if (ProtectedPrefs.GetInt("Player") == 3) { characters[0].SetActive(false); characters[1].SetActive(false); characters[2].SetActive(true); characters[3].SetActive(false); bear.SetActive(false); jacket[0].SetActive(false); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(true); belt[2].SetActive(false); MaskAnonim.SetActive(false); } else if (ProtectedPrefs.GetInt("Player") == 4) { characters[0].SetActive(false); characters[1].SetActive(false); characters[2].SetActive(false); characters[3].SetActive(true); bear.SetActive(false); jacket[0].SetActive(true); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(false); belt[2].SetActive(true); MaskAnonim.SetActive(true); ocular.SetActive(false); } else { characters[0].SetActive(true); characters[1].SetActive(false); characters[2].SetActive(false); characters[3].SetActive(false); bear.SetActive(false); jacket[0].SetActive(false); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(false); belt[2].SetActive(false); MaskAnonim.SetActive(false); } } else { if (curObjectNumber > characters.Length - 1) { curObjectNumber = characters.Length - 1; } for (int c = 0; c < characters.Length; c++) { if (c == curObjectNumber) { characters[c].SetActive(true); } else { characters[c].SetActive(false); } } if (curObjectNumber == 0) { caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); bear.SetActive(false); jacket[0].SetActive(false); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(false); belt[2].SetActive(false); MaskAnonim.SetActive(false); clothName.text = "Rifat"; Price.text = ""; charId = 0; if (ProtectedPrefs.GetInt("Character1") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } } else if (curObjectNumber == 1) { caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); bear.SetActive(true); jacket[0].SetActive(false); jacket[1].SetActive(true); belt[0].SetActive(true); belt[1].SetActive(false); belt[2].SetActive(false); MaskAnonim.SetActive(false); clothName.text = "Alim"; Price.text = "170 000"; charId = 1; if (ProtectedPrefs.GetInt("Character2") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } } else if (curObjectNumber == 2) { caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); bear.SetActive(false); jacket[0].SetActive(false); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(true); belt[2].SetActive(false); MaskAnonim.SetActive(false); clothName.text = "Umar"; Price.text = "1 250 000"; charId = 2; if (ProtectedPrefs.GetInt("Character3") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } } else if (curObjectNumber == 3) { caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); bear.SetActive(false); ocular.SetActive(false); jacket[0].SetActive(true); jacket[1].SetActive(false); belt[0].SetActive(false); belt[1].SetActive(false); belt[2].SetActive(true); MaskAnonim.SetActive(true); clothName.text = "Shamil'"; Price.text = "600 000"; charId = 3; if (ProtectedPrefs.GetInt("Character4") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } } if (curObjectNumber == 2 && ProtectedPrefs.GetInt("Cap") == 0) { caps[0].SetActive(false); capChar3.SetActive(true); } else { capChar3.SetActive(false); } } if (!capSelect) { if (ProtectedPrefs.HasKey("Cap")) { for (int i = 0; i < caps.Length; i++) { if (ProtectedPrefs.GetInt("Cap") == i) { if (i == 0 && curObjectNumber == 2 && charSelect) { capChar3.SetActive(true); caps[i].SetActive(false); } else { capChar3.SetActive(false); caps[i].SetActive(true); } } else { caps[i].SetActive(false); } } } } else { if (curObjectNumber > caps.Length - 1) { curObjectNumber = caps.Length - 1; } for (int cp = 0; cp < caps.Length; cp++) { if (cp == curObjectNumber) { Price.text = (curObjectNumber + 1) * 35 + " 000"; if (cp == 0 && ProtectedPrefs.GetInt("Characters") == 2) { capChar3.SetActive(true); caps[cp].SetActive(false); } else { capChar3.SetActive(false); caps[cp].SetActive(true); } } else { caps[cp].SetActive(false); } } clothName.text = "Helmet " + (curObjectNumber + 1); capId = curObjectNumber; switch (curObjectNumber) { case 0: if (ProtectedPrefs.GetInt("Cap1") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 1: if (ProtectedPrefs.GetInt("Cap2") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 2: if (ProtectedPrefs.GetInt("Cap3") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 3: if (ProtectedPrefs.GetInt("Cap4") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; } } if (!knifSelect) { if (ProtectedPrefs.HasKey("Knife")) { for (int i = 0; i < knifes.Length; i++) { if (ProtectedPrefs.GetInt("Knife") == i) { knifes[ProtectedPrefs.GetInt("Knife")].SetActive(true); } else { knifes[i].SetActive(false); } } } else { for (int i = 0; i < knifes.Length; i++) { knifes[i].SetActive(false); } } } else { if (curObjectNumber > knifes.Length - 1) { curObjectNumber = knifes.Length - 1; } if (ProtectedPrefs.GetInt("Cap") == 0 && ProtectedPrefs.GetInt("Characters") == 2) { capChar3.SetActive(true); caps[0].SetActive(false); } else { capChar3.SetActive(false); caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); } for (int cp = 0; cp < knifes.Length; cp++) { Price.text = (curObjectNumber + 1) * 15 + " 000"; if (cp == curObjectNumber) { knifes[cp].SetActive(true); } else { knifes[cp].SetActive(false); } clothName.text = "Whinger " + (curObjectNumber + 1); knifeId = curObjectNumber; } switch (curObjectNumber) { case 0: if (ProtectedPrefs.GetInt("Knife1") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 1: if (ProtectedPrefs.GetInt("Knife2") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 2: if (ProtectedPrefs.GetInt("Knife3") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 3: if (ProtectedPrefs.GetInt("Knife4") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; case 4: if (ProtectedPrefs.GetInt("Knife5") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); } else { selectBtn.SetActive(false); buyBtn.SetActive(true); } break; } } if (!otherSelect) { if (ProtectedPrefs.HasKey("Clock")) { clock.SetActive(true); } else { clock.SetActive(false); } if (ProtectedPrefs.HasKey("Ak47")) { ak47.SetActive(true); } else { ak47.SetActive(false); } if (ProtectedPrefs.HasKey("Oculus")) { ocular.SetActive(true); } else { ocular.SetActive(false); } SelectButtonText.text = "Select"; } else { if (ProtectedPrefs.GetInt("Player") == 4) { if (curObjectNumber > 1) { curObjectNumber = 1; } } else { if (curObjectNumber > 2) { curObjectNumber = 2; } } if (curObjectNumber == 0) { Price.text = "200 000"; if (ProtectedPrefs.GetInt("Clock1") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); if (ProtectedPrefs.GetInt("ClockStart") == 1) { SelectButtonText.text = "Drop"; clock.SetActive(true); } else { SelectButtonText.text = "Select"; clock.SetActive(false); } } else { selectBtn.SetActive(false); buyBtn.SetActive(true); clock.SetActive(true); } } else if (curObjectNumber == 1) { Price.text = "1 500 000"; if (ProtectedPrefs.GetInt("Ak471") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); if (ProtectedPrefs.GetInt("AkStart") == 1) { SelectButtonText.text = "Drop"; ak47.SetActive(true); } else { SelectButtonText.text = "Select"; ak47.SetActive(false); } } else { selectBtn.SetActive(false); buyBtn.SetActive(true); ak47.SetActive(true); } } else if (curObjectNumber == 2) { Price.text = "350 000"; if (ProtectedPrefs.GetInt("Oculus1") == 1) { selectBtn.SetActive(true); buyBtn.SetActive(false); if (ProtectedPrefs.GetInt("SpectatesStart") == 1) { SelectButtonText.text = "Drop"; ocular.SetActive(true); } else { SelectButtonText.text = "Select"; ocular.SetActive(false); } } else { selectBtn.SetActive(false); buyBtn.SetActive(true); ocular.SetActive(true); } } if (ProtectedPrefs.GetInt("Cap") == 0 && ProtectedPrefs.GetInt("Characters") == 2) { capChar3.SetActive(true); caps[0].SetActive(false); } else { capChar3.SetActive(false); caps[ProtectedPrefs.GetInt("Cap")].SetActive(true); } if (0 == curObjectNumber) { ak47.SetActive(false); ocular.SetActive(false); clothName.text = "Gold clock"; } else if (1 == curObjectNumber) { clock.SetActive(false); ocular.SetActive(false); clothName.text = "Premium gold AK-74"; } else if (2 == curObjectNumber) { clock.SetActive(false); ak47.SetActive(false); clothName.text = "Gold sunglasses"; } } //******************************************************// } //if (ProtectedPrefs.GetInt("Character4") == 1) { ocular.SetActive(false); } }
void Awake() { if (ProtectedPrefs.HasKey("Coins")) { coinGift = ProtectedPrefs.GetInt("Coins"); } this.Start((days) => { days++; switch (days) { case 1: giftText.text = "DAY 1: Your bonus + 300 Coin"; ProtectedPrefs.SetInt("Coins", coinGift + 300); giftProgress.size = 0.2f; break; case 2: giftText.text = "DAY 2: Your bonus + 900 Coin"; ProtectedPrefs.SetInt("Coins", coinGift + 900); giftProgress.size = 0.4f; break; case 3: giftText.text = "DAY 3: Your bonus + 1500 Coin"; ProtectedPrefs.SetInt("Coins", coinGift + 1500); giftProgress.size = 0.6f; break; case 4: giftText.text = "DAY 4: Your bonus + 2000 Coin"; ProtectedPrefs.SetInt("Coins", coinGift + 2000); giftProgress.size = 0.8f; break; case 5: giftText.text = "DAY 5: Your bonus + 5000 Coin"; ProtectedPrefs.SetInt("Coins", coinGift + 5000); giftProgress.size = 1.0f; break; } }, 5, new [] { "1 Day", "2 Day", "3 Day", "4 Day", "5 Day" }, new [] { "300 GOlD", "900 GOlD", "1500 GOlD", "2000 GOlD", "5000 GOlD" } ); }