Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.InventoryManager Class Reference
Inheritance diagram for AC.InventoryManager:

Public Member Functions

void ShowGUI (Rect windowRect, System.Action< ActionListAsset > showALAEditor)
InvItem CreateNewItem (int newID=-1)
 Creates a new inventory item.
InvVar CreateNewProperty ()
 Creates a new inventory item property.
InvBin CreateNewCategory ()
 Creates a new inventory item category.
int GetArraySlot (int _id)
string[] GetLabelList ()
int GetBinSlot (int _id)
void ChangeItemID (int oldID, int newID)
void ChangeDocumentID (int oldID, int newID)
void ChangeObjectiveID (int oldID, int newID)
InvVar GetProperty (int ID)
 Gets an inventory property.
InvVar GetProperty (string label)
 Gets an inventory property.
Document GetDocument (int ID)
 Gets a Document.
Objective GetObjective (int ID)
 Gets an Objective.
string GetLabel (int _id)
 Gets an inventory item's label.
InvItem GetItem (string _name)
 Gets an inventory item.
InvItem GetItem (int _id)
 Gets an inventory item.
Recipe GetRecipe (int _id)
 Gets a Recipe.
int GetFirstItemsCategoryID ()
bool IsInItemsCategory (int binID)
bool IsInDocumentsCategory (int binID)
bool IsInObjectivesCategory (int binID)
int GetFirstDocumentsCategoryID ()
Objective[] GetObjectivesInCategory (int categoryID)
 Gets an array of Objectives that belong in a given category.
int GetFirstObjectivessCategoryID ()
InvBin GetCategory (int categoryID)
 Gets an inventory category.
InvBin GetCategory (string label)
 Gets an inventory category.
InvItem[] GetItemsInCategory (int categoryID)
 Gets an array of all inventory items in a given category.
Document[] GetDocumentsInCategory (int categoryID)
 Gets an array of all Documents in a given category.
bool ObjectiveIsPerPlayer (int objectiveID)
 Checks if a given Objective is per-Player, i.e. each player has their own instance of the Objective.
int ChooseCategoryGUI (string label, int binID, bool forItems, bool forDocuments, bool forObjectives, string apiPrefix="", string tooltip="", bool addNoneOption=false)

Static Public Member Functions

static int DocumentSelectorList (int ID, string label="Document:")
static int ObjectiveSelectorList (int ID, string label="Objective:")

Public Attributes

List< InvItemitems = new List<InvItem>()
List< InvBinbins = new List<InvBin>()
List< InvVarinvVars = new List<InvVar>()
ActionListAsset unhandledCombine
ActionListAsset unhandledHotspot
bool passUnhandledHotspotAsParameter
ActionListAsset unhandledGive
List< Reciperecipes = new List<Recipe>()
List< Documentdocuments = new List<Document>()
List< Objectiveobjectives = new List<Objective>()
ObjectiveStateLabel objectiveStateActiveLabel = new ObjectiveStateLabel ("Active")
ObjectiveStateLabel objectiveStateCompleteLabel = new ObjectiveStateLabel ("Complete")
ObjectiveStateLabel objectiveStateFailLabel = new ObjectiveStateLabel ("Fail")

Detailed Description

Handles the "Inventory" tab of the Game Editor window. All inventory items, inventory categories and recipes are defined here.

Member Function Documentation

◆ CreateNewCategory()

InvBin AC.InventoryManager.CreateNewCategory ( )

Creates a new inventory item category.

Returns
The newly-created item category

◆ CreateNewItem()

InvItem AC.InventoryManager.CreateNewItem ( int newID = -1)

Creates a new inventory item.

Parameters
newIDIf >= 0, the ID number of the item, if available. If it is already taken, the item will not be created
Returns
The newly-created item

◆ CreateNewProperty()

InvVar AC.InventoryManager.CreateNewProperty ( )

Creates a new inventory item property.

Returns
The newly-created item property

◆ GetCategory() [1/2]

InvBin AC.InventoryManager.GetCategory ( int categoryID)

Gets an inventory category.

Parameters
categoryIDThe ID number of the inventory category to find
Returns
The inventory category

◆ GetCategory() [2/2]

InvBin AC.InventoryManager.GetCategory ( string label)

Gets an inventory category.

Parameters
labelThe name of the inventory category to find
Returns
The inventory category

◆ GetDocument()

Document AC.InventoryManager.GetDocument ( int ID)

Gets a Document.

Parameters
IDThe ID number of the Document to find
Returns
The Document

◆ GetDocumentsInCategory()

Document[] AC.InventoryManager.GetDocumentsInCategory ( int categoryID)

