Beispiel #1
0
        public TweenBuilder(TweenBuilder builder, IAnimation animation, bool inherit = true)
        {
            if (builder.animation != null && builder.inherit && inherit)
            {
                animation.InheritFrom(builder.animation);
            }

            this.animation = animation;
            this.target    = builder.target;
            this.target.FrameTimer.OnTick(new Func <double, bool>(dt =>
            {
                var ended = this.animation.Update(dt);
                if (ended)
                {
                    IsCompleted = true;
                    continuation?.Invoke();
                }
                return(ended);
            }));
        }