Class PromotionPopupView
Component that manages displaying a Transaction Item's promotion popup, including promotion image, display name and purchase button.
When attached to a game object, it will display an image featuring the contents of the Transaction Item's rewards (or a specified image), the Transaction Item's displayName and create and display a
PurchaseButton (Purchase
Inherited Members
Namespace: UnityEngine .GameFoundation .UI
Assembly: solution.dll
Syntax
[AddComponentMenu("Game Foundation/Promotion Popup", 2)]
[ExecuteInEditMode]
public class PromotionPopupView : MonoBehaviour
Fields
Name | Description |
---|---|
on |
Callback that will get triggered when the Promotion Popup is closed. |
on |
Callback that will get triggered when the Promotion Popup is opened. |
on |
A callback that will get triggered if a purchase for any item in the store fails. |
on |
A callback that will get triggered if a purchase for any item in the store completes successfully. |
Properties
Name | Description |
---|---|
auto |
Determines whether or not the promotion's image will be auto-generated. If true (default), the image will be generated using the sprite asset name's for each inventory or currency item listed in the transaction's Rewards. If false, the Promotion Sprite Name will be used to get the image from the transaction's Asset detail. |
auto |
The Transform in which to auto generate promotion image. /// Used only when Auto Generate Promo Image is enabled. |
badge |
The ImageInfoView to assign the badge to. |
badge |
The property key for the badge to be displayed in callout. |
currency |
The string to prefix the reward currency counts when auto generating the promotion image. |
description |
The property key for the promotion description to be displayed. |
description |
The Text component to assign the description to. |
item |
The string to prefix the reward inventory item counts when auto generating the promotion image. |
price |
The sprite asset name for price icon that will be displayed on the PurchaseButton, as specified in the asset detail for the inventory item or currency listed in the price. |
promo |
The Image component to assign the Promotion Image to. Used only when Auto Generate Promo Image is disabled. |
promo |
The sprite asset name for the promotion image that will be displayed on this view, as specified in the transaction's Asset detail. Used only when Auto Generate Promo Image is disabled. |
purchase |
The PurchaseButton to set with the TransactionItem's purchase info. |
reward |
The sprite asset name for the icon of the inventory or currency items listed in the transaction's Rewards, as specified in their Asset details. Used only when Auto Generate Promo Image is enabled. |
reward |
The RewardItem prefab to use when auto generating promotion image. |
separator |
The GameObject to use as a separator between RewardItems when auto generating promotion image. |
title |
The Text component to assign the transaction's display name to. |
transaction |
The key of the Transaction Item being displayed. |
Methods
Name | Description |
---|---|
Close() | Hides the promotion popup.
Will trigger a PopupClosedEvent (Promotion |
Get |
Gets the transaction that is displayed by the PromotionPopupView. |
Open() | Displays the promotion popup.
Will trigger a PopupOpenedEvent (Promotion |
Open(string) | Displays the promotion popup.
Will trigger a PopupOpenedEvent (Promotion |
Open(string, bool) | Displays the promotion popup.
Will trigger a PopupOpenedEvent (Promotion |
Set |
Sets whether the image used for the promotion should be auto generated or use an asset from the transaction's Asset Detail. |
Set |
Set the image used for the promotion should be auto generated. |
Set |
Sets the Transform in which to display the promotion's image on this view. |
Set |
Sets the Text component to display the promotion's badge on this view. |
Set |
Sets the static property key that will be used when displaying the promotion's badge. |
Set |
Sets the static property key that will be used when displaying the promotion's description. |
Set |
Sets the Text component to display the promotion's description on this view. |
Set |
Sets sprite asset name for price icon that will be displayed on Purchase Button (Purchase |
Set |
Sets the Image component to display the promotion image on this view. |
Set |
Sets the promotion image asset name that will be used when displaying the user-provided promotion image and disable Auto Generate Promo Image (auto |
Set |
Sets PurchaseButton to be able to purchase Transaction Item by UI. |
Set |
The prefab to use for each when auto generating the promotion image. |
Set |
Sets the prefab to use for as a separator when when auto generating the promotion image. |
Set |
Sets the Text component to display the transaction's display name on this view. |
Set |
Sets the Transaction Item that should be displayed by this view. |