1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
using System.Collections; using System.Collections.Generic; using UnityEngine; // 同步root motion到角色根节点 [DisallowMultipleComponent] public class UnitRootMotion : MonoBehaviour { Transform m_Root; Animator m_Animator; private void Awake() { m_Root = transform.parent; m_Animator = GetComponent<Animator>(); } }