You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
53 lines
1.5 KiB
3 years ago
|
using Animancer;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
public class PeopleAnimatorComponentAwakeSystem : AwakeSystem<PeopleAnimatorComponent>
|
||
|
{
|
||
|
public override void Awake(PeopleAnimatorComponent self)
|
||
|
{
|
||
|
self.Awake();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
public class PeopleAnimatorComponentDestroySystem : DestroySystem<PeopleAnimatorComponent>
|
||
|
{
|
||
|
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<People>();
|
||
|
var pView = people.GetComponent<PeopleViewComponent>();
|
||
|
self.AnimancerComp = pView.PeopleRoot.transform.Find("Body/Model").GetComponent<NamedAnimancerComponent>();
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|