using UnityEngine; public class MerchantDisappear : State { bool isDisposed; public override void Enter() { isDisposed = false; Owner.Excutor.IsBattleReady = false; Debug.Assert(Owner.Excutor.SkeletonAnimation.TryGetAnimation("die", out Spine.Animation _), "die animation not exist"); Owner.Excutor.SkeletonAnimation.AnimationState.SetAnimation(0, "die", false); } public override void Excute() { if (isDisposed) return; var trackEntry = Owner.Excutor.SkeletonAnimation.AnimationState.GetCurrent(0); if (trackEntry is null || trackEntry.IsComplete) { isDisposed = true; Owner.Excutor.Dispose(); } } }