From b603c6a2cf91c8104cc168777a827d660bf5a584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CCongG=E2=80=9D?= Date: Fri, 3 Jan 2025 14:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=91=84=E5=83=8F=E6=9C=BA?= =?UTF-8?q?=E9=97=AA=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExampleCharacter/Scripts/ExampleCharacterCamera.cs | 5 +++++ Assets/_Scripts/Application/UI/OperationStepPanel.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs b/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs index 08db393..62e5239 100644 --- a/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs +++ b/Assets/Third/KinematicCharacterController/ExampleCharacter/Scripts/ExampleCharacterCamera.cs @@ -74,7 +74,12 @@ namespace KinematicCharacterController.Examples PlanarDirection = Vector3.forward; } + public void ResetTR(Vector3 rotDefault) + { + _targetVerticalAngle = rotDefault.x; + PlanarDirection = FollowTransform.forward; + } // Set the transform that the camera will orbit around public void SetFollowTransform(Transform t) { diff --git a/Assets/_Scripts/Application/UI/OperationStepPanel.cs b/Assets/_Scripts/Application/UI/OperationStepPanel.cs index a0d4455..47817dc 100644 --- a/Assets/_Scripts/Application/UI/OperationStepPanel.cs +++ b/Assets/_Scripts/Application/UI/OperationStepPanel.cs @@ -630,6 +630,7 @@ namespace ZXK.LouDiXvMuNiu kinematic.SetPositionAndRotation(pos, Quaternion.Euler(0, rot.y, 0));///设置相机旋转,位置 characterCamera.transform.rotation = Quaternion.Euler(rot.x, rot.y, 0); characterCamera.transform.position = characterCamera.pos.transform.position; + characterCamera.ResetTR(rot); } } } \ No newline at end of file