Skip to Main Content

BTD_Mod_Helper​.Api​.Components​.ModHelperComponentExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperComponentExt Class

Extensions for mod helper components, for using generics and based on restricts for il2cpp objects

public static class ModHelperComponentExt

Inheritance System.Object  ModHelperComponentExt

Methods

ModHelperComponentExt.AddModHelperComponent(this ModHelperComponent, T) Method

Adds the ModHelperComponent to a parent GameObject, returning the ModHelperComponent


(This is an extension method just so that we can return the type generically)

public static T AddModHelperComponent<T>(this BTD_Mod_Helper.Api.Components.ModHelperComponent parentComponent, T modHelperComponent)
    where T : BTD_Mod_Helper.Api.Components.ModHelperComponent;

Type parameters

T

Parameters

parentComponent ModHelperComponent

modHelperComponent T

Returns

T

ModHelperComponentExt.AddTo(this T, Transform) Method

Adds the ModHelperComponent to a parent Transform, returning the ModHelperComponent


(This is an extension method just so that we can return the type generically)

public static T AddTo<T>(this T modHelperComponent, Transform parent)
    where T : BTD_Mod_Helper.Api.Components.ModHelperComponent;

Type parameters

T

Parameters

modHelperComponent T

parent UnityEngine.Transform

Returns

T

ModHelperComponentExt.Duplicate(this T, string) Method

Creates a copy of this ModHelperComponent with the same parent

public static T Duplicate<T>(this T component, string name)
    where T : BTD_Mod_Helper.Api.Components.ModHelperComponent;

Type parameters

T

Parameters

component T

this

name System.String

Its new name

Returns

T

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