Esempio n. 1
0
 private void Awake()
 {
     if (stateEndEvent == null)
     {
         stateEndEvent = new AnimationEndEvent();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Updates the animation. Not the part of entity loop,
        /// you need to call it on your own.
        ///
        /// NOTE: If using in Draw method, keep in mind that each camera calls the event separately.
        /// You may want to restrict it only to the first camera.
        /// </summary>
        public void Update()
        {
            if (!Running)
            {
                return;
            }

            LinearProgress += TimeKeeper.Time(Math.Abs(Speed));

            if (LinearProgress > 1)
            {
                if (!Looping)
                {
                    Running        = false;
                    LinearProgress = 1;
                }
                else
                {
                    LinearProgress -= (int)LinearProgress;
                }

                AnimationEndEvent?.Invoke(this);
            }
        }
Esempio n. 3
0
 public void StartMoveEndEvent()
 {
     AnimationEndEvent?.Invoke();
 }