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.
 
 
 
 
 
 

28 lines
776 B

using System;
using UnityEngine;
[Serializable]
public class EnemyDisappear : 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();
}
}
}