A data container that links a Unity UI Button to AC's own Menu system.
◆ UISlot() [1/2]
◆ UISlot() [2/2]
AC.UISlot.UISlot |
( |
UISlot |
uiSlot | ) |
|
A Constructor that gets its values by copying another
◆ AddClickHandler()
Adds a UISlotClick component to the Button, which acts as a click-handler.
- Parameters
-
_menu | The Menu that the Button is linked to |
_element | The MenuElement within _menu that the Button is linked to |
_slot | The index number of the slot within _element that the Button is linked to |
◆ GetRectTransform()
RectTransform AC.UISlot.GetRectTransform |
( |
| ) |
|
Gets the boundary of the UI Button.
- Returns
- The boundary Rect of the UI Button
◆ HideUIElement() [1/2]
bool AC.UISlot.HideUIElement |
( |
UIHideStyle |
uiHideStyle | ) |
|
Disables the visibility of the linked UI Button.
- Parameters
-
uiHideStyle | The method by which the UI element is hidden (DisableObject, ClearContent) |
- Returns
- True if the object being hidden is the EventSystem's currently-selected object
◆ HideUIElement() [2/2]
bool AC.UISlot.HideUIElement |
( |
UISelectableHideStyle |
uiHideStyle | ) |
|
Disables the visibility of the linked UI Button.
- Parameters
-
uiHideStyle | The method by which the UI element is hidden (DisableObject, DisableInteractability) |
- Returns
- True if the object being hidden is the EventSystem's currently-selected object
◆ LinkUIElements()
void AC.UISlot.LinkUIElements |
( |
Canvas |
canvas, |
|
|
LinkUIGraphic |
linkUIGraphic, |
|
|
Texture2D |
emptySlotTexture = null |
|
) |
| |
Links the UI GameObjects to the class, based on the supplied uiButtonID.
- Parameters
-
canvas | The Canvas that contains the UI GameObjects |
linkUIGraphic | What Image component the Element's Graphics should be linked to (ImageComponent, ButtonTargetGraphic) |
emptySlotTexture | If set, the texture to use when a slot is considered empty |
◆ RestoreColour()
void AC.UISlot.RestoreColour |
( |
| ) |
|
Reverts the 'normal' colour of the linked UI Button, if it was changed using SetColour.
◆ SetColours()
void AC.UISlot.SetColours |
( |
Color |
newNormalColour, |
|
|
Color |
newHighlightedColour |
|
) |
| |
Changes the colours of the linked UI Button.
- Parameters
-
newNormalColour | The new 'normal' colour to set |
- Parameters
-
newHighlightedColour | The new 'highlighted' colour to set |
◆ SetImage()
void AC.UISlot.SetImage |
( |
Texture |
_texture | ) |
|
Sets the image of the UI Button using a Texture.
- Parameters
-
_texture | The texture to assign the Button |
◆ SetImageAsSprite()
void AC.UISlot.SetImageAsSprite |
( |
Sprite |
_sprite | ) |
|
Sets the image of the UI Button using a Sprite.
- Parameters
-
_sprite | The sprite to assign the Button |
◆ SetText()
void AC.UISlot.SetText |
( |
string |
_text | ) |
|
Sets the text of the UI Button.
- Parameters
-
_text | The text to assign the Button |
◆ ShowUIElement()
void AC.UISlot.ShowUIElement |
( |
UIHideStyle |
uiHideStyle | ) |
|
Enables the visibility of the linked UI Button.
- Parameters
-
uiHideStyle | The method by which the UI element is hidden (DisableObject, ClearContent) |
◆ sprite
UnityEngine.Sprite AC.UISlot.sprite |
The sprite to set in the Button's Image
◆ uiButton
UnityEngine.UI.Button AC.UISlot.uiButton |
The Unity UI Button this is linked to
◆ uiButtonID
◆ CanOverrideHotspotLabel
bool AC.UISlot.CanOverrideHotspotLabel |
|
get |
Checks if the associated UI components can set a Hotspot label when selected