//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; } }
//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; } }