Exemplo n.º 1
0
        /// <summary>
        /// Creates a new animation pipeline with a delay animation as first animation.
        /// </summary>
        /// <typeparam name="TOwner">The type of the owner.</typeparam>
        /// <param name="owner">The owner.</param>
        /// <param name="seconds">The duration seconds.</param>
        /// <param name="callback">The callback.</param>
        /// <returns>The animation pipeline.</returns>
        public static IAnimationPipeline <TOwner> Delay <TOwner>(this TOwner owner, float seconds, Action callback = null)
            where TOwner : IComponent
        {
            var delayAnimation = new DelayAnimation <TOwner>(owner, seconds, callback);

            return(AnimationPipeline <TOwner> .Create(delayAnimation));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new animation pipeline with a callback.
        /// </summary>
        /// <typeparam name="TOwner">The type of the owner.</typeparam>
        /// <param name="owner">The owner.</param>
        /// <param name="callback">The callback.</param>
        /// <returns>The animation pipeline controller.</returns>
        public static IAnimationPipeline <TOwner> Do <TOwner>(this TOwner owner, Action callback)
            where TOwner : IComponent
        {
            var animation = new DelayAnimation <TOwner>(owner, 0, callback);

            return(AnimationPipeline <TOwner> .Create(animation));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds a delay animation to the pipeline.
        /// </summary>
        /// <typeparam name="TOwner">The type of the owner.</typeparam>
        /// <param name="pipeline">The animation pipeline.</param>
        /// <param name="seconds">The duration seconds.</param>
        /// <param name="callback">The callback.</param>
        /// <returns>The animation pipeline.</returns>
        public static IAnimationPipeline <TOwner> Delay <TOwner>(this IAnimationPipeline <TOwner> pipeline, float seconds, Action callback = null)
            where TOwner : IComponent
        {
            var delayAnimation = new DelayAnimation <TOwner>(pipeline.Owner, seconds, callback);

            pipeline.Add(delayAnimation);

            return(pipeline);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds a callback to the pipeline.
        /// </summary>
        /// <typeparam name="TOwner">The type of the owner.</typeparam>
        /// <param name="pipeline">The animation pipeline.</param>
        /// <param name="callback">The callback.</param>
        /// <returns>The animation pipeline controller.</returns>
        public static IAnimationPipeline <TOwner> Do <TOwner>(this IAnimationPipeline <TOwner> pipeline, Action callback)
            where TOwner : IComponent
        {
            var animation = new DelayAnimation <TOwner>(pipeline.Owner, 0, callback);

            pipeline.Add(animation);

            return(pipeline);
        }