void Update() { if (PlayerPrefsBool.GetBool(packOfObjects.name) == true) { buyButton.sprite = purchased; } }
void Update() { if (PlayerPrefsBool.GetBool("Pack") == true && PlayerPrefsBool.GetBool("Pack (1)") == true && PlayerPrefsBool.GetBool("Pack (2)") == true) { buyButton.sprite = purchased; } }
public void NextLevelBtn() { if (Application.loadedLevelName == "Level3Beta") { GameObject.FindGameObjectWithTag(Constants.Tags.WindowManager).GetComponent <WindowHandler>().CreateInfoDialog("Phrases/LastLevelHeader", "Phrases/LastLevelInfo", "Phrases/LastLevelButton", MainMenuBtn); return; } if (NextLevel == "Level3Beta" && !PlayerPrefsBool.GetBool("Level7")) { var bls = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).GetComponent <BuyLevelSeven>(); if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= bls.cost) { bls.DoYouWannaBuy(); } else { bls.NotEnoughOrbs(); } } else { Application.LoadLevel(NextLevel); } }
// Use this for initialization void Start() { if (PlayerPrefsBool.GetBool("firstTime")) { PlayerPrefsBool.SetBool("firstTime", false); TutShopController.tutorial = true; } }
void IsBought() { if (PlayerPrefsBool.GetBool(packOfObjects.name) == true) { buyButton.sprite = purchased; APack(packOfObjects); } }
void Awake() { audioSource = GetComponent <AudioSource>(); bool On = (PlayerPrefsBool.HasBoolKey("Music"))?PlayerPrefsBool.GetBool("Music"):true; float v = (On)?1f:0f; SetVolume(v); }
//GameObject hat; void Start() { Hat.SetActive(false); if (PlayerPrefsBool.GetBool(gameObject.tag + Constants.ShopItems.Hat)) { Hat.SetActive(true); Hat.GetComponent <Renderer>().material.color = Color.blue; } }
void IsBought() { if (PlayerPrefsBool.GetBool("Pack (3)") == true && PlayerPrefsBool.GetBool("Pack (4)") == true && PlayerPrefsBool.GetBool("Pack (5)") == true) { buyButton.sprite = purchased; APack(pack3); APack(pack4); APack(pack5); } }
void IsBought() { if (PlayerPrefsBool.GetBool("Pack") == true && PlayerPrefsBool.GetBool("Pack (1)") == true && PlayerPrefsBool.GetBool("Pack (2)") == true) { buyButton.sprite = purchased; APack(pack); APack(pack1); APack(pack2); } }
public void RefreshAchievements() { if (LeverPulls.leverpulls == 7 && !PlayerPrefsBool.GetBool(achievement.name)) { PlayerPrefsBool.SetBool(achievement.name, true); achievement.SetActive(true); } else { achievement.SetActive(false); } }
/// <summary> /// determine if the level has been won /// </summary> /// <returns><c>true</c>, if won was ised, <c>false</c> otherwise.</returns> /// <param name="LevelNum">Level number.</param> public static bool isWon(int LevelNum) { string PPLevelKey = getPPLevelKey(LevelNum); if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isWon")) { return(PlayerPrefsBool.GetBool(PPLevelKey + "isWon")); } else { PlayerPrefsBool.SetBool(PPLevelKey + "isWon", false); return(false); } }
/// <summary> /// determine if the Level is Locked /// </summary> /// <returns><c>true</c>, if locked was ised, <c>false</c> otherwise.</returns> /// <param name="LevelNum">Level number.</param> public static bool isLocked(int LevelNum) { string PPLevelKey = getPPLevelKey(LevelNum); if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked")) { return(PlayerPrefsBool.GetBool(PPLevelKey + "isLocked")); } else { PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", true); return(true); } }
/// <summary> /// Whether the star animation will be played /// </summary> /// <returns><c>true</c>, if animate stars was gotten, <c>false</c> otherwise.</returns> /// <param name="LevelNum">Level number.</param> public static bool getAnimateStars(int LevelNum) { string PPLevelKey = getPPLevelKey(LevelNum); if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "animateStars")) { return(PlayerPrefsBool.GetBool(PPLevelKey + "animateStars")); } else { PlayerPrefsBool.SetBool(PPLevelKey + "animateStars", false); return(false); } }
void OnTriggerEnter2D(Collider2D colObj) { if (colObj.tag == "Player") { if (!PlayerPrefsBool.GetBool("hype2")) { text.enabled = true; particles.Play(); } else { text.enabled = true; text.text = "OWNED"; } } }
/// <summary> /// Calculates the sum of all levels won /// </summary> /// <returns>The sum.</returns> public static int WinSum() { int result = 0; int LevelNum = 1; string PPLevelKey = getPPLevelKey(LevelNum); while (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isWon")) { result += (PlayerPrefsBool.GetBool(PPLevelKey + "isWon"))? 1: 0; LevelNum++; PPLevelKey = getPPLevelKey(LevelNum); } return(result); }
//set up everything on start void Start() { On = (PlayerPrefsBool.HasBoolKey(Key))?PlayerPrefsBool.GetBool(Key):true; image.sprite = (On)?OnSprite:OffSprite; float v = (On)?1f:0f; if (Key == "Music") { MusicManager.Instance.SetVolume(v); } else if (Key == "Sound") { SoundManager.Instance.SetVolume(v); } }
void OnTriggerStay2D(Collider2D colObj) { if (colObj.tag == "Player") { if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("hype1") && (PlayerPrefs.GetInt("lifetimeLoot") - price) >= 0) { text.enabled = false; PlayerPrefsBool.SetBool("hype1", true); particles.Stop(); PlayerPrefs.SetInt("lifetimeLoot", (PlayerPrefs.GetInt("lifetimeLoot") - price)); HYPEController.HYPEMode = gameObject.GetComponentInParent <Shop>().HYPEColor; } if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("hype1")) { HYPEController.HYPEMode = gameObject.GetComponentInParent <Shop>().HYPEColor; } } }
void OnTriggerStay2D(Collider2D colObj) { if (colObj.tag == "Player") { if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("skin3") && (PlayerPrefs.GetInt("lifetimeLoot") - price) >= 0) { text.enabled = false; PlayerPrefsBool.SetBool("skin3", true); particles.Stop(); PlayerPrefs.SetInt("lifetimeLoot", (PlayerPrefs.GetInt("lifetimeLoot") - price)); arm.GetComponentInParent <SpriteRenderer>().sprite = gunArm; gameObject.GetComponentInParent <Shop>().player.GetComponent <Animator>().runtimeAnimatorController = gameObject.GetComponentInParent <Shop>().skin; } if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("skin3") == true) { arm.GetComponentInParent <SpriteRenderer>().sprite = gunArm; gameObject.GetComponentInParent <Shop>().player.GetComponent <Animator>().runtimeAnimatorController = gameObject.GetComponentInParent <Shop>().skin; } } }
/// <summary> /// Sets the lock to a level /// </summary> /// <param name="LevelNum">Level number.</param> /// <param name="Locked">If set to <c>true</c> locked.</param> public static void setLock(int LevelNum, bool isLocked) { string PPLevelKey = getPPLevelKey(LevelNum); if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked")) { if ( PlayerPrefsBool.GetBool(PPLevelKey + "isLocked") && isLocked == false ) { AnimateUnlock(LevelNum, true); } PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", isLocked); } else { PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", true); } }
/// <summary> /// Gets the max unlocked level. /// </summary> /// <returns>The max unlocked level.</returns> public static int getMaxUnlockedLevel() { int result = 0; int LevelNum = 1; string PPLevelKey = getPPLevelKey(LevelNum); while (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked")) { if ( !PlayerPrefsBool.GetBool(PPLevelKey + "isLocked") && LevelNum >= result ) { result = LevelNum; } LevelNum++; PPLevelKey = getPPLevelKey(LevelNum); } return(result); }
public void BuyThisItem() { if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && PlayerPrefsBool.GetBool(packOfObjects.name) == false) { PlayerPrefsBool.SetBool(packOfObjects.name, true); am.ClickBtnPlay(); IsBought(); PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost); } else { Debug.Log("YOU DONT HAVE SO MUCH MONEY"); } }
public void BuyThisItem() { if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && (PlayerPrefsBool.GetBool("Pack") == false || PlayerPrefsBool.GetBool("Pack (1)") == false || PlayerPrefsBool.GetBool("Pack (2)") == false)) { PlayerPrefsBool.SetBool("Pack", true); PlayerPrefsBool.SetBool("Pack (1)", true); PlayerPrefsBool.SetBool("Pack (2)", true); PlayerPrefsBool.SetBool("Pack123", true); am.ClickBtnPlay(); IsBought(); PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost); } else { Debug.Log("YOU DONT HAVE SO MUCH MONEY"); } }
void UnlockLevelSeven() { if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && PlayerPrefsBool.GetBool("Level7") == false) { PlayerPrefsBool.SetBool("Level7", true); Userlevels.GetInstance().AddUserLevel("7"); PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost); if (ls != null) { ls.GetComponent <LevelSelector>().UpdateLevels(); } else { Application.LoadLevel("Level3Beta"); } } }