Пример #1
0
        public void Update()
        {
            if (UIPerformance.ShouldSkip())
            {
                return;
            }

            var currentUpdate = new Vector2(animationEditContext.clipTime, animationEditContext.current.animationLength);

            if (_lastScrubberUpdate != currentUpdate)
            {
                if (_lastScrubberUpdate.y != currentUpdate.y)
                {
                    _markers.length = currentUpdate.y;
                }

                _lastScrubberUpdate = currentUpdate;
                var ratio = Mathf.Clamp01(currentUpdate.x / currentUpdate.y);
                _scrubberRect.anchorMin = new Vector2(ratio, 0);
                _scrubberRect.anchorMax = new Vector2(ratio, 1);
            }

            if (_lastTextUpdate != currentUpdate && UIPerformance.ShouldRun(UIPerformance.LowFPSUIRate))
            {
                _lastTextUpdate = currentUpdate;
                _timeText.text  = $"{animationEditContext.clipTime:0.000}s / {animationEditContext.current.animationLength:0.000}s";
            }
        }
Пример #2
0
        public void Update()
        {
            if (UIPerformance.ShouldSkip())
            {
                return;
            }
            if (!plugin.animation.isPlaying)
            {
                return;
            }

            SetTime(plugin.animationEditContext.clipTime, false);
        }
Пример #3
0
        public void Update()
        {
            if (_animationEditContext == null)
            {
                return;
            }
            if (!_animationEditContext.animation.isPlaying)
            {
                return;
            }
            if (UIPerformance.ShouldSkip())
            {
                return;
            }

            SetScrubberPosition(_animationEditContext.clipTime, false);
        }
Пример #4
0
        public void Update()
        {
            if (_animation == null)
            {
                return;
            }
            if (_animation.clipTime == _clipTime)
            {
                return;
            }
            if (UIPerformance.ShouldSkip())
            {
                return;
            }

            _clipTime = _animation.clipTime;
            var ratio = Mathf.Clamp01(_animation.clipTime / _animationLength);

            _scrubberLineRect.anchorMin = new Vector2(ratio, 0);
            _scrubberLineRect.anchorMax = new Vector2(ratio, 1);
        }