Transitions Plus · Scripting Support (C#)
TransitionAnimator component (namespace TransitionsPlus). Access via GetComponent<TransitionAnimator>().
Add using TransitionsPlus; at the top of your script. Transitions can be started with a single static call:
using TransitionsPlus;
// Quick start with a profile asset
TransitionAnimator.Start(myTransitionProfile);
// Quick start with inline parameters
TransitionAnimator.Start(TransitionType.Fade, duration: 2f, color: Color.black);
float progress { get; set; }Current animation progress from 0 (start) to 1 (end). Default: 0.
bool isPlaying { get; }Whether the transition is currently animating (read-only).
TransitionProfile profile { get; set; }The transition profile currently in use. Default: null.
bool showInEditModeShow the transition canvas while not in Play Mode. Default: true.
bool autoPlayAutomatically start the transition when the GameObject activates. Default: true.
float playDelayDelay in seconds before starting the transition. Default: 0.
bool useUnscaledTimeUse unscaled time so the transition is not affected by Time.timeScale. Default: false.
bool autoDestroyAutomatically remove the transition from the scene when finished. Default: false.
float destroyDelayDelay in seconds before destroying the transition after it finishes. Default: 0.
bool destroyAllTransitionsWhen autoDestroy is enabled, destroy all transitions in the scene instead of just this one. Default: false.
RenderMode renderModeRendering mode: FullScreen, InsideUI (renders inside a RawImage), or VR. Default: RenderMode.FullScreen.
RawImage customScreenCustom RawImage target when renderMode is set to InsideUI. Default: null.
int sortingOrderCanvas sorting order, useful when launching several animations at the same time. Default: 100.
UnityEvent onTransitionEnd()Event triggered when the transition animation ends.
bool loadSceneAtEndLoad a scene when the transition finishes. Default: false.
string sceneNameToLoadName of the scene to load at transition end.
LoadSceneMode sceneLoadModeScene loading mode. Default: LoadSceneMode.Single.
bool fadeToCameraEnable camera-to-camera fade transition. Default: false.
Camera mainCameraPrimary camera for the transition. Auto-resolved to Camera.main if not set.
Camera secondCameraSecondary camera for camera-to-camera transitions. Default: null.
bool switchActiveCameraAutomatically toggle main/second camera active states during and after the transition. Default: true.
bool keepSecondCameraActiveKeep the second camera active while the transition is being performed. Default: false.
bool autoFollowMake the animation center follow a target GameObject. Default: false.
Transform followTargetTarget transform to follow when autoFollow is enabled. Default: null.
Vector3 followPositionOffsetOffset added to the followed target position. Default: (0, 0, 0).
void Play()Play the transition from the beginning.
void SetProgress(float t)Manually set the animation progress (0 to 1).
void SetProfile(TransitionProfile profile)Change the transition profile at runtime.
void PlayAudio()Play the sound effect assigned to the current profile.
void UpdateMaterialProperties()Refresh all shader material properties. Called automatically but can be triggered manually after changing profile values.
Both overloads return the TransitionAnimator instance, which you can use to set additional properties like useUnscaledTime that are not available as parameters.
static TransitionAnimator Start(TransitionProfile profile, ...)Start a transition from a profile asset. All parameters are optional except profile.
TransitionProfile - The profile asset to use (required).bool - Remove the transition when finished. Default: true.float - Seconds to wait before destroying. Default: 1.string - Scene to load when transition ends. Default: null.LoadSceneMode - Default: Single.bool - Enable camera-to-camera transition. Default: false.Camera - Primary camera. Default: null (auto-resolved).Camera - Secondary camera. Default: null.bool - Auto-toggle cameras. Default: true.bool - Follow a target. Default: false.Transform - Target to follow. Default: null.int - Canvas sorting order. Default: unchanged.float - Delay before starting. Default: 0.Vector3 - Follow offset. Default: (0,0,0).RenderMode - Default: FullScreen.RawImage - Target for InsideUI mode. Default: null.static TransitionAnimator Start(TransitionType type, ...)Start a transition with inline customization. Creates a temporary profile. All parameters are optional except type. Includes all parameters from the profile-based overload above, plus:
TransitionType - The transition effect (required).float - Duration in seconds. Default: 2.Color - Solid color. Default: Color.black.Gradient - Gradient (sets colorMode to Gradient). Default: null.Texture2D - Texture (sets colorMode to Texture). Default: null.Vector2 - Animation center offset. Default: (0,0).bool - Prevent stretching. Default: false.float - Rotation in degrees. Default: 0.float - Rotation speed. Default: 0.float - Default: 0.int - Default: 1.float - Default: 0.5.Texture2D - Noise texture. Default: null (built-in).Vector2 - Default: (1,1).bool - Invert direction. Default: false.float - Default: 0.5.float - Default: 1.int - Default: 5.int - Default: 8.int - Default: 0.int - Default: 64.float - Default: 16.AudioClip - Sound effect. Default: null.float - Speed multiplier. Default: 1.Texture2D - SDF shape. Default: null (built-in).int - Default: 0 (disabled).bool - Randomize seed. Default: false.float - Progress value at which the visual transition begins. Default: 0.float - Progress value at which the visual transition completes. Default: 1.useUnscaledTime, destroyAllTransitions, and keepSecondCameraActive are not available as parameters in the static Start() methods. Set them on the returned instance:
var ta = TransitionAnimator.Start(TransitionType.Fade, duration: 0.5f);
ta.useUnscaledTime = true;
A TransitionProfile is a ScriptableObject that holds all visual settings for a transition. Create one via Assets > Create > Transition Profile.
TransitionType typeThe transition effect to use. Default: TransitionType.Fade.
bool invertInvert the transition direction. Default: false.
float durationTransition duration in seconds. Default: 2.
float timeMultiplierSpeed multiplier for the transition. Values greater than 1 speed up, less than 1 slow down. Default: 1.
float progressFromRaw progress value (0-1) at which the visual transition begins. Default: 0.
float progressToRaw progress value (0-1) at which the visual transition completes. Events and camera switches fire at this point. Default: 1.
ColorMode colorModeColor source: SingleColor, Gradient, or Texture. Default: ColorMode.SingleColor.
Color colorSolid color used when colorMode is SingleColor. Default: Color.black.
Gradient gradientGradient used when colorMode is Gradient. Default: white-to-white.
GradientMode gradientModeHow the gradient is applied: Opacity, Time, SpatialRadial, SpatialHorizontal, or SpatialVertical. Default: GradientMode.Opacity.
Texture textureTexture used when colorMode is Texture. Default: null.
Texture2D shapeTextureSDF shape texture for the Shape transition type. Default: built-in star SDF.
float noiseIntensityNoise effect intensity. Range: 0-1. Default: 0.5.
Texture2D noiseTextureNoise texture. Default: built-in noise texture.
Vector2 noiseScaleScale of the noise texture. Default: (1, 1).
float vignetteIntensityVignette effect intensity (Fade type only). Range: 0-1. Default: 1.
int toonGradientIntensityToon gradient banding intensity. Range: 1-256. Default: 64.
float toonDotIntensityToon dot pattern intensity. Range: 0-1. Default: 0.5.
float toonDotRadiusRadius of toon dots. Range: 0.01-0.8. Default: 0.333.
int toonDotCountNumber of toon dots. Min: 8. Default: 32.
float rotationRotation angle in degrees. Default: 0.
float rotationMultiplierRotation speed multiplier during animation. Default: 0.
float distortionEdge distortion amount. Range: 0-5. Default: 0.
int splitsNumber of splits for applicable transition types. Min: 1. Default: 2.
Vector2 centerAnimation center offset. Clamped to (-1, -1) to (2, 2). Default: (0, 0).
bool keepAspectRatioCompensate for screen width/height difference to prevent stretching. Default: false.
bool randomizeRandomize the seed on each play. Default: false.
int seedRandom seed for procedural effects. Min: 0. Default: 0.
int centersCountNumber of effect centers for Burn, BurnSquare, and Splash types. Range: 1-32. Default: 16.
int cellDivisionsNumber of cell divisions for Mosaic, Dissolve, Tiles, and similar types. Min: 1. Default: 32.
float spreadSpread factor for Mosaic and Spiral types. Min: 1. Default: 64.
float contrastEdge contrast. Min: 1. Default: 1.
int pixelizationPixelization level. Range: 0-128. Default: 0 (disabled).
Texture2D splashTextureTexture for the Splash transition type. Default: built-in splash texture.
AudioClip soundOptional sound effect to play during the transition. Default: null.
float soundDelayDelay in seconds before playing the sound. Min: 0. Default: 0.
Available transition effects:
Fade, Mosaic, Dissolve, Tiles, Shape, Wipe, DoubleWipe, CrossWipe, CircularWipe, Burn, BurnSquare, Splash, SeaWaves, Screen, Smear, Slide, DoubleSlide, Cube, Melt, Circles, Spiral, Pixelate, TilesProgressive, Warp, Ripple
FullScreen — Render over entire screen. InsideUI — Render inside a UI RawImage. VR — Optimized for VR cameras.
using TransitionsPlus;
// Fade to black, then load a new scene
TransitionAnimator.Start(
TransitionType.Fade,
duration: 1.5f,
color: Color.black,
sceneNameToLoad: "GameLevel2"
);
// Camera-to-camera transition with a dissolve effect
TransitionAnimator.Start(
TransitionType.Dissolve,
duration: 2f,
fadeToCamera: true,
mainCamera: cam1,
secondCamera: cam2,
switchActiveCamera: true
);
// Use a profile asset with auto-destroy
TransitionAnimator.Start(myProfile, autoDestroy: true, destroyDelay: 0.5f);
// Manual control of transition progress
TransitionAnimator ta = TransitionAnimator.Start(myProfile, autoDestroy: false);
ta.SetProgress(0.5f); // Set to halfwayHelp us improve this documentation page.