For the complete documentation index, see llms.txt. This page is also available as Markdown.

Lion Ads

This package simplifies showing ads from Max SDK.

It automatically handles:

  • loading the ads

  • sending required Lion Analytics Ad events

circle-exclamation
circle-exclamation
circle-exclamation

Setup

Everything should already be setup if you previously ran the Setup Wizard. This section is for verification and troubleshooting if needed.

1. Check ad settings

  • Open LionStudios→Settings Manager → Ads in the Unity menu

  • Verify the following:

    • Ad Unit Ids are correctly setup

    • Enable Lion Ads is turned ON.

2. Next steps

  • If Google Ads Manager is installed as an adapter, it requires its own set of IDs; enter those IDs in the MAX Integration Manager by going to AppLovin → Integration Manager in the Unity menu.

  • Now, if everything is setup correctly

  • If settings are incorrect or missing

    • Go to LionStudios→Settings Manager → Ads in the Unity menu

    • Turn ON the “Enable Lion Ads” checkbox

    • Fill up the required ad unit IDs

    • Leave the other settings to their default values unless requested

Code Integration

Lion Ads provides just a few static functions to show and handle ads.

  • LionAds.IsRewardedReady

    • returns: boolean

    Call this to decide whether to propose rewarded buttons or to disable them

    Example

  • LionAds.TryShowRewarded(string placement, Action onRewarded,Action onClosed = null, Reward reward = null, Dictionary<string, object> additionalData)

    • returns: boolean: false if no ad was ready

    • parameters:

      • placement: a string describing this ad placement (ie: “SkinShop”, “SkipLevel”…)

      • onRewarded: a callback called when the player has watched through the ad. This should contain the code that gives the actual reward to the player.

      • onClosed(optional): a callback called when the ad was closed (completed or canceled). This can be used to resume normal flow after the ad.

      • reward (optional): this object will be passed in the automated call to LionAnalytics.RewardVideoCollect. (cf ‣)

      • additionalData (optional): this parameter will be passed to all ad events related to this ad (that is all RewardVideoX events except _Load and _LoadFail).

    Call this to show a rewarded video if available.

    Example

  • LionAds.TryShowInterstitial(string placement**, Action onClosed = null, Dictionary<string, object> additionalData**)**

    • returns: boolean: false if no ad was ready

    • parameters:

      • placement: a string describing this ad placement (ie: “LevelEnd”…)

      • onClosed(optional): a callback called when the ad was closed (completed or canceled or not ready). This can be used to resume normal flow after the ad.

      • additionalData (optional): this parameter will be passed to all ad events related to this ad (that is all InterstitialX events except _Load and _LoadFail).

    Call this to show an interstitial video if available.

    Example

  • LionAds.ShowBanner()

    • returns: boolean: false if no ad was ready. Even if false is returned, it will still load and show the banner as soon as ready.

    Call this to show a banner ad as soon as available.

    The banner will be positioned according to the “Banner Position” setting.

    Example

  • LionAds.HideBanner()

    • returns: void

    Call this to hide the banner ad.

    Example

  • LionAds.OnRewardedStatusChanged

    • type: Action<bool>

    Subscribe to this event to update RV buttons status when a Rewarded becomes ready. This is to avoid having to call IsRewardedReady constantly.

    Example

CPM Floor Ads Bidding System

If your studio manager has requested you to set up CPM Floor Ads Bidding in your project, please refer to the following pages for detailed instructions:

CPM Floor Ads Bidding

Last updated

Was this helpful?