Skip to Main Content

BTD_Mod_Helper​.Extensions​.ButtonExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

ButtonExt Class

Extensions for Buttons

public static class ButtonExt

Inheritance System.Object  ButtonExt

Methods

ButtonExt.AddOnClick(this Button, Function) Method

Adds an onclick function to a button

public static void AddOnClick(this Button button, BTD_Mod_Helper.Extensions.Function funcToExecute);

Parameters

button UnityEngine.UI.Button

funcToExecute Function()

ButtonExt.RemoveOnClickAction(this Button, int) Method

Removes the onclick function of a button

public static void RemoveOnClickAction(this Button button, int actionIndex);

Parameters

button UnityEngine.UI.Button

actionIndex System.Int32

ButtonExt.SetOnClick(this Button, Function) Method

Sets the onclick function of a button

public static void SetOnClick(this Button button, BTD_Mod_Helper.Extensions.Function funcToExecute);

Parameters

button UnityEngine.UI.Button

funcToExecute Function()

ButtonExt.SetSprite(this Button, Sprite, string) Method

Set the sprite for this button.

public static void SetSprite(this Button button, Sprite sprite, string newSpriteName="");

Parameters

button UnityEngine.UI.Button

sprite UnityEngine.Sprite

Sprite to change to

newSpriteName System.String

Optionally provide a new name for the sprite

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