com.amanotes.gdk 0.2.70 → 0.2.72

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +113 -87
  2. package/Editor/AmaGDKEditor.cs +1 -1
  3. package/Editor/EmbedRemoteConfigAssetInspector.cs +1 -1
  4. package/Editor/Extra/GDKCIBuildCommand.cs +57 -16
  5. package/Extra/AmaGDKInstaller.unitypackage +0 -0
  6. package/Extra/CheckDiskSpace.unitypackage +0 -0
  7. package/Extra/Consent.unitypackage +0 -0
  8. package/Extra/ForceUpdate.unitypackage +0 -0
  9. package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
  10. package/Extra/PostProcessor.unitypackage +0 -0
  11. package/Packages/AmaGDKConfig.unitypackage +0 -0
  12. package/Packages/AmaGDKExample.unitypackage +0 -0
  13. package/Packages/AmaGDKTest.unitypackage +0 -0
  14. package/Packages/AppsFlyerAdapter.PurchaseConnector.unitypackage +0 -0
  15. package/Packages/AppsFlyerAdapter.unitypackage +0 -0
  16. package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
  17. package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
  18. package/Packages/IronSourceAdapter.unitypackage +0 -0
  19. package/Packages/MaxAdNetworkAdapter.unitypackage +0 -0
  20. package/Packages/RevenueCatAdapter.unitypackage +0 -0
  21. package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
  22. package/Runtime/Ad/AdExtension.cs +2 -1
  23. package/Runtime/Ad/AdLogic.cs +1 -1
  24. package/Runtime/Ad/AdModuleConfig.cs +19 -4
  25. package/Runtime/Ad/AmaGDK.Ads.cs +20 -8
  26. package/Runtime/AmaGDK.Adapters.cs +1 -1
  27. package/Runtime/AmaGDK.Analytics.cs +37 -35
  28. package/Runtime/AmaGDK.Config.cs +1 -7
  29. package/Runtime/AmaGDK.Consent.cs +9 -8
  30. package/Runtime/AmaGDK.Context.cs +1 -1
  31. package/Runtime/AmaGDK.Device.cs +2 -1
  32. package/Runtime/AmaGDK.IAP.cs +1 -1
  33. package/Runtime/AmaGDK.RemoteConfig.cs +1 -1
  34. package/Runtime/AmaGDK.Singleton.cs +1 -1
  35. package/Runtime/AmaGDK.UserProfile.cs +12 -11
  36. package/Runtime/AmaGDK.asmdef +1 -1
  37. package/Runtime/AmaGDK.cs +6 -6
  38. package/Runtime/AnalyticQualityAsset.cs +1 -1
  39. package/Runtime/AudioToolkit/AmaGDK.Audio.cs +3 -2
  40. package/Runtime/Core/GDKDebug.cs +97 -0
  41. package/Runtime/Core/GDKDebug.cs.meta +3 -0
  42. package/Runtime/Core/GDKPool.cs +1 -0
  43. package/Runtime/Core/GDKRoutine.cs +3 -1
  44. package/Runtime/Core/GDKSemVer.cs +1 -1
  45. package/Runtime/Core/GDKString.cs +197 -0
  46. package/Runtime/Core/GDKString.cs.meta +3 -0
  47. package/Runtime/EmbedRemoteConfigAsset.cs +2 -1
  48. package/Runtime/Fps/AmaFPS.Utils.cs +2 -2
  49. package/Runtime/Fps/AmaFPS.cs +1 -1
  50. package/Runtime/Fps/AmaFPSVisualizer.cs +1 -1
  51. package/Runtime/Fps/FrameRecorder.cs +1 -1
  52. package/Runtime/GDKAudio/GDKAudio.cs +308 -0
  53. package/Runtime/GDKAudio/GDKAudio.cs.meta +3 -0
  54. package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar +0 -0
  55. package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar.meta +32 -0
  56. package/Runtime/GDKAudio/Plugins/Android.meta +3 -0
  57. package/Runtime/GDKAudio/Plugins/iOS/libatensor.a +0 -0
  58. package/Runtime/GDKAudio/Plugins/iOS/libatensor.a.meta +68 -0
  59. package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a +0 -0
  60. package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a.meta +68 -0
  61. package/Runtime/GDKAudio/Plugins/iOS/libssl.a +0 -0
  62. package/Runtime/GDKAudio/Plugins/iOS/libssl.a.meta +68 -0
  63. package/Runtime/GDKAudio/Plugins/iOS.meta +8 -0
  64. package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib +0 -0
  65. package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib.meta +81 -0
  66. package/Runtime/GDKAudio/Plugins/macOS.meta +8 -0
  67. package/Runtime/GDKAudio/Plugins.meta +8 -0
  68. package/Runtime/GDKAudio.meta +3 -0
  69. package/Runtime/Internal/AmaGDK.Internal.cs +22 -33
  70. package/Runtime/Internal/AmaGDK.Utils.cs +1 -1
  71. package/Runtime/Internal/AmaGDK.WebUtils.cs +1 -1
  72. package/Runtime/Internal/ForceQuitMonitor.cs +7 -2
  73. package/Runtime/Internal/GDKGeoLocationcs.cs +2 -1
  74. package/Runtime/Internal/GDKServerTime.cs +2 -1
  75. package/Runtime/Klavar/KlavarContainer.cs +4 -4
  76. package/Runtime/UserProfile/Plugins/Android/AdvertisingIdFetcher.cs +1 -1
  77. package/Runtime/Utils/GDKUtils.cs +35 -4
  78. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- using System;
