Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZxAd_Unity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
ZxAd_Unity
Commits
6fa33815
Commit
6fa33815
authored
Apr 09, 2021
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复激励视频加载问题
parent
66af472f
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
154 additions
and
129 deletions
+154
-129
AdManager.cs
Assets/AdSDK/AD/AD_Manager/AdManager.cs
+38
-44
ZXADRewardVideoListener.cs
.../AdSDK/AD/AD_Manager/Interface/ZXADRewardVideoListener.cs
+1
-1
ZXADSplashListener.cs
Assets/AdSDK/AD/AD_Manager/Interface/ZXADSplashListener.cs
+2
-0
ZXADConfig.cs
Assets/AdSDK/AD/AD_Manager/ZXADConfig.cs
+17
-11
CSJFullScreenUtil.cs
Assets/AdSDK/AD/CSJ/CSJFullScreenUtil.cs
+10
-10
CSJRewardUtil.cs
Assets/AdSDK/AD/CSJ/CSJRewardUtil.cs
+14
-11
CSJSplshADUtils.cs
Assets/AdSDK/AD/CSJ/CSJSplshADUtils.cs
+1
-1
AdDemo.cs
Assets/AdSDK/AD/Demo/AdDemo.cs
+7
-3
AdDemo.unity
Assets/AdSDK/AD/Demo/AdDemo.unity
+1
-1
GDTFullScreenAdUtil.cs
Assets/AdSDK/AD/GDT/GDTFullScreenAdUtil.cs
+14
-9
GDTRewardAdUtil.cs
Assets/AdSDK/AD/GDT/GDTRewardAdUtil.cs
+16
-14
YLBRewardAdUtil.cs
Assets/AdSDK/AD/YLB/YlbDemo/YLBRewardAdUtil.cs
+8
-8
Example.cs
Assets/AdSDK/AD/ZXHC/ZXHCDemo/Example.cs
+6
-2
ZXHCFeedUtil.cs
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCFeedUtil.cs
+5
-5
ZXHCSplashUtil.cs
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCSplashUtil.cs
+4
-4
zxhcsdk-release.aar
...AdSDK/AD/ZXHC/ZxHCSDK/Plugins/Android/zxhcsdk-release.aar
+0
-0
ZXHCADManager.cs
Assets/AdSDK/AD/ZXHC/ZxHCSDK/common/ZXHCADManager.cs
+2
-2
Splash.cs
Assets/AdSDK/SplashDemo/Splash.cs
+5
-0
EditorBuildSettings.asset
ProjectSettings/EditorBuildSettings.asset
+2
-2
ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+1
-1
No files found.
Assets/AdSDK/AD/AD_Manager/AdManager.cs
View file @
6fa33815
...
@@ -90,14 +90,12 @@ public class AdManager
...
@@ -90,14 +90,12 @@ public class AdManager
jc2
.
CallStatic
(
"initYLB"
,
id
.
codeAppId
);
jc2
.
CallStatic
(
"initYLB"
,
id
.
codeAppId
);
}
}
#endif
#endif
break
;
break
;
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
#if UNITY_ANDROID
#if UNITY_ANDROID
if
(
id
.
codeAppId
!=
null
&&
id
.
codeAppId
!=
""
)
if
(
id
.
codeAppId
!=
null
&&
id
.
codeAppId
!=
""
)
{
{
ZXHCADManager
.
Init
(
id
.
codeAppId
);
ZXHCADManager
.
Init
(
id
.
codeAppId
,
HttpTool
.
Instance
.
IS_TEST
);
//掌心汇川拉取广告需要oaid
ZXHCUtils
.
SetDeviceOaid
(
"1231wsd3242f"
);
}
}
#endif
#endif
break
;
break
;
...
@@ -192,6 +190,10 @@ public class AdManager
...
@@ -192,6 +190,10 @@ public class AdManager
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
mLoadSplashPlatform
(
entity
,
listener
,
SplashAdCallBack
);
mLoadSplashPlatform
(
entity
,
listener
,
SplashAdCallBack
);
}
}
else
{
listener
.
onLastError
();
}
}
}
});
});
mLoadSplashPlatform
(
entity
,
listener
,
SplashAdCallBack
);
mLoadSplashPlatform
(
entity
,
listener
,
SplashAdCallBack
);
...
@@ -221,7 +223,7 @@ public class AdManager
...
@@ -221,7 +223,7 @@ public class AdManager
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
//广点通开屏广告
//广点通开屏广告
GDTSplshAdUtils
.
Instance
.
LoadSplshAd
(
entity
,
listener
,
callback
);
GDTSplshAdUtils
.
Instance
.
LoadSplshAd
(
entity
,
listener
,
callback
);
break
;
break
;
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
//掌心汇川开屏广告
//掌心汇川开屏广告
ZXHCSplashUtil
.
Instance
.
LoadSplshAd
(
entity
,
listener
,
callback
);
ZXHCSplashUtil
.
Instance
.
LoadSplshAd
(
entity
,
listener
,
callback
);
...
@@ -468,7 +470,7 @@ public class AdManager
...
@@ -468,7 +470,7 @@ public class AdManager
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
//广点通大图广告加载
//广点通大图广告加载
GDTFeedAdUtil
.
Instance
.
LoadCacheFeedAd
(
entity
,
callback
);
GDTFeedAdUtil
.
Instance
.
LoadCacheFeedAd
(
entity
,
callback
);
break
;
break
;
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
//掌心汇川大图广告加载
//掌心汇川大图广告加载
ZXHCFeedUtil
.
Instance
.
LoadCacheFeedAd
(
entity
,
callback
);
ZXHCFeedUtil
.
Instance
.
LoadCacheFeedAd
(
entity
,
callback
);
...
@@ -519,13 +521,13 @@ public class AdManager
...
@@ -519,13 +521,13 @@ public class AdManager
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
case
ZXADConfig
.
PLANTFORM_AD_GDT
:
//广点通大图广告加载
//广点通大图广告加载
GDTFeedAdUtil
.
Instance
.
ShowCacheFeedAd
(
entity
,
callback
);
GDTFeedAdUtil
.
Instance
.
ShowCacheFeedAd
(
entity
,
callback
);
break
;
break
;
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
case
ZXADConfig
.
PLANTFORM_AD_ZXHC
:
//掌心汇川大图广告加载
//掌心汇川大图广告加载
ZXHCFeedUtil
.
Instance
.
ShowCacheFeedAd
(
entity
,
callback
);
ZXHCFeedUtil
.
Instance
.
ShowCacheFeedAd
(
entity
,
callback
);
break
;
break
;
default
:
default
:
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持Show"
+
entity
.
adPlatform
+
"的大图广告"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持Show"
+
entity
.
adPlatform
+
"的大图广告"
);
callback
(
false
);
callback
(
false
);
break
;
break
;
}
}
...
@@ -751,7 +753,7 @@ public class AdManager
...
@@ -751,7 +753,7 @@ public class AdManager
/// <summary>
/// <summary>
/// 根据广告List开始加载全屏视频缓存A
/// 根据广告List开始加载全屏视频缓存A
/// </summary>
/// </summary>
private
Action
<
bool
>
FSVideoAdCallBackA
;
private
Action
<
AdEntity
>
FSVideoAdCallBackA
;
private
void
mLoadFSVideoCacheAd_A
(
string
sloatName
,
List
<
AdEntity
>
adList
)
private
void
mLoadFSVideoCacheAd_A
(
string
sloatName
,
List
<
AdEntity
>
adList
)
{
{
if
(
adList
==
null
||
adList
.
Count
==
0
)
if
(
adList
==
null
||
adList
.
Count
==
0
)
...
@@ -770,12 +772,12 @@ public class AdManager
...
@@ -770,12 +772,12 @@ public class AdManager
//移除第一条数据
//移除第一条数据
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
FSVideoAdCallBackA
=
new
Action
<
bool
>((
bl
)
=>
FSVideoAdCallBackA
=
new
Action
<
AdEntity
>((
bl
)
=>
{
{
if
(
bl
)
if
(
bl
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"全屏视频A组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"全屏视频A组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
entity
,
"A"
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
bl
,
"A"
);
}
}
else
else
{
{
...
@@ -796,7 +798,7 @@ public class AdManager
...
@@ -796,7 +798,7 @@ public class AdManager
/// <summary>
/// <summary>
/// 根据广告List开始加载全屏视频缓存B
/// 根据广告List开始加载全屏视频缓存B
/// </summary>
/// </summary>
private
Action
<
bool
>
FSVideoAdCallBackB
;
private
Action
<
AdEntity
>
FSVideoAdCallBackB
;
private
void
mLoadFSVideoCacheAd_B
(
string
sloatName
,
List
<
AdEntity
>
adList
)
private
void
mLoadFSVideoCacheAd_B
(
string
sloatName
,
List
<
AdEntity
>
adList
)
{
{
if
(
adList
==
null
||
adList
.
Count
==
0
)
if
(
adList
==
null
||
adList
.
Count
==
0
)
...
@@ -809,12 +811,12 @@ public class AdManager
...
@@ -809,12 +811,12 @@ public class AdManager
//移除第一条数据
//移除第一条数据
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
FSVideoAdCallBackB
=
new
Action
<
bool
>((
bl
)
=>
FSVideoAdCallBackB
=
new
Action
<
AdEntity
>((
bl
)
=>
{
{
if
(
bl
)
if
(
bl
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"全屏视频B组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"全屏视频B组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
entity
,
"B"
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
bl
,
"B"
);
}
}
else
else
{
{
...
@@ -840,7 +842,7 @@ public class AdManager
...
@@ -840,7 +842,7 @@ public class AdManager
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
private
void
mLoadFSVideoAdPlatform
(
AdEntity
entity
,
Action
<
bool
>
callback
)
private
void
mLoadFSVideoAdPlatform
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
switch
(
entity
.
adPlatform
)
switch
(
entity
.
adPlatform
)
{
{
...
@@ -854,7 +856,7 @@ public class AdManager
...
@@ -854,7 +856,7 @@ public class AdManager
break
;
break
;
default
:
default
:
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持加载"
+
entity
.
adPlatform
+
"的全屏广告"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持加载"
+
entity
.
adPlatform
+
"的全屏广告"
);
callback
(
false
);
callback
(
null
);
break
;
break
;
}
}
}
}
...
@@ -885,6 +887,8 @@ public class AdManager
...
@@ -885,6 +887,8 @@ public class AdManager
entity
=
entityB
;
entity
=
entityB
;
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
}
}
entityA
=
null
;
entityB
=
null
;
}
}
else
if
(
entityA
!=
null
)
else
if
(
entityA
!=
null
)
{
{
...
@@ -1005,7 +1009,7 @@ public class AdManager
...
@@ -1005,7 +1009,7 @@ public class AdManager
/// <summary>
/// <summary>
/// 根据广告List开始加载激励视频缓存A组
/// 根据广告List开始加载激励视频缓存A组
/// </summary>
/// </summary>
private
Action
<
bool
>
rewardVideoAdCallBackA
;
private
Action
<
AdEntity
>
rewardVideoAdCallBackA
;
private
void
mLoadRewardVideoCacheAd_A
(
string
sloatName
,
List
<
AdEntity
>
adList
)
private
void
mLoadRewardVideoCacheAd_A
(
string
sloatName
,
List
<
AdEntity
>
adList
)
{
{
if
(
adList
==
null
||
adList
.
Count
==
0
)
if
(
adList
==
null
||
adList
.
Count
==
0
)
...
@@ -1024,12 +1028,12 @@ public class AdManager
...
@@ -1024,12 +1028,12 @@ public class AdManager
//移除第一条数据
//移除第一条数据
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
rewardVideoAdCallBackA
=
new
Action
<
bool
>((
bl
)
=>
rewardVideoAdCallBackA
=
new
Action
<
AdEntity
>((
bl
)
=>
{
{
if
(
bl
)
if
(
bl
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频A组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频A组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
entity
,
"A"
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
bl
,
"A"
);
}
}
else
else
{
{
...
@@ -1050,7 +1054,7 @@ public class AdManager
...
@@ -1050,7 +1054,7 @@ public class AdManager
/// <summary>
/// <summary>
/// 根据广告List开始加载激励视频缓存
/// 根据广告List开始加载激励视频缓存
/// </summary>
/// </summary>
private
Action
<
bool
>
rewardVideoAdCallBackB
;
private
Action
<
AdEntity
>
rewardVideoAdCallBackB
;
private
void
mLoadRewardVideoCacheAd_B
(
string
sloatName
,
List
<
AdEntity
>
adList
)
private
void
mLoadRewardVideoCacheAd_B
(
string
sloatName
,
List
<
AdEntity
>
adList
)
{
{
if
(
adList
==
null
||
adList
.
Count
==
0
)
if
(
adList
==
null
||
adList
.
Count
==
0
)
...
@@ -1063,12 +1067,12 @@ public class AdManager
...
@@ -1063,12 +1067,12 @@ public class AdManager
//移除第一条数据
//移除第一条数据
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
rewardVideoAdCallBackB
=
new
Action
<
bool
>((
bl
)
=>
rewardVideoAdCallBackB
=
new
Action
<
AdEntity
>((
bl
)
=>
{
{
if
(
bl
)
if
(
bl
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频B组缓存成功 "
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频B组缓存成功 "
+
bl
.
adPlatform
+
" CodeID "
+
bl
.
codeId
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
entity
,
"B"
);
ZXADConfig
.
Instance
.
SetAdCache
(
sloatName
,
bl
,
"B"
);
}
}
else
else
{
{
...
@@ -1090,7 +1094,7 @@ public class AdManager
...
@@ -1090,7 +1094,7 @@ public class AdManager
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
private
void
mLoadRewardVideoAdPlatform
(
AdEntity
entity
,
Action
<
bool
>
callback
)
private
void
mLoadRewardVideoAdPlatform
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"开始加载"
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"开始加载"
+
entity
.
adPlatform
+
" CodeID "
+
entity
.
codeId
);
switch
(
entity
.
adPlatform
)
switch
(
entity
.
adPlatform
)
...
@@ -1109,7 +1113,7 @@ public class AdManager
...
@@ -1109,7 +1113,7 @@ public class AdManager
break
;
break
;
default
:
default
:
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持加载"
+
entity
.
adPlatform
+
"的激励视频广告"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持加载"
+
entity
.
adPlatform
+
"的激励视频广告"
);
callback
(
false
);
callback
(
null
);
break
;
break
;
}
}
}
}
...
@@ -1130,7 +1134,7 @@ public class AdManager
...
@@ -1130,7 +1134,7 @@ public class AdManager
if
(
entityA
!=
null
&&
entityB
!=
null
)
if
(
entityA
!=
null
&&
entityB
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频 A组"
+
entityA
.
codePrice
+
" B组"
+
entityB
.
codePrice
+
" 都有缓存数据"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entityA
.
codeGroup
+
"激励视频 A组"
+
entityA
.
codePrice
+
" "
+
entityB
.
codeGroup
+
" B组"
+
entityB
.
codePrice
+
" 都有缓存数据"
);
if
(
entityA
.
codePrice
>=
entityB
.
codePrice
)
if
(
entityA
.
codePrice
>=
entityB
.
codePrice
)
{
{
entity
=
entityA
;
entity
=
entityA
;
...
@@ -1141,6 +1145,8 @@ public class AdManager
...
@@ -1141,6 +1145,8 @@ public class AdManager
entity
=
entityB
;
entity
=
entityB
;
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
}
}
entityA
=
null
;
entityB
=
null
;
//if (IsFirstLoadRewardAd)
//if (IsFirstLoadRewardAd)
//{
//{
// Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频 第一次预加载,直接播放A组");
// Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频 第一次预加载,直接播放A组");
...
@@ -1160,12 +1166,14 @@ public class AdManager
...
@@ -1160,12 +1166,14 @@ public class AdManager
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频 A组 有缓存数据"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频 A组 有缓存数据"
);
entity
=
entityA
;
entity
=
entityA
;
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"A"
);
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"A"
);
entityA
=
null
;
}
}
else
if
(
entityB
!=
null
)
else
if
(
entityB
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频 B组 有缓存数据"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"激励视频 B组 有缓存数据"
);
entity
=
entityB
;
entity
=
entityB
;
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
ZXADConfig
.
Instance
.
RemoveAdCache
(
slotName
,
"B"
);
entityB
=
null
;
}
}
if
(
entity
!=
null
)
if
(
entity
!=
null
)
...
@@ -1184,20 +1192,6 @@ public class AdManager
...
@@ -1184,20 +1192,6 @@ public class AdManager
//listener.onError(entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
//listener.onError(entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
}
}
}));
}));
//mPlayCacheRewardVodeoAdPlatform(entityB, listener, new Action<bool>((bl) =>
//{
// if (bl)
// {
// Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entityB.codeGroup + "播放激励视频成功 " + entityB.adPlatform + " CodeId" + entityB.codeId);
// }
// else
// {
// Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, entityB.codeGroup + "播放激励视频失败 " + entityB.adPlatform + " CodeId" + entityB.codeId);
// //listener.onError(entity.codeGroup + "播放激励视频失败 " + entity.adPlatform + " CodeId" + entity.codeId);
// }
//}));
}
}
else
else
{
{
...
...
Assets/AdSDK/AD/AD_Manager/Interface/ZXADRewardVideoListener.cs
View file @
6fa33815
...
@@ -13,5 +13,5 @@ public interface ZXADRewardVideoListener
...
@@ -13,5 +13,5 @@ public interface ZXADRewardVideoListener
//广告点击
//广告点击
void
onAdVideoBarClick
();
void
onAdVideoBarClick
();
//关闭广告
//关闭广告
void
onAdClose
();
void
onAdClose
(
AdEntity
entity
);
}
}
Assets/AdSDK/AD/AD_Manager/Interface/ZXADSplashListener.cs
View file @
6fa33815
...
@@ -10,4 +10,6 @@ public interface ZXADSplashListener
...
@@ -10,4 +10,6 @@ public interface ZXADSplashListener
void
onAdSkip
();
void
onAdSkip
();
//获取广告 错误 广告
//获取广告 错误 广告
void
onError
(
string
errorMsg
);
void
onError
(
string
errorMsg
);
//最后的开屏也没有展示成功
void
onLastError
();
}
}
Assets/AdSDK/AD/AD_Manager/ZXADConfig.cs
View file @
6fa33815
...
@@ -68,7 +68,7 @@ public class ZXADConfig
...
@@ -68,7 +68,7 @@ public class ZXADConfig
}
}
private
Dictionary
<
string
,
Queue
<
AdEntity
>>
AdCacheMap
=
new
Dictionary
<
string
,
Queue
<
AdEntity
>>();
private
Dictionary
<
string
,
List
<
AdEntity
>>
AdCacheMap
=
new
Dictionary
<
string
,
List
<
AdEntity
>>();
/// <summary>
/// <summary>
/// 保存缓存的广告数据
/// 保存缓存的广告数据
...
@@ -78,16 +78,17 @@ public class ZXADConfig
...
@@ -78,16 +78,17 @@ public class ZXADConfig
/// <param name="type">广告组</param>
/// <param name="type">广告组</param>
public
void
SetAdCache
(
string
slotName
,
AdEntity
entity
,
string
type
)
public
void
SetAdCache
(
string
slotName
,
AdEntity
entity
,
string
type
)
{
{
Queue
<
AdEntity
>
mAdCacheQueue
;
Debug
.
unityLogger
.
Log
(
"Reward"
,
"Admanger Settype"
+
entity
.
adPlatform
+
" "
+
type
);
List
<
AdEntity
>
mAdCacheQueue
;
if
(
AdCacheMap
.
ContainsKey
(
type
+
slotName
))
if
(
AdCacheMap
.
ContainsKey
(
type
+
slotName
))
{
{
mAdCacheQueue
=
AdCacheMap
[
type
+
slotName
];
mAdCacheQueue
=
AdCacheMap
[
type
+
slotName
];
}
}
else
else
{
{
mAdCacheQueue
=
new
Queue
<
AdEntity
>();
mAdCacheQueue
=
new
List
<
AdEntity
>();
}
}
mAdCacheQueue
.
Enqueue
(
entity
);
mAdCacheQueue
.
Add
(
entity
);
AdCacheMap
[
type
+
slotName
]
=
mAdCacheQueue
;
AdCacheMap
[
type
+
slotName
]
=
mAdCacheQueue
;
}
}
...
@@ -101,14 +102,14 @@ public class ZXADConfig
...
@@ -101,14 +102,14 @@ public class ZXADConfig
{
{
if
(
AdCacheMap
.
ContainsKey
(
type
+
slotName
))
if
(
AdCacheMap
.
ContainsKey
(
type
+
slotName
))
{
{
Queue
<
AdEntity
>
mAdCacheQueue
=
AdCacheMap
[
type
+
slotName
];
List
<
AdEntity
>
mAdCacheQueue
=
AdCacheMap
[
type
+
slotName
];
if
(
mAdCacheQueue
!=
null
&&
mAdCacheQueue
.
Count
>
0
)
if
(
mAdCacheQueue
!=
null
&&
mAdCacheQueue
.
Count
>
0
)
{
{
return
mAdCacheQueue
.
Dequeue
()
;
return
mAdCacheQueue
[
0
]
;
}
}
else
else
{
{
AdCacheMap
.
Remove
(
type
+
slotName
);
//
AdCacheMap.Remove(type + slotName);
}
}
}
}
return
null
;
return
null
;
...
@@ -116,10 +117,15 @@ public class ZXADConfig
...
@@ -116,10 +117,15 @@ public class ZXADConfig
public
void
RemoveAdCache
(
string
slotName
,
string
type
)
public
void
RemoveAdCache
(
string
slotName
,
string
type
)
{
{
//if (AdCacheMap.ContainsKey(type + slotName))
if
(
AdCacheMap
.
ContainsKey
(
type
+
slotName
))
//{
{
// AdCacheMap.Remove(type + slotName);
List
<
AdEntity
>
mAdCacheQueue
=
AdCacheMap
[
type
+
slotName
];
//}
if
(
mAdCacheQueue
!=
null
&&
mAdCacheQueue
.
Count
>
0
)
{
mAdCacheQueue
.
RemoveAt
(
0
);
}
//AdCacheMap.Remove(type + slotName);
}
}
}
...
...
Assets/AdSDK/AD/CSJ/CSJFullScreenUtil.cs
View file @
6fa33815
...
@@ -41,7 +41,7 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -41,7 +41,7 @@ public class CSJFullScreenUtil : MonoBehaviour
public
void
LoadCacheFullScreeVideoAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
public
void
LoadCacheFullScreeVideoAd
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
//string iosSlotID = "945113164";
//string iosSlotID = "945113164";
string
iosSlotID
=
entity
.
codeId
;
string
iosSlotID
=
entity
.
codeId
;
...
@@ -68,7 +68,7 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -68,7 +68,7 @@ public class CSJFullScreenUtil : MonoBehaviour
public
void
PlayCacheFullScreeVideoAd
(
AdEntity
entity
,
ZXADFullScreenVideoListener
listener
,
Action
<
bool
>
callback
)
public
void
PlayCacheFullScreeVideoAd
(
AdEntity
entity
,
ZXADFullScreenVideoListener
listener
,
Action
<
bool
>
callback
)
{
{
#if UNITY_IOS
#if UNITY_IOS
ExpressFullScreenVideoAd
fsAd
=
GetFSVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
codeId
);
ExpressFullScreenVideoAd
fsAd
=
GetFSVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
slotName
);
if
(
fsAd
!=
null
)
if
(
fsAd
!=
null
)
{
{
fsAd
.
SetFullScreenVideoAdInteractionListener
(
new
FullScreenAdInteractionListener
(
entity
,
listener
,
callback
));
fsAd
.
SetFullScreenVideoAdInteractionListener
(
new
FullScreenAdInteractionListener
(
entity
,
listener
,
callback
));
...
@@ -82,7 +82,7 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -82,7 +82,7 @@ public class CSJFullScreenUtil : MonoBehaviour
#elif UNITY_ANDROID
#elif UNITY_ANDROID
FullScreenVideoAd
fsAd
=
GetFSVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
codeId
);
FullScreenVideoAd
fsAd
=
GetFSVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
slotName
);
if
(
fsAd
!=
null
)
if
(
fsAd
!=
null
)
{
{
fsAd
.
SetFullScreenVideoAdInteractionListener
(
new
FullScreenAdInteractionListener
(
entity
,
listener
,
callback
));
fsAd
.
SetFullScreenVideoAdInteractionListener
(
new
FullScreenAdInteractionListener
(
entity
,
listener
,
callback
));
...
@@ -103,8 +103,8 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -103,8 +103,8 @@ public class CSJFullScreenUtil : MonoBehaviour
{
{
private
CSJFullScreenUtil
example
;
private
CSJFullScreenUtil
example
;
private
AdEntity
entity
;
private
AdEntity
entity
;
private
Action
<
bool
>
callback
;
private
Action
<
AdEntity
>
callback
;
public
FullScreenVideoAdListener
(
CSJFullScreenUtil
example
,
AdEntity
entity
,
Action
<
bool
>
callback
)
public
FullScreenVideoAdListener
(
CSJFullScreenUtil
example
,
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
this
.
example
=
example
;
this
.
example
=
example
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
...
@@ -114,7 +114,7 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -114,7 +114,7 @@ public class CSJFullScreenUtil : MonoBehaviour
public
void
OnError
(
int
code
,
string
message
)
public
void
OnError
(
int
code
,
string
message
)
{
{
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
callback
(
false
);
callback
(
null
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"CSJ 全屏视频 Error "
+
code
+
" meg "
+
message
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"CSJ 全屏视频 Error "
+
code
+
" meg "
+
message
);
}
}
...
@@ -122,8 +122,8 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -122,8 +122,8 @@ public class CSJFullScreenUtil : MonoBehaviour
{
{
#if UNITY_IOS
#if UNITY_IOS
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
callback
(
true
);
callback
(
entity
);
example
.
SetFSVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
example
.
SetFSVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
slotName
,
ad
);
#endif
#endif
}
}
...
@@ -131,8 +131,8 @@ public class CSJFullScreenUtil : MonoBehaviour
...
@@ -131,8 +131,8 @@ public class CSJFullScreenUtil : MonoBehaviour
{
{
#if UNITY_ANDROID
#if UNITY_ANDROID
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
callback
(
true
);
callback
(
entity
);
example
.
SetFSVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
example
.
SetFSVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
slotName
,
ad
);
#endif
#endif
}
}
...
...
Assets/AdSDK/AD/CSJ/CSJRewardUtil.cs
View file @
6fa33815
...
@@ -45,7 +45,7 @@ public class CSJRewardUtil
...
@@ -45,7 +45,7 @@ public class CSJRewardUtil
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
//string iosSlotID = "945113162";
//string iosSlotID = "945113162";
...
@@ -86,9 +86,9 @@ public class CSJRewardUtil
...
@@ -86,9 +86,9 @@ public class CSJRewardUtil
{
{
#if UNITY_ANDROID
#if UNITY_ANDROID
RewardVideoAd
rewardAd
=
GetRewardVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
codeId
);
RewardVideoAd
rewardAd
=
GetRewardVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
slotName
);
#elif UNITY_IOS
#elif UNITY_IOS
ExpressRewardVideoAd
rewardAd
=
GetRewardVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
codeId
);
ExpressRewardVideoAd
rewardAd
=
GetRewardVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
slotName
);
#endif
#endif
if
(
rewardAd
!=
null
)
if
(
rewardAd
!=
null
)
{
{
...
@@ -109,9 +109,9 @@ public class CSJRewardUtil
...
@@ -109,9 +109,9 @@ public class CSJRewardUtil
{
{
private
CSJRewardUtil
csjAD
;
private
CSJRewardUtil
csjAD
;
private
AdEntity
entity
;
private
AdEntity
entity
;
private
Action
<
bool
>
callback
;
private
Action
<
AdEntity
>
callback
;
public
RewardVideoAdListener
(
CSJRewardUtil
example
,
AdEntity
entity
,
Action
<
bool
>
callback
)
public
RewardVideoAdListener
(
CSJRewardUtil
example
,
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
this
.
csjAD
=
example
;
this
.
csjAD
=
example
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
...
@@ -122,8 +122,8 @@ public class CSJRewardUtil
...
@@ -122,8 +122,8 @@ public class CSJRewardUtil
{
{
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
adPlatform
+
" 激励视频 Error Group"
+
entity
.
codeGroup
+
" Code "
+
code
+
" msg"
+
message
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
adPlatform
+
" 激励视频 Error Group"
+
entity
.
codeGroup
+
" Code "
+
code
+
" msg"
+
message
);
callback
(
false
);
callback
(
null
);
}
}
public
void
OnRewardVideoAdLoad
(
RewardVideoAd
ad
)
public
void
OnRewardVideoAdLoad
(
RewardVideoAd
ad
)
{
{
...
@@ -135,8 +135,8 @@ public class CSJRewardUtil
...
@@ -135,8 +135,8 @@ public class CSJRewardUtil
//this.csjAD.rewardAd = ad;
//this.csjAD.rewardAd = ad;
#if UNITY_ANDROID
#if UNITY_ANDROID
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
this
.
csjAD
.
SetRewardVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
this
.
csjAD
.
SetRewardVideoAdForAndroid
(
entity
.
codeGroup
+
entity
.
slotName
,
ad
);
callback
(
true
);
callback
(
entity
);
#endif
#endif
}
}
...
@@ -144,7 +144,7 @@ public class CSJRewardUtil
...
@@ -144,7 +144,7 @@ public class CSJRewardUtil
{
{
#if UNITY_IOS
#if UNITY_IOS
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
this
.
csjAD
.
SetRewardVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
this
.
csjAD
.
SetRewardVideoAdForIOS
(
entity
.
codeGroup
+
entity
.
slotName
,
ad
);
callback
(
true
);
callback
(
true
);
#endif
#endif
}
}
...
@@ -197,7 +197,7 @@ public class CSJRewardUtil
...
@@ -197,7 +197,7 @@ public class CSJRewardUtil
public
void
OnAdClose
()
public
void
OnAdClose
()
{
{
Debug
.
Log
(
"rewardVideoAd close"
);
Debug
.
Log
(
"rewardVideoAd close"
);
listener
.
onAdClose
();
listener
.
onAdClose
(
entity
);
//this.cjsAd.rewardAd = null;
//this.cjsAd.rewardAd = null;
#if UNITY_IOS
#if UNITY_IOS
...
@@ -271,6 +271,8 @@ public class CSJRewardUtil
...
@@ -271,6 +271,8 @@ public class CSJRewardUtil
{
{
return
mRewardQueue
.
Dequeue
();
return
mRewardQueue
.
Dequeue
();
}
}
}
}
return
null
;
return
null
;
}
}
...
@@ -318,6 +320,7 @@ public class CSJRewardUtil
...
@@ -318,6 +320,7 @@ public class CSJRewardUtil
{
{
return
mRewardQueue
.
Dequeue
();
return
mRewardQueue
.
Dequeue
();
}
}
}
}
return
null
;
return
null
;
}
}
...
...
Assets/AdSDK/AD/CSJ/CSJSplshADUtils.cs
View file @
6fa33815
...
@@ -219,7 +219,7 @@ public class CSJSplshADUtils
...
@@ -219,7 +219,7 @@ public class CSJSplshADUtils
public
void
OnAdSkip
()
public
void
OnAdSkip
()
{
{
EventUtils
.
onEventAdComplete
(
entity
);
EventUtils
.
onEventAdComplete
(
entity
);
listener
.
onAdSkip
();
//
listener.onAdSkip();
Debug
.
Log
(
"splash Ad OnAdSkip"
);
Debug
.
Log
(
"splash Ad OnAdSkip"
);
DestorySplash
();
DestorySplash
();
}
}
...
...
Assets/AdSDK/AD/Demo/AdDemo.cs
View file @
6fa33815
...
@@ -42,11 +42,10 @@ public class AdDemo : MonoBehaviour
...
@@ -42,11 +42,10 @@ public class AdDemo : MonoBehaviour
this
.
demo
=
demo
;
this
.
demo
=
demo
;
}
}
public
void
onAdClose
(
AdEntity
entity
)
public
void
onAdClose
()
{
{
this
.
demo
.
RewardAdResult
.
text
=
"Reward onAdClose"
;
this
.
demo
.
RewardAdResult
.
text
=
"Reward onAdClose"
;
AdManager
.
Instance
.
LoadCacheRewardVideoAd
(
"video"
);
//
AdManager.Instance.LoadCacheRewardVideoAd("video");
//YLBRewardAdUtil.Instance.LoadYLBAd();
//YLBRewardAdUtil.Instance.LoadYLBAd();
}
}
...
@@ -114,6 +113,11 @@ public class AdDemo : MonoBehaviour
...
@@ -114,6 +113,11 @@ public class AdDemo : MonoBehaviour
{
{
this
.
demo
.
RewardAdResult
.
text
=
"开屏错误"
+
errorMsg
;
this
.
demo
.
RewardAdResult
.
text
=
"开屏错误"
+
errorMsg
;
}
}
public
void
onLastError
()
{
}
}
}
...
...
Assets/AdSDK/AD/Demo/AdDemo.unity
View file @
6fa33815
...
@@ -3028,7 +3028,7 @@ PrefabInstance:
...
@@ -3028,7 +3028,7 @@ PrefabInstance:
-
target
:
{
fileID
:
2853166085728200634
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
-
target
:
{
fileID
:
2853166085728200634
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
type
:
3
}
type
:
3
}
propertyPath
:
IS_TEST
propertyPath
:
IS_TEST
value
:
1
value
:
0
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
2853166085728200635
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
-
target
:
{
fileID
:
2853166085728200635
,
guid
:
1053be02c113a7a45adf322c929b0cb6
,
type
:
3
}
type
:
3
}
...
...
Assets/AdSDK/AD/GDT/GDTFullScreenAdUtil.cs
View file @
6fa33815
...
@@ -28,7 +28,7 @@ public class GDTFullScreenAdUtil
...
@@ -28,7 +28,7 @@ public class GDTFullScreenAdUtil
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
LoadCacheFullScreeVideoAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
public
void
LoadCacheFullScreeVideoAd
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
//string posId = Constants.intersititialFullScreenVideoPosId;//全屏视频测试ID
//string posId = Constants.intersititialFullScreenVideoPosId;//全屏视频测试ID
...
@@ -68,22 +68,23 @@ public class GDTFullScreenAdUtil
...
@@ -68,22 +68,23 @@ public class GDTFullScreenAdUtil
private
GDTFullScreenAdUtil
example
;
private
GDTFullScreenAdUtil
example
;
private
UnifiedInterstitialAd
ad
;
private
UnifiedInterstitialAd
ad
;
private
ZXADFullScreenVideoListener
listener
;
private
ZXADFullScreenVideoListener
listener
;
private
Action
<
bool
>
callback
;
private
Action
<
AdEntity
>
loadcallback
;
private
Action
<
bool
>
showcallback
;
private
bool
isSkipAd
;
private
bool
isSkipAd
;
public
UnifiedInterstitialAdListener
(
AdEntity
entity
,
GDTFullScreenAdUtil
example
,
UnifiedInterstitialAd
ad
,
Action
<
bool
>
callback
)
public
UnifiedInterstitialAdListener
(
AdEntity
entity
,
GDTFullScreenAdUtil
example
,
UnifiedInterstitialAd
ad
,
Action
<
AdEntity
>
load
callback
)
{
{
this
.
entity
=
entity
;
this
.
entity
=
entity
;
this
.
example
=
example
;
this
.
example
=
example
;
this
.
ad
=
ad
;
this
.
ad
=
ad
;
this
.
callback
=
callback
;
this
.
loadcallback
=
load
callback
;
}
}
public
UnifiedInterstitialAdListener
(
AdEntity
entity
,
ZXADFullScreenVideoListener
listener
,
Action
<
bool
>
callback
)
public
UnifiedInterstitialAdListener
(
AdEntity
entity
,
ZXADFullScreenVideoListener
listener
,
Action
<
bool
>
show
callback
)
{
{
isSkipAd
=
true
;
isSkipAd
=
true
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
this
.
listener
=
listener
;
this
.
listener
=
listener
;
this
.
callback
=
callback
;
this
.
showcallback
=
show
callback
;
}
}
/// <summary>
/// <summary>
...
@@ -94,8 +95,8 @@ public class GDTFullScreenAdUtil
...
@@ -94,8 +95,8 @@ public class GDTFullScreenAdUtil
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
if
(
ad
!=
null
)
if
(
ad
!=
null
)
{
{
callback
(
true
);
example
.
SetFSVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
example
.
SetFSVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
,
ad
);
loadcallback
(
entity
);
}
}
}
}
...
@@ -105,7 +106,11 @@ public class GDTFullScreenAdUtil
...
@@ -105,7 +106,11 @@ public class GDTFullScreenAdUtil
public
void
OnError
(
AdError
error
)
public
void
OnError
(
AdError
error
)
{
{
EventUtils
.
onEventPullFail
(
entity
,
error
.
GetErrorCode
().
ToString
(),
error
.
GetErrorMsg
());
EventUtils
.
onEventPullFail
(
entity
,
error
.
GetErrorCode
().
ToString
(),
error
.
GetErrorMsg
());
callback
(
false
);
if
(
ad
!=
null
)
{
loadcallback
(
null
);
}
showcallback
(
false
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"GDT 全屏视频 Error "
+
error
.
GetErrorCode
()
+
" meg "
+
error
.
GetErrorMsg
());
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"GDT 全屏视频 Error "
+
error
.
GetErrorCode
()
+
" meg "
+
error
.
GetErrorMsg
());
}
}
...
@@ -229,7 +234,7 @@ public class GDTFullScreenAdUtil
...
@@ -229,7 +234,7 @@ public class GDTFullScreenAdUtil
{
{
listener
.
onError
(
"GDT 全屏视频播放失败"
);
listener
.
onError
(
"GDT 全屏视频播放失败"
);
}
}
callback
(
false
);
show
callback
(
false
);
}
}
/// <summary>
/// <summary>
...
...
Assets/AdSDK/AD/GDT/GDTRewardAdUtil.cs
View file @
6fa33815
...
@@ -26,11 +26,11 @@ public class GDTRewardAdUtil
...
@@ -26,11 +26,11 @@ public class GDTRewardAdUtil
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
RewardVideoAd
rewardVideoAd
=
new
RewardVideoAd
(
entity
.
codeId
);
RewardVideoAd
rewardVideoAd
=
new
RewardVideoAd
(
entity
.
codeId
);
rewardVideoAd
.
SetListener
(
new
RewardVideoAdListener
(
this
,
entity
,
rewardVideoAd
,
callback
,
true
));
rewardVideoAd
.
SetListener
(
new
RewardVideoAdListener
(
this
,
entity
,
rewardVideoAd
,
callback
,
true
));
rewardVideoAd
.
SetVideoMuted
(
false
);
//设置声音
rewardVideoAd
.
SetVideoMuted
(
false
);
//设置
静音
声音
rewardVideoAd
.
LoadAd
();
rewardVideoAd
.
LoadAd
();
}
}
...
@@ -42,7 +42,7 @@ public class GDTRewardAdUtil
...
@@ -42,7 +42,7 @@ public class GDTRewardAdUtil
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
playCacheRewardAd
(
AdEntity
entity
,
ZXADRewardVideoListener
listener
,
Action
<
bool
>
callback
)
public
void
playCacheRewardAd
(
AdEntity
entity
,
ZXADRewardVideoListener
listener
,
Action
<
bool
>
callback
)
{
{
RewardVideoAd
rewardAd
=
GetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
);
RewardVideoAd
rewardAd
=
GetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
slotName
);
if
(
rewardAd
!=
null
)
if
(
rewardAd
!=
null
)
{
{
...
@@ -50,7 +50,7 @@ public class GDTRewardAdUtil
...
@@ -50,7 +50,7 @@ public class GDTRewardAdUtil
#if UNITY_IOS
#if UNITY_IOS
rewardAd
.
SetEnableDefaultAudioSessionSetting
(
false
);
rewardAd
.
SetEnableDefaultAudioSessionSetting
(
false
);
#endif
#endif
rewardAd
.
SetVideoMuted
(
false
);
//设置
是否打开
声音
rewardAd
.
SetVideoMuted
(
false
);
//设置
静音
声音
rewardAd
.
ShowAD
();
rewardAd
.
ShowAD
();
}
}
else
else
...
@@ -69,23 +69,24 @@ public class GDTRewardAdUtil
...
@@ -69,23 +69,24 @@ public class GDTRewardAdUtil
private
GDTRewardAdUtil
gdtAdUtils
;
private
GDTRewardAdUtil
gdtAdUtils
;
private
AdEntity
entity
;
private
AdEntity
entity
;
private
RewardVideoAd
rewardVideo
;
private
RewardVideoAd
rewardVideo
;
private
Action
<
bool
>
callback
;
private
Action
<
AdEntity
>
loadcallback
;
private
Action
<
bool
>
showcallback
;
private
ZXADRewardVideoListener
listener
;
private
ZXADRewardVideoListener
listener
;
public
RewardVideoAdListener
(
GDTRewardAdUtil
gdtAdUtils
,
AdEntity
entity
,
RewardVideoAd
reward
,
Action
<
bool
>
callback
,
bool
isLoad
)
public
RewardVideoAdListener
(
GDTRewardAdUtil
gdtAdUtils
,
AdEntity
entity
,
RewardVideoAd
reward
,
Action
<
AdEntity
>
load
callback
,
bool
isLoad
)
{
{
this
.
isLoad
=
isLoad
;
this
.
isLoad
=
isLoad
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
this
.
gdtAdUtils
=
gdtAdUtils
;
this
.
gdtAdUtils
=
gdtAdUtils
;
this
.
rewardVideo
=
reward
;
this
.
rewardVideo
=
reward
;
this
.
callback
=
callback
;
this
.
loadcallback
=
load
callback
;
}
}
public
RewardVideoAdListener
(
ZXADRewardVideoListener
listener
,
AdEntity
entity
,
Action
<
bool
>
callback
,
bool
isLoad
)
public
RewardVideoAdListener
(
ZXADRewardVideoListener
listener
,
AdEntity
entity
,
Action
<
bool
>
show
callback
,
bool
isLoad
)
{
{
this
.
isLoad
=
isLoad
;
this
.
isLoad
=
isLoad
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
this
.
listener
=
listener
;
this
.
listener
=
listener
;
this
.
callback
=
callback
;
this
.
showcallback
=
show
callback
;
}
}
public
void
OnAdClicked
()
public
void
OnAdClicked
()
...
@@ -101,7 +102,7 @@ public class GDTRewardAdUtil
...
@@ -101,7 +102,7 @@ public class GDTRewardAdUtil
{
{
if
(
listener
!=
null
)
if
(
listener
!=
null
)
{
{
listener
.
onAdClose
();
listener
.
onAdClose
(
entity
);
}
}
}
}
...
@@ -124,7 +125,7 @@ public class GDTRewardAdUtil
...
@@ -124,7 +125,7 @@ public class GDTRewardAdUtil
if
(
listener
!=
null
)
if
(
listener
!=
null
)
{
{
listener
.
onAdShow
();
listener
.
onAdShow
();
callback
(
true
);
show
callback
(
true
);
}
}
}
}
...
@@ -133,16 +134,17 @@ public class GDTRewardAdUtil
...
@@ -133,16 +134,17 @@ public class GDTRewardAdUtil
if
(
isLoad
)
if
(
isLoad
)
{
{
EventUtils
.
onEventPullFail
(
entity
,
error
.
GetErrorCode
().
ToString
(),
error
.
GetErrorMsg
());
EventUtils
.
onEventPullFail
(
entity
,
error
.
GetErrorCode
().
ToString
(),
error
.
GetErrorMsg
());
loadcallback
(
null
);
}
}
else
else
{
{
EventUtils
.
onEventShowFail
(
entity
);
EventUtils
.
onEventShowFail
(
entity
);
showcallback
(
false
);
}
}
if
(
listener
!=
null
)
if
(
listener
!=
null
)
{
{
listener
.
onError
(
"GDT RewardVideo ErrorCode"
+
error
.
GetErrorCode
()
+
" Msg:"
+
error
.
GetErrorMsg
());
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
());
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
adPlatform
+
" 激励视频 Error Group"
+
entity
.
codeGroup
+
" Code "
+
error
.
GetErrorCode
()
+
" msg"
+
error
.
GetErrorMsg
());
}
}
...
@@ -156,8 +158,8 @@ public class GDTRewardAdUtil
...
@@ -156,8 +158,8 @@ public class GDTRewardAdUtil
if
(
isLoad
)
if
(
isLoad
)
{
{
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
this
.
gdtAdUtils
.
SetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
,
this
.
rewardVideo
);
this
.
gdtAdUtils
.
SetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
slotName
,
this
.
rewardVideo
);
callback
(
true
);
loadcallback
(
entity
);
}
}
}
}
...
...
Assets/AdSDK/AD/YLB/YlbDemo/YLBRewardAdUtil.cs
View file @
6fa33815
...
@@ -28,7 +28,7 @@ public class YLBRewardAdUtil
...
@@ -28,7 +28,7 @@ public class YLBRewardAdUtil
/// </summary>
/// </summary>
/// <param name="entity"></param>
/// <param name="entity"></param>
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
AdEntity
>
callback
)
{
{
#if UNITY_ANDROID
#if UNITY_ANDROID
YLBRewardAD
rewardVideoAd
=
new
YLBRewardAD
();
YLBRewardAD
rewardVideoAd
=
new
YLBRewardAD
();
...
@@ -47,7 +47,7 @@ public class YLBRewardAdUtil
...
@@ -47,7 +47,7 @@ public class YLBRewardAdUtil
/// <param name="callback"></param>
/// <param name="callback"></param>
public
void
playCacheRewardAd
(
AdEntity
entity
,
ZXADRewardVideoListener
listener
,
Action
<
bool
>
callback
)
public
void
playCacheRewardAd
(
AdEntity
entity
,
ZXADRewardVideoListener
listener
,
Action
<
bool
>
callback
)
{
{
YLBRewardAD
rewardVideoAd
=
GetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
);
YLBRewardAD
rewardVideoAd
=
GetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
slotName
);
if
(
rewardVideoAd
!=
null
)
if
(
rewardVideoAd
!=
null
)
{
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"YLB Not NUll"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"YLB Not NUll"
);
...
@@ -71,8 +71,8 @@ public class YLBRewardAdUtil
...
@@ -71,8 +71,8 @@ public class YLBRewardAdUtil
private
YLBRewardAdUtil
adUtil
;
private
YLBRewardAdUtil
adUtil
;
private
AdEntity
entity
;
private
AdEntity
entity
;
private
YLBRewardAD
rewardVideo
;
private
YLBRewardAD
rewardVideo
;
private
Action
<
bool
>
callback
;
private
Action
<
AdEntity
>
callback
;
public
RewardVideoAdLoadListener
(
YLBRewardAdUtil
adUtil
,
AdEntity
entity
,
YLBRewardAD
rewardVideo
,
Action
<
bool
>
callback
)
public
RewardVideoAdLoadListener
(
YLBRewardAdUtil
adUtil
,
AdEntity
entity
,
YLBRewardAD
rewardVideo
,
Action
<
AdEntity
>
callback
)
{
{
this
.
adUtil
=
adUtil
;
this
.
adUtil
=
adUtil
;
this
.
entity
=
entity
;
this
.
entity
=
entity
;
...
@@ -84,14 +84,14 @@ public class YLBRewardAdUtil
...
@@ -84,14 +84,14 @@ public class YLBRewardAdUtil
{
{
Debug
.
unityLogger
.
Log
(
entity
.
codeGroup
+
" 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
);
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
callback
(
false
);
callback
(
null
);
}
}
public
void
onLoad
()
public
void
onLoad
()
{
{
EventUtils
.
onEventPullSuccess
(
entity
);
EventUtils
.
onEventPullSuccess
(
entity
);
adUtil
.
SetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
,
this
.
rewardVideo
);
adUtil
.
SetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
slotName
,
this
.
rewardVideo
);
callback
(
true
);
callback
(
entity
);
}
}
}
}
...
@@ -115,7 +115,7 @@ public class YLBRewardAdUtil
...
@@ -115,7 +115,7 @@ public class YLBRewardAdUtil
public
void
onAdClose
()
public
void
onAdClose
()
{
{
listener
.
onAdClose
();
listener
.
onAdClose
(
entity
);
}
}
public
void
onAdShow
()
public
void
onAdShow
()
...
...
Assets/AdSDK/AD/ZXHC/ZXHCDemo/Example.cs
View file @
6fa33815
...
@@ -9,8 +9,7 @@ namespace ZXHC
...
@@ -9,8 +9,7 @@ namespace ZXHC
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
ZXHCADManager
.
Init
(
"1000127"
);
ZXHCADManager
.
Init
(
"1000127"
,
true
);
ZXHCUtils
.
SetDeviceOaid
(
"1231wsd3242f"
);
}
}
// Update is called once per frame
// Update is called once per frame
...
@@ -64,6 +63,11 @@ namespace ZXHC
...
@@ -64,6 +63,11 @@ namespace ZXHC
{
{
Debug
.
unityLogger
.
Log
(
"开屏错误"
+
errorMsg
);
Debug
.
unityLogger
.
Log
(
"开屏错误"
+
errorMsg
);
}
}
public
void
onLastError
()
{
}
}
}
public
void
OnClickOaid
()
public
void
OnClickOaid
()
...
...
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCFeedUtil.cs
View file @
6fa33815
...
@@ -92,29 +92,29 @@ public class ZXHCFeedUtil
...
@@ -92,29 +92,29 @@ public class ZXHCFeedUtil
}
}
public
void
OnAdClicked
()
public
void
OnAdClicked
()
{
{
//
EventUtils.onEventAdClick(entity);
EventUtils
.
onEventAdClick
(
entity
);
}
}
public
void
OnAdClosed
()
public
void
OnAdClosed
()
{
{
//
EventUtils.onEventAdComplete(entity);
EventUtils
.
onEventAdComplete
(
entity
);
}
}
public
void
OnAdLoaded
()
public
void
OnAdLoaded
()
{
{
//
EventUtils.onEventPullSuccess(entity);
EventUtils
.
onEventPullSuccess
(
entity
);
feedAdCacheList
.
Enqueue
(
feedAd
);
feedAdCacheList
.
Enqueue
(
feedAd
);
callback
(
true
);
callback
(
true
);
}
}
public
void
OnAdShow
()
public
void
OnAdShow
()
{
{
//
EventUtils.onEventShowSuccess(entity);
EventUtils
.
onEventShowSuccess
(
entity
);
}
}
public
void
OnError
(
string
code
,
string
error
)
public
void
OnError
(
string
code
,
string
error
)
{
{
//
EventUtils.onEventPullFail(entity, code, error);
EventUtils
.
onEventPullFail
(
entity
,
code
,
error
);
callback
(
false
);
callback
(
false
);
}
}
}
}
...
...
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCSplashUtil.cs
View file @
6fa33815
...
@@ -63,12 +63,12 @@ public class ZXHCSplashUtil
...
@@ -63,12 +63,12 @@ public class ZXHCSplashUtil
public
void
OnAdClicked
()
public
void
OnAdClicked
()
{
{
//
EventUtils.onEventAdClick(entity);
EventUtils
.
onEventAdClick
(
entity
);
}
}
public
void
OnAdClosed
()
public
void
OnAdClosed
()
{
{
//
EventUtils.onEventAdComplete(entity);
EventUtils
.
onEventAdComplete
(
entity
);
this
.
listener
.
onAdSkip
();
this
.
listener
.
onAdSkip
();
}
}
...
@@ -88,13 +88,13 @@ public class ZXHCSplashUtil
...
@@ -88,13 +88,13 @@ public class ZXHCSplashUtil
public
void
OnAdShow
()
public
void
OnAdShow
()
{
{
//
EventUtils.onEventShowSuccess(entity);
EventUtils
.
onEventShowSuccess
(
entity
);
this
.
listener
.
onAdShow
();
this
.
listener
.
onAdShow
();
}
}
public
void
OnError
(
string
code
,
string
error
)
public
void
OnError
(
string
code
,
string
error
)
{
{
//
EventUtils.onEventPullFail(entity, code, error);
EventUtils
.
onEventPullFail
(
entity
,
code
,
error
);
this
.
listener
.
onError
(
"ZXHC Splsh Error Code"
+
code
+
" Msg "
+
error
);
this
.
listener
.
onError
(
"ZXHC Splsh Error Code"
+
code
+
" Msg "
+
error
);
callback
(
false
);
callback
(
false
);
}
}
...
...
Assets/AdSDK/AD/ZXHC/ZxHCSDK/Plugins/Android/zxhcsdk-release.aar
View file @
6fa33815
No preview for this file type
Assets/AdSDK/AD/ZXHC/ZxHCSDK/common/ZXHCADManager.cs
View file @
6fa33815
...
@@ -9,11 +9,11 @@ namespace ZXHC
...
@@ -9,11 +9,11 @@ namespace ZXHC
public
class
ZXHCADManager
public
class
ZXHCADManager
{
{
private
static
bool
hasInit
=
false
;
private
static
bool
hasInit
=
false
;
public
static
bool
Init
(
string
appId
)
public
static
bool
Init
(
string
appId
,
bool
IsDebug
)
{
{
#if UNITY_ANDROID
#if UNITY_ANDROID
AndroidJavaObject
hcAdManager
=
new
AndroidJavaClass
(
"com.ym.zxhcsdk.manager.ZXHCADManager"
).
CallStatic
<
AndroidJavaObject
>(
"getInstance"
);
AndroidJavaObject
hcAdManager
=
new
AndroidJavaClass
(
"com.ym.zxhcsdk.manager.ZXHCADManager"
).
CallStatic
<
AndroidJavaObject
>(
"getInstance"
);
hasInit
=
hcAdManager
.
Call
<
bool
>(
"InitAd"
,
ZXHCUtils
.
GetActivity
(),
appId
);
hasInit
=
hcAdManager
.
Call
<
bool
>(
"InitAd"
,
ZXHCUtils
.
GetActivity
(),
appId
,
IsDebug
);
OaidUtil
.
GetOaid
(
new
Action
<
string
>((
oaid
)
=>
{
OaidUtil
.
GetOaid
(
new
Action
<
string
>((
oaid
)
=>
{
ZXHCUtils
.
SetDeviceOaid
(
oaid
);
ZXHCUtils
.
SetDeviceOaid
(
oaid
);
}));
}));
...
...
Assets/AdSDK/SplashDemo/Splash.cs
View file @
6fa33815
...
@@ -118,6 +118,11 @@ public class Splash : MonoBehaviour
...
@@ -118,6 +118,11 @@ public class Splash : MonoBehaviour
{
{
SceneManager
.
LoadSceneAsync
(
"AdDemo"
);
SceneManager
.
LoadSceneAsync
(
"AdDemo"
);
}
}
public
void
onLastError
()
{
}
}
}
...
...
ProjectSettings/EditorBuildSettings.asset
View file @
6fa33815
...
@@ -14,13 +14,13 @@ EditorBuildSettings:
...
@@ -14,13 +14,13 @@ EditorBuildSettings:
-
enabled
:
0
-
enabled
:
0
path
:
Assets/AdSDK/SplashDemo/Splash.unity
path
:
Assets/AdSDK/SplashDemo/Splash.unity
guid
:
37af8cf3fb373478ab04e3ee2f3b700a
guid
:
37af8cf3fb373478ab04e3ee2f3b700a
-
enabled
:
0
-
enabled
:
1
path
:
Assets/AdSDK/AD/Demo/AdDemo.unity
path
:
Assets/AdSDK/AD/Demo/AdDemo.unity
guid
:
ef80a35d44f809e4a8957d1ed9571fd2
guid
:
ef80a35d44f809e4a8957d1ed9571fd2
-
enabled
:
0
-
enabled
:
0
path
:
Assets/AdSDK/NetWork/Demo/HttpDemo.unity
path
:
Assets/AdSDK/NetWork/Demo/HttpDemo.unity
guid
:
1d254830c8b62484bb74d303cbb2cc3d
guid
:
1d254830c8b62484bb74d303cbb2cc3d
-
enabled
:
1
-
enabled
:
0
path
:
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCDemo.unity
path
:
Assets/AdSDK/AD/ZXHC/ZXHCDemo/ZXHCDemo.unity
guid
:
cb50b98bfef171a4ea884c941dd43fa3
guid
:
cb50b98bfef171a4ea884c941dd43fa3
m_configObjects
:
{}
m_configObjects
:
{}
ProjectSettings/ProjectSettings.asset
View file @
6fa33815
...
@@ -175,7 +175,7 @@ PlayerSettings:
...
@@ -175,7 +175,7 @@ PlayerSettings:
androidSupportedAspectRatio
:
1
androidSupportedAspectRatio
:
1
androidMaxAspectRatio
:
2.1
androidMaxAspectRatio
:
2.1
applicationIdentifier
:
applicationIdentifier
:
Android
:
com.ym.
yzqj
Android
:
com.ym.
awpdd
Lumin
:
com.DefaultCompany.com.unity.template.mobile2D
Lumin
:
com.DefaultCompany.com.unity.template.mobile2D
Standalone
:
com.DefaultCompany.com.unity.template.mobile2D
Standalone
:
com.DefaultCompany.com.unity.template.mobile2D
iPhone
:
com.DefaultCompany.com.unity.template.mobile2D
iPhone
:
com.DefaultCompany.com.unity.template.mobile2D
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment