Skip to Main Content

BTD_Mod_Helper.Extensions.ComponentExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

ComponentExt Class

Extensions for Component

public static class ComponentExt

Inheritance System.Object  ComponentExt

Methods

ComponentExt.Destroy(this Component) Method

Destroys this Component

public static void Destroy(this Component component);

Parameters

component UnityEngine.Component

ComponentExt.GetComponent(this Component, string) Method

Finds the component with the given path and type

public static T GetComponent<T>(this Component component, string componentPath);

Type parameters

T

Parameters

component UnityEngine.Component

componentPath System.String

Returns

T

ComponentExt.GetComponentFromChildrenByName(this Component, string) Method

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;

Type parameters

T

Parameters

component UnityEngine.Component

componentName System.String

Returns

T

ComponentExt.Hide(this Component) Method

Makes the Component hidden (not visible) by setting the scale to zero

public static void Hide(this Component component);

Parameters

component UnityEngine.Component

ComponentExt.Show(this Component) Method

Makes the Component visible by setting the scale to the default value of 1

public static void Show(this Component component);

Parameters

component UnityEngine.Component

ComponentExt.TranslateScaled(this Component, Vector3) Method

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);

Parameters

component UnityEngine.Component

translation UnityEngine.Vector3

To learn how to download BTD Mod Helper and install mods, click here