1
+ using System;
2
2
  using System.Collections.Generic;
3
- using System.Text;
4
3
  using UnityEngine;
5
4
  using UnityObject = UnityEngine.Object;
6
5
  using static Amanotes.Core.AmaGDK.Analytics;
7
6
  using static Amanotes.Core.AmaGDK;
7
+ using static Amanotes.Core.GDKDebug;
8
8
 
9
9
  #if UNITY_EDITOR
10
10
  using UnityEditor;
@@ -63,40 +63,29 @@ namespace Amanotes.Core.Internal
63
63
  }
64
64
  #endif
65
65
  }
66
-
66
+
67
+ #if !AMAGDK_DEV
68
+
69
+ [Obsolete("Deprecated class - use GDKDebug instead!")]
67
70
  public static class Logging
68
71
  {
69
- public static Action<string> logNonfatalErrorHook = null;
70
- private static readonly HashSet<string> nonFatalDict = new HashSet<string>();
71
- public static readonly HashSet<string> logWarningDict = new HashSet<string>();
72
-
72
+ [Obsolete("Deprecated method - use GDKDebug.LogWarningOnce() instead!")]
73
73
  public static void LogWarningOnce(string message, string key = null)
74
- {
75
- if (Config.common.logLevel < LogLevel.Warning) return;
76
- if (string.IsNullOrEmpty(key)) key = message;
77
- if (!logWarningDict.Add(key)) return;
78
- Debug.LogWarning($"AmaGDK {message}");
79
- }
74
+ => GDKDebug.LogWarningOnce(message, key);
75
+
76
+ [Obsolete("Deprecated method - use GDKDebug.LogWarning() instead!")]
80
77
  public static void LogWarning(string message)
81
- {
82
- if (Config.common.logLevel >= LogLevel.Warning) Debug.LogWarning($"AmaGDK {message}");
83
- }
78
+ => GDKDebug.LogWarning(message);
79
+
80
+ [Obsolete("Deprecated method - use GDKDebug.LogError() instead!")]
84
81
  public static void LogError(string message)
85
- {
86
- if (Config.common.logLevel >= LogLevel.Error) Debug.LogError($"AmaGDK {message}");
87
- if (logNonfatalErrorHook == null) return;
88
- GDKUtils.DoOnMainThread(() =>
89
- {
90
- if (nonFatalDict.Contains(message)) return; // LogOnce
91
- nonFatalDict.Add(message);
92
- logNonfatalErrorHook(message);
93
- });
94
- }
82
+ => GDKDebug.LogError(message);
83
+
84
+ [Obsolete("Deprecated method - use GDKDebug.Log() instead!")]
95
85
  public static void Log(string message)
96
- {
97
- if (Config.common.logLevel == LogLevel.Verbose) Debug.Log($"AmaGDK {message}");
98
- }
86
+ => GDKDebug.Log(message);
99
87
  }
88
+ #endif
100
89
 
101
90
  public static class Forbidden
102
91
  {
@@ -141,7 +130,7 @@ namespace Amanotes.Core.Internal
141
130
  }
142
131
  #endif
143
132
 
144
- // Logging.LogWarning("Something wrong: another AmaGDK instance found!");
133
+ // LogWarning("Something wrong: another AmaGDK instance found!");
145
134
  UnityObject.Destroy(result[i].gameObject);
146
135
  }
147
136
 
@@ -203,10 +192,10 @@ namespace Amanotes.Core.Internal
203
192
  public static void ThrowExceptionIfEditor(string message)
204
193
  {
205
194
  #if UNITY_EDITOR
206
- throw new GDKException(message);
207
- #else
208
- Logging.LogError(message);
195
+ if (Application.isEditor) throw new GDKException(message);
209
196
  #endif
197
+
198
+ LogError(message);
210
199
  }
211
200
 
212
201
  /// <summary>
@@ -8,7 +8,7 @@ using System.Text;
8
8
  using System.Text.RegularExpressions;
9
9
  using UnityEngine;
10
10
  using UnityEngine.Profiling;
11
- using static Amanotes.Core.Internal.Logging;
11
+ using static Amanotes.Core.GDKDebug;
12
12
 
13
13
  namespace Amanotes.Core.Internal
14
14
  {
@@ -4,7 +4,7 @@ using System.Collections.Generic;
4
4
  using System.Text;
5
5
  using UnityEngine;
6
6
  using UnityEngine.Networking;
7
- using static Amanotes.Core.Internal.Logging;
7
+ using static Amanotes.Core.GDKDebug;
8
8
 
9
9
  namespace Amanotes.Core.Internal
10
10
  {
@@ -39,8 +39,13 @@ namespace Amanotes.Core.Internal
39
39
  }
40
40
  }
41
41
 
42
- private readonly ForceQuitData localData = new ForceQuitData();
43
-
42
+ private readonly ForceQuitData localData = new ForceQuitData();
43
+
44
+ public ForceQuitMonitor()
45
+ {
46
+ AmaGDK.Analytics.OnEventSent += OnLogEvent;
47
+ }
48
+
44
49
  private string GetStringValueOrDefault(Dictionary<string, object> dict, string key, string defaultValue = "")
45
50
  {
46
51
  return dict.TryGetValue(key, out object result)
@@ -2,6 +2,7 @@ using System;
2
2
  using System.Collections;
3
3
  using UnityEngine;
4
4
  using UnityEngine.Networking;
5
+ using static Amanotes.Core.GDKDebug;
5
6
 
6
7
  namespace Amanotes.Core.Internal
7
8
  {
@@ -39,7 +40,7 @@ namespace Amanotes.Core.Internal
39
40
  {
40
41
  result?.Invoke(data.countryCode?.ToUpper());
41
42
  if (data.errorMessage != null)
42
- Logging.Log(data.errorMessage);
43
+ Log(data.errorMessage);
43
44
  });
44
45
  }
45
46
 
@@ -3,6 +3,7 @@ using System.Collections;
3
3
  using System.Collections.Generic;
4
4
  using UnityEngine;
5
5
  using UnityEngine.Networking;
6
+ using static Amanotes.Core.GDKDebug;
6
7
 
7
8
  namespace Amanotes.Core
8
9
  {
@@ -189,7 +190,7 @@ namespace Amanotes.Core.Internal
189
190
  else
190
191
  {
191
192
  result?.Invoke(null);
192
- Logging.Log(data.errorMessage);
193
+ Log(data.errorMessage);
193
194
  FetchTimeWithOtherProvider();
194
195
  }
195
196
  });
@@ -1,8 +1,8 @@
1
1
  using System;
2
2
  using System.Reflection;
3
- using Amanotes.Core.Internal;
4
3
  using UnityEngine;
5
4
  using GUID = System.Guid;
5
+ using static Amanotes.Core.GDKDebug;
6
6
 
7
7
  namespace Amanotes.Core
8
8
  {
@@ -26,10 +26,10 @@ namespace Amanotes.Core
26
26
  public static void ThrowIfEditor(string message)
27
27
  {
28
28
  #if UNITY_EDITOR
29
- throw new KlavarException(message);
30
- #else
31
- Logging.LogError(message);
29
+ if (Application.isEditor) throw new KlavarException(message);
32
30
  #endif
31
+
32
+ LogError(message);
33
33
  }
34
34
 
35
35
  public static void ThrowErrorOnField(object parent, FieldInfo fieldInfo, string message)
@@ -1,6 +1,6 @@
1
1
  using System;
2
2
  using UnityEngine;
3
- using static Amanotes.Core.Internal.Logging;
3
+ using static Amanotes.Core.GDKDebug;
4
4
 
5
5
  namespace Amanotes.Core
6
6
  {
@@ -1,6 +1,6 @@
1
1
  using System;
2
2
  using UnityEngine;
3
- using static Amanotes.Core.Internal.Logging;
3
+ using static Amanotes.Core.GDKDebug;
4
4
 
5
5
  namespace Amanotes.Core.Internal
6
6
  {
@@ -12,13 +12,13 @@ namespace Amanotes.Core.Internal
12
12
 
13
13
  if (Application.isEditor)
14
14
  {
15
- action.Invoke();
15
+ action();
16
16
  return;
17
17
  }
18
18
 
19
19
  try
20
20
  {
21
- action.Invoke();
21
+ action();
22
22
  } catch (Exception e)
23
23
  {
24
24
  LogError(e.ToString());
@@ -27,9 +27,40 @@ namespace Amanotes.Core.Internal
27
27
 
28
28
  public static void SafeInvoke<T>(Action<T> action, T eventObject)
29
29
  {
30
- SafeInvoke(() => action?.Invoke(eventObject));
30
+ if (action == null) return;
31
+
32
+ if (Application.isEditor)
33
+ {
34
+ action(eventObject);
35
+ return;
36
+ }
37
+
38
+ try
39
+ {
40
+ action(eventObject);
41
+ } catch (Exception e)
42
+ {
43
+ LogError(e.ToString());
44
+ }
31
45
  }
32
46
 
47
+ public static void SafeInvoke<T1, T2>(Action<T1, T2> action, T1 p1, T2 p2)
48
+ {
49
+ if (Application.isEditor)
50
+ {
51
+ action(p1, p2);
52
+ return;
53
+ }
54
+
55
+ try
56
+ {
57
+ action(p1, p2);
58
+ } catch (Exception e)
59
+ {
60
+ LogError(e.ToString());
61
+ }
62
+ }
63
+
33
64
  public static void ThrowExceptionInEditor<T>(string message, Func<string, T> exceptionCreator) where T: Exception
34
65
  {
35
66
  if (Application.isEditor)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.70",
3
+ "version": "0.2.72",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",