コード例 #1
0
ファイル: Ability.cs プロジェクト: asd540578/TD_Project
        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));
        }
コード例 #2
0
        public void Init()
        {
            if (maxUseCount > 0)
            {
                usedRemained = maxUseCount;
            }
            else
            {
                usedRemained = -1;
            }

            if (indicator != null)
            {
                indicator        = (Transform)MonoBehaviour.Instantiate(indicator);
                indicator.parent = AbilityManager.GetInstance().transform;
            }
        }
コード例 #3
0
        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);
                }
            }
        }