๋ณด์ํ ๋ธ๋ก๊ทธ์์ ๋ค์ ธ์ ๋ฐ๋ผํด๋ ๊ณ์ ์ค๋ฅ๋ ๊ฐ์ง๊ณ
๊ทธ๋ฅ ์ ๋ฉดํ ๊ด๊ณ ๊ทธ๋๋ก ์ฐ๊ณ ๋จ์ID๋ง ๋ณด์ํ์ผ๋ก ํด๋ ๋จ???
private InterstitialAd interstitial;
public void Start()
{
//๊ด๊ณ ์ด๊ธฐํ
MobileAds.Initialize(initStatus =>
{
RequestInterstitial();
});
}
private void RequestInterstitial()
{
//์ฌ๋ฌ OS์์ ๊ณตํต๋ ์ฝ๋๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ ์ด๋ ๊ฒ ํ๋ฉด ํธ๋ฆฌ
//์ฌ๊ธฐ ๋ค์ด๊ฐ๋ ID๋ /๊ฐ ๋ค์ด๊ฐ ์ชฝ์ ๊ด๊ณ ๋จ์ ID
//์ด ID๋ค์ Google์ด ์ง์ํ๋ ํ ์คํธ ID์ด๋ฏ๋ก ์ ํ ์์ด ์ฌ์ฉ ๊ฐ๋ฅ
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544/5224354917";//์ด๊ฑธ ๊ทธ๋ฅ ๋ณด์ํ ๋จ์ID๋ก ๋ฐ๊พธ๋๊ฑฐ์
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-3940256099942544/5224354917";
#else
string adUnitId = "unexpected_platform";
#endif
//๋จ์ผ OS์ผ ๊ฒฝ์ฐ ์ฌ๊ธฐ์ ๋ฐ๋ก ์คํธ๋ง์ผ๋ก ๊ฝ์์ค๋ ๊ฐ๋ฅ
this.interstitial = new InterstitialAd(adUnitId);
AdRequest request = new AdRequest.Builder().Build();
this.interstitial.LoadAd(request);
}
//๊ด๊ณ ๋ฅผ ์์ํด์ผ ํ ๋์ ์ธ๋ถ์์ ์ด ํจ์๋ฅผ ํธ์ถ
public void AdStart()
{
if (this.interstitial.IsLoaded())
{
this.interstitial.Show();
}
}
}
๋๊ธ 0