Manages the player's inventory. The player can store inventory item's within the inventory, and use them for certain tasks throughout the game.
More...
List of all members.
Public Member Functions |
void | Start () |
| Initialises the inventory's attributes.
|
void | addItem (string _itemName, GameObject _item) |
| Adds an item to the player's inventory.
|
void | removeItem (string _itemName) |
| Removes an item from the player's inventory.
|
bool | isInInventory (string _itemName) |
| Checks whether the item is within the inventory.
|
GameObject | getItem (string _itemName) |
| Get an item from the inventory (returns the gameobject).
|
int | getNumberOfItems () |
| Gets the number of items in the inventory.
|
void | OnGUI () |
| OnGUI renders the inventory window the the screen.
|
void | displayInventory (int _windowID) |
| Displays inventory the inventory window and it's contents (i.e. the items in the inventory).
|
void | Update () |
| The inventory's update loop is used to capture the button press when the player selects to see their inventory. When the inventory button is pressed (on the controller) the inventory window is displayed.
|
Detailed Description
Manages the player's inventory. The player can store inventory item's within the inventory, and use them for certain tasks throughout the game.
- Author:
- Alexander Poolton
- Version:
- 5.0
- Date:
- 19/7/2011
Member Function Documentation
void Inventory::addItem |
( |
string |
_itemName, |
|
|
GameObject |
_item |
|
) |
| [inline] |
Adds an item to the player's inventory.
- Parameters:
-
[in] | _itemName | The item's name. |
[in] | _item | The item gameobject to be stored. |
void Inventory::displayInventory |
( |
int |
_windowID | ) |
[inline] |
Displays inventory the inventory window and it's contents (i.e. the items in the inventory).
- Parameters:
-
[in] | _windowID | The inventory window's window ID. |
GameObject Inventory::getItem |
( |
string |
_itemName | ) |
[inline] |
Get an item from the inventory (returns the gameobject).
- Parameters:
-
[in] | _itemName | The item's name. |
- Returns:
- Returns the gameobject of the item.
int Inventory::getNumberOfItems |
( |
| ) |
[inline] |
Gets the number of items in the inventory.
- Returns:
- Returns the number of items in the inventory.
bool Inventory::isInInventory |
( |
string |
_itemName | ) |
[inline] |
Checks whether the item is within the inventory.
- Parameters:
-
[in] | _itemName | The item's name. |
- Returns:
- Returns a boolean, corresponding to whether the item is in the inventory or not.
void Inventory::removeItem |
( |
string |
_itemName | ) |
[inline] |
Removes an item from the player's inventory.
- Parameters:
-
[in] | _itemName | The item's name. |
The documentation for this class was generated from the following file:
- C:/Users/Alex/Desktop/Gamepad Classes/Player/Inventory.cs