// 툴팁 잘림 방지 함수 Vector2 SetToolTipPosition(Vector2 p_posvec, E_SkillType p_type, Vector2 p_skillvec) { Vector2 retvec = new Vector2(); float width; float height; // 툴팁이 잘릴수 있는 최대값 width, height // 스킬 타입 별로 잘림 방지 처리 switch (p_type) { case E_SkillType.Active: width = p_posvec.x + (m_ActiveToolTip.rect.width * 0.5f); height = p_posvec.y + (m_ActiveToolTip.rect.height * 0.5f); if (width > m_CanvasScaler.referenceResolution.x) { // 오른쪽 retvec = new Vector2(p_posvec.x - m_ActiveToolTip.rect.width - (p_skillvec.x * 2f), p_posvec.y); return(retvec); } break; case E_SkillType.Passive: width = p_posvec.x + (m_PassiveToolTip.rect.width * 0.5f); height = p_posvec.y + (m_PassiveToolTip.rect.height * 0.5f); if (width > m_CanvasScaler.referenceResolution.x) { if (height < m_CanvasScaler.referenceResolution.y) { // 오른쪽 아래 retvec = new Vector2(p_posvec.x - m_PassiveToolTip.rect.width - (p_skillvec.x * 2f), p_posvec.y + m_PassiveToolTip.rect.height - (p_skillvec.x * 2f)); return(retvec); } // 오른쪽 retvec = new Vector2(p_posvec.x - m_PassiveToolTip.rect.width - (p_skillvec.x * 2f), p_posvec.y); return(retvec); } if (height < m_CanvasScaler.referenceResolution.y) { // 아래 retvec = new Vector2(p_posvec.x, p_posvec.y + m_PassiveToolTip.rect.height - (p_skillvec.x * 2f)); return(retvec); } break; } retvec = p_posvec; return(retvec); }
public void UseSkill() { List <SkillInfo> list = mSkillDict[mCurrentStep]; mSkillIndex %= list.Count; SkillInfo skill = list[mSkillIndex]; if (skill.isOnce) { list.RemoveAt(mSkillIndex); } else { ++mSkillIndex; } switch (skill.skillType) { case E_SkillType.Beat: mUsedSkillType = E_SkillType.Beat; mFSMSystem.PerformTransition(BearTransition.Beat); break; case E_SkillType.SpeedUp: mUsedSkillType = E_SkillType.SpeedUp; mFSMSystem.PerformTransition(BearTransition.SpeedUp); break; case E_SkillType.Claw: mUsedSkillType = E_SkillType.Claw; mFSMSystem.PerformTransition(BearTransition.Claw); break; case E_SkillType.FireBall: mUsedSkillType = E_SkillType.FireBall; mFSMSystem.PerformTransition(BearTransition.FireBall); break; case E_SkillType.Follow: mUsedSkillType = E_SkillType.Follow; mFSMSystem.PerformTransition(BearTransition.Follow); break; case E_SkillType.ToHome: mUsedSkillType = E_SkillType.ToHome; mFSMSystem.PerformTransition(BearTransition.ToHome); break; } }
// 엑티브, 패시브 스킬 리스트 리턴해주는 함수 public List <Skill_Info> GetSkillInfo(E_SkillType p_type) { List <Skill_Info> skill_list = new List <Skill_Info>(); if (m_Skill_List == null) { Debug.Log("저장된 스킬 정보가 없습니다."); return(null); } foreach (var item in m_Skill_List) { if (item.skill_type == p_type) { skill_list.Add(item); // 매개변수로 받은 스킬 타입과 같은 스킬 리스트에 저장해서 리턴 } } return(skill_list); }
// 엑티브, 패시브 스킬 개수 리턴해주는 함수 public int GetSkillCount(E_SkillType p_type) { if (m_Skill_List == null) { Debug.Log("저장된 스킬 정보가 없습니다."); return(0); } int count = 0; foreach (var item in m_Skill_List) { if (item.skill_type == p_type) { ++count; // 매개변수로 받은 스킬 타입에 따라 개수 세서 리턴 } } return(count); }
public void UseSkill() { List <SkillInfo> list = mSkillDict[mCurrentLocation]; SkillInfo skill = list[mSkillIndex]; if (skill.isOnce) { list.RemoveAt(mSkillIndex); } else { ++mSkillIndex; } switch (skill.skillType) { case E_SkillType.Desk: mUsedSkillType = E_SkillType.Desk; mFSMSystem.PerformTransition(BullDemonKingTransition.Desk); break; case E_SkillType.Sofa: mUsedSkillType = E_SkillType.Sofa; mFSMSystem.PerformTransition(BullDemonKingTransition.Sofa); break; case E_SkillType.FireCricle: mUsedSkillType = E_SkillType.FireCricle; mFSMSystem.PerformTransition(BullDemonKingTransition.FireCricle); break; case E_SkillType.FireFist: mUsedSkillType = E_SkillType.FireFist; mFSMSystem.PerformTransition(BullDemonKingTransition.FireFist); break; case E_SkillType.OXHorn: mUsedSkillType = E_SkillType.OXHorn; mFSMSystem.PerformTransition(BullDemonKingTransition.OXHorn); break; } }
public SkillInfo(E_SkillType type, bool once) { skillType = type; isOnce = once; }