예제 #1
0
    //Apply physical shield
    public void applyShield(shieldType type)
    {
        currentShieldType = type;

        if (!shieldEnabled)
        {
            //Instantiate
            if (currentShieldType == shieldType.Physycal)
            {
                shieldObject = Instantiate(pShieldPrefab, boss.transform);
            }
            else
            {
                shieldObject = Instantiate(mShieldPrefab, boss.transform);
            }


            //Set flag
            shieldEnabled = true;
            bossStats.applyShield(currentShieldType, true);    //apply shield

            //Set time
            currentTime = maxShieldTime;
        }
    }
예제 #2
0
    //APPLY SHIELD
    public void applyShield(shieldType type, bool toApply)
    {
        switch (type)
        {
        case shieldType.Magical:
            mShieldEnabled = toApply;
            break;

        case shieldType.Physycal:
            pShieldEnabled = toApply;
            break;

        default:
            break;
        }
    }