Example #1
0
        /// <summary>
        /// Fade extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Fade FadeFromOriginal(this TransitionStep transitionStep,
                                            float endTransparency,
                                            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.Fade(0,
                                                        endTransparency,
                                                        delay,
                                                        duration,
                                                        TransitionStep.TransitionModeType.FromOriginal,
                                                        timeUpdateMethod,
                                                        tweenType,
                                                        animationCurve,
                                                        runAtStart,
                                                        onStart,
                                                        onUpdate,
                                                        onComplete);

            return(newTransitionStep);
        }
Example #2
0
        /// <summary>
        /// Fade extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static ScreenWipe ScreenWipe(this TransitionStep transitionStep,
                                            Texture2D maskTexture,
                                            bool invertMask   = false,
                                            Color?color       = null,
                                            Texture2D texture = null,
                                            float softness    = 0,
                                            float delay       = 0,
                                            float duration    = 0.5f,
                                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                            AnimationCurve animationCurve        = null,
                                            Action onStart          = null,
                                            Action <float> onUpdate = null,
                                            Action onComplete       = null)
        {
            var newTransitionStep = new ScreenWipe(transitionStep.Target,
                                                   maskTexture,
                                                   invertMask,
                                                   color,
                                                   texture,
                                                   softness,
                                                   delay,
                                                   duration,
                                                   tweenType,
                                                   animationCurve,
                                                   onStart,
                                                   onUpdate,
                                                   onComplete);

            transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            newTransitionStep.Parent = transitionStep;
            return(newTransitionStep);
        }
Example #3
0
        /// <summary>
        /// VolumeTransition extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static VolumeTransition VolumeToCurrent(this TransitionStep transitionStep,
                                                       float startVolume,
                                                       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.VolumeTransition(startVolume,
                                                                    0,
                                                                    delay,
                                                                    duration,
                                                                    TransitionStep.TransitionModeType.ToCurrent,
                                                                    timeUpdateMethod,
                                                                    tweenType,
                                                                    animationCurve,
                                                                    runAtStart,
                                                                    onStart,
                                                                    onUpdate,
                                                                    onComplete);

            return(newTransitionStep);
        }
Example #4
0
        /// <summary>
        /// Constructor. Semi-internal - If you use this be prepared for changes. The best way is to use named
        /// parameters for all optional arguments!
        /// </summary>
        /// <param name="target"></param>
        /// <param name="delay"></param>
        /// <param name="duration"></param>
        /// <param name="transitionMode"></param>
        /// <param name="timeUpdateMethod"></param>
        /// <param name="tweenType"></param>
        /// <param name="animationCurve"></param>
        /// <param name="coordinateSpace"></param>
        /// <param name="onStart"></param>
        /// <param name="onUpdate"></param>
        /// <param name="onComplete"></param>
        public TransitionStep(UnityEngine.GameObject target = null,
                              float delay    = 0,
                              float duration = 0.5f,
                              TransitionModeType transitionMode     = TransitionModeType.Specified,
                              TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
                              TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
                              AnimationCurve animationCurve         = null,
                              CoordinateSpaceType coordinateSpace   = CoordinateSpaceType.Global,
                              Action <TransitionStep> onStart       = null,
                              Action <TransitionStep> onUpdate      = null,
                              Action <TransitionStep> onComplete    = null)
        {
            Target           = target;
            Delay            = delay;
            Duration         = duration;
            TransitionMode   = transitionMode;
            TimeUpdateMethod = timeUpdateMethod;
            TweenType        = tweenType;
            AnimationCurve   = animationCurve ?? AnimationCurve.EaseInOut(0, 0, 1, 1);
            CoordinateSpace  = coordinateSpace;

            AddOnStartAction(onStart);
            AddOnUpdateAction(onUpdate);
            AddOnCompleteAction(onComplete);
        }
Example #5
0
        public static MoveTarget MoveTargetFromOriginal(this TransitionStep transitionStep,
                                                        Vector3 endPosition,
                                                        float delay    = 0,
                                                        float duration = 0.5f,
                                                        TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                                        AnimationCurve animationCurve        = null,
                                                        bool runAtStart         = false,
                                                        Action onStart          = null,
                                                        Action <float> onUpdate = null,
                                                        Action onComplete       = null)
        {
            var newTransitionStep = new MoveTarget(transitionStep.Target,
                                                   Vector3.zero,
                                                   endPosition,
                                                   delay,
                                                   duration,
                                                   TransitionStep.TransitionModeType.FromCurrent,
                                                   tweenType,
                                                   animationCurve,
                                                   onStart,
                                                   onUpdate,
                                                   onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent     = transitionStep;
            newTransitionStep.StartValue = newTransitionStep.OriginalValue;
            return(newTransitionStep);
        }
Example #6
0
        /// <summary>
        /// Scale extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Scale ScaleFromCurrent(this TransitionStep transitionStep,
                                             Vector3 endScale,
                                             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.Scale(Vector3.zero,
                                                         endScale,
                                                         delay,
                                                         duration,
                                                         TransitionStep.TransitionModeType.FromCurrent,
                                                         timeUpdateMethod,
                                                         tweenType,
                                                         animationCurve,
                                                         runAtStart,
                                                         onStart,
                                                         onUpdate,
                                                         onComplete);

            return(newTransitionStep);
        }
Example #7
0
        /// <summary>
        /// Chain a new custom transition step with the specfied settings onto the current one.
        /// </summary>
        /// <returns></returns>
        public TransitionStep ChainCustomTransitionStep(float delay    = 0,
                                                        float duration = 0.5f,
                                                        TransitionStep.TransitionModeType transitionMode     = TransitionStep.TransitionModeType.Specified,
                                                        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 = new TransitionStep(Target,
                                                       delay,
                                                       duration,
                                                       transitionMode,
                                                       timeUpdateMethod,
                                                       tweenType,
                                                       animationCurve,
                                                       onStart: onStart,
                                                       onUpdate: onUpdate,
                                                       onComplete: onComplete);

            newTransitionStep.AddToChain(this, runAtStart);
            return(newTransitionStep);
        }
Example #8
0
        /// <summary>
        /// Fade extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static ScreenWipe ScreenWipe(this TransitionStep transitionStep,
                                            Texture2D maskTexture,
                                            bool invertMask   = false,
                                            Color?color       = null,
                                            Texture2D texture = null,
                                            float softness    = 0,
                                            float delay       = 0,
                                            float duration    = 0.5f,
                                            TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                            AnimationCurve animationCurve        = null,
                                            Action <TransitionStep> onStart      = null,
                                            Action <TransitionStep> onUpdate     = null,
                                            Action <TransitionStep> onComplete   = null)
        {
            var newTransitionStep = new ScreenWipe(transitionStep.Target,
                                                   maskTexture,
                                                   invertMask,
                                                   color,
                                                   texture,
                                                   softness,
                                                   delay,
                                                   duration,
                                                   timeUpdateMethod,
                                                   tweenType,
                                                   animationCurve,
                                                   onStart,
                                                   onUpdate,
                                                   onComplete);

            newTransitionStep.AddToChain(transitionStep, false);
            return(newTransitionStep);
        }
