角色控制相关代码
This commit is contained in:
@@ -250,7 +250,6 @@ namespace NBF.Fishing2
|
||||
private void StartMovement(MoveState moveState)
|
||||
{
|
||||
networkPosition = moveState.startPosition;
|
||||
// networkFacingDirection = moveState.currentFacing;
|
||||
|
||||
Debug.Log($"开始移动 - 位置: {moveState.startPosition}");
|
||||
}
|
||||
@@ -258,8 +257,7 @@ namespace NBF.Fishing2
|
||||
private void StopMovement(MoveState moveState)
|
||||
{
|
||||
networkPosition = moveState.startPosition;
|
||||
// networkFacingDirection = moveState.currentFacing;
|
||||
|
||||
characterController.transform.position = networkPosition;
|
||||
Debug.Log($"停止移动 - 最终位置: {moveState.startPosition}");
|
||||
}
|
||||
|
||||
@@ -294,19 +292,19 @@ namespace NBF.Fishing2
|
||||
private void UpdatePlayerRotation(Vector2 lookValue)
|
||||
{
|
||||
// Look
|
||||
Vector2 lookInput = lookValue * sensitivity;
|
||||
|
||||
if (lookInput.x != 0.0f)
|
||||
{
|
||||
_rotationInput.y += lookInput.x;
|
||||
}
|
||||
|
||||
// Player.CameraRoot.transform.localRotation = Quaternion.Euler(_cameraPitch, 0.0f, 0.0f);
|
||||
if (_rotationInput != Vector3.zero)
|
||||
{
|
||||
characterController.transform.rotation *= Quaternion.Euler(_rotationInput);
|
||||
_rotationInput = Vector3.zero;
|
||||
}
|
||||
// Vector2 lookInput = lookValue * sensitivity;
|
||||
//
|
||||
// if (lookInput.x != 0.0f)
|
||||
// {
|
||||
// _rotationInput.y += lookInput.x;
|
||||
// }
|
||||
//
|
||||
// // Player.CameraRoot.transform.localRotation = Quaternion.Euler(_cameraPitch, 0.0f, 0.0f);
|
||||
// if (_rotationInput != Vector3.zero)
|
||||
// {
|
||||
// characterController.transform.rotation *= Quaternion.Euler(_rotationInput);
|
||||
// _rotationInput = Vector3.zero;
|
||||
// }
|
||||
}
|
||||
|
||||
// 检查朝向同步
|
||||
|
||||
Reference in New Issue
Block a user