메인 콘텐츠로 건너뛰기

Documentation Index

Fetch the complete documentation index at: https://guide.daro.so/llms.txt

Use this file to discover all available pages before exploring further.

라이트 팝업 광고 형태 소개

  • 화면 위에 팝업 형태로 노출되는 광고입니다.
  • 색상과 닫기 버튼 문구는 DaroLightPopupAdOptions로 설정할 수 있습니다.

광고 연동하기

1

광고 옵션 설정

var options = new DaroLightPopupAdOptions
{
    CloseButtonText = "닫기"
};
2

광고 인스턴스 생성

private DaroLightPopupAd ad;

ad = new DaroLightPopupAd("your-lightpopup-ad-unit-id", options);
3

이벤트 핸들러 등록

ad.OnAdLoaded += info => Debug.Log("light popup loaded");
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdDismissed += info => Debug.Log("dismissed");
4

광고 로드 및 표시

ad.Load();

if (ad != null && ad.IsReady())
{
    ad.Show();
}
5

광고 해제

ad?.Dispose();
ad = null;

Example

using Daro;
using UnityEngine;

public sealed class LightPopupHost : MonoBehaviour
{
    [SerializeField] private string adUnitId = "your-lightpopup-ad-unit-id";
    private DaroLightPopupAd ad;

    private void OnEnable()
    {
        var options = new DaroLightPopupAdOptions
        {
            CloseButtonText = "Close"
        };

        ad = new DaroLightPopupAd(adUnitId, options);
        ad.OnAdLoaded += info => Debug.Log("light popup loaded");
        ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
        ad.Load();
    }

    public void Show()
    {
        if (ad != null && ad.IsReady())
        {
            ad.Show();
        }
    }

    private void OnDisable()
    {
        ad?.Dispose();
        ad = null;
    }
}