private void OnTriggerEnter2D(Collider2D collision) { if (collision.TryGetComponent <Coin>(out Coin coin)) { CoinTaken?.Invoke(coin); CoinCount++; } }
private void IncreaseCoin() { _coins++; CoinTaken?.Invoke(_coins); }