Exemple #1
0
 public bool GetAttackDataOrUseNonAttackSkill(bool isLeftHand, out float attackDistance, out float attackFov)
 {
     attackDistance = PlayerCharacterEntity.GetAttackDistance(isLeftHand);
     attackFov      = PlayerCharacterEntity.GetAttackFov(isLeftHand);
     if (queueUsingSkill.HasValue)
     {
         Skill skill = null;
         if (GameInstance.Skills.TryGetValue(queueUsingSkill.Value.dataId, out skill) && skill != null)
         {
             if (skill.IsAttack())
             {
                 attackDistance = PlayerCharacterEntity.GetSkillAttackDistance(skill, isLeftHand);
                 attackFov      = PlayerCharacterEntity.GetSkillAttackFov(skill, isLeftHand);
             }
             else
             {
                 // Stop movement to use non attack skill
                 PlayerCharacterEntity.StopMove();
                 RequestUsePendingSkill(false, null);
                 return(false);
             }
         }
         else
         {
             queueUsingSkill = null;
         }
     }
     // Return true if going to attack
     return(true);
 }
 public bool GetAttackDistanceAndFov(out float attackDistance, out float attackFov)
 {
     attackDistance = PlayerCharacterEntity.GetAttackDistance();
     attackFov      = PlayerCharacterEntity.GetAttackFov();
     if (queueUsingSkill.HasValue)
     {
         var   queueUsingSkillValue = queueUsingSkill.Value;
         Skill skill = null;
         if (GameInstance.Skills.TryGetValue(queueUsingSkillValue.dataId, out skill) && skill != null)
         {
             if (skill.IsAttack())
             {
                 attackDistance = PlayerCharacterEntity.GetSkillAttackDistance(skill);
                 attackFov      = PlayerCharacterEntity.GetSkillAttackFov(skill);
             }
             else
             {
                 // Stop movement to use non attack skill
                 PlayerCharacterEntity.StopMove();
                 RequestUsePendingSkill();
                 return(false);
             }
         }
         else
         {
             queueUsingSkill = null;
         }
     }
     return(true);
 }