Example #9
0
        /// <summary>
        /// Scale extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static Scale ScaleToOriginal(this TransitionStep transitionStep,
                                            Vector3 startScale,
                                            float delay    = 0,
                                            float duration = 0.5f,
                                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                            AnimationCurve animationCurve        = null,
                                            bool runAtStart         = false,
                                            Action onStart          = null,
                                            Action <float> onUpdate = null,
                                            Action onComplete       = null)
        {
            var newTransitionStep = new Scale(transitionStep.Target,
                                              startScale,
                                              Vector3.zero,
                                              delay,
                                              duration,
                                              TransitionStep.TransitionModeType.ToOriginal,
                                              tweenType,
                                              animationCurve,
                                              onStart,
                                              onUpdate,
                                              onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent   = transitionStep;
            newTransitionStep.EndValue = newTransitionStep.OriginalValue;
            return(newTransitionStep);
        }
Example #10
0
        /// <summary>
        /// ColorTransition extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static ColorTransition ColorTransition(this TransitionStep transitionStep,
                                                      UnityEngine.Gradient gradient,
                                                      float delay    = 0,
                                                      float duration = 0.5f,
                                                      TransitionStep.TransitionModeType transitionMode     = TransitionStep.TransitionModeType.Specified,
                                                      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 = new ColorTransition(transitionStep.Target,
                                                        gradient,
                                                        delay,
                                                        duration,
                                                        transitionMode,
                                                        timeUpdateMethod,
                                                        tweenType,
                                                        animationCurve,
                                                        onStart,
                                                        onUpdate,
                                                        onComplete);

            newTransitionStep.AddToChain(transitionStep, runAtStart);
            return(newTransitionStep);
        }
Example #11
0
        /// <summary>
        /// Scale extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Scale Scale(this TransitionStep transitionStep,
                                  Vector3 startScale,
                                  Vector3 endScale,
                                  float delay    = 0,
                                  float duration = 0.5f,
                                  TransitionStep.TransitionModeType transitionMode     = TransitionStep.TransitionModeType.Specified,
                                  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 = new Scale(transitionStep.Target,
                                              startScale,
                                              endScale,
                                              delay,
                                              duration,
                                              transitionMode,
                                              timeUpdateMethod,
                                              tweenType,
                                              animationCurve,
                                              onStart,
                                              onUpdate,
                                              onComplete);

            newTransitionStep.AddToChain(transitionStep, runAtStart);
            return(newTransitionStep);
        }
Example #12
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);
        }
Example #13
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);
        }
Example #14
0
        /// <summary>
        /// Move extension method for TransitionStep
        /// </summary>
        /// <returns></returns>
        public static Move MoveFromOriginal(this TransitionStep transitionStep,
                                            Vector3 endPosition,
                                            float delay    = 0,
                                            float duration = 0.5f,
                                            TransitionStep.TimeUpdateMethodType timeUpdateMethod = TransitionStep.TimeUpdateMethodType.GameTime,
                                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                                            AnimationCurve animationCurve        = null,
                                            TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                            bool runAtStart = false,
                                            Action <TransitionStep> onStart    = null,
                                            Action <TransitionStep> onUpdate   = null,
                                            Action <TransitionStep> onComplete = null)
        {
            var newTransitionStep = transitionStep.Move(Vector3.zero,
                                                        endPosition,
                                                        delay,
                                                        duration,
                                                        TransitionStep.TransitionModeType.FromOriginal,
                                                        timeUpdateMethod,
                                                        tweenType,
                                                        animationCurve,
                                                        coordinateMode,
                                                        runAtStart,
                                                        onStart,
                                                        onUpdate,
                                                        onComplete);

            return(newTransitionStep);
        }
Example #15
0
        public ScreenWipe(UnityEngine.GameObject target,
                          Texture2D maskTexture,
                          bool invertMask   = false,
                          Color?color       = null,
                          Texture2D texture = null,
                          float softness    = 0,
                          float delay       = 0,
                          float duration    = 0.5f,
                          TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                          AnimationCurve animationCurve        = null,
                          Action onStart          = null,
                          Action <float> onUpdate = null,
                          Action onComplete       = null) :
            base(target, delay: delay, duration: duration, tweenType: tweenType,
                 animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
        {
            Assert.IsTrue(softness >= 0 && softness <= 1, "Softness must be between 0 and 1");

            _screenWipeComponents = new ScreenWipeComponents {
                PersistantAcrossScenes = true
            };

            MaskTexture = maskTexture;
            InvertMask  = invertMask;
            Color       = color.HasValue ? color.Value : Color.white;
            Texture     = texture;
            Softness    = softness;
        }
Example #16
0
 public TransitionStepValue(GameObject target = null,
                            float delay       = 0,
                            float duration    = 0.5F,
                            TransitionModeType transitionMode     = TransitionModeType.Specified,
                            TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
                            TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
                            AnimationCurve animationCurve         = null,
                            CoordinateSpaceType coordinateSpace   = CoordinateSpaceType.Global,
                            Action <TransitionStep> onStart       = null,
                            Action <TransitionStep> onUpdate      = null,
                            Action <TransitionStep> onComplete    = null) :
     base(target, delay, duration, transitionMode, timeUpdateMethod, tweenType, animationCurve, coordinateSpace, onStart, onUpdate, onComplete)
 {
 }
Example #17
0
 public MoveTarget(UnityEngine.GameObject target,
                   Vector3?startPosition                = null,
                   Vector3?endPosition                  = null,
                   float delay                          = 0,
                   float duration                       = 0.5f,
                   TransitionModeType transitionMode    = TransitionModeType.Specified,
                   TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                   AnimationCurve animationCurve        = null,
                   Action onStart                       = null,
                   Action <float> onUpdate              = null,
                   Action onComplete                    = null) :
     base(target, startPosition, endPosition, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
 }
Example #18
0
 public Fade(UnityEngine.GameObject target,
             float startTransparency              = 0,
             float endTransparency                = 1,
             float delay                          = 0,
             float duration                       = 0.5f,
             TransitionModeType transitionMode    = TransitionModeType.Specified,
             TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
             AnimationCurve animationCurve        = null,
             Action onStart                       = null,
             Action <float> onUpdate              = null,
             Action onComplete                    = null) :
     base(target, startValue: startTransparency, endValue: endTransparency,
          delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
 }
Example #19
0
 public Scale(UnityEngine.GameObject target,
              Vector3?startScale = null,
              Vector3?endScale   = null,
              float delay        = 0,
              float duration     = 0.5f,
              TransitionModeType transitionMode     = TransitionModeType.Specified,
              TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
              TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
              AnimationCurve animationCurve         = null,
              Action <TransitionStep> onStart       = null,
              Action <TransitionStep> onUpdate      = null,
              Action <TransitionStep> onComplete    = null) :
     base(target, startScale, endScale, delay: delay, duration: duration, transitionMode: transitionMode, timeUpdateMethod: timeUpdateMethod, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
 }
 public TransitionStepScreen(UnityEngine.GameObject target,
                             float delay    = 0,
                             float duration = 0.5f,
                             TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                             AnimationCurve animationCurve        = null,
                             Action onStart                     = null,
                             Action <float> onUpdate            = null,
                             TransitionStep onCompleteItem      = null,
                             Action onComplete                  = null,
                             Action <object> onCompleteWithData = null,
                             object onCompleteData              = null) :
     base(target, delay: delay, duration: duration, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     SetupComponentReferences();
 }
 public ScreenFade(UnityEngine.GameObject target,
                   Color?color       = null,
                   Texture2D texture = null,
                   float delay       = 0,
                   float duration    = 0.5f,
                   TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                   AnimationCurve animationCurve        = null,
                   Action onStart          = null,
                   Action <float> onUpdate = null,
                   Action onComplete       = null) :
     base(target, delay: delay, duration: duration, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     Color   = color.HasValue ? color.Value : Color.white;
     Texture = texture;
 }
Example #22
0
 public Rotate(UnityEngine.GameObject target,
               Vector3?startRotation                = null,
               Vector3?endRotation                  = null,
               float delay                          = 0,
               float duration                       = 0.5f,
               TransitionModeType transitionMode    = TransitionModeType.Specified,
               TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
               AnimationCurve animationCurve        = null,
               TransitionStep.CoordinateSpaceType coordinateSpace = TransitionStep.CoordinateSpaceType.Global,
               Action onStart          = null,
               Action <float> onUpdate = null,
               Action onComplete       = null) :
     base(target, startRotation, endRotation, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType,
          animationCurve: animationCurve, coordinateSpace: coordinateSpace, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     Assert.AreNotEqual(CoordinateSpaceType.AnchoredPosition, CoordinateSpace, "AnchoredPosition is not supported for Rotate. Please change");
 }
Example #23
0
 public ColorTransition(UnityEngine.GameObject target,
                        UnityEngine.Gradient gradient = null,
                        float delay    = 0,
                        float duration = 0.5f,
                        TransitionModeType transitionMode     = TransitionModeType.Specified,
                        TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
                        TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
                        AnimationCurve animationCurve         = null,
                        Action <TransitionStep> onStart       = null,
                        Action <TransitionStep> onUpdate      = null,
                        Action <TransitionStep> onComplete    = null) :
     base(target,
          delay: delay, duration: duration, transitionMode: transitionMode, timeUpdateMethod: timeUpdateMethod, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     Gradient      = gradient;
     OriginalValue = GetCurrent();
 }
Example #24
0
 public TransitionStepFloat(UnityEngine.GameObject target = null,
                            float?startValue = null,
                            float?endValue   = null,
                            float delay      = 0,
                            float duration   = 0.5f,
                            TransitionModeType transitionMode    = TransitionModeType.Specified,
                            TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                            AnimationCurve animationCurve        = null,
                            CoordinateSpaceType coordinateSpace  = CoordinateSpaceType.Global,
                            Action onStart          = null,
                            Action <float> onUpdate = null,
                            Action onComplete       = null) :
     base(target, delay, duration, transitionMode, tweenType, animationCurve, coordinateSpace, onStart, onUpdate, onComplete)
 {
     StartValue    = startValue.GetValueOrDefault();
     EndValue      = endValue.GetValueOrDefault();
     OriginalValue = GetCurrent();
 }
Example #25
0
 public Move(UnityEngine.GameObject target,
             Vector3?startPosition                = null,
             Vector3?endPosition                  = null,
             float delay                          = 0,
             float duration                       = 0.5f,
             TransitionModeType transitionMode    = TransitionModeType.Specified,
             TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
             AnimationCurve animationCurve        = null,
             CoordinateSpaceType coordinateSpace  = CoordinateSpaceType.Global,
             Action onStart                       = null,
             Action <float> onUpdate              = null,
             Action onComplete                    = null) :
     base(target, startPosition, endPosition, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType,
          animationCurve: animationCurve, coordinateSpace: coordinateSpace, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     //TODO: Validation . where to place!
     //if (MoveMode == MoveModeType.AnchoredPosition)
     //    Assert.IsNotNull(Target.transform as RectTransform, "The target of TransitionMove must contain a RectTransform component (not just a standard Transform component) when using MoveMode of type AnchoredPosition");
 }
Example #26
0
        public ScreenFade(UnityEngine.GameObject target,
                          Color?color       = null,
                          Texture2D texture = null,
                          float delay       = 0,
                          float duration    = 0.5f,
                          TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
                          TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
                          AnimationCurve animationCurve         = null,
                          Action <TransitionStep> onStart       = null,
                          Action <TransitionStep> onUpdate      = null,
                          Action <TransitionStep> onComplete    = null) :
            base(target, delay: delay, duration: duration, timeUpdateMethod: timeUpdateMethod, tweenType: tweenType,
                 animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
        {
            _screenFadeComponents = new ScreenFadeComponents {
                PersistantAcrossScenes = true
            };

            Color   = color.HasValue ? color.Value : Color.white;
            Texture = texture;
        }
 public TransitionStepScreen(UnityEngine.GameObject target,
                             SceneChangeModeType sceneChangeMode = SceneChangeModeType.None,
                             string sceneToLoad         = null,
                             bool skipOnCrossTransition = true,
                             float delay    = 0,
                             float duration = 0.5f,
                             TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                             AnimationCurve animationCurve        = null,
                             Action onStart                     = null,
                             Action <float> onUpdate            = null,
                             TransitionStep onCompleteItem      = null,
                             Action onComplete                  = null,
                             Action <object> onCompleteWithData = null,
                             object onCompleteData              = null) :
     base(target, delay: delay, duration: duration, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     SceneChangeMode       = sceneChangeMode;
     SceneToLoad           = sceneToLoad;
     SkipOnCrossTransition = skipOnCrossTransition;
     SetupComponents();
 }
Example #28
0
        /// <summary>
        /// Rotate extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static Rotate Rotate(this TransitionStep transitionStep,
                                    Vector3 startRotation,
                                    Vector3 endRotation,
                                    float delay    = 0,
                                    float duration = 0.5f,
                                    TransitionStep.TransitionModeType transitionMode = TransitionStep.TransitionModeType.Specified,
                                    TransitionHelper.TweenType tweenType             = TransitionHelper.TweenType.linear,
                                    AnimationCurve animationCurve = null,
                                    TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global,
                                    bool runAtStart         = false,
                                    Action onStart          = null,
                                    Action <float> onUpdate = null,
                                    Action onComplete       = null)
        {
            var newTransitionStep = new Rotate(transitionStep.Target,
                                               startRotation,
                                               endRotation,
                                               delay,
                                               duration,
                                               transitionMode,
                                               tweenType,
                                               animationCurve,
                                               coordinateMode,
                                               onStart,
                                               onUpdate,
                                               onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent = transitionStep;
            return(newTransitionStep);
        }
Example #29
0
        /// <summary>
        /// Fade extension method for TransitionStep
        /// </summary>
        /// <typeparam name="T">interface type</typeparam>
        /// <param name="TransitionStep"></param>
        /// <returns></returns>
        public static Fade Fade(this TransitionStep transitionStep,
                                float startTransparency,
                                float endTransparency,
                                float delay    = 0,
                                float duration = 0.5f,
                                TransitionStep.TransitionModeType transitionMode = TransitionStep.TransitionModeType.Specified,
                                TransitionHelper.TweenType tweenType             = TransitionHelper.TweenType.linear,
                                AnimationCurve animationCurve = null,
                                bool runAtStart         = false,
                                Action onStart          = null,
                                Action <float> onUpdate = null,
                                Action onComplete       = null)
        {
            var newTransitionStep = new Fade(transitionStep.Target,
                                             startTransparency,
                                             endTransparency,
                                             delay,
                                             duration,
                                             transitionMode,
                                             tweenType,
                                             animationCurve,
                                             onStart,
                                             onUpdate,
                                             onComplete);

            if (runAtStart)
            {
                transitionStep.AddOnStartTransitionStep(newTransitionStep);
            }
            else
            {
                transitionStep.AddOnCompleteTransitionStep(newTransitionStep);
            }
            newTransitionStep.Parent = transitionStep;
            return(newTransitionStep);
        }
 /// <summary>
 /// Reset parameters to their default state.
 /// </summary>
 void Reset()
 {
     Progress = 0;
     Duration = 0.5f;
     TweenType = TransitionHelper.TweenType.linear;
     AnimationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
 }
 /// <summary>
 /// Set the transition type
 /// </summary>
 /// <param name="tweenType"></param>
 /// <returns></returns>
 public TransitionStep SetTweenType(TransitionHelper.TweenType tweenType)
 {
     TweenType = tweenType;
     return(this);
 }
 /// <summary>
 /// Set the transition type
 /// </summary>
 /// <param name="tweenType"></param>
 /// <returns></returns>
 public TransitionStep SetTweenType(TransitionHelper.TweenType tweenType)
 {
     TweenType = tweenType;
     return this;
 }