com.amanotes.gdk 0.2.48 → 0.2.49
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/CHANGELOG.md +10 -0
- package/Editor/AmaGDKEditor.cs +133 -65
- package/Editor/AmaGDKExtra.cs +31 -0
- package/Editor/AmaGDKExtra.cs.meta +11 -0
- package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs +1 -1
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/AmaGDKProject.unitypackage +0 -0
- package/Extra/SDKVersionTracking.unitypackage +0 -0
- package/Extra/SDKVersionTracking.unitypackage.meta +7 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
- package/Packages/IronSourceAdapter.unitypackage +0 -0
- package/Packages/RevenueCatAdapter.unitypackage +0 -0
- package/Runtime/AmaGDK.Adapters.cs +0 -4
- package/Runtime/AmaGDK.Ads.cs +89 -29
- package/Runtime/AmaGDK.Analytics.cs +97 -64
- package/Runtime/AmaGDK.IAP.cs +39 -45
- package/Runtime/AmaGDK.RemoteConfig.cs +76 -52
- package/Runtime/AmaGDK.UserProfile.cs +106 -124
- package/Runtime/AmaGDK.cs +46 -35
- package/Runtime/Internal/AmaGDK.Event.cs +185 -0
- package/Runtime/Internal/AmaGDK.Event.cs.meta +3 -0
- package/Runtime/Internal/AmaGDK.Internal.cs +3 -0
- package/Runtime/Internal/AmaGDK.Utils.cs +85 -24
- package/Runtime/Klavar/Attributes.meta +0 -4
- package/Runtime/Klavar.meta +0 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.49 - 2024-01-29]
|
|
4
|
+
- New feature: SDK version tracking
|
|
5
|
+
- New feature: Google Consent Management (CMP)
|
|
6
|
+
- New feature: Force update pop-up
|
|
7
|
+
- Add event dispatcher, unit tests
|
|
8
|
+
- Update user profile and map_user_id event
|
|
9
|
+
- Fix accumulated_count logic
|
|
10
|
+
- Fix IAP editor
|
|
11
|
+
- Improve generated code for Klavar
|
|
12
|
+
|
|
3
13
|
## [0.2.48 - 2024-01-15]
|
|
4
14
|
- Add GDKTest project for Unity versions 2020.3, 2021.3 and 2022.3
|
|
5
15
|
- Integrate Klavar library & toolset
|
package/Editor/AmaGDKEditor.cs
CHANGED
|
@@ -7,9 +7,11 @@ using System.Linq;
|
|
|
7
7
|
using System.Reflection;
|
|
8
8
|
using UnityEditor;
|
|
9
9
|
using UnityEngine;
|
|
10
|
+
using UnityEngine.Profiling;
|
|
10
11
|
using static Amanotes.Core.Internal.Logging;
|
|
11
12
|
using static Amanotes.Core.AmaGDK.AdapterID;
|
|
12
13
|
using UnityObject = UnityEngine.Object;
|
|
14
|
+
using UnityEvent = UnityEngine.Event;
|
|
13
15
|
|
|
14
16
|
namespace Amanotes.Editor
|
|
15
17
|
{
|
|
@@ -18,7 +20,7 @@ namespace Amanotes.Editor
|
|
|
18
20
|
{
|
|
19
21
|
private static readonly Color BLUE = new Color32(0x34, 0xFF, 0xF7, 0xFF);
|
|
20
22
|
private static readonly Color ORANGE = new Color32(0xFF, 0xC0, 0x00, 0xFF);
|
|
21
|
-
|
|
23
|
+
|
|
22
24
|
[NonSerialized] private static AmaGDK sdk;
|
|
23
25
|
[NonSerialized] private static ConfigAsset configAsset;
|
|
24
26
|
[NonSerialized] private static UnityObject invalidConfigAsset;
|
|
@@ -29,13 +31,12 @@ namespace Amanotes.Editor
|
|
|
29
31
|
private static bool showConfigDetail;
|
|
30
32
|
private static bool showAdapterInstaller;
|
|
31
33
|
private static bool showExampleDetail;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
private static bool showVersionTracking;
|
|
35
|
+
|
|
35
36
|
// DO NOT PUT [NonSerialized]
|
|
36
37
|
private static bool adapterScanned = false;
|
|
37
38
|
private static bool searchedForConfig = false;
|
|
38
|
-
|
|
39
|
+
|
|
39
40
|
private static readonly List<string> adapterPackages = new List<string>();
|
|
40
41
|
|
|
41
42
|
public static Color btnColor;
|
|
@@ -49,12 +50,12 @@ namespace Amanotes.Editor
|
|
|
49
50
|
IRONSOURCE,
|
|
50
51
|
REVENUECAT
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
|
|
53
54
|
public void OnEnable()
|
|
54
55
|
{
|
|
55
56
|
sdk = (AmaGDK)target;
|
|
56
57
|
if (sdk != null) sdk.transform.hideFlags = HideFlags.HideInInspector;
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
SDKStatus.ClearCache();
|
|
59
60
|
TryLoadConfigAsset();
|
|
60
61
|
RefreshListAdapters();
|
|
@@ -65,18 +66,18 @@ namespace Amanotes.Editor
|
|
|
65
66
|
if (configAsset != null) return;
|
|
66
67
|
if (EditorApplication.isCompiling) return;
|
|
67
68
|
if (EditorApplication.isUpdating) return;
|
|
68
|
-
|
|
69
|
+
|
|
69
70
|
searchedForConfig = true;
|
|
70
71
|
Resources.UnloadUnusedAssets();
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
configAsset = Resources.Load<ConfigAsset>("AmaGDKConfig");
|
|
73
74
|
invalidConfigAsset = configAsset == null ? Resources.Load("AmaGDKConfig") : null;
|
|
74
|
-
|
|
75
|
+
|
|
75
76
|
RefreshListAdapters();
|
|
76
77
|
SDKStatus.ClearCache();
|
|
77
78
|
Repaint();
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
|
|
80
81
|
private void DrawGUI_ConfigMissing()
|
|
81
82
|
{
|
|
82
83
|
EditorGUI.indentLevel--;
|
|
@@ -98,7 +99,7 @@ namespace Amanotes.Editor
|
|
|
98
99
|
AssetDatabase.ImportPackage(Res.AMAGDK_CONFIG_PACKAGE, false);
|
|
99
100
|
adapterScanned = false;
|
|
100
101
|
}
|
|
101
|
-
|
|
102
|
+
|
|
102
103
|
if (GUILayout.Button(EditorGUIUtility.IconContent("d_Refresh@2x"), GUILayout.Width(40f), GUILayout.Height(40f)))
|
|
103
104
|
{
|
|
104
105
|
TryLoadConfigAsset();
|
|
@@ -144,7 +145,17 @@ namespace Amanotes.Editor
|
|
|
144
145
|
adapterPackages.Add(Path.GetFileName(adapterPath[i]));
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
+
|
|
149
|
+
private void DrawGUI_VersionTracking()
|
|
150
|
+
{
|
|
151
|
+
if (GUILayout.Button("SDK Version Tracking"))
|
|
152
|
+
{
|
|
153
|
+
var package = $"{Res.PACKAGE_PATH}SDKVersionTracking.unitypackage";
|
|
154
|
+
AssetDatabase.ImportPackage(package, true);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
148
159
|
private void DrawGUI_AdapterList()
|
|
149
160
|
{
|
|
150
161
|
if (!adapterScanned) ScanForAdapterPackages();
|
|
@@ -167,7 +178,7 @@ namespace Amanotes.Editor
|
|
|
167
178
|
AssetDatabase.ImportPackage(package, false);
|
|
168
179
|
}
|
|
169
180
|
}
|
|
170
|
-
|
|
181
|
+
|
|
171
182
|
private void DrawGUI_ColorPicker()
|
|
172
183
|
{
|
|
173
184
|
GUILayout.BeginHorizontal();
|
|
@@ -177,7 +188,7 @@ namespace Amanotes.Editor
|
|
|
177
188
|
}
|
|
178
189
|
GUILayout.EndHorizontal();
|
|
179
190
|
}
|
|
180
|
-
|
|
191
|
+
|
|
181
192
|
// public void CopyVersion()
|
|
182
193
|
// {
|
|
183
194
|
// var sb = new StringBuilder();
|
|
@@ -206,7 +217,7 @@ namespace Amanotes.Editor
|
|
|
206
217
|
{
|
|
207
218
|
AmaGUI.SectionLabel($"<b>AmaGDK</b> <size=12><color=gray>v{AmaGDK.VERSION}</color></size>");
|
|
208
219
|
var rect = GUILayoutUtility.GetLastRect();
|
|
209
|
-
if (
|
|
220
|
+
if (UnityEvent.current.isMouse && UnityEvent.current.button == 1 && rect.Contains(UnityEvent.current.mousePosition))
|
|
210
221
|
{
|
|
211
222
|
var menu = new GenericMenu();
|
|
212
223
|
menu.AddDisabledItem(new GUIContent("AmaGDK"));
|
|
@@ -218,30 +229,35 @@ namespace Amanotes.Editor
|
|
|
218
229
|
});
|
|
219
230
|
menu.AddItem(new GUIContent("Clear Cache"), false, () =>
|
|
220
231
|
{
|
|
221
|
-
GDKFileUtils.ClearCacheData();
|
|
232
|
+
GDKFileUtils.ClearCacheData();
|
|
222
233
|
});
|
|
223
234
|
menu.ShowAsContext();
|
|
224
|
-
|
|
235
|
+
UnityEvent.current.Use();
|
|
225
236
|
}
|
|
226
237
|
}
|
|
227
|
-
|
|
238
|
+
|
|
228
239
|
public override void OnInspectorGUI()
|
|
229
240
|
{
|
|
241
|
+
Profiler.BeginSample("GDKEditor.OnInspectorGUI()");
|
|
242
|
+
|
|
230
243
|
if (target == null)
|
|
231
244
|
{
|
|
232
245
|
EditorGUILayout.HelpBox("Target is null!", MessageType.Warning);
|
|
233
246
|
Repaint();
|
|
247
|
+
Profiler.EndSample();
|
|
234
248
|
return;
|
|
235
249
|
}
|
|
236
|
-
|
|
250
|
+
|
|
237
251
|
sdk = (AmaGDK)target;
|
|
238
252
|
if (sdk == null)
|
|
239
253
|
{
|
|
240
254
|
EditorGUILayout.HelpBox("AmaGDK is null!", MessageType.Warning);
|
|
241
255
|
Repaint();
|
|
256
|
+
Profiler.EndSample();
|
|
242
257
|
return;
|
|
243
258
|
}
|
|
244
259
|
|
|
260
|
+
|
|
245
261
|
// DrawGUI_ColorPicker();
|
|
246
262
|
DrawGUI_AmaGDKBanner();
|
|
247
263
|
EditorGUILayout.Space();
|
|
@@ -250,22 +266,24 @@ namespace Amanotes.Editor
|
|
|
250
266
|
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
|
|
251
267
|
{
|
|
252
268
|
EditorGUILayout.HelpBox("Please wait for UnityEditor to finish compiling or importing", MessageType.Warning);
|
|
269
|
+
Profiler.EndSample();
|
|
253
270
|
return;
|
|
254
271
|
}
|
|
255
|
-
|
|
272
|
+
|
|
256
273
|
if (!searchedForConfig) TryLoadConfigAsset();
|
|
257
274
|
if (!adapterScanned) ScanForAdapterPackages();
|
|
258
|
-
|
|
275
|
+
|
|
259
276
|
if (configAsset == null)
|
|
260
277
|
{
|
|
261
278
|
DrawGUI_ConfigMissing();
|
|
262
279
|
Repaint();
|
|
280
|
+
Profiler.EndSample();
|
|
263
281
|
return;
|
|
264
282
|
}
|
|
265
|
-
|
|
283
|
+
|
|
266
284
|
configSO = new SerializedObject(configAsset);
|
|
267
285
|
configSO.Update();
|
|
268
|
-
|
|
286
|
+
|
|
269
287
|
DrawProperty(configSO, "common");
|
|
270
288
|
GUILayout.Space(8f);
|
|
271
289
|
for (var i = 0; i < allAdapters.Count; i++)
|
|
@@ -273,15 +291,26 @@ namespace Amanotes.Editor
|
|
|
273
291
|
var item = allAdapters[i];
|
|
274
292
|
DrawAdapterDetail(item.id, item.adapter);
|
|
275
293
|
}
|
|
276
|
-
|
|
294
|
+
|
|
277
295
|
EditorGUILayout.Space();
|
|
278
296
|
AmaGUI.Foldout("Config", ref showConfigDetail, DrawGUI_ConfigDetail, DrawGUI_ConfigAsset);
|
|
279
297
|
AmaGUI.Foldout("Adapters", ref showAdapterInstaller, DrawGUI_AdapterList);
|
|
298
|
+
AmaGUI.Foldout("SDK Version Tracking", ref showVersionTracking, DrawGUI_VersionTracking);
|
|
299
|
+
Profiler.EndSample();
|
|
280
300
|
}
|
|
281
301
|
|
|
282
302
|
private static List<(string id, Adapter2 adapter)> allAdapters = new List<(string, Adapter2)>();
|
|
283
303
|
private static readonly Dictionary<string, bool> configOpen = new Dictionary<string, bool>();
|
|
304
|
+
private static readonly Dictionary<string, GUIContent> cacheGUIContent = new Dictionary<string, GUIContent>();
|
|
305
|
+
private static GUIContent GetGUIContent(string str)
|
|
306
|
+
{
|
|
307
|
+
if (cacheGUIContent.TryGetValue(str, out var result)) return result;
|
|
308
|
+
result = new GUIContent(str);
|
|
309
|
+
cacheGUIContent.Add(str, result);
|
|
310
|
+
return result;
|
|
311
|
+
}
|
|
284
312
|
|
|
313
|
+
|
|
285
314
|
private static List<Type> FindSubClassesOf(Type baseType)
|
|
286
315
|
{
|
|
287
316
|
List<Type> result = new List<Type>();
|
|
@@ -296,57 +325,96 @@ namespace Amanotes.Editor
|
|
|
296
325
|
|
|
297
326
|
return result;
|
|
298
327
|
}
|
|
299
|
-
|
|
328
|
+
|
|
300
329
|
private static void RefreshListAdapters()
|
|
301
330
|
{
|
|
302
331
|
allAdapters = SDK_IDS
|
|
303
332
|
.Select(id => (id: id, adapter: GetAdapter(id)))
|
|
304
|
-
.OrderBy(x=>
|
|
305
|
-
x.adapter == null ? 2:
|
|
333
|
+
.OrderBy(x =>
|
|
334
|
+
x.adapter == null ? 2 :
|
|
306
335
|
x.adapter.enabled == false ? 1 :
|
|
307
336
|
-x.adapter.initOrder)
|
|
308
337
|
.ToList();
|
|
309
338
|
}
|
|
310
|
-
|
|
339
|
+
|
|
340
|
+
private static string FindBestAdapterFor(string adapterId)
|
|
341
|
+
{
|
|
342
|
+
var matched = adapterPackages
|
|
343
|
+
.Where(item => item.ToLower().Contains(adapterId.ToLower()));
|
|
344
|
+
|
|
345
|
+
return matched.First();
|
|
346
|
+
}
|
|
347
|
+
|
|
311
348
|
private static void DrawAdapterDetail(string adapterId, Adapter2 adapter)
|
|
312
349
|
{
|
|
313
350
|
if (!configOpen.TryGetValue(adapterId, out bool isOpen))
|
|
314
351
|
{
|
|
315
352
|
configOpen.Add(adapterId, isOpen = false);
|
|
316
353
|
}
|
|
317
|
-
|
|
318
|
-
if (adapter == null)
|
|
319
|
-
{
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
354
|
+
|
|
355
|
+
// if (adapter == null)
|
|
356
|
+
// {
|
|
357
|
+
// // EditorGUILayout.HelpBox("Adapter<" + adapterId + "> not imported!", MessageType.Info);
|
|
358
|
+
// string adapterName = FindBestAdapterFor(adapterId);
|
|
359
|
+
// var package = $"{Res.PACKAGE_PATH}{adapterName}";
|
|
360
|
+
//
|
|
361
|
+
// if (GUILayout.Button(adapterName))
|
|
362
|
+
// {
|
|
363
|
+
// AssetDatabase.ImportPackage(package, false);
|
|
364
|
+
// }
|
|
365
|
+
// return;
|
|
366
|
+
// }
|
|
367
|
+
|
|
324
368
|
SDKStatus status = SDKStatus.Get(adapterId);
|
|
325
369
|
bool changed = AmaGUI.Foldout(ObjectNames.NicifyVariableName(adapterId), ref isOpen, () =>
|
|
326
370
|
{
|
|
327
|
-
|
|
371
|
+
if (adapter != null)
|
|
372
|
+
{
|
|
373
|
+
DrawSDKConfig(adapter, adapterId, status);
|
|
374
|
+
} else
|
|
375
|
+
{
|
|
376
|
+
string adapterName = FindBestAdapterFor(adapterId);
|
|
377
|
+
var package = $"{Res.PACKAGE_PATH}{adapterName}";
|
|
378
|
+
if (GUILayout.Button(GetGUIContent($"Import {adapterId} Adapter"), GUILayout.Height(24f)))
|
|
379
|
+
{
|
|
380
|
+
AssetDatabase.ImportPackage(package, false);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
328
384
|
}, () =>
|
|
329
385
|
{
|
|
330
386
|
GUILayout.FlexibleSpace();
|
|
331
|
-
|
|
387
|
+
|
|
388
|
+
bool installed = status.adapterInstalled;
|
|
389
|
+
bool adapterActive = installed && adapter.enabled;
|
|
390
|
+
|
|
391
|
+
if (!adapterActive)
|
|
332
392
|
{
|
|
393
|
+
GUIContent label = GetGUIContent(installed ? "disabled" : "unavailable");
|
|
333
394
|
Color c = GUI.color;
|
|
334
395
|
GUI.color = Color.yellow;
|
|
335
|
-
|
|
396
|
+
|
|
397
|
+
float w = EditorStyles.label.CalcSize(label).x;
|
|
398
|
+
GUILayout.Label(label, GUILayout.Width(w));
|
|
336
399
|
GUI.color = c;
|
|
337
400
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
if (
|
|
401
|
+
|
|
402
|
+
AmaGUI.DrawVersionTag(status.sdkVersion, adapterActive);
|
|
403
|
+
|
|
404
|
+
if (installed)
|
|
342
405
|
{
|
|
343
|
-
|
|
344
|
-
|
|
406
|
+
Rect titleRect = GUILayoutUtility.GetLastRect();
|
|
407
|
+
bool hit = UnityEvent.current.isMouse && titleRect.Contains(UnityEvent.current.mousePosition);
|
|
408
|
+
if (hit && UnityEvent.current.button == 1)
|
|
409
|
+
{
|
|
410
|
+
UnityEvent.current.Use();
|
|
411
|
+
CreateGenericMenu(adapter, adapterId);
|
|
412
|
+
}
|
|
345
413
|
}
|
|
346
414
|
});
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
350
418
|
if (changed) configOpen[adapterId] = isOpen;
|
|
351
419
|
}
|
|
352
420
|
|
|
@@ -360,10 +428,10 @@ namespace Amanotes.Editor
|
|
|
360
428
|
adapter.enabled = !adapter.enabled;
|
|
361
429
|
EditorUtility.SetDirty(configAsset);
|
|
362
430
|
});
|
|
363
|
-
|
|
431
|
+
|
|
364
432
|
menu.ShowAsContext();
|
|
365
433
|
}
|
|
366
|
-
|
|
434
|
+
|
|
367
435
|
private static void DrawSDKConfig(Adapter2 adapter, string adapterId, SDKStatus status)
|
|
368
436
|
{
|
|
369
437
|
if (!status.sdkInstalled)
|
|
@@ -376,13 +444,13 @@ namespace Amanotes.Editor
|
|
|
376
444
|
EditorGUILayout.HelpBox($"{adapterId}-GDKAdapter not installed", MessageType.Warning);
|
|
377
445
|
return;
|
|
378
446
|
}
|
|
379
|
-
|
|
447
|
+
|
|
380
448
|
if (!status.adapterInstalled)
|
|
381
449
|
{
|
|
382
450
|
EditorGUILayout.HelpBox($"{adapterId}-GDKAdapter not installed", MessageType.Warning);
|
|
383
451
|
return;
|
|
384
452
|
}
|
|
385
|
-
|
|
453
|
+
|
|
386
454
|
DrawModuleConfig(adapter, adapterId);
|
|
387
455
|
}
|
|
388
456
|
|
|
@@ -402,7 +470,7 @@ namespace Amanotes.Editor
|
|
|
402
470
|
GUILayout.Space(8f);
|
|
403
471
|
});
|
|
404
472
|
}
|
|
405
|
-
|
|
473
|
+
|
|
406
474
|
if (adapter.enabled)
|
|
407
475
|
{
|
|
408
476
|
Color c = GUI.contentColor;
|
|
@@ -411,9 +479,9 @@ namespace Amanotes.Editor
|
|
|
411
479
|
if (adapter is IAPAdapter) EditorGUILayout.PropertyField(configSO.FindProperty("iap"), new GUIContent("Shared settings for In App Purchase Modules"));
|
|
412
480
|
if (adapter is AnalyticsAdapter) EditorGUILayout.PropertyField(configSO.FindProperty("analytics"), new GUIContent("Shared settings for Analytics Modules"));
|
|
413
481
|
if (adapter is RemoteConfigAdapter) EditorGUILayout.PropertyField(configSO.FindProperty("remoteConfig"), new GUIContent("Shared settings for Remote Config Modules"));
|
|
414
|
-
GUI.contentColor = c;
|
|
482
|
+
GUI.contentColor = c;
|
|
415
483
|
}
|
|
416
|
-
configSO.ApplyModifiedProperties();
|
|
484
|
+
configSO.ApplyModifiedProperties();
|
|
417
485
|
}
|
|
418
486
|
EditorGUIUtility.labelWidth -= 70;
|
|
419
487
|
EditorGUI.EndDisabledGroup();
|
|
@@ -423,27 +491,27 @@ namespace Amanotes.Editor
|
|
|
423
491
|
{
|
|
424
492
|
SerializedProperty property = so.FindProperty(propertyField);
|
|
425
493
|
if (property == null) return;
|
|
426
|
-
|
|
494
|
+
|
|
427
495
|
string basePath = property.propertyPath;
|
|
428
496
|
var first = true;
|
|
429
497
|
while (property.NextVisible(first))
|
|
430
498
|
{
|
|
431
499
|
first = false;
|
|
432
500
|
if (!property.propertyPath.Contains(basePath)) break;
|
|
433
|
-
EditorGUILayout.PropertyField(property);
|
|
501
|
+
EditorGUILayout.PropertyField(property);
|
|
434
502
|
}
|
|
435
|
-
|
|
503
|
+
|
|
436
504
|
so.ApplyModifiedProperties();
|
|
437
505
|
}
|
|
438
|
-
|
|
506
|
+
|
|
439
507
|
private static Adapter2 GetAdapter(string id)
|
|
440
508
|
{
|
|
441
509
|
if (configAsset == null) return null;
|
|
442
510
|
Type configType = configAsset.GetType();
|
|
443
|
-
|
|
511
|
+
|
|
444
512
|
FieldInfo field = configType
|
|
445
513
|
.GetField(id, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
446
|
-
|
|
514
|
+
|
|
447
515
|
if (field == null)
|
|
448
516
|
{
|
|
449
517
|
#if AMAGDK_DEV
|
|
@@ -451,14 +519,14 @@ namespace Amanotes.Editor
|
|
|
451
519
|
#endif
|
|
452
520
|
return null;
|
|
453
521
|
}
|
|
454
|
-
|
|
455
|
-
var adapter = (Adapter2)
|
|
522
|
+
|
|
523
|
+
var adapter = (Adapter2)field.GetValue(AmaGDK.Config);
|
|
456
524
|
if (adapter != null) return adapter;
|
|
457
|
-
|
|
525
|
+
|
|
458
526
|
LogWarning($"Adapter <{id}> == null in ConfigAsset? (non-serialized?)");
|
|
459
527
|
return null;
|
|
460
528
|
}
|
|
461
|
-
|
|
529
|
+
|
|
462
530
|
public static void DrawIRSAdapterVersions()
|
|
463
531
|
{
|
|
464
532
|
List<IronSourceSDKAdapter> list = ExtractVersion.IronSourceAdapter();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
|
|
3
|
+
namespace Amanotes.Editor
|
|
4
|
+
{
|
|
5
|
+
public class AmaGDKExtra : UnityEditor.Editor
|
|
6
|
+
{
|
|
7
|
+
public static Dictionary<string, object> GetThirdPartyVersions()
|
|
8
|
+
{
|
|
9
|
+
Dictionary<string, object> dicThirdParty = new Dictionary<string, object>();
|
|
10
|
+
List<GDKModule> listModule = VersionHelper.LoadLocalModuleInfo();
|
|
11
|
+
foreach (var module in listModule)
|
|
12
|
+
{
|
|
13
|
+
VersionHelper.UpdateListVersions(module);
|
|
14
|
+
dicThirdParty.Add(module.id, ExtractVersion.ThirdParty(module.id));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
foreach (IronSourceSDKAdapter adapter in ExtractVersion.IronSourceAdapter())
|
|
18
|
+
{
|
|
19
|
+
dicThirdParty.Add(adapter.name, adapter.version);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return dicThirdParty;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public static string FirebaseVersion()
|
|
26
|
+
{
|
|
27
|
+
string version = ExtractVersion.FirebaseAnalytics();
|
|
28
|
+
return !string.IsNullOrEmpty(version) ? version : ExtractVersion.FirebaseRemoteConfig();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -35,7 +35,7 @@ namespace Amanotes.Editor
|
|
|
35
35
|
public SemVer sdkVersion;
|
|
36
36
|
|
|
37
37
|
public bool sdkInstalled => sdkVersion > SemVer.ZERO;
|
|
38
|
-
public bool adapterInstalled =>
|
|
38
|
+
public bool adapterInstalled => adapterVersion > SemVer.ZERO;
|
|
39
39
|
|
|
40
40
|
public string ToTSVString()
|
|
41
41
|
{
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -27,15 +27,11 @@ namespace Amanotes.Core.Internal
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
#if UNITY_EDITOR
|
|
31
|
-
status = Status.Ready;
|
|
32
|
-
#else
|
|
33
30
|
status = Status.Initialize;
|
|
34
31
|
Init(success =>
|
|
35
32
|
{
|
|
36
33
|
status = success ? Status.Ready : Status.Failed;
|
|
37
34
|
});
|
|
38
|
-
#endif
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
|