com.azerion.bluestack 3.0.3 → 3.1.0-preview2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/Android/AndroidBuildPostProcess.cs +0 -1
- package/Editor/Android/AndroidDependency.cs +1 -2
- package/Editor/Android/AndroidDependencyModifier.cs +55 -0
- package/Editor/Android/AndroidDependencyModifier.cs.meta +3 -0
- package/Editor/Android/AndroidDependencyParser.cs +26 -1
- package/Editor/Android/ManifestProcessor.cs +2 -1
- package/Editor/Azerion.BlueStack.Editor.asmdef +14 -14
- package/Editor/BlueStackDependencies.xml +1 -1
- package/Editor/BlueStackMediationDependencies.xml +11 -0
- package/Editor/BlueStackMediationDependencies.xml.meta +7 -0
- package/Editor/BlueStackSettings.cs +21 -18
- package/Editor/BlueStackSettingsEditor.cs +64 -1
- package/Editor/DebugHelper.cs +2 -2
- package/Editor/Dependency.cs +1 -1
- package/Editor/DependencyProvider.cs +213 -2
- package/Editor/IDependencyModifier.cs +12 -0
- package/Editor/IDependencyModifier.cs.meta +11 -0
- package/Editor/IDependencyParser.cs +1 -0
- package/Editor/MediationNetworkDependency.cs +34 -0
- package/Editor/MediationNetworkDependency.cs.meta +3 -0
- package/Editor/iOS/IOSDependency.cs +12 -0
- package/Editor/iOS/IOSDependency.cs.meta +11 -0
- package/Editor/iOS/IOSDependencyModifier.cs +105 -0
- package/Editor/iOS/IOSDependencyModifier.cs.meta +3 -0
- package/Editor/iOS/IOSDependencyParser.cs +32 -0
- package/Editor/iOS/PodDependency/PodDependencyUtils.cs +5 -1
- package/Example/Azerion.BlueStack.Example.asmdef +14 -14
- package/Example/Scripts/NativeAdManager.cs +5 -7
- package/Example/Scripts/SmallNativeAdManager.cs +4 -6
- package/README.md +4 -1
- package/Runtime/API/AdSize.cs +2 -2
- package/Runtime/API/Banner/BannerAd.cs +1 -1
- package/Runtime/API/BlueStackAds.cs +7 -3
- package/Runtime/API/InterstitialAd.cs +20 -5
- package/Runtime/API/NativeAd/NativeAd.cs +20 -26
- package/Runtime/API/NativeAd/NativeAdEventArgs.cs +1 -5
- package/Runtime/API/NativeAd/NativeAdInteractionHandler.cs +176 -173
- package/Runtime/API/NativeAd/NativeAdLoader.cs +10 -14
- package/Runtime/API/NativeAd/NativeAdObject.cs +563 -547
- package/Runtime/API/NativeAd/NativeAdType.cs +6 -6
- package/Runtime/API/NativeAd/NativeAssetInfo.cs +28 -28
- package/Runtime/Azerion.BlueStack.asmdef +14 -14
- package/Runtime/Common/NativeAd/AdLoaderClientArgs.cs +8 -8
- package/Runtime/Common/NativeAd/AdsEventExecutor.cs +69 -68
- package/Runtime/Common/NativeAd/DummyNativeClient.cs +52 -52
- package/Runtime/Common/NativeAd/NativeClientEventArgs.cs +5 -5
- package/Runtime/Common/NativeAd/NativeUtils.cs +111 -107
- package/Runtime/Internal/IBannerAdClient.cs +1 -1
- package/Runtime/Internal/IBlueStackClient.cs +2 -1
- package/Runtime/Internal/NativeAd/IAdLoaderClient.cs +12 -12
- package/Runtime/Internal/NativeAd/INativeAdClient.cs +1 -1
- package/Runtime/Internal/NativeAd/INativeClientFactory.cs +5 -5
- package/Runtime/Platforms/Android/BlueStackClient.cs +2 -1
- package/Runtime/Platforms/Android/BlueStackNativeClassNames.cs +2 -1
- package/Runtime/Platforms/Unity/AdvertisementManager.cs +5 -4
- package/Runtime/Platforms/Unity/BannerAdClient.cs +16 -9
- package/Runtime/Platforms/Unity/BaseAdClient.cs +7 -5
- package/Runtime/Platforms/Unity/BlueStackClient.cs +4 -3
- package/Runtime/Platforms/Unity/ClientsFactory.cs +0 -1
- package/Runtime/Platforms/Unity/InitializationStatusClient.cs +1 -0
- package/Runtime/Platforms/Unity/InterstitialAdClient.cs +12 -6
- package/Runtime/Platforms/Unity/NativeAdClient.cs +16 -10
- package/Runtime/Platforms/Unity/RewardedVideoAdClient.cs +9 -3
- package/Runtime/Platforms/Unity/Utils.cs +7 -3
- package/Runtime/Platforms/iOS/BannerAdClient.cs +33 -24
- package/Runtime/Platforms/iOS/BlueStackClient.cs +14 -10
- package/Runtime/Platforms/iOS/ClientsFactory.cs +0 -2
- package/Runtime/Platforms/iOS/Externs.cs +72 -65
- package/Runtime/Platforms/iOS/InitializationStatusClient.cs +6 -5
- package/Runtime/Platforms/iOS/InterstitialAdClient.cs +27 -21
- package/Runtime/Platforms/iOS/NativeAdClient.cs +27 -22
- package/Runtime/Platforms/iOS/PreferenceClient.cs +1 -1
- package/Runtime/Platforms/iOS/RewardedVideoAdClient.cs +27 -20
- package/Runtime/Platforms/iOS/Utils.cs +6 -3
- package/Runtime/Utilities/MiniJSON.cs +12 -12
- package/package.json +1 -1
- package/Editor/iOS/Dependency.cs +0 -0
- package/Editor/iOS/Dependency.cs.meta +0 -3
|
@@ -2,42 +2,42 @@ using System.Collections.Generic;
|
|
|
2
2
|
|
|
3
3
|
namespace Azerion.BlueStack.API
|
|
4
4
|
{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
public class NativeAssetID
|
|
6
|
+
{
|
|
7
|
+
public string Value { get; set; }
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
public static NativeAssetID Image => new NativeAssetID("Image");
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
public static NativeAssetID Icon => new NativeAssetID("Icon");
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
public static NativeAssetID AdChoices => new NativeAssetID("AdChoices");
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
public static NativeAssetID Headline => new NativeAssetID("Headline");
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
public static NativeAssetID Body => new NativeAssetID("Body");
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
public static NativeAssetID CallToAction => new NativeAssetID("CallToAction");
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
public static NativeAssetID Advertiser => new NativeAssetID("Advertiser");
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
public static NativeAssetID Price => new NativeAssetID("Price");
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
public static NativeAssetID Store => new NativeAssetID("Store");
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
private NativeAssetID(string value)
|
|
28
|
+
{
|
|
29
|
+
Value = value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
33
|
+
public class NativeAssetInfo
|
|
34
|
+
{
|
|
35
|
+
public static List<string> RequiredAssets => new List<string>
|
|
36
|
+
{
|
|
37
|
+
NativeAssetID.Icon.Value,
|
|
38
|
+
NativeAssetID.Headline.Value,
|
|
39
|
+
NativeAssetID.CallToAction.Value,
|
|
40
|
+
NativeAssetID.Advertiser.Value
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"name": "Azerion.BlueStack",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [],
|
|
5
|
+
"includePlatforms": [],
|
|
6
|
+
"excludePlatforms": [],
|
|
7
|
+
"allowUnsafeCode": false,
|
|
8
|
+
"overrideReferences": false,
|
|
9
|
+
"precompiledReferences": [
|
|
10
|
+
""
|
|
11
|
+
],
|
|
12
|
+
"autoReferenced": true,
|
|
13
|
+
"defineConstraints": [],
|
|
14
|
+
"versionDefines": [],
|
|
15
|
+
"noEngineReferences": false
|
|
16
16
|
}
|
|
@@ -3,14 +3,14 @@ using Azerion.BlueStack.API;
|
|
|
3
3
|
|
|
4
4
|
namespace Azerion.BlueStack.Common
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
public class AdLoaderClientArgs
|
|
7
|
+
{
|
|
8
|
+
public string AdUnitId { get; set; }
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
public HashSet<NativeAdType> AdTypes { get; set; }
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
internal Dictionary<string, bool> FormatIds { get; set; }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
internal int NumberOfAdsToLoad { get; set; }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -5,80 +5,81 @@ using UnityEngine.Events;
|
|
|
5
5
|
|
|
6
6
|
namespace Azerion.BlueStack.Common
|
|
7
7
|
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
public class AdsEventExecutor : MonoBehaviour
|
|
9
|
+
{
|
|
10
|
+
public static AdsEventExecutor instance = null;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
private static System.Collections.Generic.List<System.Action> adEventsQueue =
|
|
13
|
+
new System.Collections.Generic.List<System.Action>();
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
private static volatile bool adEventsQueueEmpty = true;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
GameObject gameObject = new GameObject("AdsMainThreadExecuter");
|
|
23
|
-
gameObject.hideFlags = HideFlags.HideAndDontSave;
|
|
24
|
-
UnityEngine.Object.DontDestroyOnLoad(gameObject);
|
|
25
|
-
AdsEventExecutor.instance = gameObject.AddComponent<AdsEventExecutor>();
|
|
26
|
-
}
|
|
17
|
+
public static void Initialize()
|
|
18
|
+
{
|
|
19
|
+
if (AdsEventExecutor.IsActive())
|
|
20
|
+
{
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
GameObject gameObject = new GameObject("AdsMainThreadExecuter");
|
|
25
|
+
gameObject.hideFlags = HideFlags.HideAndDontSave;
|
|
26
|
+
UnityEngine.Object.DontDestroyOnLoad(gameObject);
|
|
27
|
+
AdsEventExecutor.instance = gameObject.AddComponent<AdsEventExecutor>();
|
|
28
|
+
}
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
public static bool IsActive()
|
|
31
|
+
{
|
|
32
|
+
return AdsEventExecutor.instance != null;
|
|
33
|
+
}
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
AdsEventExecutor.adEventsQueue.Add(action);
|
|
44
|
-
AdsEventExecutor.adEventsQueueEmpty = false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
35
|
+
public void Awake()
|
|
36
|
+
{
|
|
37
|
+
UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
|
|
38
|
+
}
|
|
47
39
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
public static void ExecuteInUpdate(System.Action action)
|
|
41
|
+
{
|
|
42
|
+
object obj = AdsEventExecutor.adEventsQueue;
|
|
43
|
+
lock (obj)
|
|
44
|
+
{
|
|
45
|
+
AdsEventExecutor.adEventsQueue.Add(action);
|
|
46
|
+
AdsEventExecutor.adEventsQueueEmpty = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
System.Collections.Generic.List<System.Action> list = new System.Collections.Generic.List<System.Action>();
|
|
63
|
-
object obj = AdsEventExecutor.adEventsQueue;
|
|
64
|
-
lock (obj)
|
|
65
|
-
{
|
|
66
|
-
list.AddRange(AdsEventExecutor.adEventsQueue);
|
|
67
|
-
AdsEventExecutor.adEventsQueue.Clear();
|
|
68
|
-
AdsEventExecutor.adEventsQueueEmpty = true;
|
|
69
|
-
}
|
|
70
|
-
foreach (System.Action current in list)
|
|
71
|
-
{
|
|
72
|
-
if (current.Target != null)
|
|
73
|
-
{
|
|
74
|
-
current();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
50
|
+
public static void InvokeInUpdate(UnityEvent eventParam)
|
|
51
|
+
{
|
|
52
|
+
AdsEventExecutor.ExecuteInUpdate(delegate { eventParam.Invoke(); });
|
|
53
|
+
}
|
|
78
54
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
55
|
+
public void Update()
|
|
56
|
+
{
|
|
57
|
+
if (AdsEventExecutor.adEventsQueueEmpty)
|
|
58
|
+
{
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
System.Collections.Generic.List<System.Action> list = new System.Collections.Generic.List<System.Action>();
|
|
63
|
+
object obj = AdsEventExecutor.adEventsQueue;
|
|
64
|
+
lock (obj)
|
|
65
|
+
{
|
|
66
|
+
list.AddRange(AdsEventExecutor.adEventsQueue);
|
|
67
|
+
AdsEventExecutor.adEventsQueue.Clear();
|
|
68
|
+
AdsEventExecutor.adEventsQueueEmpty = true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
foreach (System.Action current in list)
|
|
72
|
+
{
|
|
73
|
+
if (current.Target != null)
|
|
74
|
+
{
|
|
75
|
+
current();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public void OnDisable()
|
|
81
|
+
{
|
|
82
|
+
AdsEventExecutor.instance = null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -7,55 +7,55 @@ using UnityEngine;
|
|
|
7
7
|
|
|
8
8
|
namespace Azerion.BlueStack.Common
|
|
9
9
|
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
10
|
+
// public class DummyNativeClient : INativeAdInteractionHandlerClient, IAdLoaderClient
|
|
11
|
+
// {
|
|
12
|
+
// //* public event EventHandler<LoadAdErrorClientEventArgs> OnAdFailedToLoad;
|
|
13
|
+
//
|
|
14
|
+
// public event EventHandler<NativeClientEventArgs> OnNativeAdLoaded;
|
|
15
|
+
//
|
|
16
|
+
// public event EventHandler<EventArgs> OnNativeAdImpression;
|
|
17
|
+
//
|
|
18
|
+
// public event EventHandler<EventArgs> OnNativeAdClicked;
|
|
19
|
+
//
|
|
20
|
+
// public event EventHandler<EventArgs> OnNativeAdOpening;
|
|
21
|
+
//
|
|
22
|
+
// public event EventHandler<EventArgs> OnNativeAdClosed;
|
|
23
|
+
//
|
|
24
|
+
// public DummyNativeClient()
|
|
25
|
+
// {
|
|
26
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
27
|
+
// }
|
|
28
|
+
//
|
|
29
|
+
// //* public void LoadAd(AdRequest request)
|
|
30
|
+
// // {
|
|
31
|
+
// // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
32
|
+
// // }
|
|
33
|
+
//
|
|
34
|
+
// public void CreateAdLoader(AdLoaderClientArgs args)
|
|
35
|
+
// {
|
|
36
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// public Dictionary<string, string> GetAssetIDMappings()
|
|
40
|
+
// {
|
|
41
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
42
|
+
// return null;
|
|
43
|
+
// }
|
|
44
|
+
//
|
|
45
|
+
// public bool RecordImpression(Dictionary<string, object> signal)
|
|
46
|
+
// {
|
|
47
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
48
|
+
// return false;
|
|
49
|
+
// }
|
|
50
|
+
//
|
|
51
|
+
// public void PerformClick(Dictionary<string, object> signal)
|
|
52
|
+
// {
|
|
53
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
54
|
+
// }
|
|
55
|
+
//
|
|
56
|
+
// public void ReportTouchEvent(Dictionary<string, string> signal)
|
|
57
|
+
// {
|
|
58
|
+
// Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
|
|
59
|
+
// }
|
|
60
|
+
// }
|
|
61
|
+
}
|
|
@@ -3,8 +3,8 @@ using Azerion.BlueStack.Internal;
|
|
|
3
3
|
|
|
4
4
|
namespace Azerion.BlueStack.Common
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
public class NativeClientEventArgs : EventArgs
|
|
7
|
+
{
|
|
8
|
+
internal INativeAdClient nativeAdClient { get; set; }
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -8,110 +8,114 @@ using Debug = UnityEngine.Debug;
|
|
|
8
8
|
|
|
9
9
|
namespace Azerion.BlueStack.Common
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
11
|
+
internal class NativeUtils
|
|
12
|
+
{
|
|
13
|
+
public static string Version { get; private set; }
|
|
14
|
+
|
|
15
|
+
static NativeUtils()
|
|
16
|
+
{
|
|
17
|
+
Version version = typeof(NativeUtils).Assembly.GetName().Version;
|
|
18
|
+
NativeUtils.Version = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Revision);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static bool IsRenderedInScreenSpaceOverlayCanvas(GameObject gameObject)
|
|
22
|
+
{
|
|
23
|
+
Canvas componentInParent = gameObject.GetComponentInParent<Canvas>();
|
|
24
|
+
return !(componentInParent == null) && componentInParent.renderMode == RenderMode.ScreenSpaceOverlay;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public static Vector3 GetBoundsMin(GameObject gameObject, Camera cam, Bounds bounds)
|
|
28
|
+
{
|
|
29
|
+
if (!NativeUtils.IsRenderedInScreenSpaceOverlayCanvas(gameObject))
|
|
30
|
+
{
|
|
31
|
+
return cam.WorldToScreenPoint(bounds.min);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return bounds.min;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static Vector3 GetBoundsMax(GameObject gameObject, Camera cam, Bounds bounds)
|
|
38
|
+
{
|
|
39
|
+
if (!NativeUtils.IsRenderedInScreenSpaceOverlayCanvas(gameObject))
|
|
40
|
+
{
|
|
41
|
+
return cam.WorldToScreenPoint(bounds.max);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return bounds.max;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static Camera GetCamera()
|
|
48
|
+
{
|
|
49
|
+
Camera[] array = new Camera[Camera.allCamerasCount];
|
|
50
|
+
Camera.GetAllCameras(array);
|
|
51
|
+
Camera camera = null;
|
|
52
|
+
foreach (var camera2 in array)
|
|
53
|
+
{
|
|
54
|
+
if (camera == null || camera2.depth >= camera.depth)
|
|
55
|
+
{
|
|
56
|
+
camera = camera2;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return camera;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static float ConvertPxToDp(float pixels)
|
|
64
|
+
{
|
|
65
|
+
float num = 160f;
|
|
66
|
+
return pixels / (Screen.dpi / num);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public static Dictionary<string, string> CastAssetIDMappings(string jsonMappings)
|
|
70
|
+
{
|
|
71
|
+
Dictionary<string, object> dictionary = Json.Deserialize(jsonMappings) as Dictionary<string, object>;
|
|
72
|
+
Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
|
|
73
|
+
foreach (KeyValuePair<string, object> current in dictionary)
|
|
74
|
+
{
|
|
75
|
+
dictionary2.Add(current.Key, (current.Value != null) ? current.Value.ToString() : string.Empty);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return dictionary2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[DebuggerHidden]
|
|
82
|
+
public static IEnumerator LoadImage(string url, Action<Texture2D> callback)
|
|
83
|
+
{
|
|
84
|
+
WWW www = new WWW(url);
|
|
85
|
+
float elapsedTime = 0f;
|
|
86
|
+
while (!www.isDone)
|
|
87
|
+
{
|
|
88
|
+
elapsedTime += Time.deltaTime;
|
|
89
|
+
if (elapsedTime >= 10f)
|
|
90
|
+
{
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
yield return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!www.isDone || !string.IsNullOrEmpty(www.error))
|
|
98
|
+
{
|
|
99
|
+
callback(null);
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
{
|
|
103
|
+
callback(www.texture);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public static void CheckInitialization()
|
|
108
|
+
{
|
|
109
|
+
if (!AdsEventExecutor.IsActive())
|
|
110
|
+
AdsEventExecutor.Initialize();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public static Texture2D GetTexture2DFromByteArray(byte[] img)
|
|
114
|
+
{
|
|
115
|
+
Texture2D tex = new Texture2D(1, 1);
|
|
116
|
+
return tex.LoadImage(img)
|
|
117
|
+
? tex
|
|
118
|
+
: throw new InvalidOperationException("Could not load custom native template image asset as texture");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -18,7 +18,7 @@ namespace Azerion.BlueStack.Internal
|
|
|
18
18
|
event EventHandler<BlueStackError> OnBannerDidFailToRefresh;
|
|
19
19
|
|
|
20
20
|
event EventHandler<EventArgs> OnBannerHide;
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
event EventHandler<EventArgs> OnBannerDisplay;
|
|
23
23
|
|
|
24
24
|
void CreateBannerAd(string placementId, AdPosition adPosition);
|
|
@@ -5,6 +5,7 @@ namespace Azerion.BlueStack.Internal
|
|
|
5
5
|
{
|
|
6
6
|
public interface IBlueStackClient
|
|
7
7
|
{
|
|
8
|
-
void Initialize(string appId, Settings settings,Action<SDKInitializationStatus> sdkInitCompleteAction,
|
|
8
|
+
void Initialize(string appId, Settings settings, Action<SDKInitializationStatus> sdkInitCompleteAction,
|
|
9
|
+
Action<IInitializationStatusClient> adaptersInitCompleteAction);
|
|
9
10
|
}
|
|
10
11
|
}
|