コード例 #1
0
    void onSpellUse()
    {
        CardSpell Spell = cardHand.CardUsing.GetComponent <CardSpell>();

        if (OldTileOver != null)
        {
            OldTileOver.ChangeColor(OldTileOver.MatColorOriginal);
        }
        switch (Spell.spellType)
        {
        case SpellType.Buff:
            if (OldTileOver.cardType == CardType.Player && OldTileOver.ObjectHeld.GetComponent <CardObject>() != null)
            {
                mageSpawner.Cast(OldTileOver.transform);
                Spell.GiveBuff(OldTileOver.ObjectHeld.GetComponent <CardObject>());
                powerCounter.RemovePower(cardHand.CardUsing.GetPowerAmount);
                cardHand.DestroyCardUsed();
            }
            break;

        case SpellType.DeBuff:
            break;

        default:
            Debug.LogWarning("No Spell Type attached to Spell");
            return;
        }
    }