UxrComponent.GetCachedComponent<T> Method
Returns a Unity Component cached by type given that there is only one in the GameObject. If there is more than one, it will return the first that GetComponent``1() gets. This method is mainly used to avoid boilerplate code in property getters that return internally cached components.
Namespace: UltimateXR.Core.Components
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public T GetCachedComponent<T>()
where T : Component
Type Parameters
- T
- Component type
Return Value
Type: T
Cached component or null if there is none.