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.
 
 
 
 
 
 

30 lines
897 B

using System;
using System.Diagnostics;
public class IVMateDisappear : State<IVMate>
{
Action onComplete;
public void Setup(Action onComplete)
{
this.onComplete = onComplete;
}
public override void Enter()
{
Debug.Assert(Owner.Excutor.SkeletonAnimation != null && Owner.Excutor.SkeletonAnimation.TryGetAnimation("warp_out", out Spine.Animation _), "SkeletonAnimation is null or warp_out animation not exist");
Owner.Excutor.SkeletonAnimation.AnimationState.SetAnimation(0, "warp_out", false);
}
public override void Excute()
{
var trackEntry = Owner.Excutor.SkeletonAnimation != null ? Owner.Excutor.SkeletonAnimation.AnimationState.GetCurrent(0) : null;
if (trackEntry is null || trackEntry.IsComplete)
onComplete?.Invoke();
}
public override void Exit()
{
onComplete = null;
}
}