Пример #1
0
        public AnimationController(
            float?value                         = null,
            TimeSpan?duration                   = null,
            TimeSpan?reverseDuration            = null,
            string debugLabel                   = null,
            float lowerBound                    = 0.0f,
            float upperBound                    = 1.0f,
            AnimationBehavior animationBehavior = AnimationBehavior.normal,
            TickerProvider vsync                = null
            )
        {
            D.assert(upperBound >= lowerBound);
            D.assert(vsync != null);
            _direction = _AnimationDirection.forward;

            this.duration          = duration;
            this.reverseDuration   = reverseDuration;
            this.debugLabel        = debugLabel;
            this.lowerBound        = lowerBound;
            this.upperBound        = upperBound;
            this.animationBehavior = animationBehavior;

            _ticker = vsync.createTicker(_tick);
            _internalSetValue(value ?? lowerBound);
        }
Пример #2
0
        public void resync(TickerProvider vsync)
        {
            Ticker oldTicker = _ticker;

            _ticker = vsync.createTicker(_tick);
            _ticker.absorbTicker(oldTicker);
        }
Пример #3
0
 public static AnimationController unbounded(
     float value                         = 0.0f,
     TimeSpan?duration                   = null,
     TimeSpan?reverseDuration            = null,
     string debugLabel                   = null,
     TickerProvider vsync                = null,
     AnimationBehavior animationBehavior = AnimationBehavior.preserve
     )
 {
     return(new AnimationController(value, duration, reverseDuration, debugLabel, animationBehavior, vsync));
 }
Пример #4
0
        AnimationController(
            float value                         = 0.0f,
            TimeSpan?duration                   = null,
            TimeSpan?reverseDuration            = null,
            string debugLabel                   = null,
            AnimationBehavior?animationBehavior = null,
            TickerProvider vsync                = null
            )
        {
            D.assert(vsync != null);
            D.assert(animationBehavior != null);
            lowerBound = float.NegativeInfinity;
            upperBound = float.PositiveInfinity;
            _direction = _AnimationDirection.forward;

            this.duration          = duration;
            this.reverseDuration   = reverseDuration;
            this.debugLabel        = debugLabel;
            this.animationBehavior = animationBehavior.Value;

            _ticker = vsync.createTicker(_tick);
            _internalSetValue(value);
        }