船相关脚本呢
This commit is contained in:
@@ -5,13 +5,11 @@ using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
|
||||
public class PlayerCharacter : Character
|
||||
{
|
||||
private float _cameraPitch;
|
||||
private FPlayer _player;
|
||||
|
||||
|
||||
[Space(10.0f)] public float maxSprintSpeed = 10.0f;
|
||||
|
||||
public GameObject cameraParent;
|
||||
@@ -25,7 +23,6 @@ namespace NBF
|
||||
[HideInInspector] public int nextShowSlotIndex = -1;
|
||||
public bool IsSelf;
|
||||
|
||||
|
||||
public LookAtIK lookAtIK; // 挂在背部上的 LookAtIK 脚本
|
||||
public float aimDistance = 1.5f; // 目标点离相机多远
|
||||
|
||||
@@ -70,7 +67,16 @@ namespace NBF
|
||||
private void Update()
|
||||
{
|
||||
InteractiveCheck();
|
||||
UpdatePlayerPositionAndRotation();
|
||||
if (_player.NowBoat)
|
||||
{
|
||||
_player.NowBoat.BoatInput(InputManager.GetMovementInput());
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdatePlayerPosition();
|
||||
}
|
||||
|
||||
UpdatePlayerRotation();
|
||||
UpdateGear();
|
||||
}
|
||||
|
||||
@@ -189,7 +195,7 @@ namespace NBF
|
||||
private bool _isSprinting;
|
||||
private bool _sprintInputPressed;
|
||||
|
||||
private void UpdatePlayerPositionAndRotation()
|
||||
private void UpdatePlayerPosition()
|
||||
{
|
||||
// Move
|
||||
Vector2 movementInput = InputManager.GetMovementInput();
|
||||
@@ -203,7 +209,10 @@ namespace NBF
|
||||
movementDirection.relativeTo(cameraTransform, GetUpVector());
|
||||
|
||||
SetMovementDirection(movementDirection);
|
||||
}
|
||||
|
||||
private void UpdatePlayerRotation()
|
||||
{
|
||||
// Look
|
||||
Vector2 lookInput = InputManager.GetLookInput() * sensitivity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user