public void DequeueSkill() { BattleSkillBtn skill = _queSkill.Dequeue(); ResourceMgr.PushSkill(skill.Type, skill); ResetSkillBar(); }
private void SetMainSkill(int skillId) { BattleSkillBtn skill = ResourceMgr.PopSkill(skillId); skill.IsMainSkill = true; skill.m_Transform.SetParent(SkillBarTran); skill.SetToLargerScale(); skill.SetPosImmediately(-4.7f); }
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); } }
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(); }
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); }