Pass ForgeDocs Product page

API

Transitions and scene changes

Screen transitions, on their own or around a scene load.

PassForgeTransition

Screen transitions from scripts: from the current picture to whatever comes next, for camera cuts, respawns and scene loads, or to a covered screen and back, for loading screens. Needs no Volume; a Volume restyles them.

public static class PassForgeTransition

Namespace PassForge.Effects, assembly PassForge.Runtime.

PassForgeTransition.style

Style of the current or last transition.

public static TransitionStyle style { get; }

PassForgeTransition.color

Color a covered screen shows.

public static Color color { get; }

PassForgeTransition.mask

The grayscale picture the Mask style sweeps by: its dark parts are covered first and its light parts last, and uncovered the other way round. Pass Forge ships over twenty in its Textures/Transition Masks folder. Null uses the Transition Volume's Mask, or a plain wipe.

public static Texture mask { get; set; }

PassForgeTransition.focus

A point in the world the Iris closes on and opens from, followed on screen, such as the player. Null centers it on the screen. It is let go once a transition has uncovered the screen.

public static Vector3? focus { get; set; }

PassForgeTransition.isPlaying

True while a transition animates.

public static bool isPlaying { get; }

PassForgeTransition.isCovered

True once a cover has finished and the screen is fully hidden, until Reveal.

public static bool isCovered { get; }

PassForgeTransition.onCovered

Raised once when a cover has fully come on, such as to load a level behind it: after Cover(TransitionStyle, float), and in LoadScene(string, TransitionStyle, float) before the scene starts loading. A cover cut short by a Reveal or Stop raises nothing. Raised in Play Mode, from an Update and never while drawing. It is static, so subscribe in OnEnable and unsubscribe in OnDisable.

public static event Action onCovered

PassForgeTransition.onRevealed

Raised once when the screen shows the scene again: when a Reveal, a FromCurrentPicture or a LoadScene(string, TransitionStyle, float) has finished, or when Stop ended a transition early. A Timeline track's transition raises nothing. Raised in Play Mode, from an Update and never while drawing. It is static, so subscribe in OnEnable and unsubscribe in OnDisable.

public static event Action onRevealed

PassForgeTransition.WaitUntilCovered()

Waits in a coroutine until a cover coming on is complete: yield return PassForgeTransition.WaitUntilCovered(); It also ends when the cover is cut short, and at once when no cover is coming on. It returns the same object every time, so waiting allocates nothing.

public static CustomYieldInstruction WaitUntilCovered()

PassForgeTransition.WaitUntilRevealed()

Waits in a coroutine until no transition shows: until a cover has been revealed, or a FromCurrentPicture has ended. A cover that stays on keeps it waiting until a Reveal or Stop. A Timeline track's transition does not count. yield return PassForgeTransition.WaitUntilRevealed(); It returns the same object every time, so waiting allocates nothing.

public static CustomYieldInstruction WaitUntilRevealed()

PassForgeTransition.FromCurrentPicture(TransitionStyle, float)

Takes the picture on screen and passes from it to whatever the camera shows next. To load a scene behind it, call this, wait one frame, then load.

public static void FromCurrentPicture(TransitionStyle transitionStyle, float duration = 1f)

PassForgeTransition.Cover(TransitionStyle, float)

Covers the screen with a color and keeps it covered until Reveal.

public static void Cover(TransitionStyle transitionStyle, float duration = 0.6f)

PassForgeTransition.Cover(TransitionStyle, float, Color)

Covers the screen with a color and keeps it covered until Reveal.

public static void Cover(TransitionStyle transitionStyle, float duration, Color coverColor)

PassForgeTransition.Reveal(TransitionStyle, float)

Uncovers the screen after Cover(TransitionStyle, float).

public static void Reveal(TransitionStyle transitionStyle, float duration = 0.6f)

PassForgeTransition.LoadScene(string, TransitionStyle, float)

Covers the screen, loads a scene behind the cover and uncovers it once the scene is in: a level change in one call. The scene must be in the build's scene list. Play Mode only.

public static void LoadScene(string sceneName, TransitionStyle transitionStyle = TransitionStyle.Fade, float duration = 0.6f)

PassForgeTransition.LoadScene(string, TransitionStyle, float, Color)

Covers the screen with a color, loads a scene behind the cover and uncovers it once the scene is in. The scene must be in the build's scene list. Play Mode only.

public static void LoadScene(string sceneName, TransitionStyle transitionStyle, float duration, Color coverColor)

PassForgeTransition.RevealLeftoverCover(TransitionStyle, float)

Reveals a cover an earlier scene left on, such as a Death moment's fade to black, in a scene that does not cover the screen itself: call it from Start. It waits three frames and for any transition under way, so a LoadScene(string, TransitionStyle, float) or a moment about to reveal the screen does it instead. With nothing covered when it is called, it does nothing, so a cover the scene starts later stays on. Play Mode only.

public static void RevealLeftoverCover(TransitionStyle transitionStyle = TransitionStyle.Fade, float duration = 0.4f)

PassForgeTransition.Stop()

Ends any transition at once and shows the scene.

public static void Stop()

PassForgeTransitionTrack

A Timeline track that covers the screen with a transition: each clip's ease in covers it, the middle holds it covered and the ease out uncovers it, for cuts in a cutscene. It shows while scrubbing in Edit Mode too.

public sealed class PassForgeTransitionTrack : TrackAsset

Namespace PassForge.Timeline, assembly PassForge.Timeline. Timeline track: Pass Forge > Transition Track.

PassForgeTransitionClip

A clip that covers the screen over its ease in and uncovers it over its ease out.

public sealed class PassForgeTransitionClip : PlayableAsset, ITimelineClipAsset

Namespace PassForge.Timeline, assembly PassForge.Timeline. Timeline track: Transition.

PassForgeTransitionClip.style

How the screen is covered and uncovered.

public TransitionStyle style

PassForgeTransitionClip.color

Color the screen is covered with.

public Color color

PassForgeTransitionClip.mask

The picture a Mask transition sweeps by.

public Texture2D mask

TransitionStyle

How a transition passes from one picture to the next.

public enum TransitionStyle

Namespace PassForge.Effects, assembly PassForge.Runtime.

ValueMeaning
FadeA plain cross fade.
IrisA circle closing on or opening from the middle of the screen.
DiamondsDiamond shaped pixels growing across the screen.
DissolveA noisy dissolve with a glowing edge.
WipeA straight wipe across the screen.
InkSplashAn ink blot spreading from the middle.
GlassShatterThe picture shatters like glass and falls away.
PaperBurnThe picture burns away from the bottom with glowing embers.
PageTurnThe picture turns like a book page.
ComicPanelsThe picture splits into comic panels that slide away.
MaskSweeps by a grayscale picture: its dark parts are covered first and its light parts last. Pass Forge ships over twenty, from hearts and stars to blinds and clouds. See PassForgeTransition.mask.