예제 #1
0
    public override void HitBlock()
    {
        if (capacity == 0)
        {
            return;
        }

        base.HitBlock();
        // TODO: Handle coin animation
        capacity--;

        switch (questionBoxItem)
        {
        case Content.Mushroom:
            Mushroom mushroom = Instantiate(mushroomPrefab, transform).GetComponent <Mushroom>();
            StartCoroutine(mushroom.AnimateOutOfBox(transform.position));
            break;

        case Content.Coin:
        case Content.TenCoin:
            Coin coin = Instantiate(coinPrefab, transform).GetComponent <Coin>();
            StartCoroutine(coin.BounceCoin(transform.position));
            break;

        case Content.FireFlower:
            break;
        }
    }