private void SetBag() { BagElement bgE; for (int i = 0; i < 4; i++) { bgE = new BagElement(); bgE.isLocked = false; bgE.bagEType = BagElementType.Tools; bgE.elementTypeIndex = i; bgE.count = 1; bagL.Add(bgE); } int bagUpgradeLevel = StoreInventory.GetGoodUpgradeLevel(AnimineStoreAssets.BAG_VG_ITEM_ID); bagCapacity = (bagUpgradeLevel * 2 + 2) * 10; for (int i = 4; i < bagUpgradeLevel * 2 + 6; i++) { bgE = new BagElement(); bgE.isLocked = false; bagL.Add(bgE); } for (int i = bagUpgradeLevel * 2 + 6; i < 16; i++) { bgE = new BagElement(); bgE.isLocked = true; bagL.Add(bgE); } refreashBag(); }
void OnEnable() { int batteryUpgradeIndex = StoreInventory.GetGoodUpgradeLevel(AnimineStoreAssets.BATTERY_VG_ITEM_ID); BATTERY_DURATION = Constants.BATTERY_DURATION[batteryUpgradeIndex]; StartCoroutine(countdown(BATTERY_DURATION * StoreInventory.GetItemBalance(AnimineStoreAssets.BATTERY_VG_ITEM_ID))); }
public void resetTimer() { //PauseGame(); string ItemId = AndysApplesAssets.LONGEVITY_GOOD.ItemId; int level = StoreInventory.GetGoodUpgradeLevel(ItemId); endSoundPlaying = !endSoundPlaying; //AndyUtils.LogDebug(TAG, "Setting time to default"); countDownSeconds = 60; if (db.getStatus(3)) // returns if longevity is on or off { if (level < 6) { countDownSeconds += (5 * level); } else { countDownSeconds += 25; } } //AndyUtils.LogDebug(TAG, "CountdownSeconds are now " + countDownSeconds); DisplayTimer(); //ResumeGame(); }
// Automatically run when a game starts void Awake() { Debug.Log(TAG + " first catch is " + firstCatch); GM_INDEX = (int)GAME_MODE; script = transform.parent.GetComponent <playerAnimController>(); score = int.Parse(textScore.text); combo = int.Parse(comboText.text); switch (Application.loadedLevel) { case 3: // Fast Apples gameNum = db.getValue("fa_games"); //AndyUtils.LogDebug(TAG,"Fast Apples games played: " + gameNum); if (gameNum > 0) { firstGame = false; highscore = db.getValue("fa_gamescore"); } break; case 4: // Perfectionist if (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.LONGEVITY_GOOD.ItemId) > 4) { lifeCounter = 5; } else { lifeCounter = 3; } timerText.text = lifeCounter.ToString(); timerText.Commit(); gameNum = db.getValue("p_games"); //AndyUtils.LogDebug(TAG,"Perfectionist games played: " + gameNum); if (gameNum > 0) { firstGame = false; highscore = db.getValue("p_gamescore"); } break; } #if UNITY_ANDROID TouchSenseSingleDevice device = new TouchSenseSingleDevice(0); //AndyUtils.LogDebug(TAG, "Device is " + device.name); //AndyUtils.LogDebug(TAG, "Device type is " + device.type.ToString()); Debug.Log(TAG + "Device is " + device.name); Debug.Log(TAG + "Device type is " + device.type.ToString()); if (device == null) { result = false; TouchSense.instance.hapticsEnabled = false; } #endif effectTimer = 5; }
private void SetDrillerStrength() { int drillerUpgradeLevel = StoreInventory.GetGoodUpgradeLevel(AnimineStoreAssets.DRILLER_VG_ITEM_ID); for (int i = 0; i < 8; i++) { int strength = Mathf.Min(7 + drillerUpgradeLevel, (int)(Constants.INTIAL_DRILLER_STRENGTH [i] + (drillerUpgradeLevel * (drillerUpgradeLevel + 1)) * 0.5f)); DRILLER_RATE [i] = Mathf.Max(0, strength); } }
public void ResetLives() { if ((StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.LONGEVITY_GOOD.ItemId) > 4) && optionDB.getStatus(3)) { lifeCounter = 5; } else { lifeCounter = 3; } DisplayLives(); }
// Use this for initialization void Start() { string ItemId = AndysApplesAssets.LONGEVITY_GOOD.ItemId; int level = StoreInventory.GetGoodUpgradeLevel(ItemId); textMesh = GetComponent <tk2dTextMesh> (); switch (colliderscript.GAME_MODE) { case AppleCollider.GAME_MODES.FAST_APPLES: if (level < 6) { countDownSeconds += (5 * level); textMesh.text = countDownSeconds.ToString(); } else { countDownSeconds += 25; textMesh.text = countDownSeconds.ToString(); } //countDownSeconds = 10; //AndyUtils.LogDebug(TAG, "CountdownSeconds are " + countDownSeconds); textMesh.text = countDownSeconds.ToString(); break; case AppleCollider.GAME_MODES.PERFECTIONIST: textMesh.text = colliderscript.lifeCounter.ToString(); break; } //AndyUtils.LogDebug(TAG, "Committing Text"); textMesh.Commit(); if (game_end != null && audio == null) { AudioSource source = gameObject.AddComponent <AudioSource> (); source.playOnAwake = false; } if (timerActive) { switch (colliderscript.GAME_MODE) { case AppleCollider.GAME_MODES.FAST_APPLES: InvokeRepeating("InitiateCountdown", 1.0f, 1.0f); break; case AppleCollider.GAME_MODES.PERFECTIONIST: InvokeRepeating("TimeGame", 1.0f, 1.0f); break; } } }
// Longevity Upgrade public void BuyUpgrade5() { string ItemId = AndysApplesAssets.LONGEVITY_GOOD.ItemId; int balance = StoreInventory.GetGoodUpgradeLevel(ItemId); if (balance < 6) { tracker.AddProgressToAchievement("Straight A's", 1.0f); tracker.StoreIAPprogress(); StoreInventory.UpgradeGood(ItemId); displayInfo(); } }
// Frenzy Upgrade public void BuyUpgrade1() { string ItemId = AndysApplesAssets.FRENZY_GOOD.ItemId; int balance = StoreInventory.GetGoodUpgradeLevel(ItemId); AndyUtils.LogDebug(TAG, "Frenzy Level = " + balance); if (balance < 6) { tracker.AddProgressToAchievement("Straight A's", 1.0f); tracker.StoreIAPprogress(); StoreInventory.UpgradeGood(ItemId); displayInfo(); } }
public void refreashBag(bool checkBagUpgrade = false) { bagL [(int)ToolType.Battery].count = StoreInventory.GetItemBalance(AnimineStoreAssets.BATTERY_VG_ITEM_ID); bagL [(int)ToolType.Dynamite].count = StoreInventory.GetItemBalance(AnimineStoreAssets.DYNAMITE_VG_ITEM_ID); if (checkBagUpgrade) { int bagUpgradeLevel = StoreInventory.GetGoodUpgradeLevel(AnimineStoreAssets.BAG_VG_ITEM_ID); bagCapacity = (bagUpgradeLevel * 2 + 2) * 10; BagElement bgE; for (int i = 4; i < bagUpgradeLevel * 2 + 6; i++) { bgE = bagL[i]; bgE.isLocked = false; bgE.count = 0; } } }
void bought(VirtualGood arg1, UpgradeVG arg2) { if (upgrades) { int upgdLevel = StoreInventory.GetGoodUpgradeLevel(id); if (upgdLevel == 5) { el_desc.text = LanguageManager.current.getText(LanguageNode.FullUpgraded); buy.gameObject.SetActive(false); el_upgradeMeter.fillAmount = 1f; } else { el_upgradeMeter.fillAmount = upgdLevel / 5f; el_price.text = AnimineStoreAssets.UPGRADE_PRICE [upgdLevel] + ""; } } }
void _OnElementBuy() { if (upgrades) { int upgdLevel = StoreInventory.GetGoodUpgradeLevel(id); if (StoreInventory.GetItemBalance(AnimineStoreAssets.GOLD_COIN_VC_ITEM_ID) >= AnimineStoreAssets.UPGRADE_PRICE[upgdLevel]) { StoreInventory.UpgradeGood(id); } } else { if (StoreInventory.CanAfford(id) && StoreInventory.GetItemBalance(id) < 5) { //MAudioManager.current.PlayFx (AudioName.PurchaseClick); StoreInventory.BuyItem(id); } } }
public void init(string id, int index, string name, string desc, ToolType tlType, Sprite img, bool upgrades = true) { this.index = index; this.id = id; el_name.text = name; el_img.sprite = img; this.toolType = tlType; this.upgrades = upgrades; el_upgradeMeter.gameObject.SetActive(upgrades); if (upgrades) { int upgdLevel = StoreInventory.GetGoodUpgradeLevel(id); if (upgdLevel == 5) { el_desc.text = LanguageManager.current.getText(LanguageNode.FullUpgraded); buy.gameObject.SetActive(false); el_upgradeMeter.fillAmount = 1f; } else { el_desc.text = desc; el_price.text = AnimineStoreAssets.UPGRADE_PRICE [upgdLevel] + ""; buy.onClick.AddListener(() => { _OnElementBuy(); }); } el_upgradeMeter.fillAmount = upgdLevel / 5f; } else { el_desc.text = desc; el_price.text = AnimineStoreAssets.TOOLS_PRICE[(int)toolType] + ""; buy.onClick.AddListener(() => { _OnElementBuy(); }); } }
/*--- Gold Effect Methods ---*/ #region Gold Effects Functions private void activateEffect() { string itemId = ""; goldEffectActive = true; MersenneTwister random = new MersenneTwister(); int index = random.Next(1, 5); if (!firstCatch) { Debug.Log(TAG + " first catch was " + firstCatch); firstCatch = !firstCatch; Debug.Log(TAG + " first catch is now " + firstCatch); if (effectTimer == 0) { effectTimer = 5; } switch (index) { case 1: //AndyUtils.LogDebug(TAG, "Index " + index + ": Frenzy"); animGold.gameObject.SetActive(true); animGold.Play("Frenzy"); // The delegate is used here to return to the previously // playing clip after the "hit" animation is done playing. animGold.animationCompleteDelegate = AnimFinishedDelegate; break; case 2: //AndyUtils.LogDebug(TAG, "Index " + index + ": Super Frenzy"); animGold.gameObject.SetActive(true); animGold.Play("Super Frenzy"); // The delegate is used here to return to the previously // playing clip after the "hit" animation is done playing. animGold.animationCompleteDelegate = AnimFinishedDelegate; break; case 3: //AndyUtils.LogDebug(TAG, "Index " + index + ": Double Points"); animGold.gameObject.SetActive(true); animGold.Play("Double"); // The delegate is used here to return to the previously // playing clip after the "hit" animation is done playing. animGold.animationCompleteDelegate = AnimFinishedDelegate; break; case 4: //AndyUtils.LogDebug(TAG, "Index " + index + ": Repellent"); animGold.gameObject.SetActive(true); animGold.Play("Repellent"); // The delegate is used here to return to the previously // playing clip after the "hit" animation is done playing. animGold.animationCompleteDelegate = AnimFinishedDelegate; break; } } // set the item id for the store invetory retrival switch (index) { case 1: // Frenzy //AndyUtils.LogDebug(TAG,"Current Effect Before:" + CURRENT_EFFECT); CURRENT_EFFECT = GOLD_EFFECTS.FRENZY; //AndyUtils.LogDebug(TAG,"Current Effect After:" + CURRENT_EFFECT); itemId = AndysApplesAssets.FRENZY_GOOD.ItemId; break; case 2: // Super Frenzy //AndyUtils.LogDebug(TAG,"Current Effect Before:" + CURRENT_EFFECT); CURRENT_EFFECT = GOLD_EFFECTS.SUPERFRENZY; //AndyUtils.LogDebug(TAG,"Current Effect After:" + CURRENT_EFFECT); itemId = AndysApplesAssets.SUPER_GOOD.ItemId; break; case 3: // Double Points //AndyUtils.LogDebug(TAG,"Current Effect Before:" + CURRENT_EFFECT); CURRENT_EFFECT = GOLD_EFFECTS.DOUBLE; //AndyUtils.LogDebug(TAG,"Current Effect After:" + CURRENT_EFFECT); itemId = AndysApplesAssets.DOUBLE_GOOD.ItemId; break; case 4: // Repellent //AndyUtils.LogDebug(TAG,"Current Effect Before:" + CURRENT_EFFECT); CURRENT_EFFECT = GOLD_EFFECTS.REPEL; //AndyUtils.LogDebug(TAG,"Current Effect After:" + CURRENT_EFFECT); itemId = AndysApplesAssets.REPELLENT_GOOD.ItemId; break; } //AndyUtils.LogDebug(TAG,"now adding to achievements"); achievementTracker.AddProgressToAchievement("Gold Standard", 1.0f); GE_INDEX = index; //AndyUtils.LogDebug(TAG,"now switching on/ Gold effect"); switch (CURRENT_EFFECT) { case GOLD_EFFECTS.FRENZY: achievementTracker.AddProgressToAchievement("Frenzy Fanatic", 1.0f); achievementTracker.AddProgressToAchievement("Fred's Frenzy Bonanaza", 1.0f); if (StoreInventory.GetGoodUpgradeLevel(itemId) < 6) { effectTimer += StoreInventory.GetGoodUpgradeLevel(itemId); } else { effectTimer += 5; } break; case GOLD_EFFECTS.SUPERFRENZY: achievementTracker.AddProgressToAchievement("Raining Combos", 1.0f); achievementTracker.AddProgressToAchievement("Super Frenzy Wizard", 1.0f); incrementSuperFrenzyAchievements(); if (StoreInventory.GetGoodUpgradeLevel(itemId) < 6) { effectTimer += StoreInventory.GetGoodUpgradeLevel(itemId); } else { effectTimer += 5; } break; case GOLD_EFFECTS.DOUBLE: achievementTracker.AddProgressToAchievement("Twice The Charm", 1.0f); achievementTracker.AddProgressToAchievement("2X Mastery", 1.0f); if (StoreInventory.GetGoodUpgradeLevel(itemId) < 6) { effectTimer += StoreInventory.GetGoodUpgradeLevel(itemId); } else { effectTimer += 5; } break; case GOLD_EFFECTS.REPEL: achievementTracker.AddProgressToAchievement("Honor System", 1.0f); achievementTracker.AddProgressToAchievement("No No to Rottens", 1.0f); if (StoreInventory.GetGoodUpgradeLevel(itemId) < 6) { effectTimer += StoreInventory.GetGoodUpgradeLevel(itemId); } else { effectTimer += 5; } break; default: break; } //AndyUtils.LogDebug(TAG,"Effect timer length for Gold Effect " + CURRENT_EFFECT + " is " + effectTimer + " seconds."); effectTimerCounter = effectTimer; Invoke("decrementEffectTimer", 1.0f); Invoke("deactivateEffect", (float)effectTimer); }
private void SetFanSpeed() { int fanUpgradeLevel = StoreInventory.GetGoodUpgradeLevel(AnimineStoreAssets.FAN_VG_ITEM_ID); _fanSpeed = Constants.FAN_SPEED[fanUpgradeLevel]; }
void displayInfo() { VirtualGood uVG; #region Frenzy Upgrades switch (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId)) { case 0: // Show info for Level 1 uVG = AndysApplesAssets.FRENZY_UPGRADE1; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; case 1: // Show info for Level 2 uVG = AndysApplesAssets.FRENZY_UPGRADE2; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; case 2: // Show info for Level 3 uVG = AndysApplesAssets.FRENZY_UPGRADE3; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; case 3: // Show info for Level 4 uVG = AndysApplesAssets.FRENZY_UPGRADE4; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; case 4: // Show info for Level 5 uVG = AndysApplesAssets.FRENZY_UPGRADE5; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; case 5: // Show info for Level 6 uVG = AndysApplesAssets.FRENZY_UPGRADE6; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = uVG.Description; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; default: // Show info for Fully Upgraded (Level 6) uVG = AndysApplesAssets.FRENZY_UPGRADE6; upgradeFrenzy.amount.text = "Lv " + StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.FRENZY_GOOD.ItemId).ToString(); upgradeFrenzy.description.text = "Fully Upgraded"; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); break; } #endregion #region Super Frenzy Upgrades switch (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.SUPER_GOOD.ItemId)) { case 0: // Show info for Level 1 uVG = AndysApplesAssets.SUPER_UPGRADE1; upgradeSuperFrenzy.amount.text = "Lv 0"; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; case 1: // Show info for Level 2 uVG = AndysApplesAssets.SUPER_UPGRADE2; upgradeSuperFrenzy.amount.text = "Lv 1"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; case 2: // Show info for Level 3 uVG = AndysApplesAssets.SUPER_UPGRADE3; upgradeSuperFrenzy.amount.text = "Lv 2"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; case 3: // Show info for Level 4 uVG = AndysApplesAssets.SUPER_UPGRADE4; upgradeSuperFrenzy.amount.text = "Lv 3"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; case 4: // Show info for Level 5 uVG = AndysApplesAssets.SUPER_UPGRADE5; upgradeSuperFrenzy.amount.text = "Lv 4"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; case 5: // Show info for Level 6 uVG = AndysApplesAssets.SUPER_UPGRADE6; upgradeSuperFrenzy.amount.text = "Lv 5"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = uVG.Description; break; default: // Show info for Fully Upgraded (Level 6) uVG = AndysApplesAssets.SUPER_UPGRADE6; upgradeSuperFrenzy.amount.text = "Lv 6"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeSuperFrenzy.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeSuperFrenzy.description.text = "Fully Upgraded"; break; } #endregion #region Double Points Upgrade switch (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.DOUBLE_GOOD.ItemId)) { case 0: // Show info for Level 1 uVG = AndysApplesAssets.DOUBLE_UPGRADE1; upgradeDoublePoints.amount.text = "Lv 0"; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; case 1: // Show info for Level 2 uVG = AndysApplesAssets.DOUBLE_UPGRADE2; upgradeDoublePoints.amount.text = "Lv 1"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; case 2: // Show info for Level 3 uVG = AndysApplesAssets.DOUBLE_UPGRADE3; upgradeDoublePoints.amount.text = "Lv 2"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; case 3: // Show info for Level 4 uVG = AndysApplesAssets.DOUBLE_UPGRADE4; upgradeDoublePoints.amount.text = "Lv 3"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; case 4: // Show info for Level 5 uVG = AndysApplesAssets.DOUBLE_UPGRADE5; upgradeDoublePoints.amount.text = "Lv 4"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; case 5: // Show info for Level 6 uVG = AndysApplesAssets.DOUBLE_UPGRADE6; upgradeDoublePoints.amount.text = "Lv 5"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = uVG.Description; break; default: // Show info for Fully Upgraded (Level 6) uVG = AndysApplesAssets.DOUBLE_UPGRADE6; upgradeDoublePoints.amount.text = "Lv 6"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeDoublePoints.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeDoublePoints.description.text = "Fully Upgraded"; break; } #endregion #region Repellent Upgrades switch (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.REPELLENT_GOOD.ItemId)) { case 0: // Show info for Level 1 uVG = AndysApplesAssets.REPELLENT_UPGRADE1; upgradeRepellent.amount.text = "Lv 0"; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; case 1: // Show info for Level 2 uVG = AndysApplesAssets.REPELLENT_UPGRADE2; upgradeRepellent.amount.text = "Lv 1"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; case 2: // Show info for Level 3 uVG = AndysApplesAssets.REPELLENT_UPGRADE3; upgradeRepellent.amount.text = "Lv 2"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; case 3: // Show info for Level 4 uVG = AndysApplesAssets.REPELLENT_UPGRADE4; upgradeRepellent.amount.text = "Lv 3"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; case 4: // Show info for Level 5 uVG = AndysApplesAssets.REPELLENT_UPGRADE5; upgradeRepellent.amount.text = "Lv 4"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; case 5: // Show info for Level 6 uVG = AndysApplesAssets.REPELLENT_UPGRADE6; upgradeRepellent.amount.text = "Lv 5"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = uVG.Description; break; default: // Show info for Fully Upgraded (Level 6) uVG = AndysApplesAssets.REPELLENT_UPGRADE6; upgradeRepellent.amount.text = "Lv 6"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeRepellent.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeRepellent.description.text = "Fully Upgraded"; break; } #endregion #region Longevity Upgrades switch (StoreInventory.GetGoodUpgradeLevel(AndysApplesAssets.LONGEVITY_GOOD.ItemId)) { case 0: // Show info for Level 1 uVG = AndysApplesAssets.LONGEVITY_UPGRADE1; upgradeLongevity.amount.text = "Lv 0"; AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; case 1: // Show info for Level 2 uVG = AndysApplesAssets.LONGEVITY_UPGRADE2; upgradeLongevity.amount.text = "Lv 1"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; case 2: // Show info for Level 3 uVG = AndysApplesAssets.LONGEVITY_UPGRADE3; upgradeLongevity.amount.text = "Lv 2"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; case 3: // Show info for Level 4 uVG = AndysApplesAssets.LONGEVITY_UPGRADE4; upgradeLongevity.amount.text = "Lv 3"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; case 4: // Show info for Level 5 uVG = AndysApplesAssets.LONGEVITY_UPGRADE5; upgradeLongevity.amount.text = "Lv 4"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; case 5: // Show info for Level 6 uVG = AndysApplesAssets.LONGEVITY_UPGRADE6; upgradeLongevity.amount.text = "Lv 5"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = uVG.Description; break; default: // Show info for Fully Upgraded (Level 6) uVG = AndysApplesAssets.LONGEVITY_UPGRADE6; upgradeLongevity.amount.text = "Lv 6"; // + StoreInventory.GetGoodUpgradeLevel(uVG.ItemId).ToString(); AndyUtils.LogDebug(TAG, "cost for " + uVG.ItemId + " is " + ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount); upgradeLongevity.cost.text = ((PurchaseWithVirtualItem)uVG.PurchaseType).Amount.ToString(); upgradeLongevity.description.text = "Fully Upgraded"; break; } #endregion Invoke("DisplayCurrencyInfo", 1.0f); }