Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.InventoryManager Class Reference
Inheritance diagram for AC.InventoryManager:

Public Member Functions

void ShowGUI (Rect windowRect)
 
InvItem CreateNewItem (int newID=-1)
 Creates a new inventory item More...
 
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. More...
 
Document GetDocument (int ID)
 Gets a Document. More...
 
Objective GetObjective (int ID)
 Gets an Objective. More...
 
string GetLabel (int _id)
 Gets an inventory item's label. More...
 
InvItem GetItem (string _name)
 Gets an inventory item. More...
 
InvItem GetItem (int _id)
 Gets an inventory item. More...
 
Recipe GetRecipe (int _id)
 Gets a Recipe. More...
 
int GetFirstItemsCategoryID ()
 
bool IsInItemsCategory (int binID)
 
bool IsInDocumentsCategory (int binID)
 
bool IsInObjectivesCategory (int binID)
 
int GetFirstDocumentsCategoryID ()
 
int GetFirstObjectivessCategoryID ()
 
InvBin GetCategory (int categoryID)
 Gets an inventory category. More...
 
InvItem[] GetItemsInCategory (int categoryID)
 Gets an array of all inventory items in a given category More...
 
Document[] GetDocumentsInCategory (int categoryID)
 Gets an array of all Documents in a given category More...
 
bool ObjectiveIsPerPlayer (int objectiveID)
 Checks if a given Objective is per-Player, i.e. each player has their own instance of the Objective More...
 
int ChooseCategoryGUI (string label, int binID, bool forItems, bool forDocuments, bool forObjectives, string apiPrefix="", string tooltip="")
 

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

◆ 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

◆ GetCategory()

InvBin AC.InventoryManager.GetCategory ( int  categoryID)

Gets an inventory category.

Parameters
categoryIDThe ID number 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

◆ GetProperty()

InvVar AC.InventoryManager.GetProperty ( int  ID)

Gets an inventory property.

Parameters
IDThe ID number 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)

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