Skip to main content

Class Promoter

Declaration
public sealed class Promoter : Module<Promoter, PromoterConfig, PromoterDebugger>

Properties

CanShowCrossPromo

Declaration
public static bool CanShowCrossPromo { get; }

Logger

Declaration
public override ILog Logger { get; }

Methods

Initialize(Action<InitializationResult>)

Declaration
protected override void Initialize(Action<InitializationResult> setResult)
Parameters
TypeName
System.Action<InitializationResult>setResult

GetPinnedPromo()

Get pinned promotion info

Declaration
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

Declaration
public static CrossPromo GetMappedPromo(string map)
Returns

MatchinghamGames.PromoterModule.Models.CrossPromo: Promotion data identified by provided map

Parameters
TypeNameDescription
System.StringmapIdentifier/Mapped key of the promotion to be loaded

GetRandomPromo()

Gets a random cross promotion info

Declaration
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

Declaration
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
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoPromotion info the image will be loaded for
MatchinghamGames.PromoterModule.ResolutionresolutionResolution of the images to be loaded
System.Int32indexIndex of promotion info

LoadRandomImage(CrossPromo, Resolution)

Loads a random image from provided cross promotion's image list for given resolution

Declaration
public static (Texture2D texture, bool isLocalImage) LoadRandomImage(CrossPromo promo, Resolution resolution)
Returns

System.ValueTuple<Texture2D,System.Boolean>: Loaded texture of random image

Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoPromotion info the image will be loaded for
MatchinghamGames.PromoterModule.ResolutionresolutionResolution of the image to be loaded

LoadLocalImage(CrossPromo)

Loads the local image from cross promotion's data.

Declaration
public static (Texture2D texture, bool isLocalImage) LoadLocalImage(CrossPromo promo)
Returns

System.ValueTuple<Texture2D,System.Boolean>: Texture of the local image

Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoPromotion info

IsVideoAvailable(CrossPromo)

Returns a value indicating whether the remote video is downloaded and available

Declaration
public static bool IsVideoAvailable(CrossPromo promo)
Returns

System.Boolean: Returns true if a remote video is provided and downloaded

Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoPromo to search the video of

GetVideoPath(CrossPromo)

Gets the video path of the given promotion

Declaration
public static string GetVideoPath(CrossPromo promo)
Returns

System.String: Video path for the promotion

Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoThe promotion we want to display the video of

GetLocalVideoPath(CrossPromo)

Declaration
public static string GetLocalVideoPath(CrossPromo promo)
Returns

System.String

Parameters
TypeName
MatchinghamGames.PromoterModule.Models.CrossPromopromo

DownloadVideo(CrossPromo)

Downloads the provided promotion's video, if it is not already downloaded.

Declaration
public static AsyncOperation DownloadVideo(CrossPromo promo)
Returns

Global.AsyncOperation: The download operation instance

Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromopromoInformation about the promotion we want to download the video of

SendImpression(CrossPromo)

Sends an impression for provided promotion

Declaration
public static void SendImpression(CrossPromo crossPromo)
Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromocrossPromoThe impression will be sent for this cross promotion data

Click(CrossPromo)

Sends an impression for provided promotion and redirects user to promoted url

Declaration
public static void Click(CrossPromo crossPromo)
Parameters
TypeNameDescription
MatchinghamGames.PromoterModule.Models.CrossPromocrossPromoPromotion that user has clicked