GetButtonIndex

Returns the index of the button that this information is associated with in the list of buttons currently on the radial menu.

using UnityEngine;

public class RadialButtonInfoExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateRadialMenu radialMenu;
	public UltimateRadialButtonInfo buttonInfo;

	void Start ()
	{
		// Register the button to the menu.
		radialMenu.RegisterButton( MyCallback, buttonInfo );
		
		// After the button info has been registered get the index of this information by calling the GetButtonIndex function.
		int buttonIndex = buttonInfo.GetButtonIndex();
		
		// Now you can do anything you need with the UltimateRadialButtonList on the radial menu by referencing this index.
	}
	
	void MyCallback ()
	{
		Debug.Log( "MyCallback" );
	}
}

Last updated