角色控制相关代码

This commit is contained in:
2025-09-10 10:37:37 +08:00
parent b57cf055c5
commit 1d002b8c25
2 changed files with 15 additions and 16 deletions

View File

@@ -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;
// }
}
// 检查朝向同步

View File

@@ -4,6 +4,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAttributeUsageAttribute_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5a41d6b7189842eca409fd0b1c3e3dcf17bf78_003F87_003F656e3c96_003FAttributeUsageAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5a41d6b7189842eca409fd0b1c3e3dcf17bf78_003Fa8_003F57a4f791_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABindingFlags_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c2967a135e648bdb993c5397a44991b573620_003F94_003F16186629_003FBindingFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterController_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F21f01dcabaec42e5804351a26927d8a329c00_003Fa8_003Ff67063b8_003FCharacterController_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACollider_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F03ef825315384b1cab81c4b53eb03d922ac00_003Fd1_003Fa6f13559_003FCollider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AComponent_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4c8c45fec274213bfac03ee0e9a3d621f5a00_003F7b_003F4d79464b_003FComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACursor_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd0_003F709b15ec_003FCursor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>