|
@@ -1,17 +1,18 @@
|
|
|
using CMDType = ET.Client.AnimatorComponent.CommandType;
|
|
|
using AniType = Mono.AnimationData.AnimationType;
|
|
|
+using UnityEngine;
|
|
|
|
|
|
namespace ET.Client
|
|
|
{
|
|
|
- [FriendOfAttribute(typeof(GameObjectComponent))]
|
|
|
[FriendOf(typeof(AnimatorComponent))]
|
|
|
public static class AnimatorComponentSystem
|
|
|
{
|
|
|
[ObjectSystem]
|
|
|
- public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
|
|
|
+ public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent, GameObject>
|
|
|
{
|
|
|
- protected override void Awake(AnimatorComponent self)
|
|
|
+ protected override void Awake(AnimatorComponent self, GameObject go)
|
|
|
{
|
|
|
+ self.GameObject = go;
|
|
|
self.Awake();
|
|
|
}
|
|
|
}
|
|
@@ -31,6 +32,7 @@ namespace ET.Client
|
|
|
protected override void Destroy(AnimatorComponent self)
|
|
|
{
|
|
|
self.AniData.Animancer.Stop();
|
|
|
+ UnityEngine.Object.Destroy(self.GameObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -47,8 +49,7 @@ namespace ET.Client
|
|
|
|
|
|
public static void Awake(this AnimatorComponent self)
|
|
|
{
|
|
|
- GameObjectComponent gameObjectComponent = self.GetParent<Unit>().GetComponent<GameObjectComponent>();
|
|
|
- self.AniData = gameObjectComponent.GameObject.GetComponent<Mono.AnimationData>();
|
|
|
+ self.AniData = self.GameObject.GetComponent<Mono.AnimationData>();
|
|
|
|
|
|
self.DoingType = AniType.Dead;
|
|
|
self.ExeCommand(AnimatorComponent.CMDIdle);
|