A ModHelperComponent for a dropdown menu that utilizes a ModHelperPopupMenu
public class ModHelperPopdown : BTD_Mod_Helper.Api.Components.ModHelperPanel
Inheritance UnityEngine.MonoBehaviour ModHelperComponent ModHelperPanel ModHelperPopdown
Whether to automatically size the component that opens the dropdown based on the text width
public bool autosize;
The component which handles the dropdown
public TMP_Dropdown dropdown;
The popup menu used
public ModHelperPopupMenu menu;
Constructs a new popup menu dropdown
public static BTD_Mod_Helper.Api.Components.ModHelperPopdown Create(BTD_Mod_Helper.Api.Components.Info info, Vector2 itemSize, List<string> options, UnityAction<int> onValueChanged, Vector2 direction=default(Vector2), float labelFontSize=42f, string background=null, Vector2 menuOffset=default(Vector2), List<string> images=null, bool autosize=false);
info Info
the initial info to use, should have a Height defined
itemSize UnityEngine.Vector2
size of each option in the popup menu (before margins/padding)
options Il2CppSystem.Collections.Generic.List
the labels for the options
onValueChanged UnityEngine.Events.UnityAction
called when an option is selected, index passed in
direction UnityEngine.Vector2
the direction of the dropdown, Vector2.down or Vector2.up will be the most used
labelFontSize System.Single
text size for label
background System.String
background image, or null
menuOffset UnityEngine.Vector2
position offset for the menu
images Il2CppSystem.Collections.Generic.List
images guids to use for the options
autosize System.Boolean
ModHelperPopdown
the created popdown
Unity Component OnUpdate
protected override void OnUpdate();