using System; public class IVMateDisappear : IState { IVMate owner; Action onComplete; public IVMateDisappear(IVMate owner, Action onComplete) { this.owner = owner; this.onComplete = onComplete; } public void Enter(StateHandler excutor) { #if UNITY_EDITOR if (owner.SkeletonAnimation != null && owner.SkeletonAnimation.TryGetAnimation("warp_out", out Spine.Animation _)) #endif { owner.SkeletonAnimation.AnimationState.SetAnimation(0, "warp_out", false); } } public void Excute() { var trackEntry = owner.SkeletonAnimation != null ? owner.SkeletonAnimation.AnimationState.GetCurrent(0) : null; if (trackEntry is null || trackEntry.IsComplete) onComplete?.Invoke(); } public void Exit() { onComplete = null; } }