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.
인터스티셜 광고 형태 소개
- 화면 전체를 덮는 형태로 노출되는 광고입니다.
- 게임 라운드 사이, 화면 전환, 주요 액션 이후처럼 자연스러운 중단 지점에 사용합니다.
광고 연동하기
광고 인스턴스 생성
private DaroInterstitialAd ad;
ad = new DaroInterstitialAd("your-interstitial-ad-unit-id");
이벤트 핸들러 등록
ad.OnAdLoaded += info => Debug.Log("interstitial loaded");
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdShown += info => Debug.Log("shown");
ad.OnAdFailedToShow += error => Debug.LogWarning(error.Message);
ad.OnAdClicked += info => Debug.Log("clicked");
ad.OnAdImpression += info => Debug.Log("impression");
ad.OnAdDismissed += info => Debug.Log("dismissed");
광고 표시
if (ad != null && ad.IsReady())
{
ad.Show();
}
광고 해제
ad?.Dispose();
ad = null;
Example
using Daro;
using UnityEngine;
public sealed class InterstitialHost : MonoBehaviour
{
[SerializeField] private string adUnitId = "your-interstitial-ad-unit-id";
private DaroInterstitialAd ad;
private void OnEnable()
{
ad = new DaroInterstitialAd(adUnitId);
ad.OnAdLoaded += info => Debug.Log($"loaded latency={info.Latency}ms");
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdDismissed += info => ad?.Load();
ad.Load();
}
public void Show()
{
if (ad != null && ad.IsReady())
{
ad.Show();
}
}
private void OnDisable()
{
ad?.Dispose();
ad = null;
}
}