Commit f531f188 authored by zhangzhe's avatar zhangzhe

穿山甲广告

parent c4bc27cf
...@@ -49,8 +49,19 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -49,8 +49,19 @@ public class CSJFeedUtil : MonoBehaviour
#elif UNITY_IOS #elif UNITY_IOS
feedAd.Dispose(); feedAd.Dispose();
feedAd = null; feedAd = null;
#endif
if (lastEntity != null && lastCallBack != null)
{
var adSlot = new AdSlot.Builder()
.SetCodeId(lastEntity.codeId)
.SetImageAcceptedSize(Screen.width, 0)
.SetSupportDeepLink(true)
.SetOrientation(AdOrientation.Horizontal)
.SetAdCount(1) //请求广告数量为1到3条
.Build();
this.AdNative.LoadNativeExpressAd(adSlot, new CloseLoadFeedAdListener(lastEntity, lastCallBack));
}
#endif
} }
} }
...@@ -59,6 +70,9 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -59,6 +70,9 @@ public class CSJFeedUtil : MonoBehaviour
/// </summary> /// </summary>
private static Queue<ExpressAd> feedAdCacheList = new Queue<ExpressAd>(); private static Queue<ExpressAd> feedAdCacheList = new Queue<ExpressAd>();
private static AdEntity lastEntity;
private static Action<bool> lastCallBack;
/// <summary> /// <summary>
/// 缓存加载FeedAd /// 缓存加载FeedAd
/// </summary> /// </summary>
...@@ -66,17 +80,21 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -66,17 +80,21 @@ public class CSJFeedUtil : MonoBehaviour
/// <param name="callback"></param> /// <param name="callback"></param>
public void LoadCacheFeedAd(AdEntity entity, Action<bool> callback) public void LoadCacheFeedAd(AdEntity entity, Action<bool> callback)
{ {
lastEntity = entity;
lastCallBack = callback;
var adSlot = new AdSlot.Builder() var adSlot = new AdSlot.Builder()
#if UNITY_IOS #if UNITY_IOS
.SetCodeId(entity.codeId) .SetCodeId(entity.codeId)
.SetExpressViewAcceptedSize(Screen.width, 0) .SetImageAcceptedSize(Screen.width, 0)
#else #else
.SetCodeId(entity.codeId) .SetCodeId(entity.codeId)
////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应 ////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应
.SetExpressViewAcceptedSize(Screen.width, 0) .SetExpressViewAcceptedSize(Screen.width, 0)
.SetImageAcceptedSize(1080, 1920)
#endif #endif
.SetSupportDeepLink(true) .SetSupportDeepLink(true)
.SetImageAcceptedSize(1080, 1920)
.SetOrientation(AdOrientation.Horizontal) .SetOrientation(AdOrientation.Horizontal)
.SetAdCount(1) //请求广告数量为1到3条 .SetAdCount(1) //请求广告数量为1到3条
.Build(); .Build();
...@@ -85,19 +103,28 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -85,19 +103,28 @@ public class CSJFeedUtil : MonoBehaviour
//FeedAd IOS 和 Android 相同 //FeedAd IOS 和 Android 相同
private ExpressAd feedAd; private ExpressAd feedAd;
// 判断是否是刘海屏
private static bool isX;
public static bool IsX
{
get => isX = !(Screen.width == 750 && Screen.height == 1334) && !(Screen.width == 1242 && Screen.height == 2208) && !(Screen.width == 640 && Screen.height == 1136) && !(Screen.width == 1080 && Screen.height == 1920);
set => isX = value;
}
/// <summary> /// <summary>
/// 展示缓存的FeedAd /// 展示缓存的FeedAd
/// </summary> /// </summary>
/// <param name="entity"></param> /// <param name="entity"></param>
public void ShowCacheFeedAd(AdEntity entity,Action<bool> callback) public void ShowCacheFeedAd(AdEntity entity,Action<bool> callback)
{ {
CloseFeedAd(); //CloseFeedAd();
if (feedAdCacheList.Count > 0) if (feedAdCacheList.Count > 0)
{ {
feedAd = feedAdCacheList.Dequeue(); feedAd = feedAdCacheList.Dequeue();
#if UNITY_IOS #if UNITY_IOS
int x = 0; float x = 0;
int y = 100; float y = Screen.height - (Screen.width * 275.5f / 375) - (IsX ? 45 : 0);
//if (y == 0) //if (y == 0)
//{ //{
// y = 100; // 防止Demo里刘海遮挡 // y = 100; // 防止Demo里刘海遮挡
...@@ -162,6 +189,44 @@ public class CSJFeedUtil : MonoBehaviour ...@@ -162,6 +189,44 @@ public class CSJFeedUtil : MonoBehaviour
} }
/// <summary>
/// 代替关闭方法的加载方法监听
/// </summary>
private sealed class CloseLoadFeedAdListener : IExpressAdListener
{
private AdEntity entity;
private Action<bool> callback;
public CloseLoadFeedAdListener(AdEntity entity, Action<bool> callback)
{
this.entity = entity;
this.callback = callback;
}
public void OnError(int code, string message)
{
callback(false);
}
public void OnExpressAdLoad(List<ExpressAd> ads)
{
}
#if UNITY_IOS
public void OnExpressBannerAdLoad(ExpressBannerAd ad)
{
}
public void OnExpressInterstitialAdLoad(ExpressInterstitialAd ad)
{
}
#else
#endif
}
private sealed class ExpressAdInteractionListener : IExpressAdInteractionListener private sealed class ExpressAdInteractionListener : IExpressAdInteractionListener
{ {
......
...@@ -726,22 +726,22 @@ public sealed class Example : MonoBehaviour ...@@ -726,22 +726,22 @@ public sealed class Example : MonoBehaviour
public void LoadExpressFeedAd() public void LoadExpressFeedAd()
{ {
//this.width = GameObject.Find("Canvas/Width").GetComponent<InputField>(); this.width = GameObject.Find("Canvas/Width").GetComponent<InputField>();
//this.height = GameObject.Find("Canvas/Height").GetComponent<InputField>(); this.height = GameObject.Find("Canvas/Height").GetComponent<InputField>();
//int width; int width;
//int height; int height;
//int.TryParse(this.width.text, out width); int.TryParse(this.width.text, out width);
//int.TryParse(this.height.text, out height); int.TryParse(this.height.text, out height);
//if (width == 0) if (width == 0)
//{ {
// width = 375; width = Screen.width;
//} }
//if (height == 0) if (height == 0)
//{ {
// height = 0; height = 0;
//} }
#if UNITY_IOS #if UNITY_IOS
...@@ -760,14 +760,14 @@ public sealed class Example : MonoBehaviour ...@@ -760,14 +760,14 @@ public sealed class Example : MonoBehaviour
var adSlot = new AdSlot.Builder() var adSlot = new AdSlot.Builder()
#if UNITY_IOS #if UNITY_IOS
.SetCodeId("945870984") .SetCodeId("945870984")
.SetExpressViewAcceptedSize(Screen.width, 0) .SetImageAcceptedSize(width, height)
#else #else
.SetCodeId("901121253") .SetCodeId("901121253")
////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应 ////期望模板广告view的size,单位dp,//高度设置为0,则高度会自适应
.SetExpressViewAcceptedSize(350, 0) .SetExpressViewAcceptedSize(350, 0)
.SetImageAcceptedSize(1080, 1920)
#endif #endif
.SetSupportDeepLink(true) .SetSupportDeepLink(true)
.SetImageAcceptedSize(1080, 1920)
.SetOrientation(AdOrientation.Horizontal) .SetOrientation(AdOrientation.Horizontal)
.SetAdCount(1) //请求广告数量为1到3条 .SetAdCount(1) //请求广告数量为1到3条
.Build(); .Build();
...@@ -775,6 +775,25 @@ public sealed class Example : MonoBehaviour ...@@ -775,6 +775,25 @@ public sealed class Example : MonoBehaviour
} }
public void CloseExpressFeedAd()
{
#if UNITY_IOS
if (this.mExpressFeedad != null)
{
this.mExpressFeedad.Dispose();
this.mExpressFeedad = null;
}
#endif
}
// 判断是否是刘海屏
private static bool isX;
public static bool IsX
{
get => isX = !(Screen.width == 750 && Screen.height == 1334) && !(Screen.width == 1242 && Screen.height == 2208) && !(Screen.width == 640 && Screen.height == 1136) && !(Screen.width == 1080 && Screen.height == 1920);
set => isX = value;
}
/// <summary> /// <summary>
/// Show the expressFeed Ad. /// Show the expressFeed Ad.
/// </summary> /// </summary>
...@@ -800,10 +819,13 @@ public sealed class Example : MonoBehaviour ...@@ -800,10 +819,13 @@ public sealed class Example : MonoBehaviour
if (y == 0) if (y == 0)
{ {
y = 100; // 防止Demo里刘海遮挡 this.mExpressFeedad.ShowExpressAd(x, Screen.height - (Screen.width * 275.5f / 375) + (IsX ? 45 : 0));
} }
else
this.mExpressFeedad.ShowExpressAd(x, y); {
this.mExpressFeedad.ShowExpressAd(x, y);
}
#else #else
if (this.mExpressFeedad == null) if (this.mExpressFeedad == null)
{ {
......
...@@ -153,7 +153,7 @@ RectTransform: ...@@ -153,7 +153,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 1701156893} - {fileID: 1701156893}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 23 m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -622,7 +622,7 @@ RectTransform: ...@@ -622,7 +622,7 @@ RectTransform:
- {fileID: 390820842} - {fileID: 390820842}
- {fileID: 1900675143} - {fileID: 1900675143}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 27 m_RootOrder: 28
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -692,6 +692,7 @@ MonoBehaviour: ...@@ -692,6 +692,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &298469318 --- !u!114 &298469318
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1175,6 +1176,136 @@ CanvasRenderer: ...@@ -1175,6 +1176,136 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 390820841} m_GameObject: {fileID: 390820841}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &435488353
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 435488354}
- component: {fileID: 435488357}
- component: {fileID: 435488356}
- component: {fileID: 435488355}
m_Layer: 5
m_Name: CloseExpressFeedAd
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &435488354
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 435488353}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2135914299}
m_Father: {fileID: 1314392414}
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 150, y: -399}
m_SizeDelta: {x: 200, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &435488355
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 435488353}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Highlighted
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 435488356}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1314392415}
m_MethodName: CloseExpressFeedAd
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &435488356
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 435488353}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &435488357
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 435488353}
m_CullTransparentMesh: 0
--- !u!1 &451692491 --- !u!1 &451692491
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1286,7 +1417,7 @@ RectTransform: ...@@ -1286,7 +1417,7 @@ RectTransform:
- {fileID: 862931689} - {fileID: 862931689}
- {fileID: 1705353080} - {fileID: 1705353080}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 22 m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -1356,6 +1487,7 @@ MonoBehaviour: ...@@ -1356,6 +1487,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &476831098 --- !u!114 &476831098
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1504,7 +1636,7 @@ RectTransform: ...@@ -1504,7 +1636,7 @@ RectTransform:
- {fileID: 1580559473} - {fileID: 1580559473}
- {fileID: 1509932176} - {fileID: 1509932176}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 20 m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -1574,6 +1706,7 @@ MonoBehaviour: ...@@ -1574,6 +1706,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &512089642 --- !u!114 &512089642
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2137,7 +2270,7 @@ RectTransform: ...@@ -2137,7 +2270,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 2016523971} - {fileID: 2016523971}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 24 m_RootOrder: 25
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -2918,6 +3051,7 @@ RectTransform: ...@@ -2918,6 +3051,7 @@ RectTransform:
- {fileID: 1886729928} - {fileID: 1886729928}
- {fileID: 2012056991} - {fileID: 2012056991}
- {fileID: 1949856215} - {fileID: 1949856215}
- {fileID: 435488354}
- {fileID: 1941372746} - {fileID: 1941372746}
- {fileID: 512089640} - {fileID: 512089640}
- {fileID: 2065175342} - {fileID: 2065175342}
...@@ -3454,7 +3588,7 @@ RectTransform: ...@@ -3454,7 +3588,7 @@ RectTransform:
- {fileID: 339129617} - {fileID: 339129617}
- {fileID: 322711759} - {fileID: 322711759}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 25 m_RootOrder: 26
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -3524,6 +3658,7 @@ MonoBehaviour: ...@@ -3524,6 +3658,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &1538577465 --- !u!114 &1538577465
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -4816,7 +4951,7 @@ RectTransform: ...@@ -4816,7 +4951,7 @@ RectTransform:
- {fileID: 1713482699} - {fileID: 1713482699}
- {fileID: 215046895} - {fileID: 215046895}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 26 m_RootOrder: 27
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -4886,6 +5021,7 @@ MonoBehaviour: ...@@ -4886,6 +5021,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &1837937550 --- !u!114 &1837937550
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -5552,7 +5688,7 @@ RectTransform: ...@@ -5552,7 +5688,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 19 m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -6225,7 +6361,7 @@ RectTransform: ...@@ -6225,7 +6361,7 @@ RectTransform:
- {fileID: 347773257} - {fileID: 347773257}
- {fileID: 1585133255} - {fileID: 1585133255}
m_Father: {fileID: 1314392414} m_Father: {fileID: 1314392414}
m_RootOrder: 21 m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -6295,6 +6431,7 @@ MonoBehaviour: ...@@ -6295,6 +6431,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &2065175344 --- !u!114 &2065175344
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -6696,3 +6833,81 @@ CanvasRenderer: ...@@ -6696,3 +6833,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2116684603} m_GameObject: {fileID: 2116684603}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &2135914298
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2135914299}
- component: {fileID: 2135914301}
- component: {fileID: 2135914300}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2135914299
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2135914298}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 435488354}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2135914300
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2135914298}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 15
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: CloseExpressFeedAd
--- !u!222 &2135914301
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2135914298}
m_CullTransparentMesh: 0
...@@ -382,7 +382,7 @@ MonoBehaviour: ...@@ -382,7 +382,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 788e2a3a769e26b459cd63d4a5de7d76, type: 3} m_Script: {fileID: 11500000, guid: 788e2a3a769e26b459cd63d4a5de7d76, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
isTest: 0 isTest: 1
isShowLog: 1 isShowLog: 1
XyDialog: {fileID: 0} XyDialog: {fileID: 0}
--- !u!1 &2010092450 --- !u!1 &2010092450
......
...@@ -231,14 +231,14 @@ public class AdUtils ...@@ -231,14 +231,14 @@ public class AdUtils
#endif #endif
AdManager.Instance.CloseFeedAd(); AdManager.Instance.CloseFeedAd();
#if UNITY_IOS #if UNITY_IOS
AdManager.Instance.LoadCacheFeedAd("bigimage"); AdManager.Instance.LoadCacheFeedAd("bigimage");
#endif #endif
} }
public static void showBanner(string action) public static void showBanner(string action)
{ {
IsShowRewardAd = true; IsShowRewardAd = true;
#if UNITY_EDITOR #if UNITY_EDITOR || UNITY_IOS
return; return;
#endif #endif
AdManager.Instance.ShowCacheBannerAd("banner", action); AdManager.Instance.ShowCacheBannerAd("banner", action);
......
...@@ -478,12 +478,12 @@ public class DialogControl : MonoBehaviour ...@@ -478,12 +478,12 @@ public class DialogControl : MonoBehaviour
//EventUtils.OnEvent("addDiamond_click", "点击钻石加号"); //EventUtils.OnEvent("addDiamond_click", "点击钻石加号");
AudioUtils.ins.PlayBtnAudio(); AudioUtils.ins.PlayBtnAudio();
DiamondDialog.SetActive(true); DiamondDialog.SetActive(true);
#if UNITY_IOS //#if UNITY_IOS
moveDiamondDialog(); // moveDiamondDialog();
#else //#else
Invoke("showAd",0.5f); Invoke("showAd",0.5f);
Invoke("moveDiamondDialog", 1f); Invoke("moveDiamondDialog", 1f);
#endif //#endif
HttpTool.Instance._Get("app/v1/wdlc/reward/diamond_by_video_status", parm, new Action<DiamondStatusBean>((bean) => HttpTool.Instance._Get("app/v1/wdlc/reward/diamond_by_video_status", parm, new Action<DiamondStatusBean>((bean) =>
{ {
...@@ -587,12 +587,12 @@ public class DialogControl : MonoBehaviour ...@@ -587,12 +587,12 @@ public class DialogControl : MonoBehaviour
AllSpeedDialog.SetActive(true); AllSpeedDialog.SetActive(true);
allSpeedDesc.text = "所有作物成熟速度加" + bean.reduceMinute + "分钟"; allSpeedDesc.text = "所有作物成熟速度加" + bean.reduceMinute + "分钟";
useAllSpeedByVideoNumTv.text = "每天0点重置视频次数(剩余" + bean.todayVideoRemainingNum + "次)"; useAllSpeedByVideoNumTv.text = "每天0点重置视频次数(剩余" + bean.todayVideoRemainingNum + "次)";
#if UNITY_IOS //#if UNITY_IOS
moveAllSpeedDialog(); // moveAllSpeedDialog();
#else //#else
Invoke("showAd", 0.5f); Invoke("showAd", 0.5f);
Invoke("moveAllSpeedDialog", 1f); Invoke("moveAllSpeedDialog", 1f);
#endif //#endif
//HttpTool.Instance._Get("app/v1/game/reward_video/status", parm, new Action<VideoStatusBean>((bean) => //HttpTool.Instance._Get("app/v1/game/reward_video/status", parm, new Action<VideoStatusBean>((bean) =>
//{ //{
...@@ -641,11 +641,10 @@ public class DialogControl : MonoBehaviour ...@@ -641,11 +641,10 @@ public class DialogControl : MonoBehaviour
/// </summary> /// </summary>
public void OnClickCloseAllSpeedDialog() public void OnClickCloseAllSpeedDialog()
{ {
AdUtils.closeFeedAd();
allspeedcontent.transform.localPosition -= new Vector3(0, 320, 0); allspeedcontent.transform.localPosition -= new Vector3(0, 320, 0);
AudioUtils.ins.PlayBtnAudio(); AudioUtils.ins.PlayBtnAudio();
AllSpeedDialog.SetActive(false); AllSpeedDialog.SetActive(false);
AdUtils.closeFeedAd();
} }
//使用及时雨 //使用及时雨
......
...@@ -34,12 +34,12 @@ public class StickDialog : MonoBehaviour ...@@ -34,12 +34,12 @@ public class StickDialog : MonoBehaviour
Debug.unityLogger.Log("显示害虫弹窗"+arg); Debug.unityLogger.Log("显示害虫弹窗"+arg);
StickDialogObj.SetActive(true); StickDialogObj.SetActive(true);
#if UNITY_IOS //#if UNITY_IOS
moveDialog(); // moveDialog();
#else //#else
AdUtils.showFeedAd("stick"); AdUtils.showFeedAd("stick");
Invoke("moveDialog", 1f); Invoke("moveDialog", 1f);
#endif //#endif
} }
private void moveDialog() private void moveDialog()
{ {
......
...@@ -5,16 +5,22 @@ EditorBuildSettings: ...@@ -5,16 +5,22 @@ EditorBuildSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 1 - enabled: 0
path: Assets/Game/Main/Scenes/InitScene.unity path: Assets/Game/Main/Scenes/InitScene.unity
guid: 902436d14e36d4d42921eab701175b51 guid: 902436d14e36d4d42921eab701175b51
- enabled: 1 - enabled: 0
path: Assets/Game/Splash/Splash.unity path: Assets/Game/Splash/Splash.unity
guid: 37af8cf3fb373478ab04e3ee2f3b700a guid: 37af8cf3fb373478ab04e3ee2f3b700a
- enabled: 1 - enabled: 0
path: Assets/Game/Main/Scenes/CrazyCar.unity path: Assets/Game/Main/Scenes/CrazyCar.unity
guid: 2ae344869669f6641a05481805b94e98 guid: 2ae344869669f6641a05481805b94e98
- enabled: 0 - enabled: 0
path: Assets/Base/AdSDK/AD/Demo/AdDemo.unity path: Assets/Base/AdSDK/AD/Demo/AdDemo.unity
guid: ef80a35d44f809e4a8957d1ed9571fd2 guid: ef80a35d44f809e4a8957d1ed9571fd2
- enabled: 0
path: Assets/Base/AdSDK/AD/CSJ/Example/Example.unity
guid: 1e4f8457b1266154e80399e42b932ceb
- enabled: 1
path: Assets/Base/AdSDK/AD/GDT/UnionDemo/UnionExample.unity
guid: 6c963ae210fa3c3438c2f6770ee81fc9
m_configObjects: {} m_configObjects: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment