Пример #1
0
        /// <summary>
        /// ColorTransition extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static ColorTransition ColorTransitionFromCurrent(this TransitionStep transitionStep,
                                                                 Color endColor,
                                                                 float delay    = 0,
                                                                 float duration = 0.5f,
                                                                 TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                                                 TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                                                 AnimationCurve animationCurve        = null,
                                                                 bool runAtStart = false,
                                                                 Action <TransitionStep> onStart    = null,
                                                                 Action <TransitionStep> onUpdate   = null,
                                                                 Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = transitionStep.ColorTransition(Color.black,
                                                                   endColor,
                                                                   delay,
                                                                   duration,
                                                                   TransitionStep.TransitionModeType.FromCurrent,
                                                                   timeUpdateMethod,
                                                                   tweenType,
                                                                   animationCurve,
                                                                   runAtStart,
                                                                   onStart,
                                                                   onUpdate,
                                                                   onComplete);

            return(newTransitionStep);
        }
Пример #2
0
        /// <summary>
        /// ColorTransition extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static ColorTransition ColorTransitionToOriginal(this TransitionStep transitionStep,
                                                                UnityEngine.Gradient gradient,
                                                                float delay    = 0,
                                                                float duration = 0.5f,
                                                                TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                                                TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                                                AnimationCurve animationCurve        = null,
                                                                bool runAtStart = false,
                                                                Action <TransitionStep> onStart    = null,
                                                                Action <TransitionStep> onUpdate   = null,
                                                                Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = transitionStep.ColorTransition(gradient,
                                                                   delay,
                                                                   duration,
                                                                   TransitionStep.TransitionModeType.ToOriginal,
                                                                   timeUpdateMethod,
                                                                   tweenType,
                                                                   animationCurve,
                                                                   runAtStart,
                                                                   onStart,
                                                                   onUpdate,
                                                                   onComplete);

            return(newTransitionStep);
        }