Commit 2a244c94 authored by 王雪伟's avatar 王雪伟

Merge branch 'zxad_1.3.5' of gitlab.huolea.com:wangxuewei/zxad_unity into zxad_1.3.5

parents 899d5346 4f37171d
......@@ -57,11 +57,11 @@ public class CSJRewardUtil
.SetCodeId(iosSlotID)
#else
.SetCodeId(AndroidSlotID)
.SetRewardName("金币") // 奖励的名称
.SetRewardAmount(3) // 奖励的数量
#endif
.SetSupportDeepLink(true)
.SetImageAcceptedSize(1080, 1920)
.SetRewardName("金币") // 奖励的名称
.SetRewardAmount(3) // 奖励的数量
.SetUserID("user123") // 用户id,必传参数
.SetMediaExtra("media_extra") // 附加参数,可选
.SetOrientation(AdOrientation.Horizontal) // 必填参数,期望视频的播放方向
......
......@@ -59,8 +59,15 @@ public class CSJSplshADUtils
/// <param name="activity"></param>
/// <param name="splashAdManager"></param>
/// <param name="listener"></param>
public void LoadSplshAd(AdEntity entity,AndroidJavaObject activity, AndroidJavaObject splashAdManager, ZXADSplashListener listener, Action<bool> callback)
public void LoadSplshAd(AdEntity entity, AndroidJavaObject activity, AndroidJavaObject splashAdManager, ZXADSplashListener listener, Action<bool> callback)
{
#if UNITY_IOS
if (this.splashAd != null)
{
this.splashAd.Dispose();
this.splashAd = null;
}
#endif
//string iosSlotID = "800546808";
//string AndroidSlotID = "801121648";
string iosSlotID = entity.codeId;
......@@ -81,7 +88,7 @@ public class CSJSplshADUtils
.SetImageAcceptedSize(1080, 1920)
.Build();
#if UNITY_IOS
this.AdNative.LoadSplashAd(adSlot, new SplashAdListener(entity,this,listener,callback));
splashAd = this.AdNative.LoadSplashAd_iOS(adSlot, new SplashAdListener(entity, this, listener, callback));
#else
this.AdNative.LoadSplashAd(adSlot, new SplashAdListener(entity,this, listener, activity, splashAdManager, callback));
#endif
......@@ -99,7 +106,7 @@ public class CSJSplshADUtils
private AndroidJavaObject activity;
private AndroidJavaObject splashAdManager;
private const int INTERACTION_TYPE_DOWNLOAD = 4;
public SplashAdListener(AdEntity entity,CSJSplshADUtils example, ZXADSplashListener listener, Action<bool> callback)
public SplashAdListener(AdEntity entity, CSJSplshADUtils example, ZXADSplashListener listener, Action<bool> callback)
{
this.entity = entity;
this.csjAD = example;
......@@ -107,7 +114,7 @@ public class CSJSplshADUtils
this.callback = callback;
}
public SplashAdListener(AdEntity entity,CSJSplshADUtils example, ZXADSplashListener listener, AndroidJavaObject activity, AndroidJavaObject splashAdManager, Action<bool> callback)
public SplashAdListener(AdEntity entity, CSJSplshADUtils example, ZXADSplashListener listener, AndroidJavaObject activity, AndroidJavaObject splashAdManager, Action<bool> callback)
{
this.entity = entity;
this.csjAD = example;
......@@ -127,6 +134,7 @@ public class CSJSplshADUtils
public void OnSplashAdLoad(BUSplashAd ad)
{
EventUtils.onEventPullSuccess(entity);
if (ad != null)
{
......@@ -134,7 +142,7 @@ public class CSJSplshADUtils
this.csjAD.splashAd = ad;
Debug.Log("splash load Onsucc:");
#if UNITY_IOS
ad.SetSplashInteractionListener(new SplashAdInteractionListener(entity,this.csjAD,listener));
ad.SetSplashInteractionListener(new SplashAdInteractionListener(entity, this.csjAD, listener));
#else
ad.SetSplashInteractionListener(new SplashAdInteractionListener(entity,this.csjAD, listener, this.activity, this.splashAdManager));
if (ad.GetInteractionType() == INTERACTION_TYPE_DOWNLOAD)
......@@ -144,6 +152,20 @@ public class CSJSplshADUtils
}
#endif
}
#if UNITY_IOS
else if (this.csjAD.splashAd != null)
{
callback(true);
ad = this.csjAD.splashAd;
Debug.Log("splash load Onsucc:");
ad.SetSplashInteractionListener(new SplashAdInteractionListener(entity, this.csjAD, listener));
}
#endif
else
{
callback(false);
}
#if UNITY_ANDROID
if (ad != null && this.splashAdManager != null && this.activity != null)
{
......@@ -160,7 +182,7 @@ public class CSJSplshADUtils
private ZXADSplashListener listener;
private AndroidJavaObject activity;
private AndroidJavaObject splashAdManager;
public SplashAdInteractionListener(AdEntity entity,CSJSplshADUtils example, ZXADSplashListener listener)
public SplashAdInteractionListener(AdEntity entity, CSJSplshADUtils example, ZXADSplashListener listener)
{
this.entity = entity;
this.csjAD = example;
......@@ -225,7 +247,6 @@ public class CSJSplshADUtils
#if UNITY_ANDROID
DestorySplash();
#endif
}
/// <summary>
......
fileFormatVersion: 2
guid: a7e20345cf807564fbfb4c3d2779e72f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,7 +11,7 @@
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.common": {
"version": "2.1.0",
......@@ -21,21 +21,21 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.path": {
"version": "2.1.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.pixel-perfect": {
"version": "2.1.0",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.psdimporter": {
"version": "2.1.6",
......@@ -46,7 +46,7 @@
"com.unity.2d.animation": "3.2.5",
"com.unity.2d.sprite": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.sprite": {
"version": "1.0.0",
......@@ -63,7 +63,7 @@
"com.unity.2d.common": "2.0.2",
"com.unity.2d.path": "2.0.6"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.2d.tilemap": {
"version": "1.0.0",
......@@ -76,14 +76,14 @@
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "1.1.4",
......@@ -92,28 +92,28 @@
"dependencies": {
"com.unity.test-framework": "1.1.1"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.3",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.1.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.mobile.android-logcat": {
"version": "1.2.1",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.mobile.notifications": {
"version": "1.3.2",
......@@ -122,7 +122,7 @@
"dependencies": {
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.22",
......@@ -133,7 +133,7 @@
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "2.1.3",
......@@ -142,7 +142,7 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.2.18",
......@@ -154,7 +154,7 @@
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.cn"
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
......
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