Beispiel #1
0
        private void UseGameObjectSkill(GameObject go)
        {
            var skill = go.GetComponent <BaseSkill>();

            if (skill == null)
            {
                Debug.LogWarning("Skill dosen't have base skill component.");
                return;
            }

            if (!skill.CanUse)
            {
                return;
            }

            if (!skill.CoolDowning())
            {
                return;
            }

            if (!skill.HaveMP())
            {
                return;
            }

            if (_currentSkill == null)
            {
                _currentSkill = skill;
                _currentSkill.Use();
            }
            else if (_usingSkills.Count >= 1 && _usingSkills.Peek() != skill)
            {
                _usingSkills.Enqueue(skill);
            }
        }
Beispiel #2
0
        public void EndUseSkill()
        {
            //var currentSkill = _usingSkills.Dequeue();
            _currentSkill.EndUseSkill();
            _currentSkill = null;

            if (_usingSkills.Count != 0)
            {
                _currentSkill = _usingSkills.Dequeue();
                _currentSkill.Use();
            }
        }