Registers the information provided to the radial menu.
Overload Methods
RegisterButton( Action ButtonCallback, UltimateRadialButtonInfo info, int index )
RegisterButton( Action<int> ButtonCallback, UltimateRadialButtonInfo info, int index )
RegisterButton( Action<string> ButtonCallback, UltimateRadialButtonInfo info, int index )
Basic Callback
usingUnityEngine;publicclassRadialMenuExample:MonoBehaviour{ // BE SURE TO ASSIGN THIS IN THE INSPECTOR //publicUltimateRadialMenu radialMenu;publicUltimateRadialButtonInfo buttonInfo;voidStart () {radialMenu.RegisterButton( MyCallback, buttonInfo ); }voidMyCallback () {Debug.Log( "MyCallback called!" ); }}
int Callback
usingUnityEngine;publicclassRadialMenuExample:MonoBehaviour{ // BE SURE TO ASSIGN THIS IN THE INSPECTOR //publicUltimateRadialMenu radialMenu;publicUltimateRadialButtonInfo buttonInfo;voidStart () { // This value can be set in the inspector, or here before registering the information to the radial menu.buttonInfo.id=101;radialMenu.RegisterButton( UseItem, buttonInfo ); }voidUseItem ( int id ) { // This is where you can check your item dictionary.Debug.Log( $"UseItem called for item: {id}" ); }}
string Callback
usingUnityEngine;publicclassRadialMenuExample:MonoBehaviour{ // BE SURE TO ASSIGN THIS IN THE INSPECTOR //publicUltimateRadialMenu radialMenu;publicUltimateRadialButtonInfo buttonInfo;voidStart () { // This value can be set in the inspector, or here before registering the information to the radial menu.buttonInfo.key="HealthPotion";radialMenu.RegisterButton( UseItem, buttonInfo ); }voidUseItem ( string key ) { // This is where you can check your item dictionary.Debug.Log( $"UseItem called for: {key}" ); }}