using Animancer; using UnityEngine; namespace ET { public class PeopleAnimatorComponentAwakeSystem : AwakeSystem { public override void Awake(PeopleAnimatorComponent self) { self.Awake(); } } public class PeopleAnimatorComponentDestroySystem : DestroySystem { public override void Destroy(PeopleAnimatorComponent self) { self.Destroy(); } } [FriendClass(typeof(PeopleAnimatorComponent))] [FriendClass(typeof(PeopleViewComponent))] public static class PeopleAnimatorComponentSystem { public static void Awake(this PeopleAnimatorComponent self) { var people = self.GetParent(); var pView = people.GetComponent(); self.AnimancerComp = pView.PeopleRoot.transform.Find("Body/Model").GetComponent(); } public static void StopAll(this PeopleAnimatorComponent self) { self.AnimancerComp.Stop(); } public static void StopAnimation(this PeopleAnimatorComponent self, string animName) { self.AnimancerComp.Stop(animName); } public static void PlayAnimation(this PeopleAnimatorComponent self, string animName) { self.AnimancerComp.TryPlay(animName); } public static void Destroy(this PeopleAnimatorComponent self) { self.AnimancerComp = null; } } }