Gets an array of all Documents in a given category.

Parameters
categoryIDThe ID number of the category in question
Returns
An array of all Documents in the category

◆ GetFirstDocumentsCategoryID()

int AC.InventoryManager.GetFirstDocumentsCategoryID ( )

Gets the ID of the first-defined category avaiable for Documents, or -1 otherwise

◆ GetFirstItemsCategoryID()

int AC.InventoryManager.GetFirstItemsCategoryID ( )

Gets the ID of the first-defined category avaiable for Inventory items, or -1 otherwise

◆ GetFirstObjectivessCategoryID()

int AC.InventoryManager.GetFirstObjectivessCategoryID ( )

Gets the ID Of the first-defined category avaiable for Objectives, or -1 otherwise

◆ GetItem() [1/2]

InvItem AC.InventoryManager.GetItem ( int _id)

Gets an inventory item.

Parameters
_idThe ID number of the InvItem to find
Returns
The inventory item

◆ GetItem() [2/2]

InvItem AC.InventoryManager.GetItem ( string _name)

Gets an inventory item.

Parameters
_nameThe name of the InvItem to find
Returns
The inventory item

◆ GetItemsInCategory()

InvItem[] AC.InventoryManager.GetItemsInCategory ( int categoryID)

Gets an array of all inventory items in a given category.

Parameters
categoryIDThe ID number of the category in question
Returns
An array of all inventory items in the category

◆ GetLabel()

string AC.InventoryManager.GetLabel ( int _id)

Gets an inventory item's label.

Parameters
_idThe ID number of the InvItem to find
Returns
The inventory item's label

◆ GetObjective()

Objective AC.InventoryManager.GetObjective ( int ID)

Gets an Objective.

Parameters
IDThe ID number of the Objective to find
Returns
The Objective

◆ GetObjectivesInCategory()

Objective[] AC.InventoryManager.GetObjectivesInCategory ( int categoryID)

Gets an array of Objectives that belong in a given category.

Parameters
categoryIDThe ID of the category
Returns
An array of all Objectives in the given category

◆ GetProperty() [1/2]

InvVar AC.InventoryManager.GetProperty ( int ID)

Gets an inventory property.

Parameters
IDThe ID number of the property to get
Returns
The inventory property.

◆ GetProperty() [2/2]

InvVar AC.InventoryManager.GetProperty ( string label)

Gets an inventory property.

Parameters
labelThe name of the property to get
Returns
The inventory property.

◆ GetRecipe()

Recipe AC.InventoryManager.GetRecipe ( int _id)

Gets a Recipe.

Parameters
_idThe ID number of the Recipe to find
Returns
The Recipe

◆ ObjectiveIsPerPlayer()

bool AC.InventoryManager.ObjectiveIsPerPlayer ( int objectiveID)

Checks if a given Objective is per-Player, i.e. each player has their own instance of the Objective.

Parameters
objectiveIDThe ID of the Objective
Returns
True if the Objective is per-Player

◆ ShowGUI()

void AC.InventoryManager.ShowGUI ( Rect windowRect,
System.Action< ActionListAsset > showALAEditor )

Shows the GUI.

Member Data Documentation

◆ bins

List<InvBin> AC.InventoryManager.bins = new List<InvBin>()

The game's full list of inventory item categories

◆ documents

List<Document> AC.InventoryManager.documents = new List<Document>()

The game's full list of documents

◆ invVars

List<InvVar> AC.InventoryManager.invVars = new List<InvVar>()

The game's full list of inventory item properties

◆ items

List<InvItem> AC.InventoryManager.items = new List<InvItem>()

The game's full list of inventory items

◆ objectives

List<Objective> AC.InventoryManager.objectives = new List<Objective>()

The game's full list of objectives

◆ passUnhandledHotspotAsParameter

bool AC.InventoryManager.passUnhandledHotspotAsParameter

If True, the Hotspot clicked on to initiate unhandledHotspot will be sent as a parameter to the ActionListAsset

◆ recipes

List<Recipe> AC.InventoryManager.recipes = new List<Recipe>()

The game's full list of available recipes

◆ unhandledCombine

ActionListAsset AC.InventoryManager.unhandledCombine

The default ActionListAsset to run if an inventory combination is unhandled

◆ unhandledGive

ActionListAsset AC.InventoryManager.unhandledGive

The default ActionListAsset to run if giving an inventory item to an NPC is unhandled

◆ unhandledHotspot

ActionListAsset AC.InventoryManager.unhandledHotspot

The default ActionListAsset to run if using an inventory item on a Hotspot is unhandled