Class BuyInventoryItem
UI list item for buying an inventory item.
Inheritance
BuyInventoryItem
Syntax
public class BuyInventoryItem : MonoBehaviour
Fields
Declaration
[SerializeField]
protected Button buyButton
Field Value
Type |
Description |
UnityEngine.UI.Button |
|
costLabel
Declaration
[SerializeField]
protected TextMeshProUGUI costLabel
Field Value
Type |
Description |
TMPro.TextMeshProUGUI |
|
icon
Declaration
[SerializeField]
protected Image icon
Field Value
Type |
Description |
UnityEngine.UI.Image |
|
progressImage
Declaration
[SerializeField]
protected Image progressImage
Field Value
Type |
Description |
UnityEngine.UI.Image |
|
timeLabel
Declaration
[SerializeField]
protected TextMeshProUGUI timeLabel
Field Value
Type |
Description |
TMPro.TextMeshProUGUI |
|
titleLabel
Declaration
[SerializeField]
protected TextMeshProUGUI titleLabel
Field Value
Type |
Description |
TMPro.TextMeshProUGUI |
|
Properties
Cost
Declaration
public int Cost { get; set; }
Property Value
Description
Description to show in the notification.
Declaration
public string Description { get; }
Property Value
ItemData
The item data linked to this UI item.
Declaration
public InventoryItemData ItemData { get; }
Property Value
Minutes
Fire notification after this amount of minutes.
Declaration
public float Minutes { get; set; }
Property Value
Title
Title to show in the notification.
Declaration
public string Title { get; }
Property Value
Methods
Initialise(InventoryItemData, Action<BuyInventoryItem>)
Initialise the item with the specified settings.
Declaration
public void Initialise(InventoryItemData itemData, Action<BuyInventoryItem> buyAction)
Parameters
OnBuy()
Called when the buy button is clicked.
Declaration
OnBuySuccess(DateTime)
Called when buying an item was successful.
Declaration
public void OnBuySuccess(DateTime boughtDeliveryTime)
Parameters
Type |
Name |
Description |
DateTime |
boughtDeliveryTime |
|
OnCurrencyChanged(Int32)
Called when the game's currency total changed.
Declaration
public void OnCurrencyChanged(int newCurrency)
Parameters
Type |
Name |
Description |
Int32 |
newCurrency |
|
OnDeliveredItem(InventoryItemData)
Called when an item was delivered.
Declaration
public void OnDeliveredItem(InventoryItemData itemData)
Parameters
UpdateControls()
Declaration
public void UpdateControls()