Esempio n. 1
0
 public void Lunge(Vector3 lungeVector, float speed)
 {
     if (!movementActuator.GetIsHuggingWall())
     {
         movementActuator.LungeCommand(lungeVector, speed);
     }
 }
Esempio n. 2
0
    void PositionHand()
    {
        //	if (aimingController.GetIsAiming ()) {
        float shoulderOffset = idleX * aimingController.GetFacingDirection();

        if (movementActuator.GetIsHuggingWall())
        {
            shoulderOffset = shoulderAttachmentXWallGrab * aimingController.GetFacingDirection();
        }
        this.transform.localPosition = aimingController.GetAimingVector() * aimingDisplacement + new Vector3(shoulderOffset, idleY, 0f);

        //}
    }
Esempio n. 3
0
    void SetAnimatorState()
    {
        previousAnimationState = currentAnimationState;

        //States
        //0 ground/steep  - Idle or moving animation then depends on horizontal speed.
        //1 airborn
        //2 wall grab
        //3 dead
        if (characterContacts.GetContactState() == ContactState.FLATGROUND)
        {
            currentAnimationState = 0;
        }
        if (characterContacts.GetContactState() == ContactState.STEEPSLOPE)
        {
            currentAnimationState = 0;
        }
        if (characterContacts.GetContactState() == ContactState.AIRBORNE)
        {
            currentAnimationState = 1;
        }
        if (characterMovement.GetIsHuggingWall())
        {
            currentAnimationState = 2;
        }
        if (isSwinging)
        {
            currentAnimationState = 5;
        }
        if (corpus.GetIsReeling())
        {
            currentAnimationState = 4;
        }
        if (!corpus.GetIsAlive())
        {
            currentAnimationState = 3;
        }

        //Use this if rigging so all transitions come from any state
        //to prevent repeated triggering.
        if (previousAnimationState != currentAnimationState)
        {
            animator.SetInteger("State", currentAnimationState);
            hasAnimationStateChanged = true;
        }
        else
        {
            hasAnimationStateChanged = false;
        }
    }
Esempio n. 4
0
 void CheckCharacterWallAdjacent()
 {
     if (characterContact != null)
     {
         if (movementActuator.GetIsHuggingWall())
         {
             isWallAdjacent = true;
         }
         else
         {
             isWallAdjacent = false;
         }
     }
     if (isWallAdjacent)
     {
         wallSide = characterContact.GetSideAdjacent();
     }
     else
     {
         wallSide = MovementDirection.NEUTRAL;
     }
 }