![]() |
Adventure Creator
1.78.0
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
InvInstance (InvInstance invInstance) | |
A Constructor that copies values of another class instance More... | |
InvInstance (ContainerItem containerItem) | |
A Constructor based on a Container item More... | |
InvInstance (int _itemID, int _count=1) | |
A Constructor based on the linked InvItem's ID More... | |
InvInstance (string _itemName, int _count=1) | |
A Constructor based on the linked InvItem's name More... | |
InvInstance (InvItem _invItem, int _count=1) | |
A Constructor based on the linked InvItem More... | |
InvInstance (int _itemID, int _count, string propertyData, string disabledInteractionData, string disabledCombineIndices, string _sceneItemRememberData) | |
A Constructor based on the linked InvItem's ID More... | |
void | Select (SelectItemMode _selectItemMode=SelectItemMode.Use) |
void | Deselect () |
InvVar | GetProperty (int propertyID) |
Gets the local property of the associated item's More... | |
InvVar | GetProperty (string propertyName) |
Gets the local property of the associated item's More... | |
InvInstance | CreateTransferInstance () |
void | Clear () |
void | Clear (int amount) |
Removes a given amount of the item from this instance, while ensuring that the OnInventoryRemove event is triggered More... | |
Container | GetSourceContainer () |
InvCollection | GetSource () |
void | Examine () |
void | Use (bool selectIfUnhandled=true) |
void | Use (int iconID) |
Runs an inventory item's interaction, when multiple "use" interactions are defined. More... | |
void | Combine (InvInstance combineInstance, bool allowSelfCombining=false) |
Combines two inventory items. More... | |
int | GetInventoryDisplayCount () |
bool | IsPartialTransfer () |
bool | CanStack () |
void | AddStack () |
void | RemoveStack () |
MatchingInvInteractionData | GetMatchingInvInteractionData (bool rebuild) |
Gets data related to what interactions are possible More... | |
int | GetNextInteraction (int i) |
Gets the index number of the next relevant use/combine interaction. More... | |
void | RunDefaultInteraction () |
int | GetFirstStandardIcon () |
Gets the ID of the icon that represents the first-available Standard interaction. More... | |
string | GetFullLabel (int languageNumber=0) |
Gets the items's display name, with prefix. More... | |
string | GetLabelPrefix (int languageNumber=0, int cursorID=-1) |
Gets the prefix for the Hotspot label (the label without the interactive Hotspot or inventory item) More... | |
int | GetPreviousInteraction (int i) |
Gets the index number of the previous relevant use/combine interaction. More... | |
int | GetActiveInvButtonID () |
void | RestoreInteraction () |
string | GetHotspotPrefixLabel (int languageNumber, bool canGive=false) |
Gets the full prefix to a Hotpsot label when an item is selected, e.g. "Use X on " / "Give X to ". More... | |
void | SetInteractionState (int ID, bool state, bool useCursorID=false) |
Enables or disables a Standard Interaction of the associated item More... | |
void | SetCombineInteractionState (int ID, bool state, bool useItemID=false) |
Enables or disables a Combine Interaction of the associated item More... | |
bool | HasCursorIcon () |
If True, the inventory item has a graphic that can be used by the cursor when selected. More... | |
bool | IsMatch (InvInstance invInstance, bool checkProperties) |
Checks if the InvInstance represents the same inventory item as another More... | |
void | ResetProperties () |
SceneItem | SpawnInScene (bool reduceCount=false, bool applyRememberData=true) |
Instantiates the item's Linked Prefab into the scene, and creates a link between the two by adding a SceneItem comopnent if it doesn't have one. More... | |
SceneItem | GetLinkedSceneItem () |
Static Public Member Functions | |
static bool | IsValid (InvInstance invInstance) |
Checks if the instance is both non-null, and references an item More... | |
static string | GetSaveData (InvInstance invInstance) |
Generates data to save about an item instance in a single string. More... | |
static InvInstance | LoadData (string dataString) |
Properties | |
int? | Count [get, set] |
int? | TransferCount [get, set] |
InvItem | InvItem [get] |
int | ItemID [get] |
CursorIcon | CursorIcon [get] |
int | Capacity [get] |
int | LastInteractionIndex [get, set] |
SelectItemMode | SelectItemMode [get, set] |
ItemStackingMode | ItemStackingMode [get] |
bool | CanBeAnimated [get] |
InvInteraction[] | Interactions [get] |
InvCombineInteraction[] | CombineInteractions [get] |
Texture | Tex [get, set] |
Texture | ActiveTex [get, set] |
Texture | SelectedTex [get, set] |
string | ItemLabel [get, set] |
string | SceneItemRememberData [get, set] |
A data class for an Inventory item instance. When an item is added to the Player's inventory at runtime, a reference is created to it with this class.
AC.InvInstance.InvInstance | ( | InvInstance | invInstance | ) |
A Constructor that copies values of another class instance
invInstance | The class instance to copy from |
AC.InvInstance.InvInstance | ( | ContainerItem | containerItem | ) |
AC.InvInstance.InvInstance | ( | int | _itemID, |
int | _count = 1 |
||
) |
AC.InvInstance.InvInstance | ( | string | _itemName, |
int | _count = 1 |
||
) |
AC.InvInstance.InvInstance | ( | InvItem | _invItem, |
int | _count = 1 |
||
) |
AC.InvInstance.InvInstance | ( | int | _itemID, |
int | _count, | ||
string | propertyData, | ||
string | disabledInteractionData, | ||
string | disabledCombineIndices, | ||
string | _sceneItemRememberData | ||
) |
A Constructor based on the linked InvItem's ID
_itemID | The ID number of the associated InvItem |
_count | The amount of that item to reference |
propertyData | Serialized data related to the instance's property data, which will override the default values. |
propertyData | Serialized data related to the instance's disabled interaction data, which will override the default values. |
propertyData | Serialized data related to the instance's disabled combine data, which will override the default values. |
_sceneItemRememberData | A backup of its associated SceneItem's Remember component data. |
void AC.InvInstance.AddStack | ( | ) |
Increases the transfer count by 1, if possible
bool AC.InvInstance.CanStack | ( | ) |
Checks if stacking is possible
void AC.InvInstance.Clear | ( | ) |
Removes all counts of the item from this instance, while ensuring that the OnInventoryRemove event is triggered
void AC.InvInstance.Clear | ( | int | amount | ) |
Removes a given amount of the item from this instance, while ensuring that the OnInventoryRemove event is triggered
amount | How much of the item to remove |
void AC.InvInstance.Combine | ( | InvInstance | combineInstance, |
bool | allowSelfCombining = false |
||
) |
Combines two inventory items.
combineInstance | The instance of the inventory item to combine |
allowSelfCombining | If True, then an item can be combined with itself |
InvInstance AC.InvInstance.CreateTransferInstance | ( | ) |
Reduces the item instance's own internal amount of associated items, and creates a new one ready to be transferred to another collection
void AC.InvInstance.Deselect | ( | ) |
Dselects the associated item, if selected
void AC.InvInstance.Examine | ( | ) |
Runs an inventory item's "Examine" interaction
int AC.InvInstance.GetActiveInvButtonID | ( | ) |
Gets the ID of the active inventory interaction, or -1 if none is found
int AC.InvInstance.GetFirstStandardIcon | ( | ) |
Gets the ID of the icon that represents the first-available Standard interaction.
string AC.InvInstance.GetFullLabel | ( | int | languageNumber = 0 | ) |
Gets the items's display name, with prefix.
languageNumber | The index of the current language, as set in SpeechManager |
string AC.InvInstance.GetHotspotPrefixLabel | ( | int | languageNumber, |
bool | canGive = false |
||
) |
Gets the full prefix to a Hotpsot label when an item is selected, e.g. "Use X on " / "Give X to ".
invItem | The inventory item that is selected |
languageNumber | The index of the current language, as set in SpeechManager |
canGive | If True, the the item is assumed to be in "give" mode, as opposed to "use". |
int AC.InvInstance.GetInventoryDisplayCount | ( | ) |
Gets the amount of instances not being selected/transferred
string AC.InvInstance.GetLabelPrefix | ( | int | languageNumber = 0 , |
int | cursorID = -1 |
||
) |
Gets the prefix for the Hotspot label (the label without the interactive Hotspot or inventory item)
_hotspot | The Hotspot to get the prefix label for. This will be ignored if _invItem is not null |
_invItem | The Inventory Item to get the prefix label for. This will override _hotspot if not null |
languageNumber | The index number of the language to return. If 0, the default language will be used |
cursorID | The ID number of the cursor to rely on, if appropriate. If <0, the active cursor will be used |
MatchingInvInteractionData AC.InvInstance.GetMatchingInvInteractionData | ( | bool | rebuild | ) |
Gets data related to what interactions are possible
rebuild | If True, the data will be rebuilt before being returned |
int AC.InvInstance.GetNextInteraction | ( | int | i | ) |
Gets the index number of the next relevant use/combine interaction.
i | The index number to start from |
int AC.InvInstance.GetPreviousInteraction | ( | int | i | ) |
Gets the index number of the previous relevant use/combine interaction.
i | The index number to start from |
InvVar AC.InvInstance.GetProperty | ( | int | propertyID | ) |
Gets the local property of the associated item's
propertyID | The ID of the local property to retrieve |
InvVar AC.InvInstance.GetProperty | ( | string | propertyName | ) |
Gets the local property of the associated item's
propertyName | The name of the local property to retrieve |
|
static |
Generates data to save about an item instance in a single string.
invInstance | The inventory item instance to save |
InvCollection AC.InvInstance.GetSource | ( | ) |
Gets the collection of item instances that this is a part of
Container AC.InvInstance.GetSourceContainer | ( | ) |
Gets the Container that this item instance is a part of, if it's in one
bool AC.InvInstance.HasCursorIcon | ( | ) |
If True, the inventory item has a graphic that can be used by the cursor when selected.
bool AC.InvInstance.IsMatch | ( | InvInstance | invInstance, |
bool | checkProperties | ||
) |
Checks if the InvInstance represents the same inventory item as another
invInstance | The other InvInstance to compare |
checkProperties | If True, then the two InvInstance classes must have the same property values for the result to return True |
bool AC.InvInstance.IsPartialTransfer | ( | ) |
Checks if the item instance is only being partially selected/transferred, in that the number of items being affected is not the same as its total capacity
|
static |
Checks if the instance is both non-null, and references an item
invInstance | The instance to check |
void AC.InvInstance.RemoveStack | ( | ) |
Removes the transfer count by 1. If the transfer count is then 1, and the item is selected, it will be de-selected automatically.
void AC.InvInstance.ResetProperties | ( | ) |
Resets the item instance's properties to their original values
void AC.InvInstance.RestoreInteraction | ( | ) |
Restores the previous interaction state
void AC.InvInstance.RunDefaultInteraction | ( | ) |
Runs the item's default 'Use' interactions. This is the first defined 'Standard Interaction' in the item's properties.
void AC.InvInstance.Select | ( | SelectItemMode | _selectItemMode = SelectItemMode.Use | ) |
Selects the associated item
void AC.InvInstance.SetCombineInteractionState | ( | int | ID, |
bool | state, | ||
bool | useItemID = false |
||
) |
Enables or disables a Combine Interaction of the associated item
ID | The ID of the Combine Interaction to affect |
state | If True, the interaction will be enabled. If False, the interaction will be disabled |
useCursorID | If True, then ID becomes the ID of the interaction's associated Inventory Item, and not the ID of the interaction itself |
void AC.InvInstance.SetInteractionState | ( | int | ID, |
bool | state, | ||
bool | useCursorID = false |
||
) |
Enables or disables a Standard Interaction of the associated item
ID | The ID of the Standard Interaction to affect |
state | If True, the interaction will be enabled. If False, the interaction will be disabled |
useCursorID | If True, then ID becomes the ID of the interaction's associated Cursor Icon, and not the ID of the interaction itself |
SceneItem AC.InvInstance.SpawnInScene | ( | bool | reduceCount = false , |
bool | applyRememberData = true |
||
) |
Instantiates the item's Linked Prefab into the scene, and creates a link between the two by adding a SceneItem comopnent if it doesn't have one.
reduceCount | If True, and this object can represent multiple instances of the same item, the instantiated object will only represent a single instance, and that instance will be removed from the object |
applyRememberData | If True, any backedup Remember data associated with the SceneItem and its children will be applied |
void AC.InvInstance.Use | ( | bool | selectIfUnhandled = true | ) |
Runs an inventory item's "Use" interaction
void AC.InvInstance.Use | ( | int | iconID | ) |
Runs an inventory item's interaction, when multiple "use" interactions are defined.
iconID | The ID number of the interaction's icon, defined in CursorManager |
|
getset |
The item's 'highlighted' graphic. Setting this will override the default.
|
get |
Checks if the item's assigned textures are enough for animated effects to be possible.
|
get |
How many additional counts of the item can occupy this instance
|
get |
An array of all combine interactions that are currently enabled
|
getset |
The amount of the associated item this refers to
|
get |
The associated inventory item's Cursor Icon
|
get |
An array of all standard interactions that are currently enabled
|
get |
The associated inventory item
|
get |
The associated inventory item's ID number
|
getset |
The inventory item's label, in the current language. Setting this will override the default
|
get |
The item stacking mode
|
getset |
An identifier number of the last Use/Inventory interaction associated with the item
|
getset |
|
getset |
The item's 'selected' graphic (if SettingsManager's selectInventoryDisplay = SelectInventoryDisplay.ShowSelectedGraphic). Setting this will override the default.
|
getset |
The item selection mode
|
getset |
The item's main graphic. Setting this will override the default.
|
getset |
The amount of items to transfer. To move only some of the items associated with this instance, set this value and then add the result of CreateTransferInstance to an InvCollection