![]() |
Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
|
Classes | |
| struct | InteractionMenuData |
Public Member Functions | |||
| void | OnInitPersistentEngine () | ||
| void | ShowEnabledOnStartMenus () | ||
| void | RebuildMenus (MenuManager menuManager=null) | ||
| Rebuilds the game's Menus, either from the existing MenuManager asset, or from a new one. | |||
| void | CreateEventSystem (bool force=false) | ||
| Spawns an Event System, either using the prefab supplied in the Menu Manager, or generating one from scratch otherwise. | |||
| void | OnInitialiseScene () | ||
| void | ClearParents () | ||
| void | DrawLoadingMenus () | ||
| void | DrawMenus () | ||
| Menu | GetMenuWithElement (MenuElement _element) | ||
| Gets the Menu that a given MenuElement is a part of. | |||
| void | DrawMenu (AC.Menu menu, int languageNumber=0) | ||
| Draws an Adventure Creator-sourced Menu. This should be called from OnGUI() | |||
| void | UpdateMenuPosition (AC.Menu menu, Vector2 invertedMouse, bool force=false) | ||
| Updates a Menu's position. | |||
| void | UpdateMenu (AC.Menu menu, int languageNumber=0, bool justPosition=false, bool updateElements=true) | ||
| Updates a Menu's display and position. | |||
| bool | IsEventSystemSelectingObject (GameObject _gameObject) | ||
| Checks if the Unity UI EventSystem currently has a given GameObject selected. | |||
| bool | IsEventSystemSelectingObject () | ||
| Checks if the Unity UI EventSystem currently has any GameObject selected. | |||
| bool | DeselectEventSystemMenu (Menu _menu) | ||
| De-selects the Unity UI EventSystem's selected gameobject if it is associated with a given Menu. | |||
| void | RefreshDialogueOptions () | ||
| void | UpdateLoadingMenus () | ||
| void | CheckForInput () | ||
| void | UpdateAllMenus () | ||
| void | CheckCrossfade (AC.Menu _menu) | ||
| Begins fading in the second Menu in a crossfade if the first Menu matches the supplied parameter. | |||
| virtual void | SelectInputBox (MenuInput input) | ||
| Selects a MenuInput element, allowing the player to enter text into it. | |||
| void | OnTurnOffMenu (Menu menu) | ||
| Called automatically whenever a Menu is turned off. | |||
| void | DeselectInputBox (MenuElement menuElement) | ||
| Deselects the active InputBox element if it is the one in the parameter. | |||
| void | RemoveSpeechFromMenu (Speech speech) | ||
| Unassigns a Speech line from any temporarily-duplicated Menus. This will signal such Menus that they can be removed. | |||
| void | AssignSpeechToMenu (Speech speech) | ||
| Duplicates any Menu set to display a single speech line. | |||
| Menu[] | GetMenusAssignedToSpeech (Speech speech) | ||
| Gets all Menus associated with a given Speech line. | |||
| void | CrossFade (AC.Menu _menuTo) | ||
| Crossfades to a Menu. Any other Menus will be turned off. | |||
| void | CloseInteractionMenus () | ||
| void | EnableInteractionMenus (Hotspot hotspotFor) | ||
| Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Hotspot. | |||
| void | EnableInteractionMenus (InvInstance itemFor) | ||
| Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to. | |||
| void | EnableInteractionMenus (InvItem itemFor) | ||
| Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to. | |||
| void | RequestRepositionUpdate (Menu menu, Vector2 screenPosition) | ||
| Repositions a menu a frame later, so that its scale values can be properly calculated after spawning. This normally only needs to be called internally. | |||
| void | DisableHotspotMenus () | ||
| string | GetHotspotLabel () | ||
| Gets the complete Hotspot label to be displayed in a MenuLabel element with labelType = AC_LabelType.Hotspot. | |||
| bool | CanCurrentlyRightClick () | ||
| void | UpdatePauseMenusRecord () | ||
| bool | ArePauseMenusOn (Menu excludingMenu=null) | ||
| Checks if any Menus that pause the game are currently turned on. | |||
| void | ForceOffSubtitles (SpeechMenuLimit speechMenuLimit=SpeechMenuLimit.All) | ||
| Instantly turns off all Menus that have appearType = AppearType.WhenSpeechPlays. | |||
| Menu | GetMenuWithCanvas (Canvas canvas) | ||
Gets the Menu associated with a given Unity UI Canvas</summar>
| |||
| void | RegisterCustomMenu (Menu menu, bool deleteWhenTurnOff=false) | ||
| Registers a script-created Menu instance, so that it's click-handling, updating and rendering are handled automatically. | |||
| void | UnregisterCustomMenu (Menu menu, bool showError=true) | ||
| Unregisters a script-created Menu instance, so that it is no longer updated automatically. | |||
| Menu[] | GetRegisteredCustomMenus () | ||
| Gets all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus. | |||
| void | DestroyCustomMenus () | ||
| void | RecalculateAll () | ||
| void | FindFirstSelectedElement (Menu menuToIgnore=null, bool ignoreIfAlreadySelectingMenu=false) | ||
| Selects the first element GameObject in a Unity UI-based Menu. | |||
| void | SelectUIElement (GameObject objectToSelect) | ||
| Selects a Unity UI GameObject. | |||
| virtual int | GetElementOverCursorID () | ||
| Gets the ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over. | |||
| bool | IsMouseOverMenu () | ||
| Checks if the cursor is hovering over a Menu. | |||
| bool | IsMouseOverInventory () | ||
| Checks if the cursor is hovering over an Inventory. | |||
| bool | IsMouseOverInteractionMenu () | ||
| Checks if the cursor is hovering over a Menu with appearType = AppearType.OnInteraction. | |||
| bool | IsInteractionMenuOn () | ||
| Checks if any Menu with appearType = AppearType.OnInteraction is on. | |||
| bool | IsCyclingInteractionMenu () | ||
| Checks if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it. | |||
| bool | IsPausingInteractionMenuOn () | ||
| Checks if the last-opened Menu with appearType = AppearType.OnInteraction is both open and set to pause the game. | |||
| void | UpdateUIInteractability () | ||
| MainData | SaveMainData (MainData mainData) | ||
| Updates a MainData class with its own variables that need saving. | |||
| void | LoadMainData (MainData mainData) | ||
| Updates its own variables from a MainData class. | |||
| virtual void | PreScreenshotBackup () | ||
| virtual void | PostScreenshotBackup () | ||
| void | DiableUIInNextFrame (Menu menu) | ||
Static Public Member Functions | |
| static List< Menu > | GetMenus (bool includeDuplicatesAndCustom=false) |
| Gets a List of all defined Menus. | |
| static Menu | GetMenuWithName (string menuName) |
| Gets a Menu with a specific name. | |
| static MenuElement | GetElementWithName (string menuName, string menuElementName) |
| Gets a MenuElement with a specific name. | |
| static bool | IsSavingLocked (Action _actionToIgnore=null, bool showDebug=false) |
| Checks if saving cannot be performed at this time. | |
| static void | ResetInventoryBoxes () |
| static void | CreateRecipe () |
| static void | ForceOffAllMenus (bool onlyPausing=false) |
| Instantly turns off all Menus. | |
| static void | SimulateClick (string menuName, string menuElementName, int slot=1) |
| Simulates the clicking of a MenuElement. | |
| static void | SimulateClick (string menuName, MenuElement _element, int _slot=1) |
| Simulates the clicking of a MenuElement. | |
Protected Member Functions | |
| void | CycleMouseOverUIs () |
| IEnumerator | CycleMouseOverUIsCo (Menu[] _menus) |
| bool | AreAnyMenusUI () |
| void | OnAddSubScene (SubScene subScene) |
| void | OnEnterGameState (GameState gameState) |
| void | OnExitGameState (GameState gameState) |
| void | OnMouseOverMenu (AC.Menu menu, MenuElement element, int slot) |
| void | UpdatePauseBackground (bool fadeIn) |
| bool | MoveMenuToHotspot (Menu menu, Hotspot hotspot) |
| bool | MoveUIMenuToHotspot (Menu menu, Hotspot hotspot) |
| void | UpdateElements (AC.Menu menu, int languageNumber, bool justDisplay=false) |
| bool | SlotIsInteractive (AC.Menu menu, int elementIndex, int slotIndex, GameState gameState) |
| bool | CheckClicks (AC.Menu menu) |
| void | UpdateAllMenusAgain () |
| virtual void | DeselectInputBox () |
| void | CheckClick (AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState) |
| bool | CheckContinuousClick (AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState) |
| bool | ShouldCloseInteractionMenu () |
| void | SetInteractionMenus (bool turnOn, Hotspot _hotspotFor, InvInstance _invInstanceFor) |
| IEnumerator | SwapInteractionMenu (InteractionMenuData interactionMenuData) |
| void | SetStyles (MenuElement element) |
| bool | CanElementBeDroppedOnto (MenuElement element) |
| void | OnDestroy () |
| void | ForceOffSubtitles (Menu menu, SpeechMenuLimit speechMenuLimit) |
| IEnumerator | SelectUIElementCoroutine (GameObject objectToSelect) |
| string | CreateMenuLockData () |
| string | CreateMenuVisibilityData () |
| string | CreateMenuElementVisibilityData () |
| string | CreateMenuJournalData () |
| void | AssignMenuLocks (string menuLockData) |
| void | AssignMenuVisibility (string menuVisibilityData) |
| void | AssignMenuElementVisibility (string menuElementVisibilityData) |
| bool | AreInteractionMenusOn () |
| void | AssignMenuJournals (string menuJournalData) |
| void | OnApplicationQuit () |
Protected Attributes | |
| bool | isMouseOverMenu = false |
| bool | isMouseOverInteractionMenu = false |
| bool | canKeyboardControl = false |
| bool | interactionMenuIsOn = false |
| bool | interactionMenuPauses = false |
| int | selected_option |
| bool | foundMouseOverMenu = false |
| bool | foundMouseOverInteractionMenu = false |
| bool | foundMouseOverInventory = false |
| bool | foundCanKeyboardControl = false |
| bool | isMouseOverInventory = false |
| float | pauseAlpha = 0f |
| List< Menu > | menus = new List<Menu>() |
| List< Menu > | dupSpeechMenus = new List<Menu>() |
| List< Menu > | dupHotspotMenus = new List<Menu>() |
| List< Menu > | customMenus = new List<Menu>() |
| Texture2D | pauseTexture |
| int | menuIdentifier = -1 |
| int | lastMenuIdentifier = -1 |
| int | elementIdentifier = -1 |
| int | lastElementIdentifier = -1 |
| MenuInput | selectedInputBox |
| string | selectedInputBoxMenuName |
| MenuInventoryBox | activeInventoryBox |
| MenuCrafting | activeCrafting |
| Menu | activeInventoryBoxMenu |
| InvInstance | oldHoverInstance |
| Menu | mouseOverMenu |
| MenuElement | mouseOverElement |
| int | mouseOverElementSlot |
| bool | isOverRightClickElement |
| Menu | crossFadeTo |
| Menu | crossFadeFrom |
| UnityEngine.EventSystems.EventSystem | eventSystem |
| bool | areAnyPauseMenusOn |
| int | elementOverCursorID = -1 |
| GUIStyle | normalStyle = new GUIStyle () |
| GUIStyle | highlightedStyle = new GUIStyle() |
| Rect | lastSafeRect |
| float | lastAspectRatio |
| bool | isInCutscene |
Properties | |
| bool | PreventSaving [get, set] |
| UnityEngine.EventSystems.EventSystem | EventSystem [get] |
| float | PauseTextureAlpha [get] |
| Menu | MouseOverMenu [get] |
| MenuElement | MouseOverMenuElement [get] |
| int | MouseOverElementSlot [get] |
| bool | IsInCutscene [get] |
This script handles the initialisation, position and display of all Menus defined in MenuManager. Menus are transferred from MenuManager to a local List within this script when the game begins. It must be placed on the PersistentEngine prefab.
| bool AC.PlayerMenus.ArePauseMenusOn | ( | Menu | excludingMenu = null | ) |
Checks if any Menus that pause the game are currently turned on.
| excludingMenu | If assigned, this Menu will be excluded from the check |
| void AC.PlayerMenus.AssignSpeechToMenu | ( | Speech | speech | ) |
| void AC.PlayerMenus.CheckCrossfade | ( | AC.Menu | _menu | ) |
| void AC.PlayerMenus.CheckForInput | ( | ) |
Checks for inputs made to all Menus. This is called every frame by StateHandler.
| void AC.PlayerMenus.ClearParents | ( | ) |
Clears the parents of any Unity UI-based Menu Canvases. This makes them able to survive a scene change.
| void AC.PlayerMenus.CloseInteractionMenus | ( | ) |
Closes all "Interaction" Menus.
| void AC.PlayerMenus.CreateEventSystem | ( | bool | force = false | ) |
Spawns an Event System, either using the prefab supplied in the Menu Manager, or generating one from scratch otherwise.
| force | If True, the EventSystem will always be created. If False, it will only be generated if any Menus rely on Unity UI |
|
static |
Takes the ingredients supplied to a MenuCrafting element and sets the appropriate outcome of another MenuCrafting element with craftingType = CraftingElementType.Output.
| void AC.PlayerMenus.CrossFade | ( | AC.Menu | _menuTo | ) |
| bool AC.PlayerMenus.DeselectEventSystemMenu | ( | Menu | _menu | ) |
| void AC.PlayerMenus.DeselectInputBox | ( | MenuElement | menuElement | ) |
Deselects the active InputBox element if it is the one in the parameter.
| menuElement | The InputBox element that should be disabled |
| void AC.PlayerMenus.DestroyCustomMenus | ( | ) |
Destroys and unregisters all custom Menus registered with PlayerMenus
| void AC.PlayerMenus.DiableUIInNextFrame | ( | Menu | menu | ) |
Disables a given menu's UI canvas after a frame delay, provided that it is still off by then
| void AC.PlayerMenus.DisableHotspotMenus | ( | ) |
Turns off any Menus with appearType = AppearType.OnHotspot.
| void AC.PlayerMenus.DrawLoadingMenus | ( | ) |
Draws any OnGUI-based Menus set to appear while the game is loading.
| void AC.PlayerMenus.DrawMenu | ( | AC.Menu | menu, |
| int | languageNumber = 0 ) |
| void AC.PlayerMenus.DrawMenus | ( | ) |
Draws all OnGUI-based Menus.
| void AC.PlayerMenus.EnableInteractionMenus | ( | Hotspot | hotspotFor | ) |
| void AC.PlayerMenus.EnableInteractionMenus | ( | InvInstance | itemFor | ) |
Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.
| _itemFor | The instance of the Inventory item to connect the Menus to. |
| void AC.PlayerMenus.EnableInteractionMenus | ( | InvItem | itemFor | ) |
Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.
| _itemFor | The Inventory item to connect the Menus to. |
| void AC.PlayerMenus.FindFirstSelectedElement | ( | Menu | menuToIgnore = null, |
| bool | ignoreIfAlreadySelectingMenu = false ) |
Selects the first element GameObject in a Unity UI-based Menu.
| menuToIgnore | If set, this menu will be ignored when searching |
|
static |
Instantly turns off all Menus.
| onlyPausing | If True, then only Menus with pauseWhenEnabled = True will be turned off |
| void AC.PlayerMenus.ForceOffSubtitles | ( | SpeechMenuLimit | speechMenuLimit = SpeechMenuLimit::All | ) |
Instantly turns off all Menus that have appearType = AppearType.WhenSpeechPlays.
| speechMenuLimit | The type of speech to kill (All, BlockingOnly, BackgroundOnly) |
|
virtual |
Gets the ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over.
|
static |
Gets a MenuElement with a specific name.
| menuName | The name (title) of the Menu to find |
| menuElementName | The name (title) of the MenuElement with the Menu to find |
| string AC.PlayerMenus.GetHotspotLabel | ( | ) |
|
static |
Gets a List of all defined Menus.
| includeDuplicatesAndCustom | If True, then duplicate and custom Menus will also be included in the returned List |
| Menu AC.PlayerMenus.GetMenuWithElement | ( | MenuElement | _element | ) |
Gets the Menu that a given MenuElement is a part of.
| _element | The MenuElement to get the Menu for |
|
static |
| Menu[] AC.PlayerMenus.GetRegisteredCustomMenus | ( | ) |
Gets all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus.
| bool AC.PlayerMenus.IsCyclingInteractionMenu | ( | ) |
Checks if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it.
| bool AC.PlayerMenus.IsEventSystemSelectingObject | ( | ) |
Checks if the Unity UI EventSystem currently has any GameObject selected.
| bool AC.PlayerMenus.IsEventSystemSelectingObject | ( | GameObject | _gameObject | ) |
Checks if the Unity UI EventSystem currently has a given GameObject selected.
| _gameObject | The GameObject to check |
| bool AC.PlayerMenus.IsInteractionMenuOn | ( | ) |
| bool AC.PlayerMenus.IsMouseOverInteractionMenu | ( | ) |
| bool AC.PlayerMenus.IsMouseOverMenu | ( | ) |
| bool AC.PlayerMenus.IsPausingInteractionMenuOn | ( | ) |
|
static |
Checks if saving cannot be performed at this time.
| _actionToIgnore | Any gameplay-blocking ActionList that contains this Action will be excluded from the check |
| showDebug | If True, then a warning message will be displayed in the Console if saving is not possible, with further information |
| void AC.PlayerMenus.LoadMainData | ( | MainData | mainData | ) |
| void AC.PlayerMenus.OnTurnOffMenu | ( | Menu | menu | ) |
|
virtual |
Restores the menu and cursor systems to their former states, after taking a screenshot.
|
virtual |
Backs up the state of the menu and cursor systems, and disables them, before taking a screenshot.
| void AC.PlayerMenus.RebuildMenus | ( | MenuManager | menuManager = null | ) |
Rebuilds the game's Menus, either from the existing MenuManager asset, or from a new one.
| void AC.PlayerMenus.RecalculateAll | ( | ) |
Recalculates the position, size and display of all Menus. This is an intensive process, and should not be called every fame.
| void AC.PlayerMenus.RefreshDialogueOptions | ( | ) |
Refreshes any active MenuDialogList elements, after changing the state of dialogue options.
| void AC.PlayerMenus.RegisterCustomMenu | ( | Menu | menu, |
| bool | deleteWhenTurnOff = false ) |
Registers a script-created Menu instance, so that it's click-handling, updating and rendering are handled automatically.
| void AC.PlayerMenus.RemoveSpeechFromMenu | ( | Speech | speech | ) |
| void AC.PlayerMenus.RequestRepositionUpdate | ( | Menu | menu, |
| Vector2 | screenPosition ) |
Repositions a menu a frame later, so that its scale values can be properly calculated after spawning. This normally only needs to be called internally.
| menu | The menu to reposition |
| screenPosition | The position to take. |
|
static |
Calls RecalculateSize() on all MenuInventoryBox elements.
|
virtual |
Selects a MenuInput element, allowing the player to enter text into it.
| input | The input box to select |
| void AC.PlayerMenus.SelectUIElement | ( | GameObject | objectToSelect | ) |
Selects a Unity UI GameObject.
| objectToSelect | The UI GameObject to select |
| void AC.PlayerMenus.ShowEnabledOnStartMenus | ( | ) |
Enables any Menus set to be "enabled on start"
|
static |
Simulates the clicking of a MenuElement.
| menuName | The name (title) of the Menu that contains the MenuElement |
| _element | The MenuElement |
| slot | The index number of the slot, if the MenuElement has multiple slots |
|
static |
Simulates the clicking of a MenuElement.
| menuName | The name (title) of the Menu that contains the MenuElement |
| menuElementName | The name (title) of the MenuElement |
| slot | The index number of the slot, if the MenuElement has multiple slots |
| void AC.PlayerMenus.UnregisterCustomMenu | ( | Menu | menu, |
| bool | showError = true ) |
| void AC.PlayerMenus.UpdateAllMenus | ( | ) |
Updates the state of all Menus. This is called every frame by StateHandler.
| void AC.PlayerMenus.UpdateLoadingMenus | ( | ) |
Updates the state of all Menus set to appear while the game is loading.
| void AC.PlayerMenus.UpdateMenu | ( | AC.Menu | menu, |
| int | languageNumber = 0, | ||
| bool | justPosition = false, | ||
| bool | updateElements = true ) |
Updates a Menu's display and position.
| menu | The Menu to update |
| languageNumber | The index number of the language to use (0 = default) |
| justPosition | If True, then only the Menu's position will be updated - not its content |
| updateElements | If True, then the Menu's elements will be updated as well |
KickStarter.playerInput.IsCursorLocked () &&
| void AC.PlayerMenus.UpdateMenuPosition | ( | AC.Menu | menu, |
| Vector2 | invertedMouse, | ||
| bool | force = false ) |
| void AC.PlayerMenus.UpdatePauseMenusRecord | ( | ) |
Recalculates whether or not any pause menus are on
| void AC.PlayerMenus.UpdateUIInteractability | ( | ) |
Updates the interactability of all Menus linked to Unity UI.
|
get |
The EventSystem used by AC Menus.
|
get |
The alpha value of the full-screen texture drawn when the game is paused. This is set even if no pause texture is assigned.
|
getset |
If True, then saving will be manually disabled