Table of Contents

Class Fade

Namespace
UILib.Behaviours
Assembly
UILib.dll

A behaviour which uses a Timer internally to manage fading in/out CanvasGroups.

public class Fade : Timer
Inheritance
Object
Component
Behaviour
MonoBehaviour
Fade
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.Internal_CancelInvokeAll(MonoBehaviour)
MonoBehaviour.Internal_IsInvokingAll(MonoBehaviour)
MonoBehaviour.IsObjectMonoBehaviour(Object)
MonoBehaviour.StopCoroutineManaged(Coroutine)
MonoBehaviour.GetScriptClassName()
MonoBehaviour.useGUILayout
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.m_CachedPtr
Object.OffsetOfInstanceIDInCPlusPlusObject
Object.objectIsNullMessage
Object.cloneDestroyedMessage
Object.GetInstanceID()
Object.GetHashCode()
Object.CompareBaseObjects(Object, Object)
Object.EnsureRunningOnMainThread()
Object.IsNativeObjectAlive(Object)
Object.GetCachedPtr()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.ToString()
Object.GetOffsetOfInstanceIDInCPlusPlusObject()
Object.CurrentThreadIsMainThread()
Object.Internal_CloneSingle(Object)
Object.Internal_InstantiateSingle(Object, Vector3, Quaternion)
Object.Internal_InstantiateSingleWithParent(Object, Transform, Vector3, Quaternion)
Object.ToString(Object)
Object.GetName(Object)
Object.IsPersistent(Object)
Object.Internal_InstantiateSingle_Injected(Object, ref Vector3, ref Quaternion)
Object.Internal_InstantiateSingleWithParent_Injected(Object, Transform, ref Vector3, ref Quaternion)
Object.name
Object.hideFlags

Properties

fadeTime

The currently set length of time fading should take.

public float fadeTime { get; }

Property Value

float

fadingIn

Whether this fade is currently fading in.

public bool fadingIn { get; }

Property Value

bool

fadingOut

Whether this fade is currently fading out.

public bool fadingOut { get; }

Property Value

bool

maxOpacity

The currently set maximum opacity.

public float maxOpacity { get; }

Property Value

float

minOpacity

The currently set minimum opacity.

public float minOpacity { get; }

Property Value

float

onFadeIn

An event which invokes listeners once fading in has completed entirely.

public UnityEvent onFadeIn { get; }

Property Value

UnityEvent

onFadeOut

An event which invokes listeners once fading out has completed entirely.

public UnityEvent onFadeOut { get; }

Property Value

UnityEvent

opacity

The opacity the canvas groups are currently at.

public float opacity { get; }

Property Value

float

Methods

Add(CanvasGroup)

Adds a CanvasGroup which should have its alpha controlled by this behaviour.

public void Add(CanvasGroup group)

Parameters

group CanvasGroup

FadeIn(bool)

Fades the CanvasGroups in.

public void FadeIn(bool force = false)

Parameters

force bool

Whether to force fading in instantly

FadeOut(bool)

Fades the CanvasGroups out.

public void FadeOut(bool force = false)

Parameters

force bool

Whether to force fading out instantly

SetFadeTime(float)

Sets how long it should take to fade in/out the alpha of the CanvasGroups.

public void SetFadeTime(float time)

Parameters

time float

The length of time the fade should last

SetOpacities(float, float)

Sets the minimum and maximum opacities to fade between.

Both min and max must be between 0-1 inclusive.

If you enter a min > max they will be swapped around.

public void SetOpacities(float min = 0, float max = 1)

Parameters

min float

The minimum opacity

max float

The maximum opacity