Example #1
0
        // Main iteration
        private void Update()
        {
            if (IsPlaying)
            {
                Time += UnityEngine.Time.deltaTime;

                if (_activeAnimation != null)
                {
                    _activeAnimation.Rewind(Time);

                    if (Time > _activeAnimation.GetDuration())
                    {
                        if (_activeAnimation.Loop)
                        {
                            Time = 0;
                        }
                        else
                        {
                            Stop();
                        }
                    }
                }
            }
        }