diff options
author | chai <chaifix@163.com> | 2020-10-13 10:33:05 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-13 10:33:05 +0800 |
commit | fc6de82e75310b4c007d80753a5f58e6692f4855 (patch) | |
tree | e6d8d9226595a6727d43f18a218f53533101a4e0 /Assets/Scripts/Test/IKTest.cs | |
parent | 8cd16fb71177bb61a9475284d944bc6aba30740e (diff) |
+misc
Diffstat (limited to 'Assets/Scripts/Test/IKTest.cs')
-rw-r--r-- | Assets/Scripts/Test/IKTest.cs | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/Assets/Scripts/Test/IKTest.cs b/Assets/Scripts/Test/IKTest.cs index 4e203be9..fdc5c2a3 100644 --- a/Assets/Scripts/Test/IKTest.cs +++ b/Assets/Scripts/Test/IKTest.cs @@ -1,33 +1,33 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class IKTest : MonoBehaviour -{ - public GameObject Go_FootIK; - [Range(0,1)] - public float IKWeight; - - private Animator animator; - - private void Start() - { - - } - - private void OnAnimatorIK(int layerIndex) - { - if(animator == null) - { - animator = GetComponent<Animator>(); - } - - animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, IKWeight); - animator.SetIKPosition(AvatarIKGoal.LeftFoot, Go_FootIK.transform.position); - - animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, IKWeight); - animator.SetIKRotation(AvatarIKGoal.LeftFoot, Go_FootIK.transform.rotation); - - } - -} +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class IKTest : MonoBehaviour
+{
+ public GameObject Go_FootIK;
+ [Range(0,1)]
+ public float IKWeight;
+
+ private Animator animator;
+
+ private void Start()
+ {
+
+ }
+
+ private void OnAnimatorIK(int layerIndex)
+ {
+ if(animator == null)
+ {
+ animator = GetComponent<Animator>();
+ }
+
+ animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, IKWeight);
+ animator.SetIKPosition(AvatarIKGoal.LeftFoot, Go_FootIK.transform.position);
+
+ animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, IKWeight);
+ animator.SetIKRotation(AvatarIKGoal.LeftFoot, Go_FootIK.transform.rotation);
+
+ }
+
+}
|