Class ScreenFadeEffect
Screen fade effect by using a custom shader modifying the camera(s) rendered image
Inherited Members
Namespace: Xareus.Unity
Assembly: Xareus.Unity.Libraries.dll
Syntax
[RequireComponent(typeof(Camera))]
[DisallowMultipleComponent]
public class ScreenFadeEffect : MonoBehaviour
Fields
fadeValue
Current fade value
Declaration
protected float fadeValue
Field Value
| Type | Description |
|---|---|
| float |
mat
The fade material
Declaration
protected Material mat
Field Value
| Type | Description |
|---|---|
| Material |
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 black 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 : camera 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 : camera render) |
| Color | color | Color to use for the fade effect |
SmoothFade(Camera[], float, float)
Fade using black color
Declaration
public static void SmoothFade(Camera[] cameras, float fade, float fadeDuration)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera[] | cameras | Cameras on which the fade effect must be applied |
| float | fade | Fade value (1 : solid color, 0 : camera render) |
| float | fadeDuration | Fade duration in seconds |
SmoothFade(Camera[], float, float, Color)
Fade using the specified color
Declaration
public static void SmoothFade(Camera[] cameras, float fade, float fadeDuration, 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 : camera render) |
| float | fadeDuration | Fade duration in seconds |
| Color | color | Color to use for the fade effect |