Class StackableInventoryItemSample
This class manages the scene and serves as an example for stackable inventory items.
Inherited Members
Namespace: UnityEngine.GameFoundation.Sample
Syntax
public class StackableInventoryItemSample : MonoBehaviour
Fields
decreaseQuantityButton
Declaration
public Button decreaseQuantityButton
Field Value
Type | Description |
---|---|
Button |
increaseQuantityButton
References to the remove buttons to enable/disable when the action is not possible.
Declaration
public Button increaseQuantityButton
Field Value
Type | Description |
---|---|
Button |
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 |
zeroQuantityButton
Declaration
public Button zeroQuantityButton
Field Value
Type | Description |
---|---|
Button |
Methods
DecreaseQuantity()
Decreases quantity of stackable health potions.
Declaration
public void DecreaseQuantity()
IncreaseQuantity()
Increases stack quantity of health potions.
Declaration
public void IncreaseQuantity()
OnGameFoundationException(Exception)
If GameFoundation throws exception, log the error to console.
Declaration
public void OnGameFoundationException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception thrown by GameFoundation. |
OnGameFoundationInitialized()
Once Game Foundation completes initialization, we enable buttons, setup callbacks, update GUI, etc.
Declaration
public void OnGameFoundationInitialized()
ZeroQuantity()
Resets quantity of stackable health potions to 0.
Declaration
public void ZeroQuantity()