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.
 
 
 
 
 
 

36 lines
860 B

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;
}
}