Class Promoter
public sealed class Promoter : Module<Promoter, PromoterConfig, PromoterDebugger>
Properties
CanShowCrossPromo
public static bool CanShowCrossPromo { get; }
Logger
public override ILog Logger { get; }
Methods
Initialize(Action<InitializationResult>)
protected override void Initialize(Action<InitializationResult> setResult)
Parameters
Type | Name |
---|---|
System.Action<InitializationResult> | setResult |
GetPinnedPromo()
Get pinned promotion info
public static CrossPromo GetPinnedPromo()
Returns
MatchinghamGames.PromoterModule.Models.CrossPromo: Pinned cross promotion data### GetMappedPromo(string) Get a promotion from promotion map list of cross promo data, identified by map
public static CrossPromo GetMappedPromo(string map)
Returns
MatchinghamGames.PromoterModule.Models.CrossPromo: Promotion data identified by provided map
Parameters
Type | Name | Description |
---|---|---|
System.String | map | Identifier/Mapped key of the promotion to be loaded |
GetRandomPromo()
Gets a random cross promotion info
public static CrossPromo GetRandomPromo()
Returns
MatchinghamGames.PromoterModule.Models.CrossPromo: Random cross promotion data### LoadImage(CrossPromo, Resolution, int) Load image of given resolution type for the promotion of given index
public static (Texture2D texture, bool isLocalImage) LoadImage(CrossPromo promo, Resolution resolution, int index)
Returns
System.ValueTuple<Texture2D,System.Boolean>
: A list of Texture2Ds that is consisted of the images of given resolution for the given promotion
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | Promotion info the image will be loaded for |
MatchinghamGames.PromoterModule.Resolution | resolution | Resolution of the images to be loaded |
System.Int32 | index | Index of promotion info |
LoadRandomImage(CrossPromo, Resolution)
Loads a random image from provided cross promotion's image list for given resolution
public static (Texture2D texture, bool isLocalImage) LoadRandomImage(CrossPromo promo, Resolution resolution)
Returns
System.ValueTuple<Texture2D,System.Boolean>
: Loaded texture of random image
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | Promotion info the image will be loaded for |
MatchinghamGames.PromoterModule.Resolution | resolution | Resolution of the image to be loaded |
LoadLocalImage(CrossPromo)
Loads the local image from cross promotion's data.
public static (Texture2D texture, bool isLocalImage) LoadLocalImage(CrossPromo promo)
Returns
System.ValueTuple<Texture2D,System.Boolean>
: Texture of the local image
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | Promotion info |
IsVideoAvailable(CrossPromo)
Returns a value indicating whether the remote video is downloaded and available
public static bool IsVideoAvailable(CrossPromo promo)
Returns
System.Boolean
: Returns true if a remote video is provided and downloaded
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | Promo to search the video of |
GetVideoPath(CrossPromo)
Gets the video path of the given promotion
public static string GetVideoPath(CrossPromo promo)
Returns
System.String
: Video path for the promotion
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | The promotion we want to display the video of |
GetLocalVideoPath(CrossPromo)
public static string GetLocalVideoPath(CrossPromo promo)
Returns
System.String
Parameters
Type | Name |
---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo |
DownloadVideo(CrossPromo)
Downloads the provided promotion's video, if it is not already downloaded.
public static AsyncOperation DownloadVideo(CrossPromo promo)
Returns
Global.AsyncOperation
: The download operation instance
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | promo | Information about the promotion we want to download the video of |
SendImpression(CrossPromo)
Sends an impression for provided promotion
public static void SendImpression(CrossPromo crossPromo)
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | crossPromo | The impression will be sent for this cross promotion data |
Click(CrossPromo)
Sends an impression for provided promotion and redirects user to promoted url
public static void Click(CrossPromo crossPromo)
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.PromoterModule.Models.CrossPromo | crossPromo | Promotion that user has clicked |