com.amanotes.gdk 0.2.31-1 → 0.2.31-2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # Changelog
2
2
 
3
- ## [0.2.31-1 - 2024-03-06]
4
- - Add Analytics.enableAnalyticsLog property
3
+ ## [0.2.31-2 - 2024-08-21]
4
+ - [Fix] Exception while loading / parsing LoadJsonFromFile
5
5
 
6
6
  ## [0.2.31 - 2023-11-06]
7
7
  - [Fix] False alarm when video reward ready
@@ -30,11 +30,6 @@ namespace Amanotes.Core
30
30
  public static partial class Analytics
31
31
  {
32
32
  public static bool HasMigrated => localData.migrationLog.count > 0;
33
- public static bool enableAnalyticsLog
34
- {
35
- set => Config.common.showAnalyticsLog = value;
36
- get => Config.common.showAnalyticsLog;
37
- }
38
33
 
39
34
  public interface IEventParamsBuilder { }
40
35
 
@@ -762,7 +757,7 @@ namespace Amanotes.Core.Internal
762
757
 
763
758
  public partial class SDKConfig
764
759
  {
765
- public bool showAnalyticsLog;
760
+ public bool showAnalyticsLog = true;
766
761
  public bool normalizeEventName = true;
767
762
  public bool checkMigrationIntegrity = true;
768
763
  public bool enableEventStat;
@@ -253,14 +253,21 @@ namespace Amanotes.Core.Internal
253
253
  {
254
254
  public static T LoadJsonFromFile<T>(this T instance) where T : IJsonFile, new()
255
255
  {
256
- if (instance == null)
257
- {
258
- var result = new T();
259
- instance = result;
260
- }
256
+ instance ??= new T();
257
+
261
258
  string fileName = instance.GetType().Name;
262
259
  string json = GDKFileUtils.Load(fileName);
263
- JsonUtility.FromJsonOverwrite(json, instance);
260
+ if (!string.IsNullOrEmpty(json))
261
+ {
262
+ try
263
+ {
264
+ JsonUtility.FromJsonOverwrite(json, instance);
265
+ } catch (Exception e)
266
+ {
267
+ LogWarning("LoadJsonFromFile error: " + fileName + "\n" + e);
268
+ }
269
+ }
270
+
264
271
  return instance;
265
272
  }
266
273
 
package/Runtime/AmaGDK.cs CHANGED
@@ -14,7 +14,7 @@ namespace Amanotes.Core
14
14
  {
15
15
  public partial class AmaGDK : MonoBehaviour
16
16
  {
17
- public const string VERSION = "0.2.31-1";
17
+ public const string VERSION = "0.2.31-2";
18
18
 
19
19
  internal static AmaGDK _instance;
20
20
  internal static Status _status = Status.None;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.31-1",
3
+ "version": "0.2.31-2",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",