Class ScreenFadeEffect
Screen fade effect by using a custom shader modifying the cameraToFade(s) rendered image
Inherited Members
Namespace: Xareus.Unity
Assembly: Xareus.Unity.Libraries.dll
Syntax
[DisallowMultipleComponent]
public class ScreenFadeEffect : UnitySingleton<ScreenFadeEffect>
Fields
LastUsedPipelineType
Declaration
protected ScreenFadeEffect.PipelineType LastUsedPipelineType
Field Value
| Type | Description |
|---|---|
| ScreenFadeEffect.PipelineType |
LastUsedRenderPipelineAsset
Declaration
protected RenderPipelineAsset LastUsedRenderPipelineAsset
Field Value
| Type | Description |
|---|---|
| RenderPipelineAsset |
MustStopFading
Whether the fading must be stopped (used to stop the fading when a new fade command is given while a fading is already in progress)
Declaration
public bool MustStopFading
Field Value
| Type | Description |
|---|---|
| bool |
OnFadeFinished
Action to call when a fade routine is finished
Declaration
public Action OnFadeFinished
Field Value
| Type | Description |
|---|---|
| Action |
currentFadeBackend
Declaration
protected IScreenFadeBackend currentFadeBackend
Field Value
| Type | Description |
|---|---|
| IScreenFadeBackend |
fadeValue
Current fade value
Declaration
protected float fadeValue
Field Value
| Type | Description |
|---|---|
| float |
Methods
GetScreenFade(Camera)
Get the effect component (add the necessary elements if needed)
Declaration
protected static ScreenFadeEffect GetScreenFade(Camera camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera |
Returns
| Type | Description |
|---|---|
| ScreenFadeEffect |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
SetFade(Camera[], float)
Instant Fade using current color
Declaration
public static void SetFade(Camera[] cameras, float fade)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera[] | cameras | Cameras on which the fade effect must be applied |
| float | fade | Fade value (1 : solid color, 0 : cameraToFade render) |
SetFade(Camera[], float, Color)
Instant Fade using the specified color
Declaration
public static void SetFade(Camera[] cameras, float fade, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera[] | cameras | Cameras on which the fade effect must be applied |
| float | fade | Fade value (1 : solid color, 0 : cameraToFade render) |
| Color | color | Color to use for the fade effect |
SmoothFade(Camera[], float, float, Action)
Fade over time. The fade will be applied using the current color of the effect
Declaration
public static void SmoothFade(Camera[] cameras, float fade, float fadeDuration, Action finishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera[] | cameras | Cameras on which the fade effect must be applied |
| float | fade | Fade value (1 : solid color, 0 : cameraToFade render) |
| float | fadeDuration | Fade duration in seconds |
| Action | finishedCallback |
SmoothFade(Camera[], float, float, Color, Action)
Fade over time using the specified color. The color will be lerped from the current effect color
Declaration
public static void SmoothFade(Camera[] cameras, float fade, float fadeDuration, Color color, Action finishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera[] | cameras | Cameras on which the fade effect must be applied |
| float | fade | Fade value (1 : solid color, 0 : cameraToFade render) |
| float | fadeDuration | Fade duration in seconds |
| Color | color | Color to use for the fade effect. |
| Action | finishedCallback |