private void OnBonusApplied(ShowResult result) { if (result == ShowResult.Finished) { Analytics.CustomEvent("BonusApplied", new Dictionary <string, object> { { "score", GameManager.Instance.Score } }); CurrencyManager.AddCoins(GameManager.Instance.Score * 2); Expired = true; } }
private IEnumerator FinishTask(float delay) { if (SaveManager.Data.MaxPoints < Score) { SaveManager.Data.MaxPoints = Score; } CurrencyManager.AddCoins(Score); Analytics.CustomEvent("GameFinished", new Dictionary <string, object> { { "world", WorldManager.CurrentWorld }, { "score", Score }, { "coins", CurrencyManager.Coins } }); yield return(new WaitForSeconds(delay)); UIManager.SetCurrentPanel("FinishPanel"); }
public void ItemClicked() { switch (typeOfDivise) { case 0: // Real Money switch (typeOfItem) { case 0: // Coins break; case 1: // Crystals break; case 2: // Spell 0 break; case 3: // Spell 1 break; case 4: // Spell 2 break; case 5: // Spell 3 break; case 6: // Spell 4 break; case 7: // Spell 5 break; } break; case 1: // Coins switch (typeOfItem) { case 0: // Coins break; case 1: // Crystals break; case 2: // Spell 0 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(0, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; case 3: // Spell 1 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(1, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; case 4: // Spell 2 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(2, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; case 5: // Spell 3 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(3, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; case 6: // Spell 4 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(4, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; case 7: // Spell 5 if (currencyManager.HasEnoughCoins(cost)) { currencyManager.QuitCoins(cost); MagicSpell.AddSpell(5, amountBought); Debug.Log("Cobrados " + cost + " monedas."); } break; } break; case 2: // Crystals switch (typeOfItem) { case 0: // Coins if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); currencyManager.AddCoins(amountBought); } break; case 1: // Crystals break; case 2: // Spell 0 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(0, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; case 3: // Spell 1 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(1, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; case 4: // Spell 2 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(2, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; case 5: // Spell 3 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(3, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; case 6: // Spell 4 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(4, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; case 7: // Spell 5 if (currencyManager.HasEnoughCrystals(cost)) { currencyManager.QuitCrystals(cost); MagicSpell.AddSpell(5, amountBought); Debug.Log("Cobrados " + cost + " cristales."); } break; } break; } }
void Awake() { this.GetComponent <Button>().onClick.AddListener(() => { CurrencyManager.AddCoins(100); }); }