Beispiel #1
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);
        }
Beispiel #2
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,
                          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)
        {
            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;
        }
Beispiel #3
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)
 {
 }
Beispiel #4
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)
 {
 }
Beispiel #5
0
 public Fade(UnityEngine.GameObject target,
             float startTransparency               = 0,
             float endTransparency                 = 1,
             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, startValue: startTransparency, endValue: endTransparency,
          delay: delay, duration: duration, transitionMode: transitionMode, timeUpdateMethod: timeUpdateMethod, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
 }
 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();
 }
 public TransitionStepFloat(UnityEngine.GameObject target = null,
                            float?startValue = null,
                            float?endValue   = 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)
 {
     StartValue    = startValue.GetValueOrDefault();
     EndValue      = endValue.GetValueOrDefault();
     OriginalValue = GetCurrent();
 }
Beispiel #8
0
 public Move(UnityEngine.GameObject target,
             Vector3?startPosition                 = null,
             Vector3?endPosition                   = 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, startPosition, endPosition, delay: delay, duration: duration, transitionMode: transitionMode, timeUpdateMethod: timeUpdateMethod, 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");
 }
Beispiel #9
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;
        }
Beispiel #10
0
 public TransitionStepScreen(UnityEngine.GameObject target,
                             SceneChangeModeType sceneChangeMode = SceneChangeModeType.None,
                             string sceneToLoad         = null,
                             bool skipOnCrossTransition = true,
                             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,
                             TransitionStep onCompleteItem         = null,
                             Action <TransitionStep> onComplete    = null,
                             Action <object> onCompleteWithData    = null,
                             object onCompleteData = null) :
     base(target, delay: delay, duration: duration, timeUpdateMethod: timeUpdateMethod, tweenType: tweenType,
          animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
 {
     SceneChangeMode       = sceneChangeMode;
     SceneToLoad           = sceneToLoad;
     SkipOnCrossTransition = skipOnCrossTransition;
     SetupComponents();
 }
Beispiel #11
0
 /// <summary>
 /// Set the time update method
 /// </summary>
 /// <param name="timeUpdateMethod"></param>
 /// <returns></returns>
 public TransitionStep SetTimeUpdateMethod(TimeUpdateMethodType timeUpdateMethod)
 {
     TimeUpdateMethod = timeUpdateMethod;
     return(this);
 }