> ## Documentation Index
> Fetch the complete documentation index at: https://beta-guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# 인터스티셜 광고

> Unity 프로젝트에서 DARO 인터스티셜 광고를 구현하는 방법을 알아봅니다.

## 인터스티셜 광고 형태 소개

* 화면 전체를 덮는 형태로 노출되는 광고입니다.
* 게임 라운드 사이, 화면 전환, 주요 액션 이후처럼 자연스러운 중단 지점에 사용합니다.

***

## 광고 연동하기

<Steps>
  <Step title="광고 인스턴스 생성">
    ```csharp theme={null}
    private DaroInterstitialAd ad;

    ad = new DaroInterstitialAd("your-interstitial-ad-unit-id");
    ```
  </Step>

  <Step title="이벤트 핸들러 등록">
    ```csharp theme={null}
    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");
    ```
  </Step>

  <Step title="광고 로드">
    ```csharp theme={null}
    ad.Load();
    ```
  </Step>

  <Step title="광고 표시">
    ```csharp theme={null}
    if (ad != null && ad.IsReady())
    {
        ad.Show();
    }
    ```
  </Step>

  <Step title="광고 해제">
    ```csharp theme={null}
    ad?.Dispose();
    ad = null;
    ```
  </Step>
</Steps>

***

## Example

```csharp expandable theme={null}
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;
    }
}
```
