Commit 9b00e133 authored by zhangzhe's avatar zhangzhe

修改广告问题

parent a4d78bc0
......@@ -117,7 +117,7 @@ public class AdManager
return;
#endif
//穿山甲
if (ZXADConfig.Instance.CSJ_AD_APP_ID != null&& ZXADConfig.Instance.CSJ_AD_APP_ID!="")
if (ZXADConfig.Instance.CSJ_AD_APP_ID != null && ZXADConfig.Instance.CSJ_AD_APP_ID != "")
{
#if UNITY_ANDROID
......@@ -153,7 +153,7 @@ public class AdManager
ZXHCADManager.Init(ZXADConfig.Instance.HC_AD_APP_ID, Constant.Instance.IsTestNet);
#endif
}
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "ZXADConfig.Instance.HC_AD_APP_ID "+ ZXADConfig.Instance.HC_AD_APP_ID);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "ZXADConfig.Instance.HC_AD_APP_ID " + ZXADConfig.Instance.HC_AD_APP_ID);
//风行
#if UNITY_ANDROID
AndroidJavaClass jc3 = new AndroidJavaClass("com.ym.admodule.fs.FunShionManager");
......@@ -206,7 +206,7 @@ public class AdManager
// listener.onError("code" + code + "没有默认配置 errMsg" + errMsg);
// listener.onLastError();
//}
listener.onError(code + "errormsg" +errMsg);
listener.onError(code + "errormsg" + errMsg);
listener.onLastError();
}));
......@@ -306,7 +306,7 @@ public class AdManager
CSJSplshADUtils.Instance.LoadSplshAd(entity, GetActivity(), GetSplashAdManager(), listener, callback);
#elif UNITY_IOS
//加载穿山甲开屏广告
CSJSplshADUtils.Instance.LoadSplshAd(entity,null, null, listener, callback);
CSJSplshADUtils.Instance.LoadSplshAd(entity, null, null, listener, callback);
#endif
break;
......@@ -594,7 +594,7 @@ public class AdManager
if (bl)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "大图缓存成功 " + entity.adPlatform + " CodeID " + entity.codeId);
//保存插屏缓存数据
//保存大图缓存数据
ZXADConfig.Instance.SetAdCache(sloatName, entity, "");
}
else
......@@ -850,7 +850,7 @@ public class AdManager
{
entity.actionName = actionName;
ZXADConfig.Instance.RemoveAdCache(slotName, "");
mPlayCacheInterstitialAdPlatform(entity,listener, new Action<bool>((bl) =>
mPlayCacheInterstitialAdPlatform(entity, listener, new Action<bool>((bl) =>
{
if (bl)
{
......@@ -885,7 +885,7 @@ public class AdManager
#if UNITY_ANDROID
case ZXADConfig.PLANTFORM_AD_KUS:
//快手插屏广告加载
KsInterstitialAdUtils.Instance.PlayCacheInterstitialAd(entity, callback,listener);
KsInterstitialAdUtils.Instance.PlayCacheInterstitialAd(entity, callback, listener);
break;
#endif
default:
......@@ -1289,6 +1289,15 @@ public class AdManager
if (adList == null || adList.Count == 0)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频A组没有数据");
ADLoading.Instance().loadFailCount++;
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
return;
}
if (IsFirstLoadRewardAd)
......@@ -1333,6 +1342,7 @@ public class AdManager
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
}
......@@ -1353,6 +1363,15 @@ public class AdManager
if (adList == null || adList.Count == 0)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频B组没有数据");
ADLoading.Instance().loadFailCount++;
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
return;
}
List<AdEntity> totalEntityList = adList;
......@@ -1390,6 +1409,7 @@ public class AdManager
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
}
......
......@@ -48,7 +48,7 @@ namespace Tencent.GDT
{
return;
}
loadListeners.Add((int) rewardVideoAd, listener);
loadListeners[(int) rewardVideoAd] = listener;
}
public void SetEnableDefaultAudioSessionSetting(bool audioSessionSetting)
......
......@@ -49,7 +49,7 @@ namespace Tencent.GDT
{
return;
}
loadListeners.Add((int)this.nativeExpressAd, listener);
loadListeners[(int)this.nativeExpressAd] = listener;
}
public void LoadAd(int count)
......
......@@ -48,7 +48,7 @@ PluginImporter:
second:
enabled: 0
settings:
CPU: x86_64
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
......
......@@ -67,6 +67,10 @@ public class AdUtils
public void onAdClose(AdEntity entity)
{
#if UNITY_IOS
Time.timeScale = 1;
#endif
Debug.Log("音乐是否开关的值"+ PlayerPrefs.GetInt("IS_OPEN_MUSIC", 0));
if(PlayerPrefs.GetInt("IS_OPEN_MUSIC", 0) == 0)
{
......@@ -107,6 +111,9 @@ public class AdUtils
public void onAdShow()
{
#if UNITY_IOS
Time.timeScale = 0;
#endif
AudioUtils.ins.music.Stop();
EventUtils.OnEvent("video_show");
......@@ -212,6 +219,9 @@ public class AdUtils
public void onError(string errorMsg)
{
#if UNITY_IOS
Time.timeScale = 1;
#endif
callback(false);
}
......
......@@ -203,6 +203,9 @@ public class StartControl : MonoBehaviour
int passTime = curTime - lastCloseTime;
if (passTime > Constant.Instance.splash_time && passTime < Constant.Instance.video_time)
{
#if UNITY_IOS
ShowSplashAd();
#else
if (AdUtils.IsShowRewardAd)
{
AdUtils.IsShowRewardAd = false;
......@@ -211,9 +214,13 @@ public class StartControl : MonoBehaviour
{
ShowSplashAd();
}
#endif
}
else if (passTime >= Constant.Instance.video_time)
{
#if UNITY_IOS
ShowRewardAd();
#else
if (AdUtils.IsShowRewardAd)
{
AdUtils.IsShowRewardAd = false;
......@@ -222,6 +229,7 @@ public class StartControl : MonoBehaviour
{
ShowRewardAd();
}
#endif
}
}
......
......@@ -17,7 +17,7 @@ MonoBehaviour:
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.cn
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_UserSelectedRegistryName:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment