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
Show 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
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.Events
;
using
UnityEngine.UI
;
public
static
class
EffectMgr
{
public
static
float
TimeSpeed
=
1
;
private
static
WaitForEndOfFrame
WaitForNextFrame
=
new
WaitForEndOfFrame
();
//逐渐显示(Image)
public
static
Coroutine
GraduallyAppear
(
this
Image
picture
,
float
duration
,
UnityAction
<
Image
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyAppear
(
picture
,
duration
,
callback
));
}
private
static
IEnumerator
IEGraduallyAppear
(
Image
picture
,
float
duration
,
UnityAction
<
Image
>
callback
=
null
)
{
Color
color
=
picture
.
color
;
float
ColorPercent
=
1
-
color
.
a
;
while
(
color
.
a
<
1
)
{
color
.
a
+=
Time
.
deltaTime
/
duration
*
ColorPercent
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
callback
?.
Invoke
(
picture
);
}
//逐渐显示(Text)
public
static
Coroutine
GraduallyAppear
(
this
Text
picture
,
float
duration
,
UnityAction
<
Text
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyAppear
(
picture
,
duration
,
callback
));
}
private
static
IEnumerator
IEGraduallyAppear
(
Text
picture
,
float
duration
,
UnityAction
<
Text
>
callback
=
null
)
{
Color
color
=
picture
.
color
;
float
ColorPercent
=
1
-
color
.
a
;
while
(
color
.
a
<
1
)
{
color
.
a
+=
Time
.
deltaTime
/
duration
*
ColorPercent
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
callback
?.
Invoke
(
picture
);
}
//逐渐消失(Image)
public
static
Coroutine
GraduallyDisappear
(
this
Image
picture
,
float
duration
,
UnityAction
<
Image
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyDisappear
(
picture
,
duration
,
callback
));
}
private
static
IEnumerator
IEGraduallyDisappear
(
Image
picture
,
float
duration
,
UnityAction
<
Image
>
callback
=
null
)
{
Color
color
=
picture
.
color
;
float
Percent
=
color
.
a
;
while
(
color
.
a
>
0
)
{
color
.
a
-=
Time
.
deltaTime
/
duration
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
callback
?.
Invoke
(
picture
);
}
//逐渐消失(Text)
public
static
Coroutine
GraduallyDisappear
(
this
Text
picture
,
float
duration
,
UnityAction
<
Text
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyDisappear
(
picture
,
duration
,
callback
));
}
private
static
IEnumerator
IEGraduallyDisappear
(
Text
picture
,
float
duration
,
UnityAction
<
Text
>
callback
=
null
)
{
Color
color
=
picture
.
color
;
float
Percent
=
color
.
a
;
while
(
color
.
a
>
0
)
{
color
.
a
-=
Time
.
deltaTime
/
duration
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
callback
?.
Invoke
(
picture
);
}
//消失复现循环(Image)
public
static
Coroutine
GraduallyAppearAndDisAppear
(
this
Image
picture
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyAppearAndDisAppear
(
picture
));
}
private
static
IEnumerator
IEGraduallyAppearAndDisAppear
(
Image
picture
)
{
Color
color
=
picture
.
color
;
while
(
true
)
{
while
(
color
.
a
>
0
)
{
color
.
a
-=
Time
.
deltaTime
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
while
(
color
.
a
<
1
)
{
color
.
a
+=
Time
.
deltaTime
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
}
}
//消失复现循环(Text)
public
static
Coroutine
GraduallyAppearAndDisAppear
(
this
Text
picture
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyAppearAndDisAppear
(
picture
));
}
private
static
IEnumerator
IEGraduallyAppearAndDisAppear
(
Text
picture
)
{
Color
color
=
picture
.
color
;
while
(
true
)
{
while
(
color
.
a
>
0
)
{
color
.
a
-=
Time
.
deltaTime
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
while
(
color
.
a
<
1
)
{
color
.
a
+=
Time
.
deltaTime
;
picture
.
color
=
color
;
yield
return
WaitForNextFrame
;
}
}
}
//放大缩小
public
static
Coroutine
GraduallyChangeScale
(
this
Transform
picture
,
Vector2
endScale
,
float
duration
,
UnityAction
<
Transform
>
func
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyChangeScale
(
picture
,
endScale
,
duration
,
func
));
}
private
static
IEnumerator
IEGraduallyChangeScale
(
Transform
picture
,
Vector2
endScale
,
float
duration
,
UnityAction
<
Transform
>
func
=
null
)
{
Vector2
originScale
=
picture
.
localScale
;
Vector2
nowScale
=
picture
.
localScale
;
int
para
=
endScale
.
x
>
originScale
.
x
?
1
:
-
1
;
while
(
nowScale
.
x
<
endScale
.
x
*
para
)
{
nowScale
+=
Time
.
deltaTime
*
(
endScale
-
originScale
)
/
duration
;
picture
.
localScale
=
nowScale
;
yield
return
WaitForNextFrame
;
}
picture
.
GetComponent
<
RectTransform
>().
localScale
=
endScale
;
func
?.
Invoke
(
picture
);
}
//旋转 参数:图片,转几圈,最后角度,是否顺时针,持续时间,回调函数
public
static
Coroutine
GraduallyRotate
(
this
Transform
picture
,
int
Rotatetimes
,
float
lastangel
,
bool
clockwise
,
float
duration
,
UnityAction
<
Transform
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEGraduallyRotate
(
picture
,
Rotatetimes
,
lastangel
,
clockwise
,
duration
,
callback
));
}
private
static
IEnumerator
IEGraduallyRotate
(
Transform
picture
,
int
Rotatetimes
,
float
lastangel
,
bool
clockwise
,
float
duration
,
UnityAction
<
Transform
>
callback
=
null
)
{
Vector3
OriginRotate
=
picture
.
localEulerAngles
;
Vector3
NowRotate
=
picture
.
localEulerAngles
;
float
nowangel
=
picture
.
eulerAngles
.
z
%
360
;
if
(
nowangel
<
0
)
{
nowangel
=
360
+
nowangel
;
}
lastangel
%=
360
;
if
(
lastangel
<
0
)
{
lastangel
=
360
+
lastangel
;
}
float
totalangle
;
float
Goingangle
=
0
;
//是否顺时针
if
(
clockwise
)
{
float
angel
=
nowangel
-
lastangel
;
if
(
angel
<
0
)
{
angel
=
360
+
angel
;
}
totalangle
=
angel
+
Rotatetimes
*
360
;
while
(
Goingangle
<
totalangle
)
{
float
steprotate
=
Time
.
deltaTime
*
(
totalangle
-
OriginRotate
.
z
)
/
duration
;
NowRotate
.
z
-=
steprotate
;
picture
.
localEulerAngles
=
NowRotate
;
Goingangle
+=
steprotate
;
yield
return
WaitForNextFrame
;
}
OriginRotate
.
z
=
lastangel
;
picture
.
localEulerAngles
=
OriginRotate
;
}
else
{
float
angel
=
lastangel
-
nowangel
;
if
(
angel
<
0
)
{
angel
=
360
+
angel
;
}
totalangle
=
angel
+
Rotatetimes
*
360
;
while
(
Goingangle
<
totalangle
)
{
float
steprotate
=
Time
.
deltaTime
*
(
totalangle
-
OriginRotate
.
z
)
/
duration
;
NowRotate
.
z
+=
steprotate
;
picture
.
localEulerAngles
=
NowRotate
;
Goingangle
+=
steprotate
;
yield
return
WaitForNextFrame
;
}
OriginRotate
.
z
=
lastangel
;
picture
.
localEulerAngles
=
OriginRotate
;
}
callback
?.
Invoke
(
picture
);
}
//移动
public
static
Coroutine
DoMove
(
this
RectTransform
picture
,
float
duration
,
Vector2
endpos
,
UnityAction
<
RectTransform
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEDoMove
(
picture
,
duration
,
endpos
,
callback
));
}
private
static
IEnumerator
IEDoMove
(
RectTransform
picture
,
float
duration
,
Vector2
endpos
,
UnityAction
<
RectTransform
>
callback
=
null
)
{
Vector2
startpos
=
picture
.
anchoredPosition
;
Vector2
nowpos
=
picture
.
anchoredPosition
;
Vector2
Dir
=
(
endpos
-
startpos
).
normalized
;
Vector2
GoingDir
=
(
endpos
-
nowpos
).
normalized
;
while
(
Dir
.
x
*
GoingDir
.
x
>
0
)
{
nowpos
+=
Time
.
deltaTime
*
(
endpos
-
startpos
)
/
duration
;
picture
.
anchoredPosition
=
nowpos
;
GoingDir
=
(
endpos
-
nowpos
).
normalized
;
yield
return
WaitForNextFrame
;
}
picture
.
anchoredPosition
=
endpos
;
callback
?.
Invoke
(
picture
);
}
//打字机效果
public
static
Coroutine
TyperEffect
(
this
Text
text
,
string
conststring
,
string
totalstring
,
float
intervaltime
=
0.05f
,
UnityAction
<
Text
>
callback
=
null
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IETyperEffect
(
text
,
conststring
,
totalstring
,
intervaltime
,
callback
));
}
private
static
IEnumerator
IETyperEffect
(
Text
text
,
string
conststring
,
string
totalstring
,
float
intervaltime
,
UnityAction
<
Text
>
callback
=
null
)
{
string
str
=
totalstring
.
Substring
(
conststring
.
Length
);
text
.
text
=
conststring
;
int
index
=
0
;
while
(
index
<
str
.
Length
)
{
text
.
text
+=
str
[
index
];
index
++;
yield
return
new
WaitForSeconds
(
intervaltime
);
}
callback
?.
Invoke
(
text
);
}
//延迟函数
public
static
Coroutine
Invoke
<
T
>(
this
object
obj
,
float
time
,
T
parm
,
UnityAction
<
T
>
func
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEInvoke
(
time
,
parm
,
func
));
}
private
static
IEnumerator
IEInvoke
<
T
>(
float
time
,
T
parm
,
UnityAction
<
T
>
func
)
{
yield
return
new
WaitForSeconds
(
time
);
func
.
Invoke
(
parm
);
}
public
static
Coroutine
Invoke
(
this
object
obj
,
float
time
,
UnityAction
func
)
{
return
MonoMgr
.
Getinstance
().
StartCoroutine
(
IEInvoke
(
time
,
func
));
}
private
static
IEnumerator
IEInvoke
(
float
time
,
UnityAction
func
)
{
yield
return
new
WaitForSeconds
(
time
);
func
.
Invoke
();
}
//设置为透明方法
public
static
void
HideImage
(
this
Image
picture
)
{
Color
color
=
picture
.
color
;
color
.
a
=
0
;
picture
.
color
=
color
;
}
//恢复透明度方法
public
static
void
ShowImage
(
this
Image
picture
)
{
Color
color
=
picture
.
color
;
color
.
a
=
1
;
picture
.
color
=
color
;
}
////初始化
//public static void ReSet(this Transform trans)
//{
// trans.localPosition = Vector3.zero;
// trans.localScale = Vector3.one;
// RectTransform rect = null;
// trans.TryGetComponent(out rect);
// if (rect!=null)
// {
// rect.anchoredPosition = Vector3.zero;
// }
// PersonBase person = null;
// trans.TryGetComponent(out person);
// if (person!=null)
// {
// person.ReSetCell();
// }
//}
//public static void ReSet(this Transform trans,Vector3 pos)
//{
// trans.localPosition = pos;
// trans.localScale = Vector3.one;
// RectTransform rect = null;
// trans.TryGetComponent(out rect);
// if (rect != null)
// {
// rect.anchoredPosition = pos;
// }
// PersonBase person = null;
// trans.TryGetComponent(out person);
// if (person != null)
// {
// person.ReSetCell();
// }
//}
//public static void ReSet(this Transform trans, Vector3 pos,Vector3 Scale)
//{
// trans.localPosition = pos;
// trans.localScale = Scale;
// RectTransform rect = null;
// trans.TryGetComponent(out rect);
// if (rect != null)
// {
// rect.anchoredPosition = pos;
// }
// PersonBase person = null;
// trans.TryGetComponent(out person);
// if (person != null)
// {
// person.ReSetCell();
// }
//}
//public static void ResetToCanvas(this Transform trans,E_Layer layer)
//{
// try
// {
// switch (layer)
// {
// case E_Layer.bot:
// trans.SetParent(UIMgr.Getinstance().bot);
// break;
// case E_Layer.lower_mid:
// trans.SetParent(UIMgr.Getinstance().lower_mid);
// break;
// case E_Layer.mid:
// trans.SetParent(UIMgr.Getinstance().mid);
// break;
// case E_Layer.upper_mid:
// trans.SetParent(UIMgr.Getinstance().upper_mid);
// break;
// case E_Layer.lower_top:
// trans.SetParent(UIMgr.Getinstance().lower_top);
// break;
// case E_Layer.top:
// trans.SetParent(UIMgr.Getinstance().top);
// break;
// case E_Layer.upper_top:
// trans.SetParent(UIMgr.Getinstance().upper_top);
// break;
// case E_Layer.system:
// trans.SetParent(UIMgr.Getinstance().system);
// break;
// }
// trans.ReSet();
// }
// catch
// {
// Debug.Log("ResetToCanvas失败");
// }
//}
//public static void ResetToCanvas(this Transform trans, E_Layer layer,Vector3 pos)
//{
// try
// {
// switch (layer)
// {
// case E_Layer.bot:
// trans.SetParent(UIMgr.Getinstance().bot);
// break;
// case E_Layer.lower_mid:
// trans.SetParent(UIMgr.Getinstance().lower_mid);
// break;
// case E_Layer.mid:
// trans.SetParent(UIMgr.Getinstance().mid);
// break;
// case E_Layer.upper_mid:
// trans.SetParent(UIMgr.Getinstance().upper_mid);
// break;
// case E_Layer.lower_top:
// trans.SetParent(UIMgr.Getinstance().lower_top);
// break;
// case E_Layer.top:
// trans.SetParent(UIMgr.Getinstance().top);
// break;
// case E_Layer.upper_top:
// trans.SetParent(UIMgr.Getinstance().upper_top);
// break;
// case E_Layer.system:
// trans.SetParent(UIMgr.Getinstance().system);
// break;
// }
// trans.ReSet(pos);
// }
// catch
// {
// Debug.Log("ResetToCanvas失败");
// }
//}
//public static void ResetToCanvas(this Transform trans, E_Layer layer, Vector3 pos,Vector3 Scale)
//{
// try
// {
// switch (layer)
// {
// case E_Layer.bot:
// trans.SetParent(UIMgr.Getinstance().bot);
// break;
// case E_Layer.lower_mid:
// trans.SetParent(UIMgr.Getinstance().lower_mid);
// break;
// case E_Layer.mid:
// trans.SetParent(UIMgr.Getinstance().mid);
// break;
// case E_Layer.upper_mid:
// trans.SetParent(UIMgr.Getinstance().upper_mid);
// break;
// case E_Layer.lower_top:
// trans.SetParent(UIMgr.Getinstance().lower_top);
// break;
// case E_Layer.top:
// trans.SetParent(UIMgr.Getinstance().top);
// break;
// case E_Layer.upper_top:
// trans.SetParent(UIMgr.Getinstance().upper_top);
// break;
// case E_Layer.system:
// trans.SetParent(UIMgr.Getinstance().system);
// break;
// }
// trans.ReSet(pos,Scale);
// }
// catch
// {
// Debug.Log("ResetToCanvas失败");
// }
//}
}
\ No newline at end of file
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
#endif
break
;
case
ZXADConfig
.
PLANTFORM_AD_KUS
:
#if UNITUY_ANDROD
if
(
id
.
codeAppId
!=
null
&&
id
.
codeAppId
!=
""
)
{
KsAdSDK
.
InitKsAdSDK
(
id
.
codeAppId
,
Application
.
identifier
);
}
#endif
break
;
default
:
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"不支持初始化"
+
id
.
adPlatform
+
"的广告"
);
...
...
@@ -1116,9 +1114,10 @@ public class AdManager
if
(
ADLoading
.
isShowing
)
{
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
ADLoading
.
Instance
().
HideADLoading
();
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
}
}
else
...
...
@@ -1130,7 +1129,8 @@ public class AdManager
totalEntityList
.
RemoveAt
(
0
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackA
);
}
else
{
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
...
...
@@ -1138,6 +1138,9 @@ public class AdManager
ADLoading
.
Instance
().
HideADLoading
();
}
}
}
});
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"A开始缓存激励视频"
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackA
);
...
...
@@ -1169,9 +1172,9 @@ public class AdManager
if
(
ADLoading
.
isShowing
)
{
ADLoading
.
Instance
().
HideADLoading
();
PlayCacheRewardVideoAd
(
ADLoading
.
adSlotName
,
ADLoading
.
adActionName
,
ADLoading
.
adListener
);
ADLoading
.
Instance
().
HideADLoading
();
}
}
else
...
...
@@ -1183,7 +1186,8 @@ public class AdManager
totalEntityList
.
RemoveAt
(
0
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackB
);
}
else
{
ADLoading
.
Instance
().
loadFailCount
++;
if
(
ADLoading
.
Instance
().
loadFailCount
==
2
)
...
...
@@ -1191,6 +1195,9 @@ public class AdManager
ADLoading
.
Instance
().
HideADLoading
();
}
}
}
});
Debug
.
unityLogger
.
Log
(
ZXADConfig
.
ADManagerTAG
,
"B开始缓存激励视频"
);
mLoadRewardVideoAdPlatform
(
entity
,
rewardVideoAdCallBackB
);
...
...
@@ -1244,6 +1251,9 @@ public class AdManager
/// <param name="listener">广告回调</param>
public
void
PlayCacheRewardVideoAd
(
string
slotName
,
string
actionName
,
ZXADRewardVideoListener
listener
)
{
Debug
.
unityLogger
.
Log
(
"1PlayCacheRewardVideoAd"
);
Debug
.
unityLogger
.
Log
(
"2PlayCacheRewardVideoAd"
+
slotName
);
AdEntity
entity
=
null
;
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,6 +49,9 @@ public class KsUnityFeedAd {
public
void
ShowFeedAd
(
Activity
activity
,
KsUnityFeedShowListener
listener
)
{
if
(
feedAd
!=
null
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
feedAd
.
setAdInteractionListener
(
new
KsFeedAd
.
AdInteractionListener
()
{
@Override
public
void
onAdClicked
()
{
...
...
@@ -80,6 +83,8 @@ public class KsUnityFeedAd {
root
.
addView
(
feedlinearLayout
);
}
}
}
});
}
else
{
listener
.
onShowError
(-
1
,
"没有大图广告数据"
);
}
...
...
Assets/Resources/ADLoading/ADLoading.prefab
View file @
4f37171d
...
...
@@ -192,7 +192,7 @@ MonoBehaviour:
m_OnClick
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
4283400949935885017
}
-
m_Target
:
{
fileID
:
0
}
m_MethodName
:
HideADLoading
m_Mode
:
1
m_Arguments
:
...
...
@@ -215,7 +215,6 @@ GameObject:
-
component
:
{
fileID
:
7874596718903047866
}
-
component
:
{
fileID
:
7874596718903047867
}
-
component
:
{
fileID
:
7874596718903047812
}
-
component
:
{
fileID
:
4283400949935885017
}
m_Layer
:
5
m_Name
:
ADLoading
m_TagString
:
Untagged
...
...
@@ -304,22 +303,6 @@ MonoBehaviour:
m_BlockingMask
:
serializedVersion
:
2
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
GameObject
:
m_ObjectHideFlags
:
0
...
...
ProjectSettings/GraphicsSettings.asset
View file @
4f37171d
...
...
@@ -39,6 +39,7 @@ GraphicsSettings:
-
{
fileID
:
16000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16001
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
17000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16003
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_PreloadedShaders
:
[]
m_SpritesDefaultMaterial
:
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
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