Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
    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");
    }
Exemplo n.º 3
0
    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;
        }
    }
Exemplo n.º 4
0
 void Awake()
 {
     this.GetComponent <Button>().onClick.AddListener(() => {
         CurrencyManager.AddCoins(100);
     });
 }