Adventure Creator  1.57
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2017
AC.InvItem Class Reference

Public Member Functions

 InvItem (int[] idArray)
 The default Constructor. More...
 
 InvItem (InvItem assetItem)
 A Constructor that sets all its values by copying another InvItem. More...
 
bool DoesHaveInventoryInteraction (InvItem invItem)
 Checks if the item has an InvInteraction combine interaction for a specific InvItem. More...
 
string GetLabel (int languageNumber)
 Gets the item's display name. More...
 
void RunUseInteraction (int iconID=-1)
 Runs one of the item's 'Use' interactions. More...
 
void RunExamineInteraction ()
 Runs the item's 'Examine' interaction, if one is defined.
 
void CombineWithItem (int otherItemID)
 Combines the item with another. More...
 
void CombineWithItem (InvItem otherItem)
 Combines the item with another. More...
 
void Select ()
 Selects the item.
 
string GetFullLabel (int languageNumber=0)
 Gets the items's display name, with prefix. More...
 
int GetNextInteraction (int i, int numInvInteractions)
 Gets the index number of the next relevant use/combine interaction. More...
 
int GetPreviousInteraction (int i, int numInvInteractions)
 Gets the index number of the previous relevant use/combine interaction. More...
 
bool CanBeAnimated ()
 Checks if the item's assigned textures are enough for animated effects to be possible. More...
 
InvVar GetProperty (int ID)
 Gets a property of the inventory item. More...
 

Public Attributes

string label
 
int id
 
string altLabel
 
bool carryOnStart
 
bool carryOnStartNotDefault
 
int carryOnStartID
 
List< InvVarvars = new List<InvVar>()
 
bool canCarryMultiple
 
int count
 
bool useSeparateSlots
 
Texture2D tex
 
Texture2D activeTex
 
Texture2D selectedTex
 
GameObject linkedPrefab
 
CursorIcon cursorIcon = new CursorIcon ()
 
int lineID = -1
 
int useIconID = 0
 
int binID
 
bool isEditing = false
 
int recipeSlot = -1
 
int lastInteractionIndex = 0
 
bool overrideUseSyntax = false
 
HotspotPrefix hotspotPrefix1 = new HotspotPrefix ("Use")
 
HotspotPrefix hotspotPrefix2 = new HotspotPrefix ("on")
 
ActionListAsset useActionList
 
ActionListAsset lookActionList
 
List< InvInteractioninteractions = new List<InvInteraction>()
 
List< ActionListAssetcombineActionList = new List<ActionListAsset>()
 
List< int > combineID = new List<int>()
 
ActionListAsset unhandledActionList
 
ActionListAsset unhandledCombineActionList
 

Detailed Description

A container class for an Inventory item. Items are defined in InventoryManager, and downloaded to the RuntimeInventory component during gameplay.

Constructor & Destructor Documentation

AC.InvItem.InvItem ( int[]  idArray)

The default Constructor.

Parameters
idArrayAn array of already-used ID numbers, so that a unique ID number can be assigned
AC.InvItem.InvItem ( InvItem  assetItem)

A Constructor that sets all its values by copying another InvItem.

Parameters
assetItemThe InvItem to copy

Member Function Documentation

bool AC.InvItem.CanBeAnimated ( )

Checks if the item's assigned textures are enough for animated effects to be possible.

Returns
True if the item's assigned textures are enough for animated effects to be possible.
void AC.InvItem.CombineWithItem ( int  otherItemID)

Combines the item with another.

Parameters
otherItemIDThe ID number of the inventory item to combine with
void AC.InvItem.CombineWithItem ( InvItem  otherItem)

Combines the item with another.

Parameters
otherItemThe inventory item to combine with
bool AC.InvItem.DoesHaveInventoryInteraction ( InvItem  invItem)

Checks if the item has an InvInteraction combine interaction for a specific InvItem.

Parameters
invItemThe InvITem to check for
Returns
True if the item has an InvInteraction combine interaction for the InvItem.
string AC.InvItem.GetFullLabel ( int  languageNumber = 0)

Gets the items's display name, with prefix.

Parameters
languageNumberThe index of the current language, as set in SpeechManager
Returns
The item's display name, with prefix
string AC.InvItem.GetLabel ( int  languageNumber)

Gets the item's display name.

Parameters
languageNumberThe index of the current language, as set in SpeechManager
Returns
The item's display name
int AC.InvItem.GetNextInteraction ( int  i,
int  numInvInteractions 
)

Gets the index number of the next relevant use/combine interaction.

Parameters
iThe index number to start from
numInvInteractionsThe number of relevant "combine" interactions
int AC.InvItem.GetPreviousInteraction ( int  i,
int  numInvInteractions 
)

Gets the index number of the previous relevant use/combine interaction.

Parameters
iThe index number to start from
numInvInteractionsThe number of relevant "combine" interactions
InvVar AC.InvItem.GetProperty ( int  ID)

Gets a property of the inventory item.

Parameters
IDThe ID number of the property to get
Returns
The property of the inventory item
void AC.InvItem.RunUseInteraction ( int  iconID = -1)

Runs one of the item's 'Use' interactions.

Parameters
iconIDThe ID number of the CursorIcon associated with the use interaction. If no number is supplied, the default use interaction will be run.

Member Data Documentation

Texture2D AC.InvItem.activeTex

The item's 'highlighted' graphic

string AC.InvItem.altLabel

The item's in-game name, if not label

int AC.InvItem.binID

The ID number of the item's InvBin category, as defined in InventoryManager

bool AC.InvItem.canCarryMultiple

If True, then multiple instances of the item can be carried at once

bool AC.InvItem.carryOnStart

If True, the Player carries the item when the game begins

int AC.InvItem.carryOnStartID

The ID number of the Player prefab that carries the item when the game begins, if carryOnStartNotDefault = True

bool AC.InvItem.carryOnStartNotDefault

If True, then a Player prefab that is not the default carries the item when the game begins (if playerSwitching = PlayerSwitching.Allow in SettingsManager)

List<ActionListAsset> AC.InvItem.combineActionList = new List<ActionListAsset>()

A List of all "Combine" InvInteraction objects associated with the item

List<int> AC.InvItem.combineID = new List<int>()

A List of InvItem ID numbers associated with the InvInteraction objects in combineActionList

int AC.InvItem.count

The number of instances being carried, if canCarryMultiple = True

CursorIcon AC.InvItem.cursorIcon = new CursorIcon ()

A CursorIcon instance that, if assigned, will be used in place of the 'tex' Texture when the item is selected on the cursor

HotspotPrefix AC.InvItem.hotspotPrefix1 = new HotspotPrefix ("Use")

The "Use" in "Use X on Y", if overrideUseSyntax = True

HotspotPrefix AC.InvItem.hotspotPrefix2 = new HotspotPrefix ("on")

The "on" on "Use X on Y", if overrideUseSyntax = True

int AC.InvItem.id

A unique identifier

List<InvInteraction> AC.InvItem.interactions = new List<InvInteraction>()

A List of all "Use" InvInteraction objects associated with the item

bool AC.InvItem.isEditing = false

If True, the item is being edited within the InventoryManager GUI

string AC.InvItem.label

The item's Editor name

int AC.InvItem.lastInteractionIndex = 0

An identifier number of the last Use/Inventory interaction associated with the item

int AC.InvItem.lineID = -1

The translation ID number of the item's name, as generated by SpeechManager

GameObject AC.InvItem.linkedPrefab

A GameObject that can be associated with the item, for the creation of e.g. 3D inventory items (through scripting only)

ActionListAsset AC.InvItem.lookActionList

The ActionListAsset to run when the item is examined, if multiple interactions are disallowed

bool AC.InvItem.overrideUseSyntax = false

If True, then the item has its own "Use X on Y" syntax when selected

int AC.InvItem.recipeSlot = -1

The index number of the MenuCrafting slot that the item is placed in, when used as a Recipe ingredient

Texture2D AC.InvItem.selectedTex

The item's 'selected' graphic (if SettingsManager's selectInventoryDisplay = SelectInventoryDisplay.ShowSelectedGraphic)

Texture2D AC.InvItem.tex

The item's main graphic

ActionListAsset AC.InvItem.unhandledActionList

The ActionListAsset to run when using the item on a Hotspot is unhandled

ActionListAsset AC.InvItem.unhandledCombineActionList

The ActionListAsset to run when using the item on another InvItem is unhandled

ActionListAsset AC.InvItem.useActionList

The ActionListAsset to run when the item is used, if multiple interactions are disallowed

int AC.InvItem.useIconID = 0

The ID number of the CursorIcon (in CursorManager's cursorIcons List) to show when hovering over the item if appropriate

bool AC.InvItem.useSeparateSlots

If True, and canCarryMultiple = True, then multiple instances of the same item will be listed in separate MenuInventoryBox slots

List<InvVar> AC.InvItem.vars = new List<InvVar>()

The item's properties