Esempio n. 1
0
 public virtual void EnterBuildMode()
 {
     tpInput.SetLockAllInput(true);
     currentBuild.EnterBuild();
     if (currentBuild.strafeWhileCreate && tpInput.cc.locomotionType != vThirdPersonMotor.LocomotionType.OnlyStrafe)
     {
         tpInput.SetStrafeLocomotion(true);
     }
     onEnterBuildMode.Invoke();
     genericAction.SetLockTriggerEvents(true);
 }
Esempio n. 2
0
 private void SwimmingBehaviour()
 {
     // trigger swim behaviour only if the water level matches the player height + offset
     if (tpInput.cc._capsuleCollider.bounds.center.y + heightOffset < waterHeightLevel)
     {
         if (tpInput.cc.currentHealth > 0)
         {
             if (!triggerSwimState)
             {
                 EnterSwimState();                                   // call once the swim behaviour
             }
             SwimUpOrDownInput();                                    // input to swin up or down
             tpInput.SetStrafeLocomotion(false);                     // limit the player to not go on strafe mode
             tpInput.MoveInput();                                    // update the input
             tpInput.cc.SetAnimatorMoveSpeed(tpInput.cc.freeSpeed);  // update the animator input magnitude
         }
         else
         {
             ExitSwimState();                                        // use the trigger around the edges to exit by playing an animation
         }
     }
     else
     {
         ExitSwimState();
     }
 }