Class ComponentExtensions
- Namespace
- S1MAPI.Extensions
- Assembly
- S1MAPI_Mono.dll
Extension methods for Component operations.
public static class ComponentExtensions
- Inheritance
-
ComponentExtensions
- Inherited Members
Methods
Disable<T>(T)
Disable this component.
public static T Disable<T>(this T component) where T : Behaviour
Parameters
componentT
Returns
- T
Type Parameters
T
Enable<T>(T)
Enable this component.
public static T Enable<T>(this T component) where T : Behaviour
Parameters
componentT
Returns
- T
Type Parameters
T
GetComponentByName(Component, string, bool)
Get component by type name without requiring type reference.
public static Component? GetComponentByName(this Component component, string componentName, bool includeInactive = false)
Parameters
Returns
- Component
GetComponent<T>(Component)
Get component or null if not found (no exception thrown).
public static T? GetComponent<T>(this Component component) where T : class
Parameters
componentComponent
Returns
- T
Type Parameters
T