From 22891bf59032ba88262824255a706d652031384b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 10 Mar 2022 14:07:40 +0800 Subject: * move folder --- Assets/Scripts/Test/RootConstainTest.cs | 41 --------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 Assets/Scripts/Test/RootConstainTest.cs (limited to 'Assets/Scripts/Test/RootConstainTest.cs') diff --git a/Assets/Scripts/Test/RootConstainTest.cs b/Assets/Scripts/Test/RootConstainTest.cs deleted file mode 100644 index 7936fd25..00000000 --- a/Assets/Scripts/Test/RootConstainTest.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class RootConstainTest : MonoBehaviour -{ - // Start is called before the first frame update - void Start() - { - - } - - // Update is called once per frame - void Update() - { - - } - - private void OnAnimatorMove() - { - Animator animator = GetComponent(); - - // 约束z=0 - if (animator) - { - Vector3 position = transform.position; - position.x += animator.deltaPosition.x; - position.y += animator.deltaPosition.y; - - 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; - //transform.rotation *= Quaternion.Euler(euler); - } - } - -} -- cgit v1.1-26-g67d0