//called when an ability is fired, reduce the energy, start the cooldown and what not public void ActivateAbility(Ability ab, Vector3 pos = default(Vector3)) { ab.usedCount += 1; energy -= ab.GetCost(); StartCoroutine(ab.CooldownRoutine()); CastAbility(ab, pos); if (onAbilityActivatedE != null) { onAbilityActivatedE(ab); } }
//called when an ability is fired, reduce the energy, start the cooldown and what not public void ActivateAbility(Ability ab, Vector3 pos=default(Vector3), Unit unit=null){ ab.usedCount+=1; energy-=ab.GetCost(); StartCoroutine(ab.CooldownRoutine()); CastAbility(ab, pos, unit); if(onAbilityActivatedE!=null) onAbilityActivatedE(ab); }