Adventure Creator  1.66.8
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.UISlot Class Reference

Public Member Functions

 UISlot ()
 
void LinkedUiGUI (int i, MenuSource source)
 
RectTransform GetRectTransform ()
 Gets the boundary of the UI Button. More...
 
void LinkUIElements (Canvas canvas, LinkUIGraphic linkUIGraphic)
 Links the UI GameObjects to the class, based on the supplied uiButtonID. More...
 
void SetText (string _text)
 Sets the text of the UI Button. More...
 
void SetImage (Texture _texture)
 Sets the image of the UI Button using a Texture. More...
 
void SetImageAsSprite (Sprite _sprite)
 Sets the image of the UI Button using a Sprite. More...
 
void ShowUIElement (UIHideStyle uiHideStyle)
 Enables the visibility of the linked UI Button. More...
 
void HideUIElement (UIHideStyle uiHideStyle)
 Disables the visibility of the linked UI Button. More...
 
void AddClickHandler (AC.Menu _menu, MenuElement _element, int _slot)
 Adds a UISlotClick component to the Button, which acts as a click-handler. More...
 
void SetColour (Color newColour)
 Changes the 'normal' colour of the linked UI Button. More...
 
void RestoreColour ()
 Reverts the 'normal' colour of the linked UI Button, if it was changed using SetColour.
 

Public Attributes

UnityEngine.UI.Button uiButton
 
int uiButtonID
 
UnityEngine.Sprite sprite
 

Detailed Description

A data container that links a Unity UI Button to AC's own Menu system.

Constructor & Destructor Documentation

◆ UISlot()

AC.UISlot.UISlot ( )

The default Constructor.

Member Function Documentation

◆ AddClickHandler()

void AC.UISlot.AddClickHandler ( AC.Menu  _menu,
MenuElement  _element,
int  _slot 
)

Adds a UISlotClick component to the Button, which acts as a click-handler.

The Menu that the Button is linked to

The MenuElement within _menu that the Button is linked to

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()

void AC.UISlot.HideUIElement ( UIHideStyle  uiHideStyle)

Disables the visibility of the linked UI Button.

Parameters
uiHideStyleThe method by which the UI element is hidden (DisableObject, ClearContent, DisableInteractibility)

◆ LinkUIElements()

void AC.UISlot.LinkUIElements ( Canvas  canvas,
LinkUIGraphic  linkUIGraphic 
)

Links the UI GameObjects to the class, based on the supplied uiButtonID.

Parameters
canvasThe Canvas that contains the UI GameObjects
linkUIGraphicWhat Image component the Element's Graphics should be linked to (ImageComponent, ButtonTargetGraphic)

◆ SetColour()

void AC.UISlot.SetColour ( Color  newColour)

Changes the 'normal' colour of the linked UI Button.

Parameters
newColourThe new 'normal' colour to set

◆ SetImage()

void AC.UISlot.SetImage ( Texture  _texture)

Sets the image of the UI Button using a Texture.

The texture to assign the Button

◆ SetImageAsSprite()

void AC.UISlot.SetImageAsSprite ( Sprite  _sprite)

Sets the image of the UI Button using a Sprite.

The sprite to assign the Button

◆ SetText()

void AC.UISlot.SetText ( string  _text)

Sets the text of the UI Button.

The text to assign the Button

◆ ShowUIElement()

void AC.UISlot.ShowUIElement ( UIHideStyle  uiHideStyle)

Enables the visibility of the linked UI Button.

Parameters
uiHideStyleThe method by which the UI element is hidden (DisableObject, ClearContent, DisableInteractibility)

Member Data Documentation

◆ 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

int AC.UISlot.uiButtonID

The ConstantID number of the linked Unity UI Button