예제 #1
0
    IEnumerator AOEBuff(Vector3 pos, float range, float duration, BuffStat buff, _ModifierType modType, float delay)
    {
        yield return(new WaitForSeconds(delay));

        LayerMask maskTower = 1 << LayerManager.LayerTower();

        Collider[] cols = Physics.OverlapSphere(pos, range, maskTower);

        foreach (Collider col in cols)
        {
            UnitTower unitTower = col.gameObject.GetComponent <UnitTower>();
            if (unitTower != null)
            {
                if (modType == _ModifierType.percentage)
                {
                    unitTower.AbilityBuffMod(buff, duration);
                }
                else if (modType == _ModifierType.value)
                {
                    unitTower.AbilityBuffVal(buff, duration);
                }
            }
        }
        //~ List<UnitTower> tempBuffList = new List<UnitTower>(buffList.Length);
        //~ tempBuffList.AddRange(buffList);
    }
예제 #2
0
 void IncreaseEnergyCap(float val, _ModifierType mod)
 {
     if (mod == _ModifierType.value)
     {
         energyMax += val;
     }
     else if (mod == _ModifierType.percentage)
     {
         energyMax += energyDefault * val;
     }
 }
예제 #3
0
 public void AbilityArmorReduc(float val, _ModifierType modType, float duration)
 {
     if (modType == _ModifierType.percentage)
     {
         dmgReducMod = val;
     }
     else if (modType == _ModifierType.value)
     {
         dmgReducVal = val;
     }
     StartCoroutine(ArmorReset(duration));
 }