Commit 881cbf7e authored by 王雪伟's avatar 王雪伟

Unity广告SDK 1.0.0

parent 0677490a
This diff is collapsed.
......@@ -95,5 +95,13 @@ public class ZXADConfig
return null;
}
public void RemoveAdCache(string slotName, string type)
{
if (AdCacheMap.ContainsKey(type + slotName))
{
AdCacheMap.Remove(type + slotName);
}
}
}
......@@ -80,4 +80,8 @@ public class AdEntity
///
/// </summary>
public List<string> playcomplete_trackings { get; set; }
/// <summary>
///
/// </summary>
public AdEntity bgroup { get; set; }
}
......@@ -6,5 +6,5 @@ public class AdIdConfig
{
public string adPlatform;
public string codeAppId;
public string codeAppKey;
//public string codeAppKey;
}
......@@ -58,23 +58,24 @@ public class CSJBannerUtil
{
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId("900546269")
.SetCodeId(entity.codeId)
#else
.SetCodeId("901121246")
.SetCodeId(entity.codeId)
////期望模板广告view的size,单位dp,//高度按照实际rit对应宽高传入
#endif
.SetExpressViewAcceptedSize(Screen.width, float.Parse(Screen.width.ToString()) / 600 * 90)
//.SetExpressViewAcceptedSize(Screen.width, float.Parse(Screen.width.ToString()) / 600 * 90)
.SetExpressViewAcceptedSize(Screen.width, float.Parse(Screen.width.ToString()) /4)
.SetSupportDeepLink(true)
.SetImageAcceptedSize(1080, 1920)
.SetAdCount(1)
.SetOrientation(AdOrientation.Horizontal)
.Build();
Debug.LogError("SetExpressViewAcceptedSize:" + float.Parse(Screen.width.ToString()) / 600 * 90);
//Debug.LogError("SetExpressViewAcceptedSize:" + float.Parse(Screen.width.ToString()) / 600 * 90);
this.AdNative.LoadExpressBannerAd(adSlot, new BannerAdListener(callback));
}
public void ShowCacheBannerAd()
public void ShowCacheBannerAd(AdEntity entity,Action<bool> callback)
{
#if UNITY_IOS
if (bannerAdCacheListIOS.Count > 0)
......@@ -86,7 +87,7 @@ public class CSJBannerUtil
//{
// y = 100; // 防止Demo里刘海遮挡
//}
mBanneAd.SetExpressInteractionListener(new ExpressAdInteractionListener(this, entity, callback, 1));
mBanneAd.ShowExpressAd(x, y);
}
else
......@@ -100,12 +101,14 @@ public class CSJBannerUtil
//设置轮播间隔 30s--120s;不设置则不开启轮播
mBanneAd.SetSlideIntervalTime(30 * 1000);
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this, 1);
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this,entity,callback,1);
ExpressAdDislikeCallback dislikeCallback = new ExpressAdDislikeCallback(this, 1);
NativeAdManager.Instance().ShowExpressBannerAd(GetActivity(), mBanneAd.handle, expressAdInteractionListener, dislikeCallback);
}
else
{
callback(false);
Debug.Log("CSJ Banner广告没有缓存数据了");
}
......@@ -159,11 +162,15 @@ public class CSJBannerUtil
private sealed class ExpressAdInteractionListener : IExpressAdInteractionListener
{
private CSJBannerUtil example;
private AdEntity entity;
private Action<bool> callback;
int type;//0:feed 1:banner 2:interstitial
public ExpressAdInteractionListener(CSJBannerUtil example, int type)
public ExpressAdInteractionListener(CSJBannerUtil example, AdEntity entity,Action<bool> callback, int type)
{
this.example = example;
this.entity = entity;
this.callback = callback;
this.type = type;
}
public void OnAdClicked(ExpressAd ad)
......@@ -173,11 +180,13 @@ public class CSJBannerUtil
public void OnAdShow(ExpressAd ad)
{
callback(true);
Debug.Log("express OnAdShow,type:" + type);
}
public void OnAdViewRenderError(ExpressAd ad, int code, string message)
{
callback(false);
Debug.Log("express OnAdViewRenderError,type:" + type);
}
......
......@@ -53,9 +53,9 @@ public class CSJFeedUtil : MonoBehaviour
{
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId("900546131")
.SetCodeId(entity.codeId)
#else
.SetCodeId("901121253")
.SetCodeId(entity.codeId)
////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应
.SetExpressViewAcceptedSize(350, 0)
#endif
......@@ -73,7 +73,7 @@ public class CSJFeedUtil : MonoBehaviour
/// 展示缓存的FeedAd
/// </summary>
/// <param name="entity"></param>
public void ShowCacheFeedAd(AdEntity entity)
public void ShowCacheFeedAd(AdEntity entity,Action<bool> callback)
{
if (feedAdCacheList.Count > 0)
{
......@@ -85,15 +85,17 @@ public class CSJFeedUtil : MonoBehaviour
//{
// y = 100; // 防止Demo里刘海遮挡
//}
feedAd.SetExpressInteractionListener(new ExpressAdInteractionListener(this, entity, callback, 0));
feedAd.ShowExpressAd(x, y);
#else
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this, 0);
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this,entity,callback, 0);
ExpressAdDislikeCallback dislikeCallback = new ExpressAdDislikeCallback(this, 0);
NativeAdManager.Instance().ShowExpressFeedAd(GetActivity(), feedAd.handle, expressAdInteractionListener, dislikeCallback);
#endif
}
else
{
callback(false);
Debug.Log("CSJ Feed广告没有缓存数据了");
}
}
......@@ -143,11 +145,15 @@ public class CSJFeedUtil : MonoBehaviour
private sealed class ExpressAdInteractionListener : IExpressAdInteractionListener
{
private CSJFeedUtil example;
private AdEntity entity;
private Action<bool> callback;
int type;//0:feed 1:banner 2:interstitial
public ExpressAdInteractionListener(CSJFeedUtil example, int type)
public ExpressAdInteractionListener(CSJFeedUtil example, AdEntity entity, Action<bool> callback, int type)
{
this.example = example;
this.entity = entity;
this.callback = callback;
this.type = type;
}
public void OnAdClicked(ExpressAd ad)
......@@ -157,11 +163,13 @@ public class CSJFeedUtil : MonoBehaviour
public void OnAdShow(ExpressAd ad)
{
callback(true);
Debug.Log("express OnAdShow,type:" + type);
}
public void OnAdViewRenderError(ExpressAd ad, int code, string message)
{
callback(false);
Debug.Log("express OnAdViewRenderError,type:" + type);
}
......
......@@ -61,10 +61,10 @@ public class CSJInterstitialUtil
{
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId("900546270")
.SetCodeId(entity.codeId)
.SetExpressViewAcceptedSize(200, 300)
#else
.SetCodeId("901121133")
.SetCodeId(entity.codeId)
.SetExpressViewAcceptedSize(350, 0)
////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应
#endif
......@@ -75,7 +75,7 @@ public class CSJInterstitialUtil
this.AdNative.LoadExpressInterstitialAd(adSlot, new InterstitialAdListener(callback));
}
public void PlayCacheInterstitialAd(AdEntity entity)
public void PlayCacheInterstitialAd(AdEntity entity,Action<bool> callback)
{
#if UNITY_IOS
if (interstitialAdCacheListIOS.Count > 0)
......@@ -87,10 +87,12 @@ public class CSJInterstitialUtil
//{
// y = 100; // 防止Demo里刘海遮挡
//}
mInterstitialAd.SetExpressInteractionListener(new ExpressAdInteractionListener(this, callback, entity, 1));
mInterstitialAd.ShowExpressAd(x, y);
}
else
{
{
callback(false);
Debug.Log("CSJ 插屏广告没有缓存数据了");
}
......@@ -98,11 +100,12 @@ public class CSJInterstitialUtil
if (interstitialAdCacheListAndroid.Count > 0)
{
mInterstitialAd = interstitialAdCacheListAndroid.Dequeue();
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this, 1);
ExpressAdInteractionListener expressAdInteractionListener = new ExpressAdInteractionListener(this, callback,entity, 1);
NativeAdManager.Instance().ShowExpressInterstitialAd(GetActivity(), mInterstitialAd.handle, expressAdInteractionListener);
}
else
{
callback(false);
Debug.Log("CSJ 插屏广告没有缓存数据了");
}
#endif
......@@ -155,11 +158,15 @@ public class CSJInterstitialUtil
private sealed class ExpressAdInteractionListener : IExpressAdInteractionListener
{
private CSJInterstitialUtil example;
private Action<bool> callback;
private AdEntity entity;
int type;//0:feed 1:banner 2:interstitial
public ExpressAdInteractionListener(CSJInterstitialUtil example, int type)
public ExpressAdInteractionListener(CSJInterstitialUtil example,Action<bool> callback,AdEntity entity, int type)
{
this.example = example;
this.callback = callback;
this.entity = entity;
this.type = type;
}
public void OnAdClicked(ExpressAd ad)
......
......@@ -48,41 +48,32 @@ public class CSJRewardUtil
public void LoadCacheRewardAd(AdEntity entity, Action<bool> callback)
{
//if (this.rewardAd != null)
//{
// Debug.Log("广告已经加载");
// return;
//}
//string iosSlotID = "945113162";
string iosSlotID = entity.codeId;
//string AndroidSlotID = "901121593";
string AndroidSlotID = entity.codeId;
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId(iosSlotID)
.SetCodeId(iosSlotID)
#else
.SetCodeId(AndroidSlotID)
.SetCodeId(AndroidSlotID)
#endif
.SetSupportDeepLink(true)
.SetSupportDeepLink(true)
.SetImageAcceptedSize(1080, 1920)
.SetRewardName("金币") // 奖励的名称
.SetRewardAmount(3) // 奖励的数量
.SetUserID("") // 用户id,必传参数
.SetUserID("user123") // 用户id,必传参数
.SetMediaExtra("media_extra") // 附加参数,可选
.SetOrientation(AdOrientation.Vertical) // 必填参数,期望视频的播放方向
.SetOrientation(AdOrientation.Horizontal) // 必填参数,期望视频的播放方向
.Build();
#if UNITY_IOS
this.AdNative.LoadExpressRewardAd(
adSlot, new RewardVideoAdListener(this,entity, callback));
this.AdNative.LoadExpressRewardAd(
adSlot, new RewardVideoAdListener(this,entity, callback));
#else
this.AdNative.LoadExpressRewardAd(
this.AdNative.LoadRewardVideoAd(
adSlot, new RewardVideoAdListener(this, entity, callback));
#endif
}
/// <summary>
......@@ -97,7 +88,7 @@ public class CSJRewardUtil
#if UNITY_ANDROID
RewardVideoAd rewardAd = GetRewardVideoAdForAndroid(entity.codeGroup+entity.codeId);
#elif UNITY_IOS
ExpressRewardVideoAd rewardAd = GetRewardVideoAdForIOS("");
ExpressRewardVideoAd rewardAd = GetRewardVideoAdForIOS(entity.codeGroup+entity.codeId);
#endif
if (rewardAd != null)
{
......@@ -107,7 +98,7 @@ public class CSJRewardUtil
else
{
callback(false);
Debug.Log("CSJ 激励视频 缓存不存在");
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG,"CSJ 激励视频 缓存不存在");
}
}
......@@ -129,14 +120,12 @@ public class CSJRewardUtil
public void OnError(int code, string message)
{
Debug.Log("OnRewardError: " + message);
callback(false);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.adPlatform + " 激励视频 Error Group" + entity.codeGroup + " Code " + code + " msg" + message);
}
public void OnRewardVideoAdLoad(RewardVideoAd ad)
{
Debug.Log("OnRewardVideoAdLoad");
//ad.SetRewardAdInteractionListener(
// new RewardAdInteractionListener(this.csjAD));
//ad.SetDownloadListener(
......@@ -151,7 +140,6 @@ public class CSJRewardUtil
public void OnExpressRewardVideoAdLoad(ExpressRewardVideoAd ad)
{
#if UNITY_IOS
this.csjAD.SetRewardVideoAdForIOS(entity.codeGroup+entity.codeId, ad);
callback(true);
......@@ -160,7 +148,6 @@ public class CSJRewardUtil
public void OnRewardVideoCached()
{
Debug.Log("OnRewardVideoCached");
//if (this.csjAD.rewardAd != null)
//{
// this.csjAD.rewardAd.IsDownloaded = true;
......@@ -313,7 +300,6 @@ public class CSJRewardUtil
/// <returns></returns>
private ExpressRewardVideoAd GetRewardVideoAdForIOS(string codeId)
{
codeId = "IOS";
if (mRewardCacheMapIOS.ContainsKey(codeId))
{
Queue<ExpressRewardVideoAd> mRewardQueue = mRewardCacheMapIOS[codeId];
......
......@@ -61,8 +61,10 @@ public class CSJSplshADUtils
/// <param name="listener"></param>
public void LoadSplshAd(AdEntity entity,AndroidJavaObject activity, AndroidJavaObject splashAdManager, ZXADSplashListener listener, Action<bool> callback)
{
string iosSlotID = "800546808";
string AndroidSlotID = "801121648";
//string iosSlotID = "800546808";
//string AndroidSlotID = "801121648";
string iosSlotID = entity.codeId;
string AndroidSlotID = entity.codeId;
//// 横屏 开屏的横屏配置需要在服务端针对广告位进行设置
//if (this.getScreenOrientationConfig() == 1)
//{
......
......@@ -20,25 +20,25 @@ public final class UnionApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AppliContext.init(this);
AppliContext.init(this);
TTAdConfig config = new TTAdConfig.Builder()
//.appId("5001121")
.appId("5145269")
.useTextureView(false) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.appName("APP测试媒体")
.titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
.allowShowNotify(true) //是否允许sdk展示通知栏提示
.allowShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页
.debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.supportMultiProcess(false) //是否支持多进程,true支持
.customController(getController())//控制隐私数据
.build();
// TTAdConfig config = new TTAdConfig.Builder()
// //.appId("5001121")
// .appId("5145269")
// .useTextureView(false) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
// .appName("APP测试媒体")
// .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
// .allowShowNotify(true) //是否允许sdk展示通知栏提示
// .allowShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页
// .debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
// .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
// .supportMultiProcess(false) //是否支持多进程,true支持
// .customController(getController())//控制隐私数据
// .build();
// 强烈建议在应用对应的Application#onCreate()方法中调用,避免出现content为null的异常
TTAdSdk.init(this, config);
// // 强烈建议在应用对应的Application#onCreate()方法中调用,避免出现content为null的异常
// TTAdSdk.init(this, config);
//如果明确某个进程不会使用到广告SDK,可以只针对特定进程初始化广告SDK的content
//if (PROCESS_NAME_XXXX.equals(processName)) {
......@@ -46,45 +46,45 @@ public final class UnionApplication extends Application {
//}
}
private static TTCustomController getController() {
MyTTCustomController customController = new MyTTCustomController();
return customController;
}
// private static TTCustomController getController() {
// MyTTCustomController customController = new MyTTCustomController();
// return customController;
// }
private static class MyTTCustomController extends TTCustomController{
@Override
public boolean isCanUseLocation() {
return super.isCanUseLocation();
}
// private static class MyTTCustomController extends TTCustomController{
// @Override
// public boolean isCanUseLocation() {
// return super.isCanUseLocation();
// }
@Override
public TTLocation getTTLocation() {
return super.getTTLocation();
}
// @Override
// public TTLocation getTTLocation() {
// return super.getTTLocation();
// }
@Override
public boolean alist() {
return super.alist();
}
// @Override
// public boolean alist() {
// return super.alist();
// }
@Override
public boolean isCanUsePhoneState() {
return super.isCanUsePhoneState();
}
// @Override
// public boolean isCanUsePhoneState() {
// return super.isCanUsePhoneState();
// }
@Override
public String getDevImei() {
return super.getDevImei();
}
// @Override
// public String getDevImei() {
// return super.getDevImei();
// }
@Override
public boolean isCanUseWifiState() {
return super.isCanUseWifiState();
}
// @Override
// public boolean isCanUseWifiState() {
// return super.isCanUseWifiState();
// }
@Override
public boolean isCanUseWriteExternal() {
return super.isCanUseWriteExternal();
}
}
// @Override
// public boolean isCanUseWriteExternal() {
// return super.isCanUseWriteExternal();
// }
// }
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1508,7 +1508,7 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.42986825, g: 0.7849259, b: 0.8679245, a: 0}
m_BackGroundColor: {r: 0.17702031, g: 0.8137047, b: 0.9622642, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
......@@ -2869,80 +2869,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2017943968}
m_CullTransparentMesh: 0
--- !u!1001 &2110713141
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2853166085728200632, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_Name
value: HTTP
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200634, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: IS_TGYZ
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1053be02c113a7a45adf322c929b0cb6, type: 3}
--- !u!1 &2116183217
GameObject:
m_ObjectHideFlags: 0
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
<<<<<<< HEAD
AdManager.Instance.LoadCacheFSVideoAd("fullvideo");
=======
//AdManager.Instance.LoadCacheFSVideoAd();
>>>>>>> c9dc7224cab183311983fe752879dab5c389d597
}
public void OnClickPlayFullScreeVideoAd()
{
<<<<<<< HEAD
AdManager.Instance.PlayCacheFSVideoAd("fullvideo", "test", new FullScreenAdListener(this));
=======
//AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
>>>>>>> c9dc7224cab183311983fe752879dab5c389d597
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
<<<<<<< HEAD
AdManager.Instance.LoadCacheFSVideoAd("fullvideo");
=======
//AdManager.Instance.LoadCacheFSVideoAd();
>>>>>>> c9dc7224cab183311983fe752879dab5c389d597
}
public void OnClickPlayFullScreeVideoAd()
{
<<<<<<< HEAD
AdManager.Instance.PlayCacheFSVideoAd("fullvideo", "test", new FullScreenAdListener(this));
=======
//AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
>>>>>>> c9dc7224cab183311983fe752879dab5c389d597
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
AdManager.Instance.LoadCacheFSVideoAd();
}
public void OnClickPlayFullScreeVideoAd()
{
AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
AdManager.Instance.LoadCacheFSVideoAd();
}
public void OnClickPlayFullScreeVideoAd()
{
AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
AdManager.Instance.LoadCacheFSVideoAd("fullvideo");
}
public void OnClickPlayFullScreeVideoAd()
{
AdManager.Instance.PlayCacheFSVideoAd("fullvideo", "test", new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
AdManager.Instance.LoadCacheFSVideoAd("fullvideo");
}
public void OnClickPlayFullScreeVideoAd()
{
AdManager.Instance.PlayCacheFSVideoAd("fullvideo", "test", new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
//AdManager.Instance.LoadCacheFSVideoAd();
}
public void OnClickPlayFullScreeVideoAd()
{
//AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdDemo : MonoBehaviour
{
public Text RewardAdResult;
public void OnClickLoadRewardAd()
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void OnClickPlayRewardAd()
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(this));
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private AdDemo demo;
public RewardAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "Reward onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "Reward onAdShow";
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "Reward onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "Reward onError" + errorMsg;
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "Reward onSuccess";
}
}
public void OnClickInitAd()
{
//AdManager.Instance.LoadSplshAd(new SplshAdListener(this));
AdManager.Instance.InitAd();
}
public void OnClickPlaySplshAd()
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(this));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private AdDemo demo;
public SplshAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "开屏展示";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "开屏跳过";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "开屏错误" + errorMsg;
}
}
public void OnClickLoadBannerAd()
{
AdManager.Instance.LoadCacheBannerAd();
}
public void OnClickShowBannerAd()
{
AdManager.Instance.ShowCacheBannerAd();
}
public void OnClickLoadFeed()
{
AdManager.Instance.LoadCacheFeedAd();
}
public void OnClickShowFeed()
{
AdManager.Instance.ShowCacheFeedAd();
}
public void OnClickLoadInterAd()
{
AdManager.Instance.LoadCacheInterstitialAd();
}
public void OnClickPlayInterAd()
{
AdManager.Instance.PlayCacheInterstitialAd();
}
public void OnClickLoadFullScreeVideoAd()
{
//AdManager.Instance.LoadCacheFSVideoAd();
}
public void OnClickPlayFullScreeVideoAd()
{
//AdManager.Instance.PlayCacheFSVideoAd(new FullScreenAdListener(this));
}
private sealed class FullScreenAdListener : ZXADFullScreenVideoListener
{
private AdDemo demo;
public FullScreenAdListener(AdDemo demo)
{
this.demo = demo;
}
public void onAdClose()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdClose";
}
public void onAdShow()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdShow";
}
public void onAdSkip()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdSkip";
}
public void onAdVideoBarClick()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onAdVideoBarClick";
}
public void onError(string errorMsg)
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onError";
}
public void onSuccess()
{
this.demo.RewardAdResult.text = "FullScreenVideoAD onSuccess";
}
}
}
......@@ -28,8 +28,8 @@ public class GDTBannerAdUtil
/// </summary>
public void LoadCacheBannerAd(AdEntity entity, Action<bool> callback)
{
UnifiedBannerAd ad = new UnifiedBannerAd(Constants.bannerPosId, new AdSize(375, 60));
ad.SetListener(new BannerListener(ad, callback));
UnifiedBannerAd ad = new UnifiedBannerAd(entity.codeId, new AdSize(375, 60));
ad.SetListener(new BannerListener(ad, entity, callback));
ad.LoadAndShowAd();
}
......@@ -38,7 +38,7 @@ public class GDTBannerAdUtil
/// </summary>
/// <param name="entity"></param>
private UnifiedBannerAd gdtBannerAd;
public void ShowCacheBannerAd(AdEntity entity)
public void ShowCacheBannerAd(AdEntity entity,Action<bool> callback)
{
if (bannerCacheList.Count > 0)
{
......@@ -47,6 +47,7 @@ public class GDTBannerAdUtil
gdtBannerAd.CloseAd();
}
gdtBannerAd = bannerCacheList.Dequeue();
gdtBannerAd.SetListener(new BannerListener(gdtBannerAd,entity,callback));
#if UNITY_ANDROID
AndroidDemoUtils.ShowView(gdtBannerAd.GetAndroidNativeView(), true);
#elif UNITY_IOS
......@@ -55,6 +56,7 @@ public class GDTBannerAdUtil
}
else
{
callback(false);
Debug.Log("GDT Banner广告没有缓存数据了");
}
}
......@@ -63,10 +65,12 @@ public class GDTBannerAdUtil
/// </summary>
private sealed class BannerListener : IUnifiedBannerAdListener
{
private AdEntity entity;
private Action<bool> callback;
private UnifiedBannerAd bannerAD;
public BannerListener(UnifiedBannerAd bannerAD, Action<bool> callback)
public BannerListener(UnifiedBannerAd bannerAD, AdEntity entity,Action<bool> callback)
{
this.entity = entity;
this.bannerAD = bannerAD;
this.callback = callback;
}
......@@ -97,6 +101,7 @@ public class GDTBannerAdUtil
/// </summary>
public void OnAdExposured()
{
callback(true);
string msg = "OnAdExposured";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
......
......@@ -37,10 +37,10 @@ public class GDTFeedAdUtil
public void LoadCacheFeedAd(AdEntity entity, Action<bool> callback)
{
//string PosId = Constants.nativeExpressPosId;//不带视频的大图广告
string PosId = Constants.nativeExpressVideoPosId;//带视频的大图广告
//string PosId = Constants.nativeExpressVideoPosId;//带视频的大图广告
NativeExpressAd ad = new NativeExpressAd(PosId, GetAdSize());
ad.SetListener(new FeedAdListener(callback));
NativeExpressAd ad = new NativeExpressAd(entity.codeId, GetAdSize());
ad.SetListener(new FeedAdListener(entity,callback));
ad.LoadAd(1);
}
......@@ -48,7 +48,7 @@ public class GDTFeedAdUtil
/// 展示缓存的FeedAd
/// </summary>
/// <param name="entity"></param>
public void ShowCacheFeedAd(AdEntity entity)
public void ShowCacheFeedAd(AdEntity entity,Action<bool> callback)
{
if (feedAd != null)
{
......@@ -57,7 +57,6 @@ public class GDTFeedAdUtil
if (feedAdCacheList.Count > 0)
{
feedAd = feedAdCacheList.Dequeue();
#if UNITY_IOS
// iOS 广告加载完毕即可展示
feedAd.Render();
......@@ -82,6 +81,7 @@ public class GDTFeedAdUtil
}
else
{
callback(false);
Debug.Log("GDT Feed广告没有缓存数据了");
}
......@@ -101,9 +101,11 @@ public class GDTFeedAdUtil
private sealed class FeedAdListener: INativeExpressAdListener
{
private AdEntity entity;
private Action<bool> callback;
public FeedAdListener(Action<bool> callback)
public FeedAdListener(AdEntity entity,Action<bool> callback)
{
this.entity = entity;
this.callback = callback;
}
......@@ -150,6 +152,7 @@ public class GDTFeedAdUtil
/// </summary>
public void OnAdViewRenderSuccess(NativeExpressAdView adView)
{
callback(true);
string msg = "OnAdViewRenderSuccess";
Debug.unityLogger.Log(Constants.tagForLog, msg);
//Debug.unityLogger.Log(Constants.tagForLog, "nativeexpressad ecpmlevel=" + example.view.GetECPMLevel());
......@@ -160,6 +163,7 @@ public class GDTFeedAdUtil
/// </summary>
public void OnAdViewRenderFailed(NativeExpressAdView adView)
{
callback(false);
string msg = "OnAdViewRenderFailed";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
......@@ -169,6 +173,7 @@ public class GDTFeedAdUtil
/// </summary>
public void OnAdExposured(NativeExpressAdView adView)
{
callback(true);
string msg = "OnAdExposured";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
......@@ -299,6 +304,7 @@ public class GDTFeedAdUtil
/// </summary>
public void OnVideoError(NativeExpressAdView adView, AdError error)
{
callback(false);
string msg = "OnVideoError" + error.GetErrorMsg();
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
......
......@@ -96,8 +96,6 @@ public class GDTFullScreenAdUtil
callback(true);
example.SetFSVideoAd(entity.codeGroup+entity.codeId, ad);
}
string msg = "OnAdLoaded";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -114,8 +112,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnAdShown()
{
string msg = "OnAdShown";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -127,8 +124,6 @@ public class GDTFullScreenAdUtil
{
listener.onAdShow();
}
string msg = "OnAdExposured";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -140,8 +135,6 @@ public class GDTFullScreenAdUtil
{
listener.onAdVideoBarClick();
}
string msg = "OnAdClicked";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -149,8 +142,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnAdLeaveApp()
{
string msg = "OnAdLeaveApp";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -166,8 +158,6 @@ public class GDTFullScreenAdUtil
}
listener.onAdClose();
}
string msg = "OnAdClosed";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
#if UNITY_ANDROID
......@@ -177,8 +167,7 @@ public class GDTFullScreenAdUtil
public void OnVideoCached()
{
// 视频素材加载完成,在此时调用展示,视频广告不会有进度条。
string msg = "OnVideoCached";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
#endif
......@@ -187,8 +176,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnVideoInit()
{
string msg = "OnVideoInit";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -196,8 +184,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnVideoLoading()
{
string msg = "OnVideoLoading";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -209,8 +196,6 @@ public class GDTFullScreenAdUtil
{
listener.onSuccess();
}
string msg = "OnVideoStarted";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -218,8 +203,6 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnVideoPaused()
{
string msg = "OnVideoPaused";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -229,8 +212,6 @@ public class GDTFullScreenAdUtil
{
isSkipAd = false;
string msg = "OnVideoCompleted";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -243,8 +224,6 @@ public class GDTFullScreenAdUtil
listener.onError("GDT 全屏视频播放失败");
}
callback(false);
string msg = "OnVideoError";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -252,8 +231,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnVideoDetailPageShown()
{
string msg = "OnVideoDetailPageShown";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -261,8 +239,7 @@ public class GDTFullScreenAdUtil
/// </summary>
public void OnVideoDetailPageClosed()
{
string msg = "OnVideoDetailPageClosed";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
}
......
......@@ -35,10 +35,10 @@ public class GDTInterstitialAdUtil
public void LoadCacheInterstitialAd(AdEntity entity, Action<bool> callback)
{
string posId = Constants.intersititialVideoPosId;//带视频插屏测试广告
//string posId = Constants.intersititialVideoPosId;//带视频插屏测试广告
//string posId = Constants.intersititialNoVideoPosId;//不带视频的插屏广告测试Id
UnifiedInterstitialAd ad = new UnifiedInterstitialAd(posId);
UnifiedInterstitialAd ad = new UnifiedInterstitialAd(entity.codeId);
ad.SetListener(new UnifiedInterstitialAdListener(ad,callback));
ad.LoadAd();
}
......@@ -47,15 +47,17 @@ public class GDTInterstitialAdUtil
/// 播放缓存的插屏广告
/// </summary>
/// <param name="entity"></param>
public void PlayCacheInterstitialAd(AdEntity entity)
public void PlayCacheInterstitialAd(AdEntity entity,Action<bool> callback)
{
if (interstitialAdCacheList.Count > 0)
{
UnifiedInterstitialAd interAd = interstitialAdCacheList.Dequeue();
interAd.SetListener(new UnifiedInterstitialAdListener(interAd, callback));
interAd.Show();
}
else
{
callback(false);
Debug.Log("GDT 插屏广告没有缓存数据了");
}
}
......@@ -82,8 +84,6 @@ public class GDTInterstitialAdUtil
{
interstitialAdCacheList.Enqueue(ad);
callback(true);
string msg = "OnAdLoaded";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -92,8 +92,6 @@ public class GDTInterstitialAdUtil
public void OnError(AdError error)
{
callback(false);
string msg = "OnError" + error.GetErrorMsg();
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -101,8 +99,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdShown()
{
string msg = "OnAdShown";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -110,8 +107,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdExposured()
{
string msg = "OnAdExposured";
Debug.unityLogger.Log(Constants.tagForLog, msg);
callback(true);
}
/// <summary>
......@@ -119,8 +115,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdClicked()
{
string msg = "OnAdClicked";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -128,8 +123,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdLeaveApp()
{
string msg = "OnAdLeaveApp";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -137,8 +131,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdClosed()
{
string msg = "OnAdClosed";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
#if UNITY_ANDROID
......@@ -148,8 +141,7 @@ public class GDTInterstitialAdUtil
public void OnVideoCached()
{
// 视频素材加载完成,在此时调用展示,视频广告不会有进度条。
string msg = "OnVideoCached";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
#endif
......@@ -158,8 +150,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoInit()
{
string msg = "OnVideoInit";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -167,8 +158,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoLoading()
{
string msg = "OnVideoLoading";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -176,8 +166,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoStarted()
{
string msg = "OnVideoStarted";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -185,8 +174,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoPaused()
{
string msg = "OnVideoPaused";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -194,8 +182,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoCompleted()
{
string msg = "OnVideoCompleted";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -203,8 +190,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoError()
{
string msg = "OnVideoError";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -212,8 +198,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoDetailPageShown()
{
string msg = "OnVideoDetailPageShown";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
/// <summary>
......@@ -221,8 +206,7 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnVideoDetailPageClosed()
{
string msg = "OnVideoDetailPageClosed";
Debug.unityLogger.Log(Constants.tagForLog, msg);
}
}
}
......@@ -28,9 +28,9 @@ public class GDTRewardAdUtil
/// <param name="callback"></param>
public void LoadCacheRewardAd(AdEntity entity, Action<bool> callback)
{
RewardVideoAd rewardVideoAd = new RewardVideoAd(Constants.rewardVideoPosId);
RewardVideoAd rewardVideoAd = new RewardVideoAd(entity.codeId);
rewardVideoAd.SetListener(new RewardVideoAdListener(this, entity, rewardVideoAd, callback, true));
rewardVideoAd.SetVideoMuted(false);//设置声音
rewardVideoAd.SetVideoMuted(true);//设置声音
rewardVideoAd.LoadAd();
}
......@@ -50,7 +50,7 @@ public class GDTRewardAdUtil
#if UNITY_IOS
rewardAd.SetEnableDefaultAudioSessionSetting(false);
#endif
rewardAd.SetVideoMuted(false);//设置是否打开声音
rewardAd.SetVideoMuted(true);//设置是否打开声音
rewardAd.ShowAD();
}
else
......@@ -128,11 +128,13 @@ public class GDTRewardAdUtil
public void OnError(AdError error)
{
if (listener != null)
{
listener.onError("GDT RewardVideo ErrorCode" + error.GetErrorCode() + " Msg:" + error.GetErrorMsg());
}
callback(false);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entity.adPlatform + " 激励视频 Error Group" + entity.codeGroup + " Code " + error.GetErrorCode() + " msg" + error.GetErrorMsg());
}
public void OnRewarded()
......
......@@ -9,6 +9,7 @@ PluginImporter:
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
......
fileFormatVersion: 2
guid: ea5489225a2e4482096765b124c62e25
guid: cbfc243b533794f4a9a553e3e085f2be
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
......@@ -16,7 +16,9 @@ public class Splash : MonoBehaviour
/// </summary>
private void Awake()
{
//Application.runInBackground = true;
}
/// <summary>
......@@ -46,6 +48,7 @@ public class Splash : MonoBehaviour
{
yield return new WaitForSeconds(3f);
AdManager.Instance.LoadSplashAd(new SplshAdListener());
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
private sealed class SplshAdListener : ZXADSplashListener
......@@ -61,6 +64,7 @@ public class Splash : MonoBehaviour
public void onError(string errorMsg)
{
SceneManager.LoadScene("AdDemo");
}
}
......
fileFormatVersion: 2
guid: ddf78793cf99f4b699c5a9dcf9cc2b60
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,7 +2,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityEngine.Android;
using UnityEngine.UI;
......@@ -36,7 +35,7 @@ public class HttpTest : MonoBehaviour
public void OnClickPost()
{
Dictionary<string, string> d = new Dictionary<string, string>();
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("type", "1");
//HttpTool.Instance._Post("app/v1/game/xynt/use_fertilize", "", null, actionRes);
HttpTool.Instance._Post("app/v1/game/xynt/box_reward", d, new Action<TestBean>((bean) =>
......@@ -80,7 +79,7 @@ public class HttpTest : MonoBehaviour
AndroidJavaClass cpuUtils = new AndroidJavaClass(
"com.unity.adcommon.unity.CpuUtils");
Dictionary<string, string> d = new Dictionary<string, string>();
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("md5", PrefenceUtils.GetInstance().getMd5());
d.Add("type", cpuUtils.CallStatic<string>("getArchType"));
HttpTool.Instance._Get("app/v1/novel/info", d, new Action<TestBean>((bean) =>
......
This diff is collapsed.
......@@ -12,12 +12,12 @@ EditorBuildSettings:
path: Assets/AD/GDT/UnionDemo/UnionExample.unity
guid: 6c963ae210fa3c3438c2f6770ee81fc9
- enabled: 1
path: Assets/Splash/Splash.unity
path: Assets/Game/Splash/Splash.unity
guid: 37af8cf3fb373478ab04e3ee2f3b700a
- enabled: 1
path: Assets/AD/Demo/AdDemo.unity
guid: ef80a35d44f809e4a8957d1ed9571fd2
- enabled: 1
- enabled: 0
path: Assets/NetWork/Demo/HttpDemo.unity
guid: 1d254830c8b62484bb74d303cbb2cc3d
m_configObjects: {}
......@@ -262,15 +262,15 @@ PlayerSettings:
AndroidTargetArchitectures: 1
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidKeystoreName: D:/antearn.jks
AndroidKeyaliasName: antearn
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0
androidUseCustomKeystore: 1
m_AndroidBanners:
- width: 320
height: 180
......@@ -654,7 +654,8 @@ PlayerSettings:
webGLWasmStreaming: 0
scriptingDefineSymbols: {}
platformArchitecture: {}
scriptingBackend: {}
scriptingBackend:
Android: 0
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
......@@ -664,7 +665,8 @@ PlayerSettings:
gcIncremental: 1
assemblyVersionValidation: 1
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform: {}
apiCompatibilityLevelPerPlatform:
Android: 6
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: 2D_BuiltInRenderer
......
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