com.amanotes.gdk 0.2.7 → 0.2.9
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 +16 -0
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AmaPassport.ATTSupport.unitypackage +0 -0
- package/Packages/AmaPassportAdapter_v1.0.0.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/IronsourceAdapter_v7.2.6.unitypackage +0 -0
- package/Runtime/AmaGDK.Ads.cs +108 -40
- package/Runtime/AmaGDK.AmaPassport.cs +11 -1
- package/Runtime/AmaGDK.Analytics.cs +8 -12
- package/Runtime/AmaGDK.Internal.cs +6 -5
- package/Runtime/AmaGDK.cs +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.9 - 2023-06-15]
|
|
4
|
+
### Show total init time
|
|
5
|
+
### Show adapter version + status at init time
|
|
6
|
+
### Remove AmaGDK version in debug log
|
|
7
|
+
### Remove "Params" in analytics debug log
|
|
8
|
+
### Check "event_name" early
|
|
9
|
+
### Fix null exception in AmaGDKInstaller
|
|
10
|
+
### Add csc.rsp to enable AMAGDK_DEV
|
|
11
|
+
### Update Ads module
|
|
12
|
+
|
|
13
|
+
## [0.2.8 - 2023-06-12]
|
|
14
|
+
### Mute Appsflyer's init log on Editor
|
|
15
|
+
### Clear analytics log in adapters
|
|
16
|
+
### Check null event params before calling AddParam()
|
|
17
|
+
### Export AmaPassport info
|
|
18
|
+
|
|
3
19
|
## [0.2.7 - 2023-06-09]
|
|
4
20
|
### Fix log single adapter
|
|
5
21
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Runtime/AmaGDK.Ads.cs
CHANGED
|
@@ -134,8 +134,10 @@ namespace Amanotes.Core
|
|
|
134
134
|
_adapter?.rewardVideo.StartLoadAd();
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
public static bool
|
|
138
|
-
public static bool
|
|
137
|
+
public static bool hasInterstitial => _adapter.interstitial.hasAd;
|
|
138
|
+
public static bool hasRewardedVideo => _adapter.rewardVideo.hasAd;
|
|
139
|
+
public static bool showingBanner => _showingBanner;
|
|
140
|
+
public static bool showingAd => context != null;
|
|
139
141
|
|
|
140
142
|
public static IAdCallback ShowInterstitial(string placementName = null, Dictionary<string, object> userData = null)
|
|
141
143
|
{
|
|
@@ -272,13 +274,14 @@ namespace Amanotes.Core.Internal
|
|
|
272
274
|
this.userData = userData;
|
|
273
275
|
this.placementName = placementName;
|
|
274
276
|
adCallback = AdCallback.None;
|
|
275
|
-
showCallAt = Time.
|
|
277
|
+
showCallAt = Time.realtimeSinceStartup;
|
|
276
278
|
showFinishAt = 0;
|
|
277
279
|
}
|
|
278
280
|
|
|
279
281
|
public bool hasError => (adCallback & (AdCallback.Fail | AdCallback.Cancel)) != 0;
|
|
280
|
-
public bool
|
|
282
|
+
public bool potentiallyCompleted => (adCallback & (AdCallback.Close | AdCallback.Reward | AdCallback.Cancel)) != 0;
|
|
281
283
|
public bool hasReward => (adCallback & AdCallback.Reward) != 0;
|
|
284
|
+
public bool hasClosed => (adCallback & AdCallback.Close) != 0;
|
|
282
285
|
public bool hasCancel => (adCallback & AdCallback.Cancel) != 0;
|
|
283
286
|
public bool hasClicked => (adCallback & AdCallback.Click) != 0;
|
|
284
287
|
}
|
|
@@ -374,7 +377,7 @@ namespace Amanotes.Core.Internal
|
|
|
374
377
|
internal ShowAdsState _showState = ShowAdsState.None;
|
|
375
378
|
private Coroutine _showAdRoutine;
|
|
376
379
|
private bool _isRequesting;
|
|
377
|
-
|
|
380
|
+
private bool _isInterstitial => adType == AdType.Interstitial;
|
|
378
381
|
|
|
379
382
|
public void StartShowAd()
|
|
380
383
|
{
|
|
@@ -429,7 +432,9 @@ namespace Amanotes.Core.Internal
|
|
|
429
432
|
|
|
430
433
|
if (!isAdReady)
|
|
431
434
|
{
|
|
435
|
+
Ads.Events.OnShowTimeout?.Invoke();
|
|
432
436
|
_showState = ShowAdsState.ShowFail;
|
|
437
|
+
ShowAdRoutineCompleted(false);
|
|
433
438
|
yield break;
|
|
434
439
|
}
|
|
435
440
|
}
|
|
@@ -443,7 +448,8 @@ namespace Amanotes.Core.Internal
|
|
|
443
448
|
}
|
|
444
449
|
|
|
445
450
|
var context = Ads.context;
|
|
446
|
-
|
|
451
|
+
|
|
452
|
+
while (!context.potentiallyCompleted)
|
|
447
453
|
{
|
|
448
454
|
yield return wait1Sec;
|
|
449
455
|
}
|
|
@@ -451,31 +457,49 @@ namespace Amanotes.Core.Internal
|
|
|
451
457
|
if (adType == AdType.Interstitial)
|
|
452
458
|
{
|
|
453
459
|
_showState = context.hasError ? ShowAdsState.ShowFail : ShowAdsState.ShowSuccess;
|
|
454
|
-
|
|
460
|
+
ShowAdRoutineCompleted(_showState == ShowAdsState.ShowSuccess);
|
|
461
|
+
yield break;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (context.hasCancel)
|
|
465
|
+
{
|
|
466
|
+
yield return wait1Sec; // wait for close (1s)
|
|
467
|
+
_showState = ShowAdsState.ShowFail;
|
|
468
|
+
ShowAdRoutineCompleted(false);
|
|
469
|
+
yield break;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (context.hasClosed)
|
|
473
|
+
{
|
|
474
|
+
while (!context.hasCancel && !context.hasReward)
|
|
475
|
+
{
|
|
476
|
+
yield return wait1Sec;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
_showState = context.hasCancel ? ShowAdsState.ShowFail : ShowAdsState.ShowSuccess;
|
|
480
|
+
ShowAdRoutineCompleted(_showState == ShowAdsState.ShowSuccess);
|
|
455
481
|
yield break;
|
|
456
482
|
}
|
|
457
483
|
|
|
458
|
-
|
|
459
|
-
if (!context.hasReward && !context.hasCancel) // no reward & no cancel: wait for the delayed reward callback
|
|
484
|
+
while (!context.hasClosed)
|
|
460
485
|
{
|
|
461
486
|
yield return wait1Sec;
|
|
462
487
|
}
|
|
463
488
|
|
|
464
|
-
_showState =
|
|
465
|
-
|
|
489
|
+
_showState = ShowAdsState.ShowSuccess;
|
|
490
|
+
ShowAdRoutineCompleted(true);
|
|
491
|
+
|
|
492
|
+
Ads.context = null;
|
|
493
|
+
_showState = ShowAdsState.None;
|
|
466
494
|
}
|
|
467
495
|
|
|
468
|
-
private void
|
|
496
|
+
private void ShowAdRoutineCompleted(bool isSuccess)
|
|
469
497
|
{
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
if (isInterstitial)
|
|
473
|
-
adapter.interstitial.StartLoadAd();
|
|
474
|
-
else
|
|
475
|
-
adapter.rewardVideo.StartLoadAd();
|
|
498
|
+
StartLoadAd();
|
|
499
|
+
Ads.context.showFinishAt = Time.realtimeSinceStartup;
|
|
476
500
|
|
|
477
501
|
var localData = Ads.localData;
|
|
478
|
-
var stat =
|
|
502
|
+
var stat = _isInterstitial ? localData.interstitial : localData.reward;
|
|
479
503
|
|
|
480
504
|
if (isSuccess)
|
|
481
505
|
{
|
|
@@ -490,7 +514,6 @@ namespace Amanotes.Core.Internal
|
|
|
490
514
|
}
|
|
491
515
|
|
|
492
516
|
localData.Save();
|
|
493
|
-
|
|
494
517
|
RestoreVolume();
|
|
495
518
|
}
|
|
496
519
|
|
|
@@ -505,9 +528,17 @@ namespace Amanotes.Core.Internal
|
|
|
505
528
|
// Default implementation
|
|
506
529
|
protected void OnAdClosed()
|
|
507
530
|
{
|
|
508
|
-
Ads.context
|
|
509
|
-
|
|
510
|
-
|
|
531
|
+
if (Ads.context != null)
|
|
532
|
+
{
|
|
533
|
+
Ads.context.adCallback |= AdCallback.Close;
|
|
534
|
+
Ads.context.onClosed?.Invoke();
|
|
535
|
+
}
|
|
536
|
+
else
|
|
537
|
+
{
|
|
538
|
+
LogWarning("OnAdClosed() Something wrong - No AdContext");
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (_isInterstitial)
|
|
511
542
|
Ads.Events.OnInterstitialClosed?.Invoke();
|
|
512
543
|
else
|
|
513
544
|
Ads.Events.OnRewardedClosed?.Invoke();
|
|
@@ -515,10 +546,17 @@ namespace Amanotes.Core.Internal
|
|
|
515
546
|
|
|
516
547
|
protected void OnAdClicked()
|
|
517
548
|
{
|
|
518
|
-
Ads.context
|
|
519
|
-
|
|
549
|
+
if (Ads.context != null)
|
|
550
|
+
{
|
|
551
|
+
Ads.context.adCallback |= AdCallback.Click;
|
|
552
|
+
Ads.context.onClicked?.Invoke();
|
|
553
|
+
}
|
|
554
|
+
else
|
|
555
|
+
{
|
|
556
|
+
LogWarning("OnAdClicked() Something wrong - No AdContext");
|
|
557
|
+
}
|
|
520
558
|
|
|
521
|
-
if (
|
|
559
|
+
if (_isInterstitial)
|
|
522
560
|
Ads.Events.OnInterstitialClicked?.Invoke();
|
|
523
561
|
else
|
|
524
562
|
Ads.Events.OnRewardedClicked?.Invoke();
|
|
@@ -527,10 +565,17 @@ namespace Amanotes.Core.Internal
|
|
|
527
565
|
|
|
528
566
|
protected void OnAdShowFailed()
|
|
529
567
|
{
|
|
530
|
-
Ads.context
|
|
531
|
-
|
|
568
|
+
if (Ads.context != null)
|
|
569
|
+
{
|
|
570
|
+
Ads.context.adCallback |= AdCallback.Fail;
|
|
571
|
+
Ads.context.onShowFailed?.Invoke();
|
|
572
|
+
}
|
|
573
|
+
else
|
|
574
|
+
{
|
|
575
|
+
LogWarning("OnAdShowFailed() Something wrong - No AdContext");
|
|
576
|
+
}
|
|
532
577
|
|
|
533
|
-
if (
|
|
578
|
+
if (_isInterstitial)
|
|
534
579
|
Ads.Events.OnInterstitialShowFailed?.Invoke();
|
|
535
580
|
else
|
|
536
581
|
Ads.Events.OnRewardedShowFailed?.Invoke();
|
|
@@ -539,20 +584,34 @@ namespace Amanotes.Core.Internal
|
|
|
539
584
|
|
|
540
585
|
protected void OnAdShowSucceeded()
|
|
541
586
|
{
|
|
542
|
-
Ads.context
|
|
543
|
-
|
|
587
|
+
if (Ads.context != null)
|
|
588
|
+
{
|
|
589
|
+
Ads.context.adCallback |= AdCallback.Success;
|
|
590
|
+
Ads.context.onShowSuccess?.Invoke();
|
|
591
|
+
}
|
|
592
|
+
else
|
|
593
|
+
{
|
|
594
|
+
LogWarning("OnAdShowSucceeded() Something wrong - No AdContext");
|
|
595
|
+
}
|
|
544
596
|
|
|
545
|
-
if (
|
|
597
|
+
if (_isInterstitial)
|
|
546
598
|
Ads.Events.OnInterstitialShowSucceeded?.Invoke();
|
|
547
599
|
|
|
548
600
|
}
|
|
549
601
|
|
|
550
602
|
protected void OnAdOpen()
|
|
551
603
|
{
|
|
552
|
-
Ads.context
|
|
553
|
-
|
|
604
|
+
if (Ads.context != null)
|
|
605
|
+
{
|
|
606
|
+
Ads.context.adCallback |= AdCallback.Open;
|
|
607
|
+
Ads.context.onOpened?.Invoke();
|
|
608
|
+
}
|
|
609
|
+
else
|
|
610
|
+
{
|
|
611
|
+
LogWarning("OnAdOpen() Something wrong - No AdContext");
|
|
612
|
+
}
|
|
554
613
|
|
|
555
|
-
if (
|
|
614
|
+
if (_isInterstitial)
|
|
556
615
|
Ads.Events.OnInterstitialOpened?.Invoke();
|
|
557
616
|
else
|
|
558
617
|
Ads.Events.OnRewardedOpened?.Invoke();
|
|
@@ -560,10 +619,17 @@ namespace Amanotes.Core.Internal
|
|
|
560
619
|
|
|
561
620
|
protected void OnAdReward()
|
|
562
621
|
{
|
|
563
|
-
Ads.context
|
|
564
|
-
|
|
622
|
+
if (Ads.context != null)
|
|
623
|
+
{
|
|
624
|
+
Ads.context.adCallback |= AdCallback.Reward;
|
|
625
|
+
Ads.context.onRewardReceived?.Invoke();
|
|
626
|
+
}
|
|
627
|
+
else
|
|
628
|
+
{
|
|
629
|
+
LogWarning("OnAdReward() Something wrong - No AdContext");
|
|
630
|
+
}
|
|
565
631
|
|
|
566
|
-
if (!
|
|
632
|
+
if (!_isInterstitial)
|
|
567
633
|
Ads.Events.OnRewardedReceived?.Invoke();
|
|
568
634
|
}
|
|
569
635
|
|
|
@@ -575,13 +641,13 @@ namespace Amanotes.Core.Internal
|
|
|
575
641
|
}
|
|
576
642
|
|
|
577
643
|
_isRequesting = false;
|
|
578
|
-
if (
|
|
644
|
+
if (_isInterstitial)
|
|
579
645
|
Ads.Events.OnInterstitialLoadSucceeded?.Invoke();
|
|
580
646
|
}
|
|
581
647
|
|
|
582
648
|
protected void OnAdLoadFailed(string error)
|
|
583
649
|
{
|
|
584
|
-
if (
|
|
650
|
+
if (_isInterstitial)
|
|
585
651
|
Ads.Events.OnInterstitialLoadFailed?.Invoke(error);
|
|
586
652
|
}
|
|
587
653
|
}
|
|
@@ -601,5 +667,7 @@ namespace Amanotes.Core.Internal
|
|
|
601
667
|
public Action OnInterstitialClosed;
|
|
602
668
|
public Action OnInterstitialLoadSucceeded;
|
|
603
669
|
public Action<string> OnInterstitialLoadFailed;
|
|
670
|
+
|
|
671
|
+
public Action OnShowTimeout;
|
|
604
672
|
}
|
|
605
673
|
}
|
|
@@ -103,6 +103,7 @@ namespace Amanotes.Core
|
|
|
103
103
|
public string idfa;
|
|
104
104
|
public string gaid;
|
|
105
105
|
public string idfv;
|
|
106
|
+
public string deviceUniqueId;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
[Serializable]
|
|
@@ -327,7 +328,15 @@ namespace Amanotes.Core
|
|
|
327
328
|
private static bool isInQueue;
|
|
328
329
|
|
|
329
330
|
public static string AmaId => User.amaPassport.device.amaId;
|
|
330
|
-
|
|
331
|
+
public static string GAId => User.amaPassport.device.gaid;
|
|
332
|
+
public static string IDFA => User.amaPassport.device.idfa;
|
|
333
|
+
public static string IDFV => User.amaPassport.device.idfv;
|
|
334
|
+
public static string AndroidId => User.amaPassport.device.androidId;
|
|
335
|
+
public static string AmaDeviceId => User.amaPassport.device.amaDeviceId;
|
|
336
|
+
public static string IpAddress => User.amaPassport.device.ipAddress;
|
|
337
|
+
public static string Country => User.amaPassport.device.country;
|
|
338
|
+
public static string DeviceUniqueId => User.amaPassport.device.deviceUniqueId;
|
|
339
|
+
|
|
331
340
|
internal static void Init()
|
|
332
341
|
{
|
|
333
342
|
var adapter = Adapter.GetSingleAdapter<IAmaPassportAdapter>();
|
|
@@ -413,6 +422,7 @@ namespace Amanotes.Core
|
|
|
413
422
|
device.graphicsDeviceId = SystemInfo.graphicsDeviceID;
|
|
414
423
|
device.graphicsDeviceVendorId = SystemInfo.graphicsDeviceVendorID;
|
|
415
424
|
device.operatingSystem = SystemInfo.operatingSystem;
|
|
425
|
+
device.deviceUniqueId = SystemInfo.deviceUniqueIdentifier;
|
|
416
426
|
if (Application.platform == RuntimePlatform.Android)
|
|
417
427
|
device.androidId = SystemInfo.deviceUniqueIdentifier;
|
|
418
428
|
else if (Application.platform == RuntimePlatform.IPhonePlayer) device.idfv = SystemInfo.deviceUniqueIdentifier;
|
|
@@ -80,12 +80,7 @@ namespace Amanotes.Core
|
|
|
80
80
|
|
|
81
81
|
public static IEventParamsBuilder LogEvent(string eventName)
|
|
82
82
|
{
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
LogWarningOnce($"Invalid EventName: <{eventName}> ");
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
|
|
83
|
+
NormalizeEventName(ref eventName, true);
|
|
89
84
|
var result = new EventParams(eventName);
|
|
90
85
|
eventQueue.Enqueue(result);
|
|
91
86
|
return result;
|
|
@@ -93,12 +88,14 @@ namespace Amanotes.Core
|
|
|
93
88
|
|
|
94
89
|
public static IEventParamsBuilder LogEvent(string eventName, Dictionary<string, object> parameters)
|
|
95
90
|
{
|
|
91
|
+
if (parameters == null) return LogEvent(eventName);
|
|
96
92
|
return LogEvent(eventName).AddParam(parameters);
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
public static IEventParamsBuilder LogEvent(string eventName, params (string, object)[] parameters)
|
|
100
96
|
{
|
|
101
97
|
IEventParamsBuilder result = LogEvent(eventName);
|
|
98
|
+
if (parameters == null) return result;
|
|
102
99
|
for (var i = 0; i < parameters.Length; i++)
|
|
103
100
|
{
|
|
104
101
|
result.AddParam(parameters[i].Item1, parameters[i].Item2);
|
|
@@ -316,10 +313,9 @@ namespace Amanotes.Core
|
|
|
316
313
|
}
|
|
317
314
|
|
|
318
315
|
string eventNameToSend = GetEventNameToSend(eventData.eventName, countInSession, totalCount);
|
|
319
|
-
NormalizeEventName(ref eventNameToSend);
|
|
316
|
+
if (Config.common.normalizeEventName) NormalizeEventName(ref eventNameToSend);
|
|
320
317
|
|
|
321
|
-
if (showAnalyticsLog) Debug.Log($"
|
|
322
|
-
$"Params:\n{JsonUtils.DictionaryToJson(eventData.parameters, true)}");
|
|
318
|
+
if (showAnalyticsLog) Debug.Log($"AmaGDK v{AmaGDK.VERSION} | Event <{eventNameToSend}> (in session: {countInSession}, total: {totalCount})\n{JsonUtils.DictionaryToJson(eventData.parameters, true)}");
|
|
323
319
|
|
|
324
320
|
var inUseAdapterIDs = new List<string>();
|
|
325
321
|
foreach (AdapterContext m in listAdapters)
|
|
@@ -358,7 +354,7 @@ namespace Amanotes.Core
|
|
|
358
354
|
return $"{eventName}_{(config.withinSession ? countInSession : totalCount).ToString(config.numberFormat)}";
|
|
359
355
|
}
|
|
360
356
|
|
|
361
|
-
internal static void NormalizeEventName(ref string eventName)
|
|
357
|
+
internal static void NormalizeEventName(ref string eventName, bool dryRun = false)
|
|
362
358
|
{
|
|
363
359
|
StringBuilder sb = tmpWarningSB;
|
|
364
360
|
sb.Clear();
|
|
@@ -375,7 +371,7 @@ namespace Amanotes.Core
|
|
|
375
371
|
|
|
376
372
|
if (eventName != normalizedEventName)
|
|
377
373
|
{
|
|
378
|
-
if (
|
|
374
|
+
if (!dryRun)
|
|
379
375
|
{
|
|
380
376
|
eventName = normalizedEventName;
|
|
381
377
|
}
|
|
@@ -387,7 +383,7 @@ namespace Amanotes.Core
|
|
|
387
383
|
|
|
388
384
|
if (!char.IsLetter(eventName[0])) sb.AppendLine($" - EventName must start with a letter: <{eventName}> ");
|
|
389
385
|
if (eventName.Length > 40) sb.AppendLine($" - EventName is too long ({eventName.Length} > 40): <{eventName}> ");
|
|
390
|
-
if (sb.Length > 0) LogWarningOnce(sb.ToString(), $"NormalizeEventName<{eventName}>");
|
|
386
|
+
if (sb.Length > 0 && dryRun) LogWarningOnce(sb.ToString(), $"NormalizeEventName<{eventName}>");
|
|
391
387
|
}
|
|
392
388
|
|
|
393
389
|
internal static bool ShouldSendEvent(EventParams eventData)
|
|
@@ -4,6 +4,7 @@ using System.Text;
|
|
|
4
4
|
using UnityEngine;
|
|
5
5
|
using UnityObject = UnityEngine.Object;
|
|
6
6
|
using static Amanotes.Core.AmaGDK.Analytics;
|
|
7
|
+
using static Amanotes.Core.AmaGDK;
|
|
7
8
|
|
|
8
9
|
#if UNITY_EDITOR
|
|
9
10
|
using UnityEditor;
|
|
@@ -21,7 +22,7 @@ namespace Amanotes.Core.Internal
|
|
|
21
22
|
|
|
22
23
|
public static class Messsage
|
|
23
24
|
{
|
|
24
|
-
public const string READY = "init success
|
|
25
|
+
public const string READY = "init success";
|
|
25
26
|
public const string SDK_INIT_CALLED = "init has been called!";
|
|
26
27
|
public const string MULTIPLE_INSTANCE = "multiple instance found!";
|
|
27
28
|
public const string CONFIG_NOT_FOUND = "AmaGDKConfig not found in Resources!";
|
|
@@ -78,19 +79,19 @@ namespace Amanotes.Core.Internal
|
|
|
78
79
|
if (string.IsNullOrEmpty(key)) key = message;
|
|
79
80
|
if (logWarningDict.Contains(key)) return;
|
|
80
81
|
logWarningDict.Add(key);
|
|
81
|
-
Debug.LogWarning("
|
|
82
|
+
Debug.LogWarning($"AmaGDK {message}");
|
|
82
83
|
}
|
|
83
84
|
public static void LogWarning(string message)
|
|
84
85
|
{
|
|
85
|
-
Debug.LogWarning("
|
|
86
|
+
Debug.LogWarning($"AmaGDK {message}");
|
|
86
87
|
}
|
|
87
88
|
public static void LogError(string message)
|
|
88
89
|
{
|
|
89
|
-
Debug.LogError("
|
|
90
|
+
Debug.LogError($"AmaGDK {message}");
|
|
90
91
|
}
|
|
91
92
|
public static void Log(string message)
|
|
92
93
|
{
|
|
93
|
-
if (AmaGDK.Config.common.verboseLog) Debug.Log("
|
|
94
|
+
if (AmaGDK.Config.common.verboseLog) Debug.Log($"AmaGDK {message}");
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
|
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
using System;
|
|
2
2
|
using System.Collections;
|
|
3
|
+
using System.Text;
|
|
3
4
|
using Amanotes.Core.Internal;
|
|
4
5
|
using UnityEngine;
|
|
5
6
|
using static Amanotes.Core.Internal.Logging;
|
|
@@ -9,7 +10,7 @@ namespace Amanotes.Core
|
|
|
9
10
|
{
|
|
10
11
|
public partial class AmaGDK : MonoBehaviour
|
|
11
12
|
{
|
|
12
|
-
public const string VERSION = "0.2.
|
|
13
|
+
public const string VERSION = "0.2.9";
|
|
13
14
|
|
|
14
15
|
internal static AmaGDK _instance;
|
|
15
16
|
internal static Status _status = Status.None;
|
|
@@ -75,6 +76,8 @@ namespace Amanotes.Core
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
_status = Status.Initialize;
|
|
79
|
+
float startTime = Time.realtimeSinceStartup;
|
|
80
|
+
StringBuilder adapterInfo = new StringBuilder();
|
|
78
81
|
|
|
79
82
|
// sort on priority
|
|
80
83
|
Adapter.listAdapters.Sort((a1, a2) => a1.initOrder.CompareTo(a2.initOrder));
|
|
@@ -94,8 +97,8 @@ namespace Amanotes.Core
|
|
|
94
97
|
LogWarning($"{adapter.adapterId} init time out: {timeout}");
|
|
95
98
|
break;
|
|
96
99
|
}
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
|
|
101
|
+
adapterInfo.AppendLine(string.Format("[{0}] {1} (adapter v{2})", adapter.IsReady ? "OK" : "FAIL", adapter.adapterId, adapter.adapterVersion));
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
// Init modules (Adapter managers)
|
|
@@ -106,7 +109,7 @@ namespace Amanotes.Core
|
|
|
106
109
|
_status = Status.Ready;
|
|
107
110
|
_onReadyCallback?.Invoke();
|
|
108
111
|
_onReadyCallback = null;
|
|
109
|
-
Debug.Log($"
|
|
112
|
+
Debug.Log($"AmaGDK v{VERSION} | {READY} in {Time.realtimeSinceStartup - startTime}s\n\n{adapterInfo.ToString()}");
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
void RegisterUnityCallback(AdapterContext adapter)
|