Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
override void | Declare () |
override MenuElement | DuplicateSelf (bool fromEditor, bool ignoreUnityUI) |
Creates and returns a new MenuElement that has the same values as itself. More... | |
override void | Initialise (AC.Menu _menu) |
Performs any initialisation that can only be done once the element has been instantiated at runtime. More... | |
override void | LoadUnityUI (AC.Menu _menu, Canvas canvas, bool addEventListeners=true) |
Initialises the linked Unity UI GameObject. More... | |
override GameObject | GetObjectToSelect (int slotIndex=0) |
Gets the linked Unity UI GameObject associated with this element. More... | |
override RectTransform | GetRectTransform (int _slot) |
Gets the boundary of the element, or a slot within it. More... | |
override void | SetUIInteractableState (bool state) |
Sets the interactive state of any linked Unity UI gameobjects. More... | |
override void | ShowGUI (Menu menu) |
override bool | CheckConvertGlobalVariableToLocal (int oldGlobalID, int newLocalID) |
Checks if the Element makes references from a given global variable to a given local variable More... | |
override int | GetVariableReferences (int varID) |
Gets the number of references the MenuElement makes to a global variable More... | |
override int | UpdateVariableReferences (int oldVarID, int newVarID) |
Updates references the MenuElement makes to a global variable More... | |
override bool | ReferencesAsset (ActionListAsset actionListAsset) |
Checks if the Menu makes reference to a particular ActionList asset More... | |
override bool | ReferencesObjectOrID (GameObject gameObject, int id) |
Checks if the Element makes reference to a particular GameObject More... | |
override int | GetSlotIndex (GameObject gameObject) |
Gets the slot index that reference a particular GameObject More... | |
void | ShowClick () |
override string | GetHotspotLabelOverride (int _slot, int _language) |
Gets a string that overrides the default 'hotspot label'. More... | |
override void | OverrideLabel (string newLabel, int _lineID=-1) |
override void | PreDisplay (int _slot, int languageNumber, bool isActive) |
Performs all calculations necessary to display the element. More... | |
override void | Display (GUIStyle _style, int _slot, float zoom, bool isActive) |
Draws the element using OnGUI. More... | |
override string | GetLabel (int slot, int languageNumber) |
Gets the display text of the element, or a slot within it. More... | |
override bool | IsSelectedByEventSystem (int slotIndex) |
Checks if the element is selected by Unity UI's EventSystem (if the Menu is Unity UI-based). More... | |
override bool | IsSelectableInteractable (int slotIndex) |
Checks if the element's linked Selectable is currently Interactable (if the Menu is Unity UI-based). More... | |
override void | RecalculateSize (MenuSource source) |
Recalculates the element's size. This should be called whenever a Menu's shape is changed. More... | |
override bool | ProcessClick (AC.Menu _menu, int _slot, MouseState _mouseState) |
Performs what should happen when the element is clicked on. More... | |
override bool | ProcessContinuousClick (AC.Menu _menu, MouseState _mouseState) |
Performs what should happen when the element is clicked on continuously. More... | |
string | GetHotspotLabel (int languageNumber) |
Gets the text to place in the Hotspot label buffer (in PlayerMenus) when the mouse hovers over the element. More... | |
string | GetTranslatableString (int index) |
Gets the text to be translated, given its index. More... | |
int | GetTranslationID (int index) |
Gets the translation ID of a given text index. More... | |
AC_TextType | GetTranslationType (int index) |
Gets the translation type of a given text index. More... | |
void | UpdateTranslatableString (int index, string updatedText) |
int | GetNumTranslatables () |
Gets the maximum number of possible translatable texts. More... | |
bool | HasExistingTranslation (int index) |
Checks if a given text index has already been assigned a unique translation ID. More... | |
void | SetTranslationID (int index, int _lineID) |
Sets the translation ID of a given text index More... | |
string | GetOwner (int index) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More... | |
bool | OwnerIsPlayer (int index) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More... | |
bool | CanTranslate (int index) |
Checks if a given text index can and should be translated. More... | |
Public Member Functions inherited from AC.MenuElement | |
virtual void | Copy (MenuElement _element) |
Copies the values of another MenuElement onto itself. More... | |
virtual void | SetSpeech (Speech _speech) |
Assigns the element to a specific Speech line. More... | |
virtual void | ClearSpeech () |
void | UpdateID (int[] idArray) |
Updates the ID number to something unique. More... | |
void | UpdateLabel (int languageNumber) |
void | ShowGUIStart (Menu menu) |
virtual void | HideAllUISlots () |
virtual void | DrawOutline (bool isSelected, AC.Menu _menu) |
Draws an outline around the element. More... | |
Vector2[] | GetSlotCentres (AC.Menu _menu) |
Gets the element's slot centres, as an array of Vector2s. This is used when keyboard-navigating menus More... | |
virtual void | Shift (AC_ShiftInventory shiftType, int amount) |
Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once. More... | |
virtual bool | CanBeShifted (AC_ShiftInventory shiftType) |
Checks if the element's slots can be shifted in a particular direction. More... | |
Vector2 | GetSize () |
Gets the size of the whole element. More... | |
Vector2 | GetSizeFromCorner () |
Gets the Vector2 from the top-left corner of the parent Menu to the bottom-right corner of the element. More... | |
void | SetSize (Vector2 _size) |
Sets the size of an individual slot. More... | |
int | GetNumSlots () |
Gets the number of display slots the element has. This is not the maximum number of slots that can be shown by shifting - it is the number of slots that are shown at any one time. More... | |
Rect | GetSlotRectRelative (int _slot) |
Gets the boundary of a slot, as a proportion of the screen size. More... | |
int | GetFontSize () |
Gets the size of the font. More... | |
void | SetPosition (Vector2 _position) |
Sets the element's position. More... | |
void | SetRelativePosition (Vector2 _size) |
void | ResetDragOffset () |
void | SetDragOffset (Vector2 pos, Rect dragRect) |
Offsets an OnGUI MenuElement's position when dragged by a MenuDrag element. More... | |
Vector2 | GetDragStart () |
Gets the drag offset. More... | |
void | AutoSetVisibility () |
virtual AudioClip | GetHoverSound (int slot) |
Gets the hover sound for the element slot. More... | |
int | GetOffset () |
Gets the amount by which the slots have been offset, if the number that can be shown exceeds the number that can be display at once. More... | |
void | SetOffset (int value) |
Sets the amount by which the slots have been offset, if the number that can be shown exceeds the number that can be display at once. More... | |
virtual void | OnMenuTurnOn (Menu menu) |
Called whenever the Menu this is attached to is turned on. More... | |
string | GetVisibilitySaveData () |
override string | ToString () |
Public Attributes | |
UnityEngine.UI.Button | uiButton |
UIPointerState | uiPointerState = UIPointerState.PointerClick |
string | hotspotLabel = "" |
int | hotspotLabelID = -1 |
TextAnchor | anchor |
TextEffects | textEffects |
float | outlineSize = 2f |
Color | effectColour = Color.black |
AC_ButtonClickType | buttonClickType |
ActionListAsset | actionList |
int | parameterID = -1 |
int | parameterValue = 0 |
bool | doFade |
string | switchMenuTitle |
string | inventoryBoxTitle |
AC_ShiftInventory | shiftInventory |
int | shiftAmount = 1 |
bool | onlyShowWhenEffective |
bool | loopJournal = false |
string | inputAxis |
SimulateInputType | simulateInput = SimulateInputType.Button |
float | simulateValue = 1f |
Texture2D | clickTexture |
bool | allowContinuousClick = false |
UISelectableHideStyle | uiSelectableHideStyle = UISelectableHideStyle.DisableObject |
Public Attributes inherited from AC.MenuElement | |
int | ID |
string | title = "Element" |
Vector2 | slotSize |
AC_SizeType | sizeType |
AC_PositionType2 | positionType |
float | slotSpacing = 0f |
int | lineID = -1 |
string | alternativeInputButton = "" |
Font | font |
float | fontScaleFactor = 60f |
Color | fontColor = Color.white |
Color | fontHighlightColor = Color.white |
bool | isClickable |
ElementOrientation | orientation = ElementOrientation.Vertical |
int | gridWidth = 3 |
Texture2D | backgroundTexture |
bool | singleSlotBackgrounds = false |
Texture2D | highlightTexture |
AudioClip | hoverSound |
AudioClip | clickSound |
bool | changeCursor = false |
int | cursorID = 0 |
int | linkedUiID |
float | maxAutoWidthFactor = 0.5f |
Protected Member Functions | |
override void | ShowTextGUI (string apiPrefix) |
override void | ShowTextureGUI (string apiPrefix) |
override string | GetLabelToTranslate () |
override void | AutoSize () |
Protected Member Functions inherited from AC.MenuElement | |
void | CreateUIEvent (UnityEngine.UI.Button uiButton, AC.Menu _menu, UIPointerState uiPointerState=UIPointerState.PointerClick, int _slotIndex=0, bool liveState=true) |
void | CreateHoverSoundHandler (Selectable selectable, AC.Menu _menu, int _slotIndex=0) |
virtual void | ProcessClickUI (AC.Menu _menu, int _slot, MouseState _mouseState) |
void | ClearCache () |
string | TranslateLabel (int languageNumber) |
void | EndGUI (string apiPrefix) |
void | ShowClipHelp () |
T | LinkedUiGUI< T > (T field, string label, MenuSource source, string tooltip="") |
UISlot[] | ResizeUISlots (UISlot[] uiSlots, int maxSlots) |
void | ChangeCursorGUI (Menu menu) |
void | LimitUISlotVisibility (UISlot[] uiSlots, int _numSlots, UIHideStyle uiHideStyle, Texture emptyTexture=null) |
void | LimitUISlotVisibility (UISlot[] uiSlots, int _numSlots, UISelectableHideStyle uiHideStyle) |
Rect | ZoomRect (Rect rect, float zoom) |
void | LimitOffset () |
void | Shift (AC_ShiftInventory shiftType, int maxSlots, int arraySize, int amount) |
void | SetAbsoluteSize (Vector2 _size) |
void | AutoSize (GUIContent content) |
void | LinkUIElement< T > (Canvas canvas, ref T existingField) |
void | UpdateUISelectable< T > (T field, UISelectableHideStyle uiSelectableHideStyle) |
void | UpdateUIElement< T > (T field) |
void | ClearSpriteCache (UISlot[] uiSlots) |
void | SetUISlotsInteractableState (UISlot[] uiSlots, bool state) |
Protected Attributes | |
bool | shiftButtonIsEffective = true |
Protected Attributes inherited from AC.MenuElement | |
bool | isVisible = true |
int | offset = 0 |
Menu | parentMenu |
Rect | relativeRect |
Vector2 | relativePosition |
int | numSlots |
Properties | |
override bool | IsVisible [get, set] |
string | label [get, set] |
Properties inherited from AC.MenuElement | |
virtual bool | IsVisible [get, set] |
virtual int | MaxSlotsForOffset [get] |
Menu | ParentMenu [get] |
A MenuElement that can be clicked on to perform a specific function.
bool AC.MenuButton.CanTranslate | ( | int | index | ) |
Checks if a given text index can and should be translated.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Checks if the Element makes references from a given global variable to a given local variable
oldGlobalID | The ID number of the old global variable |
newLocalID | The ID number of the new local variable |
Reimplemented from AC.MenuElement.
|
virtual |
Initialises the MenuElement when it is created within MenuManager.
Reimplemented from AC.MenuElement.
|
virtual |
Draws the element using OnGUI.
_style | The GUIStyle to draw with |
_slot | The index number of the slot to display |
zoom | The zoom factor |
isActive | If True, then the element will be drawn as though highlighted |
Reimplemented from AC.MenuElement.
|
virtual |
Creates and returns a new MenuElement that has the same values as itself.
fromEditor | If True, the duplication was done within the Menu Manager and not as part of the gameplay initialisation. |
ignoreUnityUI | If True, variables associated with Unity UI will not be transferred |
Reimplemented from AC.MenuElement.
string AC.MenuButton.GetHotspotLabel | ( | int | languageNumber | ) |
Gets the text to place in the Hotspot label buffer (in PlayerMenus) when the mouse hovers over the element.
languageNumber | The index of the language to display the text in |
|
virtual |
Gets a string that overrides the default 'hotspot label'.
_slot | The index number of the slot to get an override label for |
_language | The index number of the language to display text in |
Reimplemented from AC.MenuElement.
|
virtual |
Gets the display text of the element, or a slot within it.
slot | The index number of the slot to get text for |
languageNumber | The index number of the language number to get the text in |
Reimplemented from AC.MenuElement.
int AC.MenuButton.GetNumTranslatables | ( | ) |
Gets the maximum number of possible translatable texts.
Implements AC.ITranslatable.
|
virtual |
Gets the linked Unity UI GameObject associated with this element.
slotIndex | The slot index, if the element has multiple slots |
Reimplemented from AC.MenuElement.
string AC.MenuButton.GetOwner | ( | int | index | ) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Gets the boundary of the element, or a slot within it.
_slot | The index number of the slot to get the boundary of |
Reimplemented from AC.MenuElement.
|
virtual |
Gets the slot index that reference a particular GameObject
gameObject | The GameObject to check for |
Reimplemented from AC.MenuElement.
string AC.MenuButton.GetTranslatableString | ( | int | index | ) |
Gets the text to be translated, given its index.
index | The index of the translatable text |
Implements AC.ITranslatable.
int AC.MenuButton.GetTranslationID | ( | int | index | ) |
Gets the translation ID of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
AC_TextType AC.MenuButton.GetTranslationType | ( | int | index | ) |
Gets the translation type of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Gets the number of references the MenuElement makes to a global variable
varID | The global variable's ID number |
Reimplemented from AC.MenuElement.
bool AC.MenuButton.HasExistingTranslation | ( | int | index | ) |
Checks if a given text index has already been assigned a unique translation ID.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Performs any initialisation that can only be done once the element has been instantiated at runtime.
_menu | The Menu that the elemnt is a part of. |
Reimplemented from AC.MenuElement.
|
virtual |
Checks if the element's linked Selectable is currently Interactable (if the Menu is Unity UI-based).
slotIndex | The element's slot index, if it has multiple slots |
Reimplemented from AC.MenuElement.
|
virtual |
Checks if the element is selected by Unity UI's EventSystem (if the Menu is Unity UI-based).
slotIndex | The element's slot index, if it has multiple slots |
Reimplemented from AC.MenuElement.
|
virtual |
Initialises the linked Unity UI GameObject.
_menu | The element's parent Menu |
canvas | The runtime Canvas associated with the Menu |
addEventListeners | If True, then event listeners should be added to the UI's Interactive component(s) |
Reimplemented from AC.MenuElement.
bool AC.MenuButton.OwnerIsPlayer | ( | int | index | ) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Performs all calculations necessary to display the element.
_slot | The index number of the slot to display |
languageNumber | The index number of the language to display text in |
isActive | If True, then the element will be drawn as though highlighted |
Reimplemented from AC.MenuElement.
|
virtual |
Performs what should happen when the element is clicked on.
_menu | The element's parent Menu |
_slot | The index number of the slot that was clicked on |
_mouseState | The state of the mouse button |
Reimplemented from AC.MenuElement.
|
virtual |
Performs what should happen when the element is clicked on continuously.
_menu | The element's parent Menu |
_mouseState | The state of the mouse button |
Reimplemented from AC.MenuElement.
|
virtual |
Recalculates the element's size. This should be called whenever a Menu's shape is changed.
source | How the parent Menu is displayed (AdventureCreator, UnityUiPrefab, UnityUiInScene) |
Reimplemented from AC.MenuElement.
|
virtual |
Checks if the Menu makes reference to a particular ActionList asset
actionListAsset | The ActionList to check for |
Reimplemented from AC.MenuElement.
|
virtual |
Checks if the Element makes reference to a particular GameObject
gameObject | The GameObject to check for |
id | The GameObject's associated ConstantID value |
Reimplemented from AC.MenuElement.
void AC.MenuButton.SetTranslationID | ( | int | index, |
int | lineID | ||
) |
Sets the translation ID of a given text index
index | The index of the translatable text |
lineID | The new translation ID to assign the translatable text |
Implements AC.ITranslatable.
|
virtual |
Sets the interactive state of any linked Unity UI gameobjects.
state | If True, linked UI gameobjects will be made interactive. If False, they will be made non-interactive |
Reimplemented from AC.MenuElement.
void AC.MenuButton.ShowClick | ( | ) |
Shows the assigned clickTexture overlay, which fades out over time.
|
virtual |
Updates references the MenuElement makes to a global variable
varID | The global variable's original ID number |
varID | The global variable's new ID number |
Reimplemented from AC.MenuElement.
ActionListAsset AC.MenuButton.actionList |
The ActionListAsset to run when clicked, if buttonClickType = AC_ButtonClickType.RunActionList
bool AC.MenuButton.allowContinuousClick = false |
If True, then the button will respond to the mouse button being held down
TextAnchor AC.MenuButton.anchor |
The text alignment
AC_ButtonClickType AC.MenuButton.buttonClickType |
The type of reaction that occurs when clicked (TurnOffMenu, Crossfade, OffsetElementSlot, RunActionList, CustomScript, OffsetJournal, SimulateInput)
Texture2D AC.MenuButton.clickTexture |
The texture to overlay when the button is clicked on
bool AC.MenuButton.doFade |
If True, and buttonClickType = AC_ButtonClickType.TurnOffMenu, then the Menu will transition as it turns off
Color AC.MenuButton.effectColour = Color.black |
The outline colour
string AC.MenuButton.hotspotLabel = "" |
The text that appears in the Hotspot label buffer when the mouse hovers over
int AC.MenuButton.hotspotLabelID = -1 |
The translation ID of the text that appears in the Hotspot label buffer when the mouse hovers over, as set in SpeechManager
string AC.MenuButton.inputAxis |
The name of the Input to simulate when clicked, if buttonClickType = AC_ButtonClickType.SimulateInput
string AC.MenuButton.inventoryBoxTitle |
The name of the MenuElement with slots to shift, if buttonClickType = AC_ButtonClickType.OffsetElementSlot
bool AC.MenuButton.loopJournal = false |
If True, and buttonClickType = AC_ButtonClickType.OffsetJournal then shifting past the last journal page will open the first
bool AC.MenuButton.onlyShowWhenEffective |
If True, and buttonClickType = AC_ButtyonClickType.OffsetElementSlot, then the button will only be visible if the slots it affects can actually be shifted
float AC.MenuButton.outlineSize = 2f |
The outline thickness, if textEffects != TextEffects.None
int AC.MenuButton.parameterID = -1 |
The ID of the integer ActionParameter that can be set within actionList, if buttonClickType = AC_ButtonClickType.RunActionList
int AC.MenuButton.parameterValue = 0 |
The value to set the integer ActionParameter within actionList, if buttonClickType = AC_ButtonClickType.RunActionList
int AC.MenuButton.shiftAmount = 1 |
The amount to shift slots by, if buttonClickType = AC_ButtonClickType.OffsetElementSlot
AC_ShiftInventory AC.MenuButton.shiftInventory |
The direction to shift slots, if buttonClickType = AC_ButtonClickType.OffsetElementSlot (Left, Right)
SimulateInputType AC.MenuButton.simulateInput = SimulateInputType.Button |
The type of Input to simulate when clicked, if buttonClickType = AC_ButtonClickType.SimulateInput
float AC.MenuButton.simulateValue = 1f |
The value of the Input to simulate when clicked, if buttonClickType = AC_ButtonClickType.SimulateInput
string AC.MenuButton.switchMenuTitle |
The name of the Menu to crossfade to, if buttonClickType = AC_ButtonClickType.Crossfade
TextEffects AC.MenuButton.textEffects |
The special FX applied to the text (None, Outline, Shadow, OutlineAndShadow)
UnityEngine.UI.Button AC.MenuButton.uiButton |
The Unity UI Button this is linked to (Unity UI Menus only)
UIPointerState AC.MenuButton.uiPointerState = UIPointerState.PointerClick |
What pointer state registers as a 'click' for Unity UI Menus (PointerClick, PointerDown, PointerEnter)
UISelectableHideStyle AC.MenuButton.uiSelectableHideStyle = UISelectableHideStyle.DisableObject |
The method by which this element is hidden from view when made invisible (DisableObject, DisableInteractability)
|
getset |
The text that's displayed on-screen