Exemplo n.º 1
0
 public AttackContext GetCurrentContext(APCharacterController character)
 {
     if (m_useAimAnimations)
     {
         // Check inputs and update animation according to this
         AttackContext ctx    = m_contextAimFront;
         bool          bFront = Mathf.Abs(character.m_inputs.m_axisX.GetValue()) > 0f;
         bool          bUp    = character.m_inputs.m_axisY.GetValue() > 0f;
         bool          bDown  = character.m_inputs.m_axisY.GetValue() < 0f;
         if (bFront)
         {
             if (bUp)
             {
                 ctx = m_contextAimFrontUp;
             }
             else if (bDown)
             {
                 ctx = m_contextAimFrontDown;
             }
         }
         else if (bUp)
         {
             ctx = m_contextAimUp;
         }
         else if (bDown)
         {
             ctx = m_contextAimDown;
         }
         return(ctx);
     }
     else
     {
         bool bCrouched = character.IsCrouched();
         if (bCrouched)
         {
             return(m_contextCrouched);
         }
         else if (character.IsOnGround())
         {
             if (!character.IsRunning())
             {
                 return(m_contextStand);
             }
             else
             {
                 return(m_contextRun);
             }
         }
         else
         {
             return(m_contextInAir);
         }
     }
 }