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
d98aa64f
Commit
d98aa64f
authored
Mar 17, 2021
by
erwin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
广告sdk修改
parent
6407267f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
AdManager.cs
Assets/AD/AD_Manager/AdManager.cs
+1
-1
AdDemo.cs
Assets/AD/Demo/AdDemo.cs
+2
-1
YLBRewardAdUtil.cs
Assets/AD/YLB/YlbDemo/YLBRewardAdUtil.cs
+15
-6
YLBRewardAD.cs
Assets/AD/YLB/YlbSDK/YLBRewardAD.cs
+2
-2
No files found.
Assets/AD/AD_Manager/AdManager.cs
View file @
d98aa64f
...
...
@@ -1115,7 +1115,7 @@ public class AdManager
{
listener
.
onError
(
"播放激励视频失败 缓存的信息为null"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"播放激励视频失败 缓存的信息为null"
);
//
LoadCacheRewardVideoAd(slotName);
LoadCacheRewardVideoAd
(
slotName
);
}
}
...
...
Assets/AD/Demo/AdDemo.cs
View file @
d98aa64f
...
...
@@ -46,7 +46,8 @@ public class AdDemo : MonoBehaviour
public
void
onAdClose
()
{
this
.
demo
.
RewardAdResult
.
text
=
"Reward onAdClose"
;
//AdManager.Instance.LoadCacheRewardVideoAd("video");
AdManager
.
Instance
.
LoadCacheRewardVideoAd
(
"video"
);
//YLBRewardAdUtil.Instance.LoadYLBAd();
}
public
void
onAdShow
()
...
...
Assets/AD/YLB/YlbDemo/YLBRewardAdUtil.cs
View file @
d98aa64f
...
...
@@ -13,7 +13,15 @@ public class YLBRewardAdUtil
return
singleInstance
;
}
}
private
YLBRewardAD
rewardVideoAd
=
new
YLBRewardAD
();
//private YLBRewardAD rewardVideoAd = new YLBRewardAD();
/// <summary>
/// 假load
/// </summary>
public
void
LoadYLBAd
()
{
//rewardVideoAd.LoadAd("12345678", "C");
}
/// <summary>
/// 加载缓存激励视频
...
...
@@ -22,6 +30,7 @@ public class YLBRewardAdUtil
/// <param name="callback"></param>
public
void
LoadCacheRewardAd
(
AdEntity
entity
,
Action
<
bool
>
callback
)
{
YLBRewardAD
rewardVideoAd
=
new
YLBRewardAD
();
rewardVideoAd
.
SetLoadListener
(
new
RewardVideoAdLoadListener
(
this
,
entity
,
rewardVideoAd
,
callback
));
rewardVideoAd
.
LoadAd
(
entity
.
codeId
,
entity
.
codeGroup
);
}
...
...
@@ -34,10 +43,10 @@ public class YLBRewardAdUtil
/// <param name="callback"></param>
public
void
playCacheRewardAd
(
AdEntity
entity
,
ZXADRewardVideoListener
listener
,
Action
<
bool
>
callback
)
{
//
rewardVideoAd = GetRewardVideoAd(entity.codeGroup + entity.codeId);
YLBRewardAD
rewardVideoAd
=
GetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
);
if
(
rewardVideoAd
!=
null
)
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"YLB Not NUll"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"YLB Not NUll"
);
#if UNITY_ANDROID
rewardVideoAd
.
SetPlayListener
(
new
RewardVideoAdListener
(
entity
,
callback
,
listener
));
rewardVideoAd
.
ShowAD
(
entity
.
codeId
,
entity
.
codeGroup
);
...
...
@@ -48,7 +57,7 @@ public class YLBRewardAdUtil
}
else
{
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"YLB NUll"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
entity
.
codeGroup
+
"YLB NUll"
);
callback
(
false
);
}
}
...
...
@@ -69,7 +78,7 @@ public class YLBRewardAdUtil
public
void
onError
(
int
code
,
string
message
)
{
Debug
.
unityLogger
.
Log
(
entity
.
code
Id
+
" codeID "
+
entity
.
codeId
+
"YLB Error code"
+
code
+
"message"
+
message
);
Debug
.
unityLogger
.
Log
(
entity
.
code
Group
+
" codeID "
+
entity
.
codeId
+
"YLB Error code"
+
code
+
"message"
+
message
);
EventUtils
.
onEventPullFail
(
entity
,
code
.
ToString
(),
message
);
callback
(
false
);
}
...
...
@@ -77,7 +86,7 @@ public class YLBRewardAdUtil
public
void
onLoad
()
{
EventUtils
.
onEventPullSuccess
(
entity
);
//
adUtil.SetRewardVideoAd(entity.codeGroup + entity.codeId, this.rewardVideo);
adUtil
.
SetRewardVideoAd
(
entity
.
codeGroup
+
entity
.
codeId
,
this
.
rewardVideo
);
callback
(
true
);
}
}
...
...
Assets/AD/YLB/YlbSDK/YLBRewardAD.cs
View file @
d98aa64f
...
...
@@ -30,7 +30,7 @@ public class YLBRewardAD
// rewardVideoAd = new AndroidJavaObject("com.ym.admodule.ylb.YLBManager");
// //Utils.GetActivity(), posId, listenerProxy, volumeOn);
//}
this
.
rewardVideoAd
.
Call
(
"loadRewardAd"
,
codeId
,
codeGroup
,
listenerLoadProxy
);
rewardVideoAd
.
Call
(
"loadRewardAd"
,
codeId
,
codeGroup
,
listenerLoadProxy
);
}
// 展示激励视频
...
...
@@ -42,6 +42,6 @@ public class YLBRewardAD
// rewardVideoAd = new AndroidJavaObject("com.ym.admodule.ylb.YLBManager");
// //Utils.GetActivity(), posId, listenerProxy, volumeOn);
//}
this
.
rewardVideoAd
.
Call
(
"playRewardAd"
,
Utils
.
GetActivity
(),
codeId
,
codeGroup
,
listenerProxy
);
rewardVideoAd
.
Call
(
"playRewardAd"
,
Utils
.
GetActivity
(),
codeId
,
codeGroup
,
listenerProxy
);
}
}
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