Splash
Full-entry ad for launch, loading, or pre-menu moments.
var result = await AdPlayManager.GetSplash(template);
AdPlayDeveloper Docs
AdPlayManager is responsible for SDK initialization, server requests, image downloading, active ad caching, display, and engagement reporting.
Visual ad methods receive an AdPlayTemplate, while interstitial sound plays without a template. All methods return AdRequestInfo.
Full-entry ad for launch, loading, or pre-menu moments.
var result = await AdPlayManager.GetSplash(template);Small persistent placement for menus, stores, or calm screens.
var result = await AdPlayManager.GetBanner(template);A larger template-driven ad, useful after transitions or on menu screens.
var result = await AdPlayManager.GetPopUp(template);Shows only a button first. The popup opens after the player clicks.
var result = await AdPlayManager.GetPopUpButton(buttonTemplate, OnClick);Plays an interstitial audio ad without creating a UI template.
var result = await AdPlayManager.GetInterstitialSound();| Method | Use for | Template requirements |
|---|---|---|
| AdPlayManager.GetSplash(template) | Full-screen or launch-time splash ad | Image |
| AdPlayManager.GetBanner(template) | Banner placement in a Canvas | Image |
| AdPlayManager.GetPopUp(template) | Clickable popup ad with optional title, description, and button text | Image, Button, RectTransform |
| AdPlayManager.GetPopUpButton(template, onClick) | Button-style entry point that can open a PopUp when clicked | Image, Button |
| AdPlayManager.GetInterstitialSound() | Interstitial audio ad without UI template setup | None |
Templates are Unity UI prefabs that AdPlay fills with ad content.
| Field | Type | Use |
|---|---|---|
| rectTransform | RectTransform | Controls ad size and layout. |
| image | Image | Displays the ad creative image. |
| clickButton | Button | Handles ad click interaction. |
| titleText | RTLTextMeshPro | Displays the ad title. |
| descriptionText | RTLTextMeshPro | Displays the ad body text. |
| clickButtonText | RTLTextMeshPro | Displays the call-to-action label. |
Canvas
└── AdContainer
└── AdPlayTemplate
├── AdImage
├── TitleText
├── DescriptionText
└── ClickButton
└── ButtonTextEvery ad method returns AdRequestInfo so developers can handle empty inventory and integration mistakes.
bool IsSuccess;
AdRequestResultState State;
string ErrorMessage;This sample shows how to wait for ads to finish loading, enable the test UI, instantiate templates, and call each supported ad method.
using Adplay.Behaviours;
using Adplay.View;
using UnityEngine;
public class SampleTest : MonoBehaviour
{
[SerializeField] private Transform canvas;
[SerializeField] private AdPlayTemplate templatePrefab;
[SerializeField] private GameObject infoGameObject, sampleTestGameObject;
[SerializeField] private Transform buttonParent;
private void OnEnable()
{
AdPlayManager.OnGetAdsComplete += OnGetAdsComplete;
}
private void OnDisable()
{
AdPlayManager.OnGetAdsComplete -= OnGetAdsComplete;
}
private void OnGetAdsComplete()
{
infoGameObject.SetActive(false);
sampleTestGameObject.SetActive(true);
}
public async void ShowPopUpButton()
{
var buttonTemplate = Instantiate(templatePrefab, canvas);
var result = await AdPlayManager.GetPopUpButton(
buttonTemplate,
async () =>
{
var template = Instantiate(templatePrefab, canvas);
var popupResult = await AdPlayManager.GetPopUp(template);
if (!popupResult.IsSuccess)
Debug.Log("No pop up");
});
if (!result.IsSuccess)
Debug.Log("No pop up button");
}
public async void ShowSplash()
{
var template = Instantiate(templatePrefab, canvas);
var result = await AdPlayManager.GetSplash(template);
if (!result.IsSuccess)
Debug.Log("No splash");
}
public async void ShowBanner()
{
var template = Instantiate(templatePrefab, canvas);
var result = await AdPlayManager.GetBanner(template);
if (!result.IsSuccess)
Debug.Log("No banner");
}
public async void ShowPopUp()
{
var template = Instantiate(templatePrefab, canvas);
var result = await AdPlayManager.GetPopUp(template);
if (!result.IsSuccess)
Debug.Log("No pop up");
}
public async void ShowInterstitialSound()
{
var result = await AdPlayManager.GetInterstitialSound();
if (!result.IsSuccess)
{
Debug.Log("No interstitial sound");
}
}
}
These are the methods developers should use directly.
await AdPlayManager.GetSplash(AdPlayTemplate template)
await AdPlayManager.GetBanner(AdPlayTemplate template)
await AdPlayManager.GetPopUp(AdPlayTemplate template)
await AdPlayManager.GetPopUpButton(AdPlayTemplate template, Action onClick)
await AdPlayManager.GetInterstitialSound()