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
4f37171d
Commit
4f37171d
authored
May 20, 2021
by
zhangzhe
Browse files
Options
Browse Files
Download
Plain Diff
处理冲突
parents
fde19213
5f9c0410
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
58 additions
and
799 deletions
+58
-799
EffectMgr.cs
Assets/AdSDK/AD/AD_Loading/EffectMgr.cs
+0
-532
EffectMgr.cs.meta
Assets/AdSDK/AD/AD_Loading/EffectMgr.cs.meta
+0
-11
MonoBaseMgr.cs
Assets/AdSDK/AD/AD_Loading/MonoBaseMgr.cs
+0
-38
MonoBaseMgr.cs.meta
Assets/AdSDK/AD/AD_Loading/MonoBaseMgr.cs.meta
+0
-11
MonoMgr.cs
Assets/AdSDK/AD/AD_Loading/MonoMgr.cs
+0
-22
MonoMgr.cs.meta
Assets/AdSDK/AD/AD_Loading/MonoMgr.cs.meta
+0
-11
AdManager.cs
Assets/AdSDK/AD/AD_Manager/AdManager.cs
+25
-15
AdUtils.cs
Assets/AdSDK/AD/Demo/AdUtils.cs
+0
-104
AdUtils.cs.meta
Assets/AdSDK/AD/Demo/AdUtils.cs.meta
+0
-11
KsUnityFeedAd.java
Assets/AdSDK/AD/KS/KsSDK/Scripts/Feed/KsUnityFeedAd.java
+31
-26
ADLoading.prefab
Assets/Resources/ADLoading/ADLoading.prefab
+1
-18
GraphicsSettings.asset
ProjectSettings/GraphicsSettings.asset
+1
-0
No files found.
Assets/AdSDK/AD/AD_Loading/EffectMgr.cs
deleted
100644 → 0
View file @
fde19213
This diff is collapsed.
Click to expand it.
Assets/AdSDK/AD/AD_Loading/EffectMgr.cs.meta
deleted
100644 → 0
View file @
fde19213
fileFormatVersion: 2
guid: 19cb369d889b04755a0562447e6cdc2e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/AdSDK/AD/AD_Loading/MonoBaseMgr.cs
deleted
100644 → 0
View file @
fde19213
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
MonoBaseMgr
<
T
>
:
MonoBehaviour
where
T
:
MonoBehaviour
{
private
static
T
instance
;
public
static
T
Getinstance
()
{
if
(
instance
==
null
)
{
GameObject
obj
=
new
GameObject
(
typeof
(
T
).
ToString
()
+
"Scripts"
);
instance
=
obj
.
AddComponent
<
T
>();
DontDestroyOnLoad
(
obj
);
}
return
instance
;
}
public
static
T
GetInstance
()
{
if
(
instance
==
null
)
{
GameObject
obj
=
new
GameObject
(
typeof
(
T
).
ToString
()
+
"Scripts"
);
instance
=
obj
.
AddComponent
<
T
>();
DontDestroyOnLoad
(
obj
);
}
return
instance
;
}
public
static
T
Instance
()
{
if
(
instance
==
null
)
{
GameObject
obj
=
new
GameObject
(
typeof
(
T
).
ToString
()
+
"Scripts"
);
instance
=
obj
.
AddComponent
<
T
>();
DontDestroyOnLoad
(
obj
);
}
return
instance
;
}
}
Assets/AdSDK/AD/AD_Loading/MonoBaseMgr.cs.meta
deleted
100644 → 0
View file @
fde19213
fileFormatVersion: 2
guid: e8de3608ab9494f819f3c11756db1eff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/AdSDK/AD/AD_Loading/MonoMgr.cs
deleted
100644 → 0
View file @
fde19213
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.Events
;
public
class
MonoMgr
:
MonoBaseMgr
<
MonoMgr
>
{
public
UnityAction
func
;
void
Update
()
{
func
?.
Invoke
();
}
public
void
AddUpdateListener
(
UnityAction
func
)
{
this
.
func
+=
func
;
}
public
void
RemoveUpdateListener
(
UnityAction
func
)
{
this
.
func
-=
func
;
}
}
Assets/AdSDK/AD/AD_Loading/MonoMgr.cs.meta
deleted
100644 → 0
View file @
fde19213
fileFormatVersion: 2
guid: 96eabe63e0a424642a928c97daa31a5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/AdSDK/AD/AD_Manager/AdManager.cs
View file @
4f37171d
...
@@ -109,12 +109,10 @@ public class AdManager
...
@@ -109,12 +109,10 @@ public class AdManager
#endif
#endif
break
;
break
;
case
ZXADConfig
.
PLANTFORM_AD_KUS
:
case
ZXADConfig
.
PLANTFORM_AD_KUS
:
#if UNITUY_ANDROD
if
(
id
.
codeAppId
!=
null
&&
id
.
codeAppId
!=
""
)
if
(
id
.
codeAppId
!=
null
&&
id
.
codeAppId
!=
""
)
{
{
KsAdSDK
.
InitKsAdSDK
(
id
.
codeAppId
,
Application
.
identifier
);
KsAdSDK
.
InitKsAdSDK
(
id
.
codeAppId
,
Application
.
identifier
);
}
}
#endif
break
;
break
;
default
:
default
:
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持初始化"
+
id
.
adPlatform
+
"的广告"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持初始化"
+
id
.
adPlatform
+
"的广告"
);
...
@@ -1116,9 +1114,10 @@ public class AdManager
...
@@ -1116,9 +1114,10 @@ public class AdManager
if
(
ADLoading
.
isShowing
)
if
(
ADLoading
.
isShowing
)
{
{
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
ADLoading
.
Instance
().
HideADLoading
();
ADLoading
.
Instance
().
HideADLoading
();
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
}
}
}
}
else
else
...
@@ -1130,13 +1129,17 @@ public class AdManager
...
@@ -1130,13 +1129,17 @@ public class AdManager
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackA
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackA
);
}
}
else
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
{
{
ADLoading
.
Instance
().
HideADLoading
();
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
{
ADLoading
.
Instance
().
HideADLoading
();
}
}
}
}
}
});
});
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"A开始缓存激励视频"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"A开始缓存激励视频"
);
...
@@ -1169,9 +1172,9 @@ public class AdManager
...
@@ -1169,9 +1172,9 @@ public class AdManager
if
(
ADLoading
.
isShowing
)
if
(
ADLoading
.
isShowing
)
{
{
ADLoading
.
Instance
().
HideADLoading
();
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
ADLoading
.
Instance
().
HideADLoading
();
}
}
}
}
else
else
...
@@ -1183,13 +1186,17 @@ public class AdManager
...
@@ -1183,13 +1186,17 @@ public class AdManager
totalEntityList
.
RemoveAt
(
0
);
totalEntityList
.
RemoveAt
(
0
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackB
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackB
);
}
}
else
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
{
{
ADLoading
.
Instance
().
HideADLoading
();
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
{
ADLoading
.
Instance
().
HideADLoading
();
}
}
}
}
}
});
});
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"B开始缓存激励视频"
);
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"B开始缓存激励视频"
);
...
@@ -1244,6 +1251,9 @@ public class AdManager
...
@@ -1244,6 +1251,9 @@ public class AdManager
/// <param name="listener">广告回调</param>
/// <param name="listener">广告回调</param>
public
void
PlayCacheRewardVideoAd
(
string
slotName
,
string
actionName
,
ZXADRewardVideoListener
listener
)
public
void
PlayCacheRewardVideoAd
(
string
slotName
,
string
actionName
,
ZXADRewardVideoListener
listener
)
{
{
Debug
.
unityLogger
.
Log
(
"1PlayCacheRewardVideoAd"
);
Debug
.
unityLogger
.
Log
(
"2PlayCacheRewardVideoAd"
+
slotName
);
AdEntity
entity
=
null
;
AdEntity
entity
=
null
;
AdEntity
entityA
=
ZXADConfig
.
Instance
.
GetAdCache
(
slotName
,
"A"
);
AdEntity
entityA
=
ZXADConfig
.
Instance
.
GetAdCache
(
slotName
,
"A"
);
...
...
Assets/AdSDK/AD/Demo/AdUtils.cs
deleted
100644 → 0
View file @
fde19213
using
System
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
AdUtils
{
private
AdUtils
()
{
}
private
static
readonly
AdUtils
singleInstance
=
new
AdUtils
();
public
static
AdUtils
Instance
{
get
{
return
singleInstance
;
}
}
private
void
InitAd
()
{
AdManager
.
Instance
.
InitAd
(
new
Action
<
bool
>((
cb
)=>
{
if
(
cb
)
{
AdManager
.
Instance
.
LoadCacheRewardVideoAd
(
"video"
);
}
}));
}
/// <summary>
/// 播放开屏广告
/// </summary>
public
void
ShowSplashAd
(
Action
<
bool
>
callback
)
{
AdManager
.
Instance
.
LoadSplashAd
(
new
SplshAdListener
(
callback
));
}
/// <summary>
/// 播放激励视频广告
/// </summary>
public
void
ShowRewardAd
(
string
action
,
Action
<
bool
>
callback
)
{
AdManager
.
Instance
.
PlayCacheRewardVideoAd
(
"video"
,
"test"
,
new
RewardAdListener
(
callback
));
}
private
sealed
class
SplshAdListener
:
ZXADSplashListener
{
private
Action
<
bool
>
callback
;
public
SplshAdListener
(
Action
<
bool
>
callback
)
{
this
.
callback
=
callback
;
}
public
void
onAdShow
()
{
}
public
void
onAdSkip
()
{
callback
(
true
);
}
public
void
onError
(
string
errorMsg
)
{
}
public
void
onLastError
()
{
callback
(
true
);
}
}
public
sealed
class
RewardAdListener
:
ZXADRewardVideoListener
{
private
Action
<
bool
>
callback
;
public
RewardAdListener
(
Action
<
bool
>
callback
)
{
this
.
callback
=
callback
;
}
public
void
onAdClose
(
AdEntity
entity
)
{
AdManager
.
Instance
.
LoadCacheRewardVideoAd
(
"video"
);
callback
(
true
);
}
public
void
onAdShow
()
{
}
public
void
onAdVideoBarClick
()
{
}
public
void
onError
(
string
errorMsg
)
{
AdManager
.
Instance
.
LoadCacheRewardVideoAd
(
"video"
);
callback
(
false
);
}
public
void
onSuccess
()
{
}
}
}
Assets/AdSDK/AD/Demo/AdUtils.cs.meta
deleted
100644 → 0
View file @
fde19213
fileFormatVersion: 2
guid: 7254c6703a47f6f438d80ec0dc944695
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/AdSDK/AD/KS/KsSDK/Scripts/Feed/KsUnityFeedAd.java
View file @
4f37171d
...
@@ -49,37 +49,42 @@ public class KsUnityFeedAd {
...
@@ -49,37 +49,42 @@ public class KsUnityFeedAd {
public
void
ShowFeedAd
(
Activity
activity
,
KsUnityFeedShowListener
listener
)
{
public
void
ShowFeedAd
(
Activity
activity
,
KsUnityFeedShowListener
listener
)
{
if
(
feedAd
!=
null
)
{
if
(
feedAd
!=
null
)
{
feedAd
.
setAdInteractionListener
(
new
KsFeedAd
.
AdInteractionListener
()
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
@Override
public
void
onAdClicked
()
{
public
void
run
()
{
listener
.
onAdClicked
();
feedAd
.
setAdInteractionListener
(
new
KsFeedAd
.
AdInteractionListener
()
{
}
@Override
public
void
onAdClicked
()
{
listener
.
onAdClicked
();
}
@Override
@Override
public
void
onAdShow
()
{
public
void
onAdShow
()
{
listener
.
onAdShow
();
listener
.
onAdShow
();
}
}
@Override
@Override
public
void
onDislikeClicked
()
{
public
void
onDislikeClicked
()
{
removeAdView
(
activity
,
feedlinearLayout
);
removeAdView
(
activity
,
feedlinearLayout
);
listener
.
onDislikeClicked
();
listener
.
onDislikeClicked
();
}
});
feedVidw
=
feedAd
.
getFeedView
(
activity
);
LinearLayout
.
LayoutParams
lp
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
lp
.
gravity
=
Gravity
.
BOTTOM
;
feedVidw
.
setLayoutParams
(
lp
);
if
(
feedVidw
!=
null
)
{
feedlinearLayout
=
new
LinearLayout
(
activity
);
LinearLayout
.
LayoutParams
layoutParams
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
feedlinearLayout
.
setLayoutParams
(
layoutParams
);
feedlinearLayout
.
addView
(
feedVidw
);
ViewGroup
root
=
getRootLayout
(
activity
);
if
(
feedVidw
!=
null
)
{
root
.
addView
(
feedlinearLayout
);
}
}
}
}
});
});
feedVidw
=
feedAd
.
getFeedView
(
activity
);
LinearLayout
.
LayoutParams
lp
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
lp
.
gravity
=
Gravity
.
BOTTOM
;
feedVidw
.
setLayoutParams
(
lp
);
if
(
feedVidw
!=
null
)
{
feedlinearLayout
=
new
LinearLayout
(
activity
);
LinearLayout
.
LayoutParams
layoutParams
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
feedlinearLayout
.
setLayoutParams
(
layoutParams
);
feedlinearLayout
.
addView
(
feedVidw
);
ViewGroup
root
=
getRootLayout
(
activity
);
if
(
feedVidw
!=
null
)
{
root
.
addView
(
feedlinearLayout
);
}
}
}
else
{
}
else
{
listener
.
onShowError
(-
1
,
"没有大图广告数据"
);
listener
.
onShowError
(-
1
,
"没有大图广告数据"
);
}
}
...
...
Assets/Resources/ADLoading/ADLoading.prefab
View file @
4f37171d
...
@@ -192,7 +192,7 @@ MonoBehaviour:
...
@@ -192,7 +192,7 @@ MonoBehaviour:
m_OnClick
:
m_OnClick
:
m_PersistentCalls
:
m_PersistentCalls
:
m_Calls
:
m_Calls
:
-
m_Target
:
{
fileID
:
4283400949935885017
}
-
m_Target
:
{
fileID
:
0
}
m_MethodName
:
HideADLoading
m_MethodName
:
HideADLoading
m_Mode
:
1
m_Mode
:
1
m_Arguments
:
m_Arguments
:
...
@@ -215,7 +215,6 @@ GameObject:
...
@@ -215,7 +215,6 @@ GameObject:
-
component
:
{
fileID
:
7874596718903047866
}
-
component
:
{
fileID
:
7874596718903047866
}
-
component
:
{
fileID
:
7874596718903047867
}
-
component
:
{
fileID
:
7874596718903047867
}
-
component
:
{
fileID
:
7874596718903047812
}
-
component
:
{
fileID
:
7874596718903047812
}
-
component
:
{
fileID
:
4283400949935885017
}
m_Layer
:
5
m_Layer
:
5
m_Name
:
ADLoading
m_Name
:
ADLoading
m_TagString
:
Untagged
m_TagString
:
Untagged
...
@@ -304,22 +303,6 @@ MonoBehaviour:
...
@@ -304,22 +303,6 @@ MonoBehaviour:
m_BlockingMask
:
m_BlockingMask
:
serializedVersion
:
2
serializedVersion
:
2
m_Bits
:
4294967295
m_Bits
:
4294967295
---
!u!114
&4283400949935885017
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7874596718903047813
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
b8e186fde1a424d898d035bae5a45073
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
isShowing
:
0
adSlotName
:
adActionName
:
loadFailCount
:
0
---
!u!1
&7874596720360528070
---
!u!1
&7874596720360528070
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
ProjectSettings/GraphicsSettings.asset
View file @
4f37171d
...
@@ -39,6 +39,7 @@ GraphicsSettings:
...
@@ -39,6 +39,7 @@ GraphicsSettings:
-
{
fileID
:
16000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16001
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16001
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
17000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
17000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16003
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_PreloadedShaders
:
[]
m_PreloadedShaders
:
[]
m_SpritesDefaultMaterial
:
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
m_SpritesDefaultMaterial
:
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
type
:
0
}
...
...
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