Class ShopItemUI
Purchase panel of a character or object.
Namespace: AutoBattleFramework.Shop.ShopGUI
Assembly: cs.temp.dll.dll
Syntax
public class ShopItemUI : MonoBehaviour
Fields
alphaAfterBought
Alpha of the elements after the purchase.
Declaration
public float alphaAfterBought
Field Value
Type | Description |
---|---|
Single |
item
Declaration
public ScriptableShopItem item
Field Value
Type | Description |
---|---|
ScriptableShopItem |
ItemCost
Item purchase price text.
Declaration
public TMPro.TextMeshProUGUI ItemCost
Field Value
Type | Description |
---|---|
TMPro.TextMeshProUGUI |
ItemImage
Image of the item.
Declaration
public Image ItemImage
Field Value
Type | Description |
---|---|
Image |
ItemName
Declaration
public TMPro.TextMeshProUGUI ItemName
Field Value
Type | Description |
---|---|
TMPro.TextMeshProUGUI |
ItemTraits
Panel where the character's traits are displayed.
Declaration
public Image ItemTraits
Field Value
Type | Description |
---|---|
Image |
TraitPrefab
Declaration
public TraitStatsUI TraitPrefab
Field Value
Type | Description |
---|---|
TraitStatsUI |
Methods
Buy()
Purchase the item, deducting the currency from the total and disabling the panel.
Declaration
public void Buy()
CanBeBought()
Returns true if the player has enough currency to buy the item.
Declaration
public bool CanBeBought()
Returns
Type | Description |
---|---|
Boolean |
OnPointerClick(PointerEventData)
When clicked on the panel, the item is purchased. If right-clicked, the description of the item is displayed.
Declaration
public void OnPointerClick(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData | Pointer data. |
OnPointerEnter(PointerEventData)
Notification that the pointer has entered the panel.
Declaration
public void OnPointerEnter(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData | Pointer data. |
OnPointerExit(PointerEventData)
Notification that the pointer has left the panel.
Declaration
public void OnPointerExit(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData | Pointer data. |
SetInfo(ScriptableShopItem, ShopItemInfo, Int32, ShopManager)
Places the object information in the panel.
Declaration
public void SetInfo(ScriptableShopItem item, ShopItemInfo info, int cost, ShopManager shop)
Parameters
Type | Name | Description |
---|---|---|
ScriptableShopItem | item | Item for purchase. |
ShopItemInfo | info | Purchase information of the item. |
Int32 | cost | Purchase cost oof the item. |
ShopManager | shop | ShopSystem reference. |