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.
27 lines
741 B
27 lines
741 B
using UnityEngine;
|
|
|
|
public class MerchantDisappear : State<Character>
|
|
{
|
|
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();
|
|
}
|
|
}
|
|
}
|