Extensions for Component
public static class ComponentExt
Inheritance System.Object ComponentExt
Destroys this Component
public static void Destroy(this Component component);
component
UnityEngine.Component
Finds the component with the given path and type
public static T GetComponent<T>(this Component component, string componentPath);
T
component
UnityEngine.Component
componentPath
System.String
Try to get a component in a child of this Component by it's name. Equivelant to a foreach with GetComponentsInChildren
public static T GetComponentFromChildrenByName<T>(this Component component, string componentName)
where T : Component;
T
component
UnityEngine.Component
componentName
System.String
Makes the Component hidden (not visible) by setting the scale to zero
public static void Hide(this Component component);
component
UnityEngine.Component
Makes the Component visible by setting the scale to the default value of 1
public static void Show(this Component component);
component
UnityEngine.Component
Translates this component scaled with it's "lossyScale", making it move the same
amount regardless of screen resolution
public static void TranslateScaled(this Component component, Vector3 translation);
component
UnityEngine.Component
translation
UnityEngine.Vector3