Table of Contents
Extensions for mod helper components, for using generics and based on restricts for il2cpp objects
public static class ModHelperComponentExt
Inheritance System.Object ModHelperComponentExt
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;
T
parentComponent
ModHelperComponent
modHelperComponent
T
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;
T
modHelperComponent
T
parent
UnityEngine.Transform
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;
T
component
T
this
name
System.String
Its new name