public void StopAnimation(SE_AnimationPreset preset, bool ExecuteCallbacks = true) { if (preset == null) { return; } // Check if the preset is from the animation's slots var slot = GetAnimationSlot(preset); if (slot != null) { var anim = slot._Animation; if (!mPlayingAnimations.Contains(anim)) { return; } anim.Stop(this, ExecuteCallbacks); return; } // if not, stop animation by name StopAnimation(preset.name, ExecuteCallbacks); }
public SE_AnimationSlot GetAnimationSlot(SE_AnimationPreset preset) { foreach (var slot in _AnimationSlots) { if (slot._Preset == preset) { return(slot); } } return(null); }
public SE_Animation PlayAnim(SE_AnimationPreset preset) { if (preset == null) { return(null); } SE_Animation anim; var slot = GetAnimationSlot(preset); if (slot != null) { anim = slot._Animation; anim.Play(this); return(anim); } anim = preset.CreateAnimation(); anim.Play(this); return(anim); }
public void PlayAnimation(SE_AnimationPreset preset) { PlayAnim(preset); }