Пример #1
0
        public void StartAnimation(IAnimation animation)
        {
            if (_scale.Width == 0f && animation.Frames.Count > 0)
            {
                _scale.ResetBaseSize(animation.Frames [0].Sprite.Width, animation.Frames [0].Sprite.Height);
            }
            IAnimation currentAnimation = Animation;

            if (currentAnimation != null)
            {
                currentAnimation.State.OnAnimationCompleted.TrySetResult(new AnimationCompletedEventArgs(false));
            }
            Animation = animation;
            OnAnimationStarted.Invoke(this, new AGSEventArgs());
        }
Пример #2
0
        public void StartAnimation(IAnimation animation)
        {
            var scale = _scale;

            if (scale?.Width == 0f && animation.Frames.Count > 0)
            {
                scale.BaseSize = new SizeF(animation.Frames[0].Sprite.Width, animation.Frames[0].Sprite.Height);
            }
            IAnimation currentAnimation = Animation;

            currentAnimation?.State.OnAnimationCompleted.TrySetResult(new AnimationCompletedEventArgs(false));

            Animation = animation;
            OnAnimationStarted.Invoke();
        }
Пример #3
0
 public void Run()
 {
     AnimationStepTimer = new Timer {
         Interval = Delay
     };
     AnimationStepTimer.Tick += (sender, args) =>
     {
         if (Runtime.StopAnimation)
         {
             Stop();
             return;
         }
         OnAnimationTick?.Invoke(this);
     };
     AnimationStepTimer.Start();
     OnAnimationStarted?.Invoke(this);
 }
Пример #4
0
 public void IgniteOnAnimationStarted()
 {
     OnAnimationStarted?.Invoke();
 }