From 41a924d317b4b0b9c5e53d4c4ca53cb55ea80fd2 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Oct 2020 07:45:27 +0800 Subject: =?UTF-8?q?*#Erika#=E5=8A=A8=E7=94=BB=E6=9C=80=E4=BD=B3=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=9A=20*=20Root=20Transform=20Rotation=20?= =?UTF-8?q?=E6=B0=B8=E8=BF=9C=E5=8B=BE=E4=B8=8A=20Bake=20Into=20Pose,=20Ba?= =?UTF-8?q?sedUpon=20Original=20*=20=E5=AF=B9=E4=BA=8Eidle=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E5=92=8C=E5=85=B6=E4=BB=96=E4=BD=8D=E7=BD=AE=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E6=94=B9=E5=8F=98=E7=9A=84=E5=8A=A8=E7=94=BB=EF=BC=8C?= =?UTF-8?q?Y=E5=92=8CXZ=E9=83=BDbake=EF=BC=8CBasedUpon=20Feet=20*=20?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E5=B9=B3=E5=9C=B0=E4=B8=8A=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E7=94=BB=EF=BC=8CBake=20Y=20position?= =?UTF-8?q?=EF=BC=8CXZ=E4=B8=8D=E8=A6=81bake=20*=20=E5=AF=B9=E4=BA=8EY?= =?UTF-8?q?=E8=BD=B4=E6=94=B9=E5=8F=98=E7=9A=84=E5=8A=A8=E7=94=BB=EF=BC=8C?= =?UTF-8?q?=E6=AF=94=E5=A6=82=E8=B7=B3=E8=B7=83=E3=80=81=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=B5=AE=E7=A9=BA=E6=8A=80=E8=83=BD=EF=BC=8CY=E5=92=8CXZ?= =?UTF-8?q?=E9=83=BD=E4=B8=8D=E8=A6=81bake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Test/RootConstainTest.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Assets/Scripts/Test/RootConstainTest.cs') diff --git a/Assets/Scripts/Test/RootConstainTest.cs b/Assets/Scripts/Test/RootConstainTest.cs index 4cd9dbb1..91d37062 100644 --- a/Assets/Scripts/Test/RootConstainTest.cs +++ b/Assets/Scripts/Test/RootConstainTest.cs @@ -23,8 +23,16 @@ public class RootConstainTest : MonoBehaviour // 约束z=0 if (animator) { - //animator.ApplyBuiltinRootMotion(); - transform.position += new Vector3(animator.deltaPosition.x, animator.deltaPosition.y, 0); + Vector3 position = transform.position; + position.x += animator.deltaPosition.x; + position.y += animator.deltaPosition.y; + //position.y = Mathf.Max(0, position.y); + //position.y = 0; + + transform.position = position; + + transform.rotation *= animator.deltaRotation; + //transform.forward = animator.deltaRotation * transform.forward; //Vector3 euler = animator.deltaRotation.ToEuler(); //euler.x = euler.z = euler.y = 0; -- cgit v1.1-26-g67d0