Exemplo n.º 1
0
 private void OnRefreshSkillItems()
 {
     foreach (var current in mSkillBtns)
     {
         ESkillPos pos   = current.Key;
         ActSkill  skill = CharacterManager.Main.Skill.GetSkill(pos);
         ItemSkill tab   = current.Value;
         if (skill == null)
         {
             tab.maskSprite.gameObject.SetActive(true);
             tab.lockSprite.gameObject.SetActive(true);
         }
         else
         {
             tab.lockSprite.gameObject.SetActive(false);
             if (skill.IsCD())
             {
                 tab.maskSprite.gameObject.SetActive(true);
                 tab.maskSprite.fillAmount = skill.GetLeftTime() / skill.CD;
             }
             else
             {
                 tab.maskSprite.gameObject.SetActive(false);
             }
         }
     }
 }
Exemplo n.º 2
0
 public ActSkill SelectSkillByEnemy(Character enemy)
 {
     foreach (var current in mSkillAttacks)
     {
         ActSkill s = current.Value;
         if (s.CastDist > 0 && s.IsCD() == false)
         {
             if (enemy != null)
             {
                 if (GTTools.GetHorizontalDistance(mCharacter.Pos, enemy.Pos) < s.CastDist)
                 {
                     return(s);
                 }
             }
             else
             {
                 return(s);
             }
         }
     }
     return(GetSkill(ESkillPos.Skill_0));
 }