Class GameItem
Common Fields found in BaseItem and BaseCollection. BaseItem and BaseCollection both inherit from this class.
Namespace: UnityEngine.GameFoundation
Assembly: solution.dll
Syntax
public class GameItem
Constructors
| Name | Description |
|---|---|
| GameItem(GameItemDefinition, string, string) | Constructor for a GameItem. |
Properties
| Name | Description |
|---|---|
| categories | An array of all CategoryDefinitions assigned to this GameItem. |
| definition | The GameItemDefinition for this GameItem. |
| discarded | Determine if GameItem has been discarded (removed from inventory or inventory manager). |
| displayName | The name of this GameItem for the user to display. |
| hash | The Hash of this GameItem's Id. |
| id | The string Id of this GameItem. |
Methods
| Name | Description |
|---|---|
| AddDetail<T>() | This will add a Detail of the specified type to this GameItem. |
| AdjustStatFloat(int, float) | Sets the float Stat with corresponding statDefinitionHash by specified amount. |
| AdjustStatFloat(string, float) | Adjusts the float Stat with corresponding statDefinitionId by specified amount. |
| AdjustStatInt(int, int) | Adjusts the int Stat with corresponding statDefinitionHash by specified amount. |
| AdjustStatInt(string, int) | Adjusts the int Stat with corresponding statDefinitionId by specified amount. |
| CustomDiscard() | Override this method if you need to execute a specific action at discard time. |
| ~GameItem() | in finalizer, remove gameItem from gameItem instance lookup |
| GetDetail<T>() | This will return a reference to the requested Detail by type. |
| GetDetails() | Returns an array of all details attached to this game item. |
| GetStatFloat(int) | Gets the Float Stat for the input statDefinitionHash |
| GetStatFloat(string) | Gets the Float Stat for the input statDefinitionId |
| GetStatInt(int) | Gets the Int Stat for the input statDefinitionHash |
| GetStatInt(string) | Gets the Int Stat for the input statDefinitionId |
| LogWarningIfDisposed() | |
| RemoveDetail<T>() | This will remove the requested Detail (by Detail type) from this GameItem. |
| SetStatFloat(int, float) | Sets the Float Stat with corresponding statDefinitionHash to value. |
| SetStatFloat(string, float) | Sets the Float Stat with corresponding statDefinitionId to value. |
| SetStatInt(int, int) | Sets the Int Stat with corresponding statDefinitionHash to value. |
| SetStatInt(string, int) | Sets the Int Stat with corresponding statDefinitionId to value. |