Class MonoBehaviourExtension
Namespace: AppMana.InteractionToolkit.MaterialUI
Static class with MonoBehaviour extension methods.
public static class MonoBehaviourExtension
Inheritance
object ← MonoBehaviourExtension
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
GetAddComponent<T>(MonoBehaviour)
Gets a Component on a GameObject if it exists, otherwise add one.
public static T GetAddComponent<T>(this MonoBehaviour monoBehaviour) where T : Component
Parameters
monoBehaviour MonoBehaviour
Returns
T
The Component instance.
Type Parameters
T
The type of Component to add.
GetChildByName<T>(MonoBehaviour, string)
Gets a child Component by name and type.
public static T GetChildByName<T>(this MonoBehaviour monoBehaviour, string name) where T : Component
Parameters
monoBehaviour MonoBehaviour
The MonoBehaviour.
name string
The name to search.
Returns
T
The Component found, otherwise null.
Type Parameters
T
The type of Component.
