![]() |
Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
|
Public Member Functions | |
| void | OnInitPersistentEngine () |
| void | SetNull () |
| void | SelectItemByID (int _id, SelectItemMode _mode=SelectItemMode.Use, bool ignoreInventory=false) |
| Selects an inventory item (InvItem) by referencing its ID number. | |
| void | ReselectLastItem () |
| Re-selects the last-selected inventory item, if available. | |
| void | SelectItem (InvInstance invInstance, SelectItemMode _mode=SelectItemMode.Use) |
| Selects an inventory item (InvItem) | |
| void | Replace (int _addID, int _removeID, int addAmount=1) |
| Replaces one inventory item carried by the player with another, retaining its position in its MenuInventoryBox element. | |
| void | Add (int itemID, int amount=1, bool selectAfter=false, int playerID=-1, bool addToFront=false) |
| Adds an inventory item to the player's inventory. | |
| void | Add (InvInstance newInstance, bool selectAfter=false, int playerID=-1, bool addToFront=false) |
| Adds an inventory item to the player's inventory. | |
| void | Remove (int _id) |
| Removes an inventory item from the player's inventory. If multiple instances of the item can be held, all instances will be removed. | |
| void | Remove (InvInstance invInstance) |
| void | Remove (int _id, int amount) |
| Removes some instances of an inventory items from the player's inventory. | |
| void | AddToOtherPlayer (InvInstance invInstance, int playerID, bool addToFront) |
| void | RemoveFromOtherPlayer (int itemID, int playerID) |
| Removes an inventory item from a player's inventory. If multiple instances of the item can be held, all instances will be removed. | |
| void | RemoveFromOtherPlayer (int itemID, int amount, int playerID) |
| Removes some instances of an inventory item from a player's inventory. | |
| void | RemoveAllFromOtherPlayer (int playerID) |
| Removes all items from a player's inventory. | |
| void | RemoveAllFromOtherPlayer (int playerID, int categoryID) |
| Removes all items in a category from a player's inventory. | |
| void | Remove (string _name, int amount=0) |
| Removes an inventory item from the player's inventory. | |
| void | RemoveAll () |
| Removes all items from the player's inventory. | |
| int | GetCount (int _invID) |
| Gets the amount of a particular inventory item within the player's inventory. | |
| int | GetCount (int _invID, int _playerID) |
| Gets the amount of a particular inventory item within any player's inventory, if multiple Player prefabs are supported. | |
| int | GetCountFromAllPlayers (int _invID) |
| Gets the amount of a particular inventory item within all player inventories, if multiple Player prefabs are supported. | |
| int | GetNumberOfItemsCarried (bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by the active Player. | |
| int | GetNumberOfItemsCarried (int _playerID, bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by a given Player, if multiple Players are supported. | |
| int | GetNumberOfItemsCarriedByAllPlayers (bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by all Players, if multiple Players are supported. | |
| int | GetNumberOfItemsCarriedInCategory (int categoryID, bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by the active Player. | |
| int | GetNumberOfItemsCarriedInCategory (int categoryID, int _playerID, bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by a given Player, if multiple Players are supported. | |
| int | GetNumberOfItemsCarriedInCategoryByAllPlayers (int categoryID, bool includeMultipleInSameSlot=false) |
| Gets the total number of inventory items currently held by all Players, if multiple Players are supported. | |
| InvInstance | GetInstance (int _id) |
| Gets an inventory item instance within the player's current inventory. | |
| InvItem | GetItem (int _id) |
| Gets an inventory item within the player's current inventory. | |
| InvItem | GetItem (string _name) |
| Gets the first-found inventory item within the player's current inventory. | |
| InvInstance | GetInstance (string _name) |
| Gets the first-found instance of an inventory item within the player's current inventory. | |
| InvInstance[] | GetInstances (int _id) |
| Gets all instances of an inventory item within the player's current inventory. | |
| InvInstance[] | GetInstances (string _name) |
| Gets all instances of an inventory item within the player's current inventory. | |
| bool | IsCarryingItem (int itemID) |
| Checks if an inventory item is within the player's current inventory. | |
| bool | IsCarryingItem (InvItem invItem) |
| Checks if an inventory item is within the player's current inventory. | |
| bool | IsCarryingItem (InvInstance invInstance) |
| void | ShowInteractions (InvInstance invInstance) |
| Sets up all "Interaction" menus according to a specific inventory item. | |
| void | SetHoverItem (InvInstance invInstance, MenuInventoryBox menuInventoryBox) |
| Sets the item currently being hovered over by the mouse cursor. | |
| void | SetHoverItem (InvInstance invInstance, MenuCrafting menuCrafting) |
| Sets the item currently being hovered over by the mouse cursor. | |
| void | ClearHoverItem () |
| void | RemoveRecipes () |
| void | RemoveRecipe (string menuName, string craftingIngredientsName) |
| Resets the inventory associated with a specific Crafting Ingredients element. | |
| Recipe | CalculateRecipe (InvCollection ingredientsInvCollection, int[] limitToCategoryIDs=null) |
| Works out which Recipe, if any, for which all ingredients have been correctly arranged. | |
| void | PerformCrafting (InvCollection ingredientsInvCollection, Recipe recipe, bool selectAfter) |
| Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe. | |
| InvInstance | PerformCrafting (InvCollection ingredientsInvCollection, Recipe recipe, InvCollection toInvCollection=null) |
| Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe. | |
| List< InvInstance > | RemoveEmptySlots (List< InvInstance > invInstances) |
| InvCollection | GetIngredientsInvCollection (string menuName, string craftingElementName) |
| Gets an InvCollection of ingredients associated with a given MenuCrafting element. | |
| void | AssignPlayerInventory (InvCollection invCollection) |
| Assign's the player's current inventory in bulk. | |
| void | DrawHighlighted (Rect _rect) |
| Draws the currently-highlight item across a set region of the screen. | |
| void | HighlightItemOnInstant (int _id) |
| Fully highlights an inventory item instantly. | |
| void | HighlightItemOffInstant () |
| void | HighlightItem (int _id, HighlightType _type) |
| Highlights an inventory item. | |
| void | HighlightItem (InvInstance invInstance, HighlightType _type) |
| Highlights an inventory item instance. | |
| virtual void | DrawSelectedInventoryCount () |
| bool | ProcessInventoryBoxClick (AC.Menu _menu, MenuInventoryBox inventoryBox, int _slot, MouseState _mouseState) |
| Processes the clicking of an inventory item within a MenuInventoryBox element. | |
| MainData | SaveMainData (MainData mainData) |
| Updates a MainData class with its own variables that need saving. | |
| void | LoadMainData (MainData mainData) |
| virtual bool | CanTransferContainerItemsToInventory (Container container, InvInstance invInstance) |
| Checks if an item can be transferred from a Container to the current Player's inventory. | |
| void | OnInitialiseScene () |
Protected Member Functions | |
| void | OnApplicationQuit () |
| void | OnEnable () |
| void | OnDisable () |
| virtual string | GetInventoryCountText () |
| void | OnInventoryInteract (InvItem invItem, int cursorID) |
| void | OnInventoryCombine (InvItem invItemA, InvItem invItemB) |
| void | OnUpdatePlayableScreenArea () |
| void | AssignStartingItems () |
| InvCollection | GetItemsOnStart (int playerID=-1) |
| void | RemoveFromOtherPlayer (int invID, int amount, bool setAmount, int playerID) |
| List< InvInstance > | ReorderItems (List< InvInstance > invInstances) |
Protected Attributes | |
| InvCollection | playerInvCollection = new InvCollection () |
| List< IngredientCollection > | ingredientCollections = new List<IngredientCollection> () |
| InvInstance | selectedInstance = null |
| InvInstance | lastSelectedInstance = null |
| InvInstance | hoverInstance = null |
| InvInstance | highlightInstance = null |
| bool | showHoverLabel = true |
| InvInstance | lastClickedInstance |
| GUIStyle | countStyle = new GUIStyle () |
| TextEffects | countTextEffects |
| HighlightState | highlightState = HighlightState.None |
| float | pulse = 0f |
| int | pulseDirection = 0 |
Properties | |
| InvInstance | SelectedInstance [get] |
| InvItem | SelectedItem [get] |
| InvInstance | HighlightInstance [get] |
| List< InvItem > | localItems [get] |
| InvCollection[] | CraftingInvCollections [get] |
| InvCollection | PlayerInvCollection [get] |
| InvItem | hoverItem [get] |
| InvInstance | HoverInstance [get] |
| InvInstance | LastSelectedInstance [get] |
| InvInstance | LastClickedInstance [get, set] |
| InvItem | LastClickedItem [get] |
| InvItem | LastSelectedItem [get] |
| bool | ShowHoverLabel [get] |
This component is where inventory items (see InvItem) are stored at runtime. When the player aquires an item, it is transferred here (into _localItems) from the InventoryManager asset. It should be placed on the PersistentEngine prefab.
| void AC.RuntimeInventory.Add | ( | int | itemID, |
| int | amount = 1, | ||
| bool | selectAfter = false, | ||
| int | playerID = -1, | ||
| bool | addToFront = false ) |
Adds an inventory item to the player's inventory.
| itemID | The ID of the inventory item to add |
| amount | The number of instances of the item to add |
| selectAfter | If True, then the inventory item will be automatically selected |
| playerID | The ID number of the Player to receive the item, if multiple Player prefabs are supported. If playerID = -1, the current player will receive the item |
| addToFront | If True, the new item will be added to the front of the inventory |
| void AC.RuntimeInventory.Add | ( | InvInstance | newInstance, |
| bool | selectAfter = false, | ||
| int | playerID = -1, | ||
| bool | addToFront = false ) |
Adds an inventory item to the player's inventory.
| newInstance | The instance of the inventory item to add |
| selectAfter | If True, then the inventory item will be automatically selected |
| playerID | The ID number of the Player to receive the item, if multiple Player prefabs are supported. If playerID = -1, the current player will receive the item |
| addToFront | If True, the new item will be added to the front of the inventory |
| void AC.RuntimeInventory.AssignPlayerInventory | ( | InvCollection | invCollection | ) |
Assign's the player's current inventory in bulk.
| newInventory | A list of the InvInstance classes that make up the new inventory |
| Recipe AC.RuntimeInventory.CalculateRecipe | ( | InvCollection | ingredientsInvCollection, |
| int[] | limitToCategoryIDs = null ) |
Works out which Recipe, if any, for which all ingredients have been correctly arranged.
| ingredientsInvCollection | The InvCollection to get ingredients from |
| limitToCategoryIDs | If set, an array of item categories that the resulting item must be within for the recipe to be valid |
|
virtual |
Checks if an item can be transferred from a Container to the current Player's inventory.
| container | The Container to transfer from |
| invInstance | The inventory item to to transfer |
| void AC.RuntimeInventory.ClearHoverItem | ( | ) |
Clears the item being hovered
| void AC.RuntimeInventory.DrawHighlighted | ( | Rect | _rect | ) |
Draws the currently-highlight item across a set region of the screen.
| _rect | The Screen-Space co-ordinates at which to draw the highlight item |
|
virtual |
Draws how much of the selected item are selected, if greater than one. This should be called within an OnGUI function.
| int AC.RuntimeInventory.GetCount | ( | int | _invID | ) |
Gets the amount of a particular inventory item within the player's inventory.
| _invID | The ID number of the inventory item (InvItem) in question |
| int AC.RuntimeInventory.GetCount | ( | int | _invID, |
| int | _playerID ) |
Gets the amount of a particular inventory item within any player's inventory, if multiple Player prefabs are supported.
| _invID | The ID number of the inventory item (InvItem) in question |
| playerID | The ID number of the Player to refer to |
| int AC.RuntimeInventory.GetCountFromAllPlayers | ( | int | _invID | ) |
Gets the amount of a particular inventory item within all player inventories, if multiple Player prefabs are supported.
| _invID | The ID number of the inventory item (InvItem) in question |
| playerID | The ID number of the Player to refer to |
| InvCollection AC.RuntimeInventory.GetIngredientsInvCollection | ( | string | menuName, |
| string | craftingElementName ) |
Gets an InvCollection of ingredients associated with a given MenuCrafting element.
| menuName | The title of the Menu that contains the MenuCrafting element |
| craftingElementName | The title of the "Ingredients" MenuCrafting element |
| InvInstance AC.RuntimeInventory.GetInstance | ( | int | _id | ) |
Gets an inventory item instance within the player's current inventory.
| _id | The ID number of the inventory item |
| InvInstance AC.RuntimeInventory.GetInstance | ( | string | _name | ) |
Gets the first-found instance of an inventory item within the player's current inventory.
| _name | The name of the InvItem to find |
| InvInstance[] AC.RuntimeInventory.GetInstances | ( | int | _id | ) |
Gets all instances of an inventory item within the player's current inventory.
| _id | The ID number of the InvItem to find |
| InvInstance[] AC.RuntimeInventory.GetInstances | ( | string | _name | ) |
Gets all instances of an inventory item within the player's current inventory.
| _name | The name of the InvItem to find |
| InvItem AC.RuntimeInventory.GetItem | ( | int | _id | ) |
Gets an inventory item within the player's current inventory.
| _id | The ID number of the inventory item |
| InvItem AC.RuntimeInventory.GetItem | ( | string | _name | ) |
Gets the first-found inventory item within the player's current inventory.
| _name | The name of the InvItem to find |
| int AC.RuntimeInventory.GetNumberOfItemsCarried | ( | bool | includeMultipleInSameSlot = false | ) |
| int AC.RuntimeInventory.GetNumberOfItemsCarried | ( | int | _playerID, |
| bool | includeMultipleInSameSlot = false ) |
Gets the total number of inventory items currently held by a given Player, if multiple Players are supported.
| playerID | The ID number of the Player to refer to |
| includeMultipleInSameSlot | If True, then multiple items in the same slot will be counted separately |
| int AC.RuntimeInventory.GetNumberOfItemsCarriedByAllPlayers | ( | bool | includeMultipleInSameSlot = false | ) |
Gets the total number of inventory items currently held by all Players, if multiple Players are supported.
| includeMultipleInSameSlot | If True, then multiple items in the same slot will be counted separately |
| int AC.RuntimeInventory.GetNumberOfItemsCarriedInCategory | ( | int | categoryID, |
| bool | includeMultipleInSameSlot = false ) |
| int AC.RuntimeInventory.GetNumberOfItemsCarriedInCategory | ( | int | categoryID, |
| int | _playerID, | ||
| bool | includeMultipleInSameSlot = false ) |
Gets the total number of inventory items currently held by a given Player, if multiple Players are supported.
| categoryID | If >=0, then only items placed in the category with that ID will be counted |
| playerID | The ID number of the Player to refer to |
| int AC.RuntimeInventory.GetNumberOfItemsCarriedInCategoryByAllPlayers | ( | int | categoryID, |
| bool | includeMultipleInSameSlot = false ) |
Gets the total number of inventory items currently held by all Players, if multiple Players are supported.
| categoryID | If >=0, then only items placed in the category with that ID will be counted |
| void AC.RuntimeInventory.HighlightItem | ( | int | _id, |
| HighlightType | _type ) |
Highlights an inventory item.
| _id | The ID number of the inventory item to highlight |
| _type | The type of highlighting effect to perform (Enable, Disable, PulseOnce, PulseContinuously) |
| void AC.RuntimeInventory.HighlightItem | ( | InvInstance | invInstance, |
| HighlightType | _type ) |
Highlights an inventory item instance.
| invInstance | The inventory item instance to highlight |
| _type | The type of highlighting effect to perform (Enable, Disable, PulseOnce, PulseContinuously) |
| void AC.RuntimeInventory.HighlightItemOffInstant | ( | ) |
Removes all highlighting from the inventory item curently being highlighted.
| void AC.RuntimeInventory.HighlightItemOnInstant | ( | int | _id | ) |
Fully highlights an inventory item instantly.
| _id | The ID number of the inventory item (see InvItem) to highlight |
| bool AC.RuntimeInventory.IsCarryingItem | ( | int | itemID | ) |
Checks if an inventory item is within the player's current inventory.
| itemID | The ID number of the inventory item |
| bool AC.RuntimeInventory.IsCarryingItem | ( | InvItem | invItem | ) |
Checks if an inventory item is within the player's current inventory.
| invItem | The inventory item |
| void AC.RuntimeInventory.OnInitPersistentEngine | ( | ) |
Transfers any relevant data from InventoryManager when the game begins or restarts.
| void AC.RuntimeInventory.PerformCrafting | ( | InvCollection | ingredientsInvCollection, |
| Recipe | recipe, | ||
| bool | selectAfter ) |
Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe.
| ingredientsInvCollection | The InvCollection to get ingredients from |
| recipe | The Recipe to perform |
| selectAfter | If True, then the resulting inventory item will be selected once the crafting is complete |
| InvInstance AC.RuntimeInventory.PerformCrafting | ( | InvCollection | ingredientsInvCollection, |
| Recipe | recipe, | ||
| InvCollection | toInvCollection = null ) |
Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe.
| ingredientsInvCollection | The InvCollection to get ingredients from |
| recipe | The Recipe to perform |
| toInvCollection | If assigned, the InvCollection to place the newly-created Recipe item into |
| bool AC.RuntimeInventory.ProcessInventoryBoxClick | ( | AC.Menu | _menu, |
| MenuInventoryBox | inventoryBox, | ||
| int | _slot, | ||
| MouseState | _mouseState ) |
Processes the clicking of an inventory item within a MenuInventoryBox element.
| _menu | The Menu that contains the MenuInventoryBox element |
| inventoryBox | The MenuInventoryBox element that was clicked on |
| _slot | The index number of the MenuInventoryBox slot that was clicked on |
| _mouseState | The state of the mouse when the click occured (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo) |
| void AC.RuntimeInventory.Remove | ( | int | _id | ) |
Removes an inventory item from the player's inventory. If multiple instances of the item can be held, all instances will be removed.
| _id | The ID number of the inventory item (InvItem) to remove |
| void AC.RuntimeInventory.Remove | ( | int | _id, |
| int | amount ) |
| void AC.RuntimeInventory.Remove | ( | string | _name, |
| int | amount = 0 ) |
Removes an inventory item from the player's inventory.
| _name | The name of the item to remove |
| amount | If >0, then only that quantity will be removed, if the item's canCarryMultiple property is True. Otherwise, all instances will be removed |
| void AC.RuntimeInventory.RemoveAllFromOtherPlayer | ( | int | playerID | ) |
Removes all items from a player's inventory.
| playerID | The ID number of the player to affect |
| void AC.RuntimeInventory.RemoveAllFromOtherPlayer | ( | int | playerID, |
| int | categoryID ) |
Removes all items in a category from a player's inventory.
| playerID | The ID number of the player to affect |
| categoryID | The ID of the category |
| void AC.RuntimeInventory.RemoveFromOtherPlayer | ( | int | itemID, |
| int | amount, | ||
| int | playerID ) |
Removes some instances of an inventory item from a player's inventory.
| void AC.RuntimeInventory.RemoveFromOtherPlayer | ( | int | itemID, |
| int | playerID ) |
Removes an inventory item from a player's inventory. If multiple instances of the item can be held, all instances will be removed.
| itemID | The ID number of the inventory item (InvItem) to remove |
| playerID | The ID number of the player to affect, if player-switching is enabled |
| void AC.RuntimeInventory.RemoveRecipe | ( | string | menuName, |
| string | craftingIngredientsName ) |
Resets the inventory associated with a specific Crafting Ingredients element.
| menuName | The name of the Menu |
| craftingIngredientsName | The name of the Crafting menu element of type Ingredients |
| void AC.RuntimeInventory.RemoveRecipes | ( | ) |
Resets all active recipes, and clears all MenuCrafting elements
| void AC.RuntimeInventory.Replace | ( | int | _addID, |
| int | _removeID, | ||
| int | addAmount = 1 ) |
Replaces one inventory item carried by the player with another, retaining its position in its MenuInventoryBox element.
| void AC.RuntimeInventory.SelectItem | ( | InvInstance | invInstance, |
| SelectItemMode | _mode = SelectItemMode::Use ) |
Selects an inventory item (InvItem)
| invInstance | The instance of the inventory item to select |
| _mode | What mode the item is selected in (Use, Give) |
| void AC.RuntimeInventory.SelectItemByID | ( | int | _id, |
| SelectItemMode | _mode = SelectItemMode::Use, | ||
| bool | ignoreInventory = false ) |
Selects an inventory item (InvItem) by referencing its ID number.
| _id | The inventory item's ID number |
| _mode | What mode the item is selected in (Use, Give) |
| void AC.RuntimeInventory.SetHoverItem | ( | InvInstance | invInstance, |
| MenuCrafting | menuCrafting ) |
Sets the item currently being hovered over by the mouse cursor.
| invInstance | The instance of the item to set |
| menuCrafting | The MenuInventoryBox that the item is displayed within |
| void AC.RuntimeInventory.SetHoverItem | ( | InvInstance | invInstance, |
| MenuInventoryBox | menuInventoryBox ) |
Sets the item currently being hovered over by the mouse cursor.
| invInstance | The instance of the item to set |
| menuInventoryBox | The MenuInventoryBox that the item is displayed within |
| void AC.RuntimeInventory.SetNull | ( | ) |
De-selects the active inventory item.
| void AC.RuntimeInventory.ShowInteractions | ( | InvInstance | invInstance | ) |
Sets up all "Interaction" menus according to a specific inventory item.
| invInstance | The relevant inventory item instance |
|
get |
The InvCollections that holds the current set of items to be crafted
|
get |
The inventory item that is currently being highlighted within an MenuInventoryBox element
|
get |
The instance of the inventory item that is currently being hovered over
|
get |
The inventory item that is currently being hovered over
|
getset |
The instance of the last inventory item that the player clicked on, in any MenuInventoryBox element type
|
get |
The last inventory item that the player clicked on, in any MenuInventoryBox element type
|
get |
The instance of the last inventory item to be selected. This will return the currently-selected item if one exists
|
get |
The last inventory item to be selected. This will return the currently-selected item if one exists
|
get |
A List of inventory items carried by the player. This is calculated from LocalInstances and should not be called every frame
|
get |
The InvCollection that holds the current set of items in the Player#s inventory
|
get |
The instance inventory item that is currently selected
|
get |
The inventory item that is currently selected
|
get |
If True, then the Hotspot label will show the name of the inventory item that the mouse is hovering over