/// <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); }
/// <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); }
/// <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); }
/// <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); }
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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
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; }
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) { }
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) { }
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) { }
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; }
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"); }
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, 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(); }
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"); }
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(); }
/// <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); }
/// <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; }