![]() |
uPIe Menu - Radial Menu
|
Contains the main uPIe menu (runtime) logic More...
Public Member Functions | |
Vector2 | GetDirection () |
Gets the current direction from the center of the menu to the pointer (analogue stick direction or mouse position). More... | |
void | PollInput () |
Polls the input. More... | |
Vector2 | GetIndicatorPosition (out Vector2 resultPosition) |
Gets the indicator position. More... | |
Vector2 | GetIndicatorPosition (Vector2 dir, out Vector2 resultPosition) |
Gets the indicator position. More... | |
void | ConfirmCurrentSelection () |
Confirms the current selection (simulates a click respectively button down on the currently selected menu option). More... | |
Selectable | SelectRelatedOption () |
Selects the related option. The id stored in the field SelectedPieceId is used. More... | |
Selectable | SelectRelatedOption (int id) |
Selects the related option by a given id. More... | |
void | RemoveIndicator () |
Removes the indicator. More... | |
Vector3 | GetStartDirection (float additionalOffset=0) |
Gets the start direction. More... | |
Vector3 | GetEndDirection (Vector3 startDir) |
Gets the end direction. More... | |
Vector3 | GetEndDirection () |
Gets the end direction. More... | |
Button | AddButton (string name="", bool tryCopyFromLastMenuOption=true) |
Adds a new button (without adding it to the menu option list). In most cases you should use AddMenuOption as this sets up the button correctly and adds it to the menu options list More... | |
void | InitMenuOption (GameObject instance, string name="") |
Initialize a newly created menu option gameobject instance More... | |
Button | AddMenuOption () |
Adds a new menu option (button) to the menu. More... | |
void | AddMenuOptionAndRescaleX () |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
void | AddMenuOptionAndRescaleY () |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
void | AddMenuOptionAndRescaleZ () |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
Button | AddMenuOptionAndRealign (bool autoRescaleX=true, bool autoRescaleY=false, bool autoRescaleZ=false) |
Adds a new menu option (button) to the menu and automatically realigns the menu options according to what is set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection More... | |
void | RemoveMenuOptionAndRescaleX () |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
void | RemoveMenuOptionAndRescaleY () |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
void | RemoveMenuOptionAndRescaleZ () |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method. More... | |
void | RemoveMenuOptionAndRealign (bool autoRescaleX=true, bool autoRescaleY=false, bool autoRescaleZ=false) |
Removes the last menu option (button) from the menu and automatically realigns the menu options according to what is set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection More... | |
void | RemoveMenuOption () |
Removes the most recently added menu option. More... | |
void | RemoveMenuOption (int id) |
Removes the menu option by a given id. More... | |
void | RemoveMenuOption (Selectable slct) |
Removes the menu option by a given selectable. More... | |
void | ClearMenuOptions () |
Clears all menu options. More... | |
void | Deselect () |
Deselects the currently selected menu option. More... | |
void | OpenSubMenu (uPIeMenu subMenu) |
Opens a sub-uPIe-menu. More... | |
void | ReturnToSuperMenu (uPIeMenu superMenu) |
Closes this sub-uPIe-menu and retuns to the uPIe-menu that is superordinated to this one. More... | |
void | Realign () |
Realigns all menu options. The options set up as alignment options are used. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection More... | |
void | Realign (float radius) |
Realigns all menu options by only using a different radius as set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection More... | |
void | Realign (float radius, bool doAlignRotation, Vector3 upDirection, Vector3 forwardDirection) |
Realigns all menu options by given options More... | |
void | RescaleMenuOptions (float xScale, float yScale=1, float zScale=1, bool multiply=true) |
Rescales all menu options. More... | |
Properties | |
float | ControllerDeadzone [get, set] |
Gets or sets the controller deadzone. This means, when is the analogue stick of the controller considered to be centered. More... | |
bool | EnableSelecting [get, set] |
Gets or sets a value controlling whether selecting menu options is enabled or not. This is mostly used to enable or disable a parent menu when a submenu is opened or closed. More... | |
Selectable | DefaultSelected [get, set] |
Gets or sets the option (button or other selectable) that is selected by default. This means this is what is selected, when the controllers analogue stick is centered More... | |
string | HorizontalInputName [get, set] |
If unity default input is selected (no custom input) this is what the horizontal input is called in the input manager More... | |
string | VerticalInputName [get, set] |
If unity default input is selected (no custom input) this is what the vertical input is called in the input manager More... | |
string | ConfirmInputName [get, set] |
If unity default input is selected (no custom input) this is what the confirm input is called in the input manager More... | |
bool | ConfirmButtonDown [get, set] |
If unity default input is used this returns, if the confirm button was pressed last frame Note: you can set this value too, but this is only recommended, if you want to create your own customized version of uPIe More... | |
Selectable | CurrentlyActiveOption [get, set] |
Gets the menu option, that is currently active. Note: you can set the value too, but this should only be done, if you want to create your own, customized version of uPIe. More... | |
bool | ConstrainIndicatorPosition [get, set] |
Gets or sets the value that determines whether to constrain the indicator position to the nearest menu option. This only makes a difference, when using menus that are not full circle. More... | |
float | CircleSize [get, set] |
Gets or sets the size of the circle menu. More... | |
bool | KeepSelectedOption [get, set] |
Gets or sets the the value, that determines whether to keep the most recently selected option with gamepad, when the stick is in "origin" position More... | |
Vector2 | CurrentDirection [get, set] |
Gets or sets the current direction from center of the menu to pointer (mouse or analogue stick direction) More... | |
bool | UseCustomInputSystem [get, set] |
Gets or sets a value indicating whether to use a custom input system or the unity default one. More... | |
Vector2 | CustomInput [get, set] |
If we choose to use a custom input system, we need to set the direction (for analogue stick) or position (for mouse) here More... | |
int | SelectedPieceId [get, set] |
Gets or sets the selected piece identifier. More... | |
float | StartDegOffset [get, set] |
Gets or sets the offset in degrees where to start / where the first menu option should be More... | |
GameObject | MenuOptionPrefab [get, set] |
Gets or sets the menu option prefab to use when creating new menu options More... | |
List< Selectable > | MenuOptions [get, set] |
Gets or sets the menu options. More... | |
bool | ApplyIndicatorRotation [get, set] |
Gets or sets a value indicating whether to apply indicator rotation or not. More... | |
Graphic | IndicatorGraphic [get, set] |
Gets or sets the indicator graphic. More... | |
bool | ControlWithGamepad [get, set] |
Gets or sets a value indicating whether to control with gamepad or not. More... | |
bool | DeselectOptionIfOutsideBorders [get, set] |
Gets or sets a value indicating whether to deselect option if outside the menu borders. Note: only makes a difference when using menus that are not full circle More... | |
float | AlignRadius [get, set] |
Gets or sets the align radius (align helper in the inspector) More... | |
bool | AlignRotation [get, set] |
Gets or sets a value indicating whether the align helper (inspector) should also align rotation or not. More... | |
Vector3 | AlignUpDirection [get, set] |
Gets or sets the up direction used for alignment. More... | |
Vector3 | AlignForwardDirection [get, set] |
Gets or sets the forward direction used for alignment. More... | |
Contains the main uPIe menu (runtime) logic
Button uPIe.uPIeMenu.AddButton | ( | string | name = "" , |
bool | tryCopyFromLastMenuOption = true |
||
) |
Adds a new button (without adding it to the menu option list). In most cases you should use AddMenuOption as this sets up the button correctly and adds it to the menu options list
name | A name for the button. |
tryCopyFromLastMenuOption | If set to true (default) this method will try to copy the most recently added menu option button |
Button uPIe.uPIeMenu.AddMenuOption | ( | ) |
Adds a new menu option (button) to the menu.
Button uPIe.uPIeMenu.AddMenuOptionAndRealign | ( | bool | autoRescaleX = true , |
bool | autoRescaleY = false , |
||
bool | autoRescaleZ = false |
||
) |
Adds a new menu option (button) to the menu and automatically realigns the menu options according to what is set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection
autoRescaleX | if set to true automatically rescales the x value. |
autoRescaleY | if set to true automatically rescales the y value. |
autoRescaleZ | if set to true automatically rescales the z value. |
void uPIe.uPIeMenu.AddMenuOptionAndRescaleX | ( | ) |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.AddMenuOptionAndRescaleY | ( | ) |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.AddMenuOptionAndRescaleZ | ( | ) |
AddMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.ClearMenuOptions | ( | ) |
Clears all menu options.
void uPIe.uPIeMenu.ConfirmCurrentSelection | ( | ) |
Confirms the current selection (simulates a click respectively button down on the currently selected menu option).
void uPIe.uPIeMenu.Deselect | ( | ) |
Deselects the currently selected menu option.
Vector2 uPIe.uPIeMenu.GetDirection | ( | ) |
Gets the current direction from the center of the menu to the pointer (analogue stick direction or mouse position).
Vector3 uPIe.uPIeMenu.GetEndDirection | ( | Vector3 | startDir | ) |
Gets the end direction.
startDir | The start dir. |
Vector3 uPIe.uPIeMenu.GetEndDirection | ( | ) |
Gets the end direction.
Vector2 uPIe.uPIeMenu.GetIndicatorPosition | ( | out Vector2 | resultPosition | ) |
Gets the indicator position.
resultPosition | The resulting position. |
Vector2 uPIe.uPIeMenu.GetIndicatorPosition | ( | Vector2 | dir, |
out Vector2 | resultPosition | ||
) |
Gets the indicator position.
dir | The direction. |
resultPosition | The resulting position. |
Vector3 uPIe.uPIeMenu.GetStartDirection | ( | float | additionalOffset = 0 | ) |
Gets the start direction.
additionalOffset | The additional offset. |
void uPIe.uPIeMenu.InitMenuOption | ( | GameObject | instance, |
string | name = "" |
||
) |
Initialize a newly created menu option gameobject instance
instance | The gameobject instance you want to be treated as a menu option |
name | Name the menu option gameobject (optional) |
void uPIe.uPIeMenu.OpenSubMenu | ( | uPIeMenu | subMenu | ) |
Opens a sub-uPIe-menu.
subMenu | The sub menu. |
void uPIe.uPIeMenu.PollInput | ( | ) |
Polls the input.
void uPIe.uPIeMenu.Realign | ( | ) |
Realigns all menu options. The options set up as alignment options are used. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection
void uPIe.uPIeMenu.Realign | ( | float | radius | ) |
Realigns all menu options by only using a different radius as set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection
radius | The radius to align all options along. |
void uPIe.uPIeMenu.Realign | ( | float | radius, |
bool | doAlignRotation, | ||
Vector3 | upDirection, | ||
Vector3 | forwardDirection | ||
) |
Realigns all menu options by given options
radius | The radius. |
doAlignRotation | if set to true the menu options are also rotated. |
upDirection | Local up direction of the menu options. |
forwardDirection | Local forward direction of the menu options. |
void uPIe.uPIeMenu.RemoveIndicator | ( | ) |
Removes the indicator.
void uPIe.uPIeMenu.RemoveMenuOption | ( | ) |
Removes the most recently added menu option.
void uPIe.uPIeMenu.RemoveMenuOption | ( | int | id | ) |
Removes the menu option by a given id.
id | The identifier. |
void uPIe.uPIeMenu.RemoveMenuOption | ( | Selectable | slct | ) |
Removes the menu option by a given selectable.
slct | The selectable to remove. |
void uPIe.uPIeMenu.RemoveMenuOptionAndRealign | ( | bool | autoRescaleX = true , |
bool | autoRescaleY = false , |
||
bool | autoRescaleZ = false |
||
) |
Removes the last menu option (button) from the menu and automatically realigns the menu options according to what is set up in the alignment options. See AlignRadius, AlignRotation, AlignUpDirection, AlignForwardDirection
autoRescaleX | if set to true automatically rescales the x value. |
autoRescaleY | if set to true automatically rescales the y value. |
autoRescaleZ | if set to true automatically rescales the z value. |
void uPIe.uPIeMenu.RemoveMenuOptionAndRescaleX | ( | ) |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.RemoveMenuOptionAndRescaleY | ( | ) |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.RemoveMenuOptionAndRescaleZ | ( | ) |
RemoveMenuOptionAndRealign takes more options than this, so from a script you should probably use that method. But unity only allows one parameter when calling methods from an event trigger (like OnClick) in the inspector, so if you want to do that, use this method.
void uPIe.uPIeMenu.RescaleMenuOptions | ( | float | xScale, |
float | yScale = 1 , |
||
float | zScale = 1 , |
||
bool | multiply = true |
||
) |
Rescales all menu options.
xScale | The x scale. |
yScale | The y scale. |
zScale | The z scale. |
multiply | if set to true the scale is multiplied by its current scale. If set to false the scale value is directly set. |
void uPIe.uPIeMenu.ReturnToSuperMenu | ( | uPIeMenu | superMenu | ) |
Closes this sub-uPIe-menu and retuns to the uPIe-menu that is superordinated to this one.
superMenu | The super menu. |
Selectable uPIe.uPIeMenu.SelectRelatedOption | ( | ) |
Selects the related option. The id stored in the field SelectedPieceId is used.
Selectable uPIe.uPIeMenu.SelectRelatedOption | ( | int | id | ) |
Selects the related option by a given id.
id | The identifier. |
|
getset |
Gets or sets the forward direction used for alignment.
The align forward direction.
|
getset |
Gets or sets the align radius (align helper in the inspector)
The align radius.
|
getset |
Gets or sets a value indicating whether the align helper (inspector) should also align rotation or not.
true
if menu option rotation should be aligned; otherwise, false
.
|
getset |
Gets or sets the up direction used for alignment.
The align up direction.
|
getset |
Gets or sets a value indicating whether to apply indicator rotation or not.
true
if indicator rotation should be applied; otherwise, false
.
|
getset |
Gets or sets the size of the circle menu.
The size of the circle.
|
getset |
If unity default input is used this returns, if the confirm button was pressed last frame Note: you can set this value too, but this is only recommended, if you want to create your own customized version of uPIe
|
getset |
If unity default input is selected (no custom input) this is what the confirm input is called in the input manager
|
getset |
Gets or sets the value that determines whether to constrain the indicator position to the nearest menu option. This only makes a difference, when using menus that are not full circle.
|
getset |
Gets or sets the controller deadzone. This means, when is the analogue stick of the controller considered to be centered.
The controller deadzone.
|
getset |
Gets or sets a value indicating whether to control with gamepad or not.
true
if controlling with gamepad; otherwise, false
.
|
getset |
Gets or sets the current direction from center of the menu to pointer (mouse or analogue stick direction)
The current direction.
|
getset |
Gets the menu option, that is currently active. Note: you can set the value too, but this should only be done, if you want to create your own, customized version of uPIe.
|
getset |
If we choose to use a custom input system, we need to set the direction (for analogue stick) or position (for mouse) here
The custom input.
|
getset |
Gets or sets the option (button or other selectable) that is selected by default. This means this is what is selected, when the controllers analogue stick is centered
|
getset |
Gets or sets a value indicating whether to deselect option if outside the menu borders. Note: only makes a difference when using menus that are not full circle
true
if the menu option should be deselected when outside the menus borders; otherwise, false
.
|
getset |
Gets or sets a value controlling whether selecting menu options is enabled or not. This is mostly used to enable or disable a parent menu when a submenu is opened or closed.
true
if it should be able to select the options from this menu; otherwise, false
.
|
getset |
If unity default input is selected (no custom input) this is what the horizontal input is called in the input manager
|
getset |
Gets or sets the indicator graphic.
The indicator graphic.
|
getset |
Gets or sets the the value, that determines whether to keep the most recently selected option with gamepad, when the stick is in "origin" position
|
getset |
Gets or sets the menu option prefab to use when creating new menu options
The prefab asset to use
|
getset |
Gets or sets the menu options.
The menu options.
|
getset |
Gets or sets the selected piece identifier.
The selected piece identifier.
|
getset |
Gets or sets the offset in degrees where to start / where the first menu option should be
The start offset in degrees
|
getset |
Gets or sets a value indicating whether to use a custom input system or the unity default one.
true
if custom input system should be used; otherwise, false
.
|
getset |
If unity default input is selected (no custom input) this is what the vertical input is called in the input manager