AdManager仮導入

This commit is contained in:
kimura 2021-10-18 18:18:09 +09:00
parent 7f6a4eee9d
commit 91fa8101f4
2 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,74 @@
using System;
using UnityEngine;
public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
//-- ironSource --//
#if UNITY_IOS
private static readonly string IRONSOURCE_APP_KEY = "";
#else
private static readonly string IRONSOURCE_APP_KEY = "";
#endif
void Awake(){
#if DEVELOPMENT_BUILD
// IronSource.Agent.validateIntegration ();
// IronSource.Agent.setAdaptersDebug(true);
#endif
// IronSource.Agent.init (IRONSOURCE_APP_KEY);
}
void Start(){
LoadBannerAds();
ShowBannerAd();
}
void Update (){
}
void OnApplicationPause(bool isPaused) {
// IronSource.Agent.onApplicationPause(isPaused);
}
//-- Banners Ads --//
public void LoadBannerAds(){
// IronSource.Agent.loadBanner(IronSourceBannerSize.SMART, IronSourceBannerPosition.BOTTOM);
}
public void ShowBannerAd(){
// IronSource.Agent.displayBanner();
}
public void HideBanner(){
// IronSource.Agent.hideBanner();
}
public bool IsLoadedRewardVideo(){
return true;
// #if UNITY_EDITOR
// return true;
// #else
// return IronSource.Agent.isRewardedVideoAvailable();
// #endif
}
public void ShowRewardVideo(Action<bool> callback){
callback(true);
// #if UNITY_EDITOR
// callback(true);
// #else
// _rewardAdCallback = callback;
// if(_rewardAdCallback == null){
// return;
// }else if(IsLoadedRewardVideo()){
// _rewardAdOpen = false;
// _rewardAdFinish = false;
// _rewardAdClose = false;
// _async_frame_count = 0;
// IronSource.Agent.showRewardedVideo();
// }else{
// _rewardAdCallback(false);
// }
// #endif
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8e2021f1b8ce47f79191ab8732fba298
timeCreated: 1634545756