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/ArmorSoldierScript.cs | 57 ------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 Assets/Scripts/Test/ArmorSoldierScript.cs (limited to 'Assets/Scripts/Test/ArmorSoldierScript.cs') diff --git a/Assets/Scripts/Test/ArmorSoldierScript.cs b/Assets/Scripts/Test/ArmorSoldierScript.cs deleted file mode 100644 index c86ca009..00000000 --- a/Assets/Scripts/Test/ArmorSoldierScript.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public partial class ArmorSoldierScript : Avatar, IInteractable -{ - public Animator m_Animator; - - void Awake() - { - m_Animator = GetComponent(); - } - - private void Start() - { - base.Init(); - - SetupAnim(); - SetupStates(); - } - - private void OnAnimatorMove() - { - Animator animator = GetComponent(); - - AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0); - - // animator.deltaPosition和animator.deltaRotation是animator做的root motion后的结果 - // 在后面做一个硬性约束z=0,将角色限制在z=0平面上 - if (stateInfo.IsTag("IgnoreRootMotion")) - { - // ignore root motion - //Debug.Log("ignore root motion "); - } - else - { - Vector3 position = transform.position; - position.x += animator.deltaPosition.x; - position.y += animator.deltaPosition.y; - transform.position = position; - - // animation clip导入设置旋转一般上设置为baked inpose,不需要手动限制 - transform.rotation *= animator.deltaRotation; - } - } - - public void Hurt() - { - } - - public override void OnHurt(HurtInfo hurtInfo) - { - base.OnHurt(hurtInfo); - Hurt(); - } - -} -- cgit v1.1-26-g67d0