Class ItemListsSample
This class manages the scene and serves as an example for item lists.
Inherited Members
Namespace: UnityEngine.GameFoundation.Sample
Syntax
public class ItemListsSample : MonoBehaviour
Fields
addExistingToListButton
Declaration
public Button[] addExistingToListButton
Field Value
Type | Description |
---|---|
Button[] |
addItemButton
References to the remove buttons to enable/disable when the action is not possible.
Declaration
public Button addItemButton
Field Value
Type | Description |
---|---|
Button |
addNewToListButton
Declaration
public Button[] addNewToListButton
Field Value
Type | Description |
---|---|
Button[] |
instructionsText
Text box containing initial instructions which are hidden to show items.
Declaration
public Text instructionsText
Field Value
Type | Description |
---|---|
Text |
listItemsText
Text field for each ItemList's contents.
Declaration
public Text[] listItemsText
Field Value
Type | Description |
---|---|
Text[] |
mainText
We will need a reference to the main text box in the scene so we can easily modify it.
Declaration
public Text mainText
Field Value
Type | Description |
---|---|
Text |
removeAllButton
Declaration
public Button removeAllButton
Field Value
Type | Description |
---|---|
Button |
removeItemButton
Declaration
public Button removeItemButton
Field Value
Type | Description |
---|---|
Button |
removeItemFromListButton
Declaration
public Button[] removeItemFromListButton
Field Value
Type | Description |
---|---|
Button[] |
wrongDatabasePanel
Reference to the panel to display when the wrong database is in use.
Declaration
public GameObject wrongDatabasePanel
Field Value
Type | Description |
---|---|
GameObject |
Methods
AddExistingItemToList(Int32)
Adds existing item to specified list.
Declaration
public void AddExistingItemToList(int listIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listIndex | List index (0-2) to add item to. |
AddItem()
Adds a single unique item to the main inventory.
Declaration
public void AddItem()
AddNewItemToList(Int32)
Adds newly-created item to specified collection.
Declaration
public void AddNewItemToList(int listIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listIndex | List index (0-2) to add item to. |
RemoveAll()
Removes all items from the Inventory.
Declaration
public void RemoveAll()
RemoveItem()
Removes a single item from the main inventory.
Declaration
public void RemoveItem()
RemoveItemFromList(Int32)
Remove First item from specified collection.
Declaration
public void RemoveItemFromList(int listIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listIndex | List index (0-2) to remove item from. |