summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test/RootConstainTest.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/Scripts/Test/RootConstainTest.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/Scripts/Test/RootConstainTest.cs')
-rw-r--r--Assets/Scripts/Test/RootConstainTest.cs41
1 files changed, 0 insertions, 41 deletions
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<Animator>();
-
- // 约束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);
- }
- }
-
-}