Commit d98aa64f authored by erwin's avatar erwin

广告sdk修改

parent 6407267f
......@@ -1115,7 +1115,7 @@ public class AdManager
{
listener.onError("播放激励视频失败 缓存的信息为null");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "播放激励视频失败 缓存的信息为null");
//LoadCacheRewardVideoAd(slotName);
LoadCacheRewardVideoAd(slotName);
}
}
......
......@@ -46,7 +46,8 @@ public class AdDemo : MonoBehaviour
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
//AdManager.Instance.LoadCacheRewardVideoAd("video");
AdManager.Instance.LoadCacheRewardVideoAd("video");
//YLBRewardAdUtil.Instance.LoadYLBAd();
}
public void onAdShow()
......
......@@ -13,7 +13,15 @@ public class YLBRewardAdUtil
return singleInstance;
}
}
private YLBRewardAD rewardVideoAd = new YLBRewardAD();
//private YLBRewardAD rewardVideoAd = new YLBRewardAD();
/// <summary>
/// 假load
/// </summary>
public void LoadYLBAd()
{
//rewardVideoAd.LoadAd("12345678", "C");
}
/// <summary>
/// 加载缓存激励视频
......@@ -22,6 +30,7 @@ public class YLBRewardAdUtil
/// <param name="callback"></param>
public void LoadCacheRewardAd(AdEntity entity, Action<bool> callback)
{
YLBRewardAD rewardVideoAd = new YLBRewardAD();
rewardVideoAd.SetLoadListener(new RewardVideoAdLoadListener(this,entity,rewardVideoAd,callback));
rewardVideoAd.LoadAd(entity.codeId, entity.codeGroup);
}
......@@ -34,10 +43,10 @@ public class YLBRewardAdUtil
/// <param name="callback"></param>
public void playCacheRewardAd(AdEntity entity, ZXADRewardVideoListener listener, Action<bool> callback)
{
//rewardVideoAd = GetRewardVideoAd(entity.codeGroup + entity.codeId);
YLBRewardAD rewardVideoAd = GetRewardVideoAd(entity.codeGroup + entity.codeId);
if (rewardVideoAd != null)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "YLB Not NUll");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.codeGroup+"YLB Not NUll");
#if UNITY_ANDROID
rewardVideoAd.SetPlayListener(new RewardVideoAdListener(entity, callback, listener));
rewardVideoAd.ShowAD(entity.codeId, entity.codeGroup);
......@@ -48,7 +57,7 @@ public class YLBRewardAdUtil
}
else
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "YLB NUll");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.codeGroup + "YLB NUll");
callback(false);
}
}
......@@ -69,7 +78,7 @@ public class YLBRewardAdUtil
public void onError(int code, string message)
{
Debug.unityLogger.Log(entity.codeId+" codeID " +entity.codeId+"YLB Error code" +code+"message"+message);
Debug.unityLogger.Log(entity.codeGroup+" codeID " +entity.codeId+"YLB Error code" +code+"message"+message);
EventUtils.onEventPullFail(entity, code.ToString(),message);
callback(false);
}
......@@ -77,7 +86,7 @@ public class YLBRewardAdUtil
public void onLoad()
{
EventUtils.onEventPullSuccess(entity);
//adUtil.SetRewardVideoAd(entity.codeGroup + entity.codeId, this.rewardVideo);
adUtil.SetRewardVideoAd(entity.codeGroup + entity.codeId, this.rewardVideo);
callback(true);
}
}
......
......@@ -30,7 +30,7 @@ public class YLBRewardAD
// rewardVideoAd = new AndroidJavaObject("com.ym.admodule.ylb.YLBManager");
// //Utils.GetActivity(), posId, listenerProxy, volumeOn);
//}
this.rewardVideoAd.Call("loadRewardAd", codeId, codeGroup, listenerLoadProxy);
rewardVideoAd.Call("loadRewardAd", codeId, codeGroup, listenerLoadProxy);
}
// 展示激励视频
......@@ -42,6 +42,6 @@ public class YLBRewardAD
// rewardVideoAd = new AndroidJavaObject("com.ym.admodule.ylb.YLBManager");
// //Utils.GetActivity(), posId, listenerProxy, volumeOn);
//}
this.rewardVideoAd.Call("playRewardAd", Utils.GetActivity(), codeId, codeGroup, listenerProxy);
rewardVideoAd.Call("playRewardAd", Utils.GetActivity(), codeId, codeGroup, listenerProxy);
}
}
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