TradeButton

TradeButton handles Inputs like Pointer Enter, Pointer Exit, or Click Events to the Shop UI & Shop. It allows the interaction between the Shop and the Player, and contains essential base classes for ShopButton & CraftButton.


  • iconImage: UI Image that displays the Icon of the Item to Trade.

  • actionButton: Button that performs the Trade Action

  • nameText: Text that displays the Name of the Item to Trade.

  • callToActionText: Text that displays the Call To Action: "Purchase", "Craft", etc...

  • amountInputField: Input Field that displays the current amount to trade

  • highlightedScaleMultiplier: When hovered, the TradeButton Scale changes. Being 1 = default scale, this defines the scale of the button when hovered.

  • scaleLerpSpeed: Defines how fast the Button scales from the default scale to the highlightedScale when hovered and viceversa.

  • lockedContainer: UI that is enabled when the object to trade is locked.

  • lockedText: Text that displays the reason why the object to trade is locked.

  • previousAmountButton: Buttons that handle amount decrease.

  • nextAmountButton: Buttons that handle amount increase.


Getters | TradeButton.cs

_TradeHub

Returns a Reference to the assigned TradeHub.

Functions | TradeButton.cs

PointerEnter() | Virtual Method, can be overrided

Called when pointer enters the Button.

PointerExit() | Virtual Method, can be overrided.

Called when pointer exits the Button.

AddItemToInventory(Item_SO item, int amount) | Protected method

Adds an Item_So and the given amount to the Inventory ( Supports Weapon_SOs, Bullets_SOs & AttachmentIdentifier_SOs )

Last updated