com.amanotes.gdk 0.2.71 → 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 (61) hide show
  1. package/CHANGELOG.md +96 -88
  2. package/Editor/AmaGDKEditor.cs +1 -1
  3. package/Editor/EmbedRemoteConfigAssetInspector.cs +1 -1
  4. package/Editor/Extra/GDKCIBuildCommand.cs +2 -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/AmaGDK.Ads.cs +1 -1
  25. package/Runtime/AmaGDK.Adapters.cs +1 -1
  26. package/Runtime/AmaGDK.Analytics.cs +17 -30
  27. package/Runtime/AmaGDK.Config.cs +1 -7
  28. package/Runtime/AmaGDK.Consent.cs +9 -8
  29. package/Runtime/AmaGDK.Context.cs +1 -1
  30. package/Runtime/AmaGDK.Device.cs +3 -2
  31. package/Runtime/AmaGDK.IAP.cs +1 -1
  32. package/Runtime/AmaGDK.RemoteConfig.cs +2 -2
  33. package/Runtime/AmaGDK.Singleton.cs +1 -1
  34. package/Runtime/AmaGDK.UserProfile.cs +12 -11
  35. package/Runtime/AmaGDK.asmdef +1 -1
  36. package/Runtime/AmaGDK.cs +7 -7
  37. package/Runtime/AnalyticQualityAsset.cs +5 -6
  38. package/Runtime/AudioToolkit/AmaGDK.Audio.cs +3 -2
  39. package/Runtime/AudioToolkit/Plugins/AudioDeviceDetector.cs +2 -2
  40. package/Runtime/Core/GDKDebug.cs +97 -0
  41. package/Runtime/Core/GDKDebug.cs.meta +3 -0
  42. package/Runtime/Core/GDKPool.cs +56 -337
  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 +1 -1
  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 +11 -8
  53. package/Runtime/Internal/AmaGDK.Internal.cs +22 -33
  54. package/Runtime/Internal/AmaGDK.Utils.cs +4 -4
  55. package/Runtime/Internal/AmaGDK.WebUtils.cs +1 -1
  56. package/Runtime/Internal/GDKGeoLocationcs.cs +2 -1
  57. package/Runtime/Internal/GDKServerTime.cs +2 -1
  58. package/Runtime/Klavar/KlavarContainer.cs +4 -4
  59. package/Runtime/UserProfile/Plugins/Android/AdvertisingIdFetcher.cs +1 -1
  60. package/Runtime/Utils/GDKUtils.cs +1 -1
  61. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  using System.Collections.Generic;
2
- using static Amanotes.Core.Internal.Logging;
2
+ using static Amanotes.Core.GDKDebug;
3
3
  using UnityEngine;
4
4
  namespace Amanotes.Core
5
5
  {
@@ -1,7 +1,7 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
3
  using Amanotes.Core.Internal;
4
- using static Amanotes.Core.Internal.Logging;
4
+ using static Amanotes.Core.GDKDebug;
5
5
  using UnityEngine;
6
6
  using UnityEngine.Events;
7
7
 
@@ -3,7 +3,7 @@ using System.Collections.Generic;
3
3
  using UnityEngine;
4
4
  using UnityEngine.Profiling;
5
5
  using UnityEngine.UI;
6
- using static Amanotes.Core.Internal.Logging;
6
+ using static Amanotes.Core.GDKDebug;
7
7
 
8
8
  namespace Amanotes.Core
9
9
  {
@@ -2,7 +2,7 @@
2
2
  using System;
3
3
  using System.Collections.Generic;
4
4
  using UnityEngine;
5
- using static Amanotes.Core.Internal.Logging;
5
+ using static Amanotes.Core.GDKDebug;
6
6
 
7
7
  namespace Amanotes.Core
8
8
  {
@@ -7,9 +7,12 @@
7
7
  // 2. On Android devices (excluding the Unity Editor).
8
8
  // 3. In the Unity Editor running on macOS with Apple Silicon (M1, M2, etc.).
9
9
  #if UNITY_2021_1_OR_NEWER && ((UNITY_MOBILE && !UNITY_EDITOR) || (UNITY_MOBILE && UNITY_EDITOR_OSX))
10
+
10
11
  using System;
11
12
  using System.Runtime.InteropServices;
12
13
  using Amanotes.Core.Internal;
14
+ using static Amanotes.Core.GDKDebug;
15
+
13
16
  using UnityEngine;
14
17
 
15
18
  namespace Amanotes.Core
@@ -212,7 +215,7 @@ namespace Amanotes.Core
212
215
  ) / numChannel;
213
216
  audioData = new float[numSamples*numChannel];
214
217
  Marshal.Copy(audioDataResample, audioData, 0, numSamples*numChannel);
215
- Logging.LogWarning(
218
+ LogWarning(
216
219
  "Warning: The input AudioClip has a sample rate of " + fs + " Hz," +
217
220
  " which does not match AudioSetting sample rate of " + AudioSettings.outputSampleRate + " Hz." +
218
221
  " GDKAudio will resample the audio to match AudioSetting with high memory usage." +
@@ -220,17 +223,17 @@ namespace Amanotes.Core
220
223
  );
221
224
  }
222
225
 
223
- Logging.Log("[AAA]numSamples: " + numSamples);
224
- Logging.Log("[AAA]numChannel:" + numChannel);
225
- Logging.Log("[AAA]bufferLength:" + bufferLength);
226
- Logging.Log("[AAA]numBuffer:" + numBuffer);
226
+ Log("[AAA]numSamples: " + numSamples);
227
+ Log("[AAA]numChannel:" + numChannel);
228
+ Log("[AAA]bufferLength:" + bufferLength);
229
+ Log("[AAA]numBuffer:" + numBuffer);
227
230
 
228
231
  nFFT = 2048;
229
232
  // hop = 512;
230
233
 
231
234
  numFrame = (numSamples - nFFT) / hop;
232
235
  // Initialize
233
- Logging.Log("[AAA]TSM_Init");
236
+ Log("[AAA]TSM_Init");
234
237
  TSM_Init(audioData, speed, fs, numChannel, nFFT, hop, ref ptrL, ref ptrR);
235
238
  initialized = true;
236
239
  hopFrame = new float[hop*numChannel];
@@ -239,7 +242,7 @@ namespace Amanotes.Core
239
242
 
240
243
  audioSource.clip = audioClip;
241
244
  audioSource.loop = loop;
242
- Logging.Log("[AAA]AudioSettings.outputSampleRate (later): " + AudioSettings.outputSampleRate);
245
+ Log("[AAA]AudioSettings.outputSampleRate (later): " + AudioSettings.outputSampleRate);
243
246
  }
244
247
 
245
248
  private void OnAudioFilterRead(float[] data, int channels)
@@ -257,7 +260,7 @@ namespace Amanotes.Core
257
260
  return;
258
261
  }
259
262
  idxFrame = 0;
260
- Logging.Log("[AAA] Loop");
263
+ Log("[AAA] Loop");
261
264
  }
262
265
 
263
266
 
@@ -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
  {
@@ -268,7 +268,7 @@ namespace Amanotes.Core.Internal
268
268
 
269
269
  public static void ClearCacheData()
270
270
  {
271
- var sb = GDKPool.TakeStringBuilder();
271
+ var sb = GDKPool.GetStringBuilder();
272
272
  sb.AppendLine("[AmaGDK] All cached data & stats cleared");
273
273
 
274
274
  if (!Directory.Exists(basePath))
@@ -411,7 +411,7 @@ namespace Amanotes.Core.Internal
411
411
  if (inputDict == null) return "{}";
412
412
 
413
413
  Profiler.BeginSample("AmaGDK.JsonUtils.DictionaryToJson()");
414
- var jsonSb = GDKPool.TakeStringBuilder(8192);
414
+ var jsonSb = GDKPool.GetStringBuilder(8);
415
415
  jsonSb.Append("{");
416
416
  bool isFirstElement = true;
417
417
 
@@ -431,7 +431,7 @@ namespace Amanotes.Core.Internal
431
431
  }
432
432
 
433
433
  jsonSb.AppendFormat("{0}{1}", format ? "\n" : "", "}");
434
- var result = GDKPool.ReturnAndStringify(jsonSb);
434
+ var result = GDKPool.ReturnString(jsonSb);
435
435
  Profiler.EndSample();
436
436
 
437
437
  return result;
@@ -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
  {
@@ -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
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.71",
3
+ "version": "0.2.72",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",