# Unity에서 인터스티셜 광고 구현

> Unity 프로젝트에 인터스티셜 광고를 구현합니다. 게임플레이 순간이나 앱 전환 시점에 광고 콘텐츠를 로드하고 C# 스크립트를 통해 표시합니다.

`Advertisements API`를 사용하여 전체 화면 인터스티셜 광고를 표시하려면, 먼저 SDK를 초기화한 후 `Load` 함수를 사용하여 광고 콘텐츠를 게재 위치로 로드하고 `Show` 함수를 사용해 광고를 표시합니다.

> **Note:**
>
> 2026년 4월 1일부터 Advertisement 레거시 패키지를 통한 직접 연동을 통해 Unity Ads 수익을 창출하는 앱 광고 성과가 저하될 수 있습니다. 성과 저하를 방지하려면 입찰자로 Unity Ads 통합으로 전환하십시오.
>
> Unity Ads 네트워크는 계속해서 직접 통합을 사용하여 모든 앱 Fill을 지원하고 제공합니다. 그러나 수익과 성과를 극대화하기 위해 Unity의 광고 Mediation 플랫폼인 [LevelPlay용 Ads Mediation 패키지를 설치하는](/grow/levelplay/sdk/unity/package-integration.md.md) 것이 좋습니다.

SDK 3.7.0 이상에서는 `IUnityAdsLoadListener`와 `IUnityAdsShowListener` 콜백 함수를 사용하여 콘텐츠의 로드나 표시가 성공 또는 실패한 경우의 로직을 각각 구현할 수 있습니다.

> **Note:**
>
> `Show` 메서드를 호출할 때 플레이스먼트 ID를 지정해야 합니다. 그렇지 않으면 오류가 발생합니다.

## 인터스티셜 광고 예##interstitial-ad-example

1. **C#**

   ```cs
   using UnityEngine;
   using UnityEngine.Advertisements;

   public class InterstitialAdExample : MonoBehaviour, IUnityAdsLoadListener, IUnityAdsShowListener
   {
     [SerializeField] string _androidAdUnitId = "Interstitial_Android";
     [SerializeField] string _iOSAdUnitId = "Interstitial_iOS";
     string _adUnitId;

     void Awake()
     {
       // Get the Ad Unit ID for the current platform:
       _adUnitId = (Application.platform == RuntimePlatform.IPhonePlayer)
       ? _iOSAdUnitId
       : _androidAdUnitId;
     }

     // Load content to the Ad Unit:
     public void LoadAd()
     {
       // IMPORTANT! Only load content AFTER initialization (in this example, initialization is handled in a different script).
       Debug.Log("Loading Ad: " + _adUnitId);
       Advertisement.Load(_adUnitId, this);
     }

     // Show the loaded content in the Ad Unit:
     public void ShowAd()
     {
       // Note that if the ad content wasn't previously loaded, this method will fail
       Debug.Log("Showing Ad: " + _adUnitId);
       Advertisement.Show(_adUnitId, this);
     }

     // Implement Load Listener and Show Listener interface methods: 
     public void OnUnityAdsAdLoaded(string adUnitId)
     {
       // Optionally execute code if the Ad Unit successfully loads content.
     }

     public void OnUnityAdsFailedToLoad(string _adUnitId, UnityAdsLoadError error, string message)
     {
       Debug.Log($"Error loading Ad Unit: {_adUnitId} - {error.ToString()} - {message}");
       // Optionally execute code if the Ad Unit fails to load, such as attempting to try again.
     }

     public void OnUnityAdsShowFailure(string _adUnitId, UnityAdsShowError error, string message)
     {
       Debug.Log($"Error showing Ad Unit {_adUnitId}: {error.ToString()} - {message}");
       // Optionally execute code if the Ad Unit fails to show, such as loading another ad.
     }

     public void OnUnityAdsShowStart(string _adUnitId) { }
     public void OnUnityAdsShowClick(string _adUnitId) { }
     public void OnUnityAdsShowComplete(string _adUnitId, UnityAdsShowCompletionState showCompletionState) { }
   }
   ```

**다음 단계**: 구현 내용을 한 단계 더 발전시키려면 [Unity에서 보상형 광고 구현](/ads-unity/4.19.0/sdk-integration/rewarded-ads.md) 기술 자료를 참조하십시오.
