예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.GetComponent <TopdownCharacter>())
     {
         MoneyManager.AddCoins(value);
         Destroy(gameObject);
     }
 }
예제 #2
0
    public void EndScreenStars(int[] scoreGoals)
    {
        int numberOfStars = 0;

        for (int i = 0; i < scoreGoals.Length; i++)
        {
            if (score >= scoreGoals[i])
            {
                numberOfStars++;
            }
        }

        endStarImage.sprite = starsSprite[numberOfStars];

        moneyEarnedText.text = MoneyManager.AddCoins(numberOfStars).ToString();

        totalMoney.text = "$" + MoneyManager.Money.ToString();
    }