Пример #1
0
    public virtual void OnUse(AbilityHitDetector AHD = null)
    {
        if (OnUseSound != string.Empty)
        {
            AudioManager.Instance.PlayAudioClip(OnUseSound);
        }
        if (ready)
        {
            InitOnUseEffects();

            Debug.Log("OnUseEffectInstance " + OnUseEffectInstance.Count);
            for (int i = 0; i < OnUseEffectInstance.Count; i++)
            {
                if (AHD != null)
                {
                    OnUseEffectInstance[i].Trigger(AHD);
                }
                else
                {
                    OnUseEffectInstance[i].Trigger(this);
                }
            }

            if (cooldown > 0)
            {
                if (CDC != null)
                {
                    slave.StopCoroutine(CDC);
                }

                CDC = slave.StartCoroutine(CoolDownCoroutine());

                if (OnAbilityUse != null)
                {
                    OnAbilityUse();
                }
            }
        }
    }