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
-
ObjectComponentBehaviourMonoBehaviourFade
- 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.useGUILayoutBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.transformComponent.gameObjectComponent.tagObject.m_CachedPtrObject.OffsetOfInstanceIDInCPlusPlusObjectObject.objectIsNullMessageObject.cloneDestroyedMessageObject.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.nameObject.hideFlags
Properties
fadeTime
The currently set length of time fading should take.
public float fadeTime { get; }
Property Value
fadingIn
Whether this fade is currently fading in.
public bool fadingIn { get; }
Property Value
fadingOut
Whether this fade is currently fading out.
public bool fadingOut { get; }
Property Value
maxOpacity
The currently set maximum opacity.
public float maxOpacity { get; }
Property Value
minOpacity
The currently set minimum opacity.
public float minOpacity { get; }
Property Value
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
Methods
Add(CanvasGroup)
Adds a CanvasGroup which should have
its alpha controlled by this behaviour.
public void Add(CanvasGroup group)
Parameters
groupCanvasGroup
FadeIn(bool)
Fades the CanvasGroups in.
public void FadeIn(bool force = false)
Parameters
forceboolWhether to force fading in instantly
FadeOut(bool)
Fades the CanvasGroups out.
public void FadeOut(bool force = false)
Parameters
forceboolWhether 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
timefloatThe 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)