My Project
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Events | List of all members
UltimateRadialMenu Class Reference
Inheritance diagram for UltimateRadialMenu:

Classes

class  UltimateRadialButton
 

Public Types

enum  ScalingAxis { Width , Height }
 
enum  AngleOffset { Centered , OffCenter , OnlyEven , OnlyOdd }
 
enum  InitialState { Enabled , Disabled }
 
enum  RadialMenuToggle { FadeAlpha , Scale }
 

Public Member Functions

void UpdateParentCanvas ()
 Updates the parent canvas if it has changed.
 
void ProcessInput (Vector2 input, float distance, bool inputDown, bool inputUp)
 Processes the input and calculates the information for use within the Ultimate Radial Menu.
 
void UpdatePositioning ()
 Updates the positioning of the radial menu according to the user's options.
 
void RegisterToRadialMenu (Action ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Register the provided information to the Ultimate Radial Menu.
 
void RegisterToRadialMenu (Action< int > ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Register the provided information to the Ultimate Radial Menu.
 
void RegisterToRadialMenu (Action< string > ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Register the provided information to the Ultimate Radial Menu.
 
void EnableRadialMenu ()
 Enables the Ultimate Radial Menu so that it can be interacted with.
 
void DisableRadialMenu ()
 Disables the Ultimate Radial Menu so that it can not be interacted with.
 
void DisableRadialMenuImmediate ()
 Disables the Ultimate Radial Menu immediately so that it can not be interacted with.
 
void CreateEmptyRadialButton ()
 Creates an empty radial button at the end of the radial menu.
 
void RemoveAllRadialButtons (int buttonCount=0)
 Removes all of the radial buttons from the radial menu. If a value is provided for the buttonCount parameter, the radial menu will ensure that it does not remove more than that count of buttons.
 
void RemoveRadialButton (int buttonIndex)
 Removes the radial button at the targeted index.
 
void ClearRadialButtonInformations ()
 Clears the registered button information.
 
void SetPosition (Vector3 position)
 Updates the radial menu's position to the new position either in the world or on the screen.
 
void ResetPosition ()
 Resets the position of the radial menu back to it's original position.
 
void SetParent (Transform parent, Vector3 localPosition, Quaternion localRotation)
 Sets the parent of the Canvas to the provided Transform. This is only suitable for World Space radial menus.
 
void ClearRadialButtons ()
 
UltimateRadialButton GetUltimateRadialButton (int buttonIndex)
 
UltimateRadialButton GetUltimateRadialButton (string buttonName)
 
void UpdateSizeAndPlacement ()
 
void UpdateRadialButton (string buttonName, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void UpdateRadialButton (string buttonName, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void UpdateRadialButton (string buttonName, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void UpdateRadialButton (int buttonIndex, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void UpdateRadialButton (int buttonIndex, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void UpdateRadialButton (int buttonIndex, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void AddRadialButton (Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void AddRadialButton (Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void AddRadialButton (Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void InsertRadialButton (int buttonIndex, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void InsertRadialButton (int buttonIndex, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void InsertRadialButton (int buttonIndex, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
void EnableInteraction ()
 
void DisableInteraction ()
 

Static Public Member Functions

static UltimateRadialMenu GetUltimateRadialMenu (string radialMenuName)
 Returns the radial menu that has been registered with the targeted radial menu name.
 
static void RegisterToRadialMenu (string radialMenuName, Action ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Registered the provided information to the targeted Ultimate Radial Menu.
 
static void RegisterToRadialMenu (string radialMenuName, Action< int > ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Registered the provided information to the targeted Ultimate Radial Menu.
 
static void RegisterToRadialMenu (string radialMenuName, Action< string > ButtonCallback, UltimateRadialButtonInfo buttonInfo, int buttonIndex=-1)
 Registered the provided information to the targeted Ultimate Radial Menu.
 
static void EnableRadialMenu (string radialMenuName)
 Enables the targeted Ultimate Radial Menu so that it can be interacted with.
 
static void DisableRadialMenu (string radialMenuName)
 Disables the targeted Ultimate Radial Menu so that it can not be interacted with.
 
static void DisableRadialMenuImmediate (string radialMenuName)
 Disables the Ultimate Radial Menu immediately so that it can not be interacted with.
 
static void CreateEmptyRadialButton (string radialMenuName)
 Creates an empty radial button at the end of the targeted radial menu.
 
static void RemoveAllRadialButtons (string radialMenuName)
 Deletes all of the radial menu buttons from the radial menu.
 
static void RemoveRadialButton (string radialMenuName, int buttonIndex)
 Removes the radial button at the targeted index.
 
static void ClearRadialButtonInformations (string radialMenuName)
 Clears the registered button information.
 
static void SetPosition (string radialMenuName, Vector3 screenPosition)
 Updates the targeted radial menu's position to the new position on the screen.
 
static void ResetPosition (string radialMenuName)
 Resets the position of the radial menu back to it's original position.
 
static void SetParent (string radialMenuName, Transform parent, Vector3 localPosition, Quaternion localRotation)
 Sets the parent of the Canvas to the provided Transform. This is only suitable for World Space radial menus.
 
static void ClearRadialButtons (string radialMenuName)
 
static UltimateRadialButton GetUltimateRadialButton (string radialMenuName, string buttonName)
 
static UltimateRadialButton GetUltimateRadialButton (string radialMenuName, int buttonIndex)
 
static void UpdateRadialButton (string radialMenuName, string buttonName, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void UpdateRadialButton (string radialMenuName, string buttonName, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void UpdateRadialButton (string radialMenuName, string buttonName, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void UpdateRadialButton (string radialMenuName, int buttonIndex, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void UpdateRadialButton (string radialMenuName, int buttonIndex, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void UpdateRadialButton (string radialMenuName, int buttonIndex, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void AddRadialButton (string radialMenuName, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void AddRadialButton (string radialMenuName, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void AddRadialButton (string radialMenuName, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void InsertRadialButton (string radialMenuName, int buttonIndex, Action ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void InsertRadialButton (string radialMenuName, int buttonIndex, Action< int > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 
static void InsertRadialButton (string radialMenuName, int buttonIndex, Action< string > ButtonCallback, UltimateRadialButtonInfo newRadialButtonInfo)
 

Public Attributes

int menuButtonCount = 4
 
ScalingAxis scalingAxis = ScalingAxis.Height
 
float menuSize = 5.0f
 
float horizontalPosition = 50.0f
 
float verticalPosition = 50.0f
 
float depthPosition = 0.0f
 
float menuButtonSize = 0.25f
 
float radialMenuButtonRadius = 1.0f
 
AngleOffset angleOffset = AngleOffset.Centered
 
bool followOrbitalRotation = true
 
float minRange = 0.25f
 
float maxRange = 1.5f
 
bool infiniteMaxRange = false
 
float buttonInputAngle = 0.0f
 
UltimateRadialMenuStyle radialMenuStyle
 
Sprite normalSprite
 
Color normalColor = Color.white
 
InitialState initialState = InitialState.Enabled
 
RadialMenuToggle radialMenuToggle = RadialMenuToggle.FadeAlpha
 
float toggleInDuration = 0.25f
 
float toggleOutDuration = 0.25f
 
bool displayButtonName = false
 
Text nameText
 
float nameTextRatioX = 1.0f
 
float nameTextRatioY = 1.0f
 
float nameTextSize = 0.25f
 
float nameTextHorizontalPosition = 50.0f
 
float nameTextVerticalPosition = 50.0f
 
bool displayButtonDescription = false
 
Text descriptionText
 
float descriptionTextRatioX = 1.0f
 
float descriptionTextRatioY = 1.0f
 
float descriptionTextSize = 0.25f
 
float descriptionTextHorizontalPosition = 50.0f
 
float descriptionTextVerticalPosition = 50.0f
 
bool useButtonIcon = false
 
float iconSize = 0.25f
 
float iconRotation = 0.0f
 
float iconHorizontalPosition = 50.0f
 
float iconVerticalPosition = 50.0f
 
bool iconLocalRotation = false
 
Color iconNormalColor = Color.white
 
Vector2 iconOffset
 
bool useButtonText = false
 
float textAreaRatioX = 1.0f
 
float textAreaRatioY = 0.25f
 
float textSize = 0.25f
 
float textHorizontalPosition = 50.0f
 
float textVerticalPosition = 50.0f
 
bool displayNameOnButton = true
 
bool textLocalPosition = true
 
bool textLocalRotation = true
 
Color textNormalColor = Color.white
 
Font nameFont
 
Font descriptionFont
 
Font buttonTextFont
 
bool nameOutline = false
 
bool descriptionOutline = false
 
bool buttonTextOutline = false
 
Color buttonTextOutlineColor = Color.white
 
bool spriteSwap = false
 
bool colorChange = true
 
bool scaleTransform = false
 
bool iconColorChange = false
 
bool iconScaleTransform = false
 
bool textColorChange = false
 
Sprite highlightedSprite
 
Color highlightedColor = Color.white
 
float highlightedScaleModifier = 1.1f
 
float positionModifier = 0.0f
 
Color iconHighlightedColor = Color.white
 
float iconHighlightedScaleModifier = 1.1f
 
Color textHighlightedColor = Color.white
 
Sprite pressedSprite
 
Color pressedColor = Color.white
 
float pressedScaleModifier = 1.05f
 
float pressedPositionModifier = 0.0f
 
Color iconPressedColor = Color.white
 
float iconPressedScaleModifier = 1.0f
 
Color textPressedColor = Color.white
 
bool selectButtonOnInteract = false
 
Sprite selectedSprite
 
Color selectedColor = Color.white
 
float selectedScaleModifier = 1.0f
 
float selectedPositionModifier = 0.0f
 
Color iconSelectedColor = Color.white
 
float iconSelectedScaleModifier = 1.0f
 
Color textSelectedColor = Color.white
 
Sprite disabledSprite
 
Color disabledColor = Color.white
 
float disabledScaleModifier = 1.0f
 
float disabledPositionModifier = 0.0f
 
Color iconDisabledColor = Color.white
 
float iconDisabledScaleModifier = 1.0f
 
Color textDisabledColor = Color.white
 
List< UltimateRadialButtonUltimateRadialButtonList = new List<UltimateRadialButton>()
 
string radialMenuName = string.Empty
 

Properties

Canvas ParentCanvas [get, set]
 The parent canvas component that this radial menu is a child of.
 
bool IsWorldSpaceRadialMenu [get]
 Returns if this is a World Space radial menu or not.
 
float GetAnglePerButton [get]
 Returns the angle of each button, determined by the menu button count.
 
float GetCurrentInputAngle [get]
 Returns the current input angle so that other scripts can access the current input of this radial menu.
 
float CalculatedMinRange [get]
 Returns the calculated minimum range of the radial menu.
 
float CalculatedMaxRange [get]
 Returns the calculated maximum range of the radial menu.
 
RectTransform BaseTransform [get]
 The base RectTransform component.
 
Vector3 BasePosition [get]
 Returns the position of the base transform.
 
int CurrentButtonIndex [get]
 Returns the index of the button currently being interacted with.
 
int CurrentSelectedButtonIndex [get]
 Returns the stored current selected button index.
 
bool RadialMenuActive [get]
 Returns the current state of the radial menu.
 
bool InputInRange [get]
 Returns the current state of the input on this radial menu.
 
bool Interactable [get, set]
 The current state of being able to interact with the radial menu.
 
bool InTransition [get]
 Returns the state of transitioning the radial menu toggle.
 

Events

Action< int > OnRadialButtonEnter
 This callback will be called when a radial button has been entered.
 
Action< int > OnRadialButtonExit
 This callback will be called when a radial button has been exited.
 
Action< int > OnRadialButtonInputDown
 This callback will be called when the input has been pressed on a radial button.
 
Action< int > OnRadialButtonInputUp
 This callback will be called when the input has been released on a radial button.
 
Action< int > OnRadialButtonInteract
 This callback will be called when a radial button has been interacted with.
 
Action< int > OnRadialButtonSelected
 This callback will be called with a radial menu has been selected.
 
Action OnRadialMenuLostFocus
 This callback will be called when the radial menu has lost focus.
 
Action OnRadialMenuEnabled
 This callback will be called when the radial menu has been enabled.
 
Action OnRadialMenuDisabled
 This callback will be called when the radial menu has been disabled.
 
Action OnUpdatePositioning
 This callback will be called when the radial menu's positioning has been updated.
 
Action< int > OnRadialMenuButtonCountModified
 This callback will be called when a radial button is added or subtracted from the Radial Menu during this frame. This is useful for swapping sprites and positioning for a new count.
 
Action OnUpdateSizeAndPlacement
 

Member Function Documentation

◆ ClearRadialButtonInformations()

static void UltimateRadialMenu.ClearRadialButtonInformations ( string  radialMenuName)
inlinestatic

Clears the registered button information.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ CreateEmptyRadialButton()

static void UltimateRadialMenu.CreateEmptyRadialButton ( string  radialMenuName)
inlinestatic

Creates an empty radial button at the end of the targeted radial menu.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ DisableRadialMenu()

static void UltimateRadialMenu.DisableRadialMenu ( string  radialMenuName)
inlinestatic

Disables the targeted Ultimate Radial Menu so that it can not be interacted with.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ DisableRadialMenuImmediate()

static void UltimateRadialMenu.DisableRadialMenuImmediate ( string  radialMenuName)
inlinestatic

Disables the Ultimate Radial Menu immediately so that it can not be interacted with.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ EnableRadialMenu()

static void UltimateRadialMenu.EnableRadialMenu ( string  radialMenuName)
inlinestatic

Enables the targeted Ultimate Radial Menu so that it can be interacted with.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ GetUltimateRadialMenu()

static UltimateRadialMenu UltimateRadialMenu.GetUltimateRadialMenu ( string  radialMenuName)
inlinestatic

Returns the radial menu that has been registered with the targeted radial menu name.

Parameters
radialMenuNameThe string name that the radial menu has been registered with.

◆ ProcessInput()

void UltimateRadialMenu.ProcessInput ( Vector2  input,
float  distance,
bool  inputDown,
bool  inputUp 
)
inline

Processes the input and calculates the information for use within the Ultimate Radial Menu.

Parameters
inputThe current input values.
distanceThe distance of the input from the center of the radial menu.
inputDownThe state of the input being pressed this frame.
inputUpThe state of the input being released this frame.

◆ RegisterToRadialMenu() [1/6]

void UltimateRadialMenu.RegisterToRadialMenu ( Action  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inline

Register the provided information to the Ultimate Radial Menu.

Parameters
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RegisterToRadialMenu() [2/6]

void UltimateRadialMenu.RegisterToRadialMenu ( Action< int >  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inline

Register the provided information to the Ultimate Radial Menu.

Parameters
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RegisterToRadialMenu() [3/6]

void UltimateRadialMenu.RegisterToRadialMenu ( Action< string >  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inline

Register the provided information to the Ultimate Radial Menu.

Parameters
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RegisterToRadialMenu() [4/6]

static void UltimateRadialMenu.RegisterToRadialMenu ( string  radialMenuName,
Action  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inlinestatic

Registered the provided information to the targeted Ultimate Radial Menu.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RegisterToRadialMenu() [5/6]

static void UltimateRadialMenu.RegisterToRadialMenu ( string  radialMenuName,
Action< int >  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inlinestatic

Registered the provided information to the targeted Ultimate Radial Menu.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RegisterToRadialMenu() [6/6]

static void UltimateRadialMenu.RegisterToRadialMenu ( string  radialMenuName,
Action< string >  ButtonCallback,
UltimateRadialButtonInfo  buttonInfo,
int  buttonIndex = -1 
)
inlinestatic

Registered the provided information to the targeted Ultimate Radial Menu.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
ButtonCallbackThe function that will be called with the button is interacted with.
buttonInfoThe provided button information to apply to the radial button.
buttonIndex[OPTIONAL] This parameter is optional and will determine where to register this information. If no parameter is provided, the information will be registered to the first available button.

◆ RemoveAllRadialButtons() [1/2]

void UltimateRadialMenu.RemoveAllRadialButtons ( int  buttonCount = 0)
inline

Removes all of the radial buttons from the radial menu. If a value is provided for the buttonCount parameter, the radial menu will ensure that it does not remove more than that count of buttons.

Parameters
buttonCount[Optional Parameter] Determines how many buttons the radial menu will leave on the menu.

◆ RemoveAllRadialButtons() [2/2]

static void UltimateRadialMenu.RemoveAllRadialButtons ( string  radialMenuName)
inlinestatic

Deletes all of the radial menu buttons from the radial menu.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ RemoveRadialButton() [1/2]

void UltimateRadialMenu.RemoveRadialButton ( int  buttonIndex)
inline

Removes the radial button at the targeted index.

Parameters
buttonIndexThe index to remove the radial button at.

◆ RemoveRadialButton() [2/2]

static void UltimateRadialMenu.RemoveRadialButton ( string  radialMenuName,
int  buttonIndex 
)
inlinestatic

Removes the radial button at the targeted index.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
buttonIndexThe index to remove the radial button at.

◆ ResetPosition()

static void UltimateRadialMenu.ResetPosition ( string  radialMenuName)
inlinestatic

Resets the position of the radial menu back to it's original position.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.

◆ SetParent() [1/2]

static void UltimateRadialMenu.SetParent ( string  radialMenuName,
Transform  parent,
Vector3  localPosition,
Quaternion  localRotation 
)
inlinestatic

Sets the parent of the Canvas to the provided Transform. This is only suitable for World Space radial menus.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
parentThe new Transform to make the Canvas a child of.
localPositionThe local position of the radial menu.
localRotationThe local rotation of the radial menu.

◆ SetParent() [2/2]

void UltimateRadialMenu.SetParent ( Transform  parent,
Vector3  localPosition,
Quaternion  localRotation 
)
inline

Sets the parent of the Canvas to the provided Transform. This is only suitable for World Space radial menus.

Parameters
parentThe new Transform to make the Canvas a child of.
localPositionThe local position of the radial menu.
localRotationThe local rotation of the radial menu.

◆ SetPosition() [1/2]

static void UltimateRadialMenu.SetPosition ( string  radialMenuName,
Vector3  screenPosition 
)
inlinestatic

Updates the targeted radial menu's position to the new position on the screen.

Parameters
radialMenuNameThe string name that the targeted Ultimate Radial Menu has been registered with.
screenPositionThe new position on the screen.

◆ SetPosition() [2/2]

void UltimateRadialMenu.SetPosition ( Vector3  position)
inline

Updates the radial menu's position to the new position either in the world or on the screen.

Parameters
positionThe new position either on the screen, or in the world.

The documentation for this class was generated from the following file: