Exemple #1
0
        public void DequeueSkill()
        {
            BattleSkillBtn skill = _queSkill.Dequeue();

            ResourceMgr.PushSkill(skill.Type, skill);
            ResetSkillBar();
        }
Exemple #2
0
        private void SetMainSkill(int skillId)
        {
            BattleSkillBtn skill = ResourceMgr.PopSkill(skillId);

            skill.IsMainSkill = true;
            skill.m_Transform.SetParent(SkillBarTran);
            skill.SetToLargerScale();
            skill.SetPosImmediately(-4.7f);
        }
Exemple #3
0
 public static void PushSkill(int type, BattleSkillBtn skill)
 {
     if (!_dicSkills[type].Contains(skill))
     {
         skill.m_Transform.SetParent(BattleManager.GetInst().BattlePoorTran);
         skill.m_Transform.localPosition = PositionMgr.vecHidePos;
         skill.m_Transform.localScale    = Vector3.one;
         _dicSkills[type].Push(skill);
     }
 }
Exemple #4
0
        public void EnqueueSkill(int skillType)
        {
            if (_queSkill.Count > 4)
            {
                DequeueSkill();
            }

            BattleSkillBtn skill = ResourceMgr.PopSkill(skillType);

            skill.m_Transform.SetParent(SkillBarTran);
            skill.SetToOriScale();
            _queSkill.Enqueue(skill);
            ResetSkillBar();
        }
Exemple #5
0
        public static BattleSkillBtn PopSkill(int skillId)
        {
            if (!_dicSkills.ContainsKey(skillId))
            {
                _dicSkills.Add(skillId, new Stack <BattleSkillBtn>());
            }

            if (_dicSkills[skillId].Count > 0)
            {
                return(_dicSkills[skillId].Pop());
            }

            BattleSkillBtn skill = (Object.Instantiate(_skills[skillId]) as GameObject).GetComponent <BattleSkillBtn>();

            return(skill);
        }