예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        CoinController coin = other.GetComponent <CoinController>();

        if (coin != null)
        {
            score += coin.Value;
            coin.Vanish();
            if (score >= 50)
            {
                _5_CoinsCollected.Invoke();
            }
            if (score >= 100)
            {
                _10_CoinsCollected.Invoke();
            }
            if (score >= 160)
            {
                _16_CoinsCollected.Invoke();
            }
            if (score >= 230)
            {
                _23_CoinsCollected.Invoke();
            }
        }
    }