Table of Contents
ModHelperComponent for a Checkbox
public class ModHelperCheckbox : BTD_Mod_Helper.Api.Components.ModHelperComponent
Inheritance UnityEngine.MonoBehaviour ModHelperComponent ModHelperCheckbox
The ModHelperImage for the Checkmark
public BTD_Mod_Helper.Api.Components.ModHelperImage Check { get; }
Whether it is currently checked or not
public bool CurrentValue { get; }
The Toggle component
public Toggle Toggle { get; }
Creates a new ModHelperCheckbox
public static BTD_Mod_Helper.Api.Components.ModHelperCheckbox Create(BTD_Mod_Helper.Api.Components.Info info, bool defaultValue, string background, UnityAction<bool> onValueChanged=null, string checkImage=null, int padding=0);
info
Info
The name/position/size info
defaultValue
System.Boolean
If it starts out checked or not
background
System.String
The background behind the check, or null for nothing
onValueChanged
UnityEngine.Events.UnityAction
Action to perform when it is checked/unchecked, or null
checkImage
System.String
The checkmark itself, or null for the default checkmark
padding
System.Int32
How much space around the outside of the check there is
ModHelperCheckbox
The new ModHelperCheckbox
Sets the current value of this
public void SetChecked(bool isChecked, bool sendCallback=true);
isChecked
System.Boolean
The new value
sendCallback
System.Boolean
Whether the onValueChanged listener should fire