コード例 #1
0
        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);
        }
コード例 #2
0
 public SE_AnimationSlot GetAnimationSlot(SE_AnimationPreset preset)
 {
     foreach (var slot in _AnimationSlots)
     {
         if (slot._Preset == preset)
         {
             return(slot);
         }
     }
     return(null);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void PlayAnimation(SE_AnimationPreset preset)
 {
     PlayAnim(preset);
 }