Esempio n. 1
0
        //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)
        {
            energy -= ab.GetCost();
            ab.Activate(pos);

            //ab.CastEffectObject(pos);

            //CastAbility(ab, pos, unit);
            //if(ab.effectObj!=null)
            //	ObjectPoolManager.Spawn(ab.effectObj, pos, Quaternion.identity);

            if (ab.useDefaultEffect)
            {
                StartCoroutine(ApplyAbilityEffect(ab, pos, unit));
            }

            TDTK.OnAbilityActivated(ab);
        }