private void OnTriggerEnter2D(Collider2D collision) { if (collision.GetComponent <TopdownCharacter>()) { MoneyManager.AddCoins(value); Destroy(gameObject); } }
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(); }