/// <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> /// 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> /// <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> /// <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> /// 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> /// Called when an out transition is started /// </summary> protected virtual void TransitionStart(TransitionStep transitionStep) { if (TransitionStartEvent != null) { Fsm.Event(TransitionStartEvent); } }
/// <summary> /// Called when an in transition has been completed (or interupted) /// </summary> protected virtual void TransitionComplete(TransitionStep transitionStep) { if (TransitionCompleteEvent != null) { Fsm.Event(TransitionCompleteEvent); } }
/// <summary> /// Override this if you need to do any specific action when the value is updated /// </summary> /// <param name="amount"></param> protected virtual void TransitionOutUpdate(TransitionStep transitionStep) { if (TransitionOutConfig.OnTransitionUpdate != null) { TransitionOutConfig.OnTransitionUpdate.Invoke(transitionStep); } }
/// <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); }
internal TransitionStep this[int index] { get { TransitionStep transitionStep = new TransitionStep(); transitionStep.State = m_StateChain[index]; int bitPos = index * 2; if (m_ActionBits[bitPos]) { if (m_ActionBits[bitPos + 1]) { transitionStep.QSignal = QSignals.Exit; } else { transitionStep.QSignal = QSignals.Entry; } } else { if (m_ActionBits[bitPos + 1]) { transitionStep.QSignal = QSignals.Init; } else { transitionStep.QSignal = QSignals.Empty; } } return(transitionStep); } }
/// <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> /// 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> /// 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); }
/// <summary> /// Initialise for a transition out. /// </summary> public virtual void InitTransitionOut() { SetupInitialStateOnce(); TransitionMode = TransitionModeType.Out; CurrentTransitionStep = CreateTransitionStepOut(); CurrentTransitionStep.SetProgressToStart(); }
/// <summary> /// Step 5 - Demonstrates fading and scaling at the same time using runAtStart on the second transition. /// </summary> void Step5FadeAndScale(TransitionStep transitionStep) { ShowTransitionedDescription("Fade and Scale in one."); // fade the end text in while at the same time scaling. new Fade(TestGameObject5, 0, 1, 0, 4). ScaleToOriginal(Vector3.zero, 0, 3, runAtStart: true).GetChainRoot().Start(); }
/// <summary> /// Called when an in transition has been completed (or interupted) /// </summary> protected virtual void TransitionComplete(TransitionStep transitionStep) { //if (OnTransitionComplete != null) // OnTransitionComplete.Invoke(transitionStep); //#if GAME_FRAMEWORK // GameFramework.GameStructure.Game.GameActionHelper.PerformActions(TransitionInConfig.OnTransitionCompleteActionReferences, this, false); //#endif }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepOut(TransitionStep transitionStep) { var transitionStepMoveTarget = transitionStep as Move; transitionStepMoveTarget.StartValue = ShownPosition; transitionStepMoveTarget.EndValue = HiddenPosition; base.SetupTransitionStepOut(transitionStep); }
protected override void TransitionOutStart(TransitionStep transitionStep) { if (CrossTransitionTarget != null) { CrossTransitionRenderTexture = new RenderTexture(UnityEngine.Screen.width, UnityEngine.Screen.height, 24); CrossTransitionTarget.gameObject.SetActive(true); CrossTransitionTarget.targetTexture = CrossTransitionRenderTexture; } base.TransitionOutStart(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public virtual void SetupTransitionStep(TransitionStep transitionStep) { transitionStep.Delay = Delay.Value; transitionStep.Duration = Duration.Value; transitionStep.TimeUpdateMethod = (TransitionStep.TimeUpdateMethodType)TimeUpdateMethod.Value; transitionStep.TweenType = (TransitionHelper.TweenType)TransitionType.Value; transitionStep.AnimationCurve = AnimationCurve.curve; transitionStep.OnStart = TransitionStart; transitionStep.OnComplete = TransitionComplete; }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public virtual void SetupTransitionStepOut(TransitionStep transitionStep) { transitionStep.Delay = TransitionOutConfig.Delay; transitionStep.Duration = TransitionOutConfig.Duration; transitionStep.TweenType = TransitionOutConfig.TransitionType; transitionStep.AnimationCurve = TransitionOutConfig.AnimationCurve; transitionStep.OnStart += TransitionOutStart; transitionStep.OnComplete += TransitionOutComplete; transitionStep.OnUpdate += ValueUpdated; }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStep(TransitionStep transitionStep) { var transitionStepColor = transitionStep as ColorTransition; if (transitionStepColor != null) { transitionStepColor.Gradient = Gradient; } base.SetupTransitionStep(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepOut(TransitionStep transitionStep) { var transitionStepVolume = transitionStep as VolumeTransition; if (transitionStepVolume != null) { transitionStepVolume.StartValue = transitionStepVolume.GetCurrent(); transitionStepVolume.EndValue = OutConfig.EndVolume; } base.SetupTransitionStepOut(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStep(TransitionStep transitionStep) { var transitionStepVolume = transitionStep as VolumeTransition; if (transitionStepVolume != null) { transitionStepVolume.StartValue = StartVolume.Value; transitionStepVolume.EndValue = EndVolume.Value; } base.SetupTransitionStep(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepIn(TransitionStep transitionStep) { var transitionStepMoveTarget = transitionStep as MoveTarget; if (transitionStepMoveTarget != null) { transitionStepMoveTarget.StartValue = MoveInConfig.StartTarget.transform.position; transitionStepMoveTarget.EndValue = _originalPosition; } base.SetupTransitionStepIn(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStep(TransitionStep transitionStep) { var transitionStepRotate = transitionStep as TransitionSteps.Rotate; if (transitionStepRotate != null) { transitionStepRotate.StartValue = StartRotation; transitionStepRotate.EndValue = EndRotation; } base.SetupTransitionStep(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepOut(TransitionStep transitionStep) { var transitionStepScreenFade = transitionStep as ScreenFade; if (transitionStepScreenFade != null) { transitionStepScreenFade.Color = OutConfig.Color; transitionStepScreenFade.Texture = OutConfig.Texture; } base.SetupTransitionStepOut(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepOut(TransitionStep transitionStep) { var transitionStepFade = transitionStep as Fade; if (transitionStepFade != null) { transitionStepFade.StartValue = transitionStepFade.GetCurrent(); transitionStepFade.EndValue = FadeOutConfig.EndTransparency; } base.SetupTransitionStepOut(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepIn(TransitionStep transitionStep) { var transitionStepFade = transitionStep as Fade; if (transitionStepFade != null) { transitionStepFade.StartValue = FadeInConfig.StartTransparency; transitionStepFade.EndValue = _originalTransparency; } base.SetupTransitionStepIn(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the in transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStep(TransitionStep transitionStep) { var transitionStepFade = transitionStep as Fade; if (transitionStepFade != null) { transitionStepFade.StartValue = StartTransparency.Value; transitionStepFade.EndValue = EndTransparency.Value; } base.SetupTransitionStep(transitionStep); }
/// <summary> /// Add common values to the transitionStep for the out transition /// </summary> /// <param name="transitionStep"></param> public override void SetupTransitionStepOut(TransitionStep transitionStep) { var transitionStepMoveTarget = transitionStep as MoveTarget; if (transitionStepMoveTarget != null) { transitionStepMoveTarget.StartValue = transitionStepMoveTarget.GetCurrent(); transitionStepMoveTarget.EndValue = MoveOutConfig.EndTarget.transform.position; } base.SetupTransitionStepOut(transitionStep); }
internal TransitionStep this[int index] { get { TransitionStep transitionStep = new TransitionStep(); transitionStep.StateMethod = m_StateMethodChain[index]; int bitPos = index * 2; if (m_ActionBits[bitPos]) { if (m_ActionBits[bitPos + 1]) { transitionStep.QSignal = QSignals.Exit; } else { transitionStep.QSignal = QSignals.Entry; } } else { if (m_ActionBits[bitPos + 1]) { transitionStep.QSignal = QSignals.Init; } else { transitionStep.QSignal = QSignals.Empty; } } return transitionStep; } }