protected override void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.tag == "Player")
        {
            if (playerWallet.GetCoins() < 999)
            {
                playerWallet.AddCoin();
                DoPickupAnimation();
                Destroy(gameObject);

                return;
            }

            DoCancelPickupAnimation();
        }
    }
Ejemplo n.º 2
0
 private void Update()
 {
     text.text = playerWallet.GetCoins().ToString("000");
 }