public void Activate(Vector3 pos = default(Vector3)) { useCount += 1; currentCD = GetCooldown(); if (AbilityManager.UseRscManagerForCost()) { RscManager.SpendRsc(GetCostRsc()); } else { AbilityManager.SpendRsc(GetCost()); } effectOnActivate.Spawn(pos, Quaternion.identity); AudioManager.PlaySound(soundOnActivate); //activateCallback(); if (effectType != _EffectType.Default) { return; } AbilityManager.GetInstance().StartCoroutine(AbilityEffect(pos)); }
public void Init() { if (maxUseCount > 0) { usedRemained = maxUseCount; } else { usedRemained = -1; } if (indicator != null) { indicator = (Transform)MonoBehaviour.Instantiate(indicator); indicator.parent = AbilityManager.GetInstance().transform; } }
public void Activate(Vector3 pos) { usedCount += 1; usedRemained -= 1; AbilityManager.GetInstance().StartCoroutine(CooldownRoutine()); if (effectObj != null) { if (!destroyEffectObj) { ObjectPoolManager.Spawn(effectObj, pos, Quaternion.identity); } else { ObjectPoolManager.Spawn(effectObj, pos, Quaternion.identity, destroyEffectDuration); } } }