com.amanotes.gdk 0.2.33 → 0.2.34-1

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,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.34-1 - 2023-12-15]
4
+ - Add option to auto save Remote Config
5
+
6
+ ## [0.2.34 - 2023-11-10]
7
+ - [Fix] ShowSuccessed event not call in editor
8
+ - Add clear all data button on AmaGDK prefab
9
+
3
10
  ## [0.2.33 - 2023-11-09]
4
11
  - Remove Adjust
5
12
  - Update RevenueCat attributes
@@ -229,6 +229,11 @@ namespace Amanotes.Editor
229
229
  ToggleGroup("Adapters", ref showAdapterInstaller, DrawGUI_AdapterList);
230
230
 
231
231
  //("Example", ref showExampleDetail, DrawGUI_ExampleScene);
232
+
233
+ if (GUILayout.Button("Clear All Data"))
234
+ {
235
+ GDKFileUtils.ClearCacheData();
236
+ }
232
237
  }
233
238
 
234
239
  private static void DrawVersion(string label, string version)
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -93,6 +93,23 @@ namespace Amanotes.Core
93
93
  LogWarning("[RemoteConfig] No embed remote config available");
94
94
  adapterConfig.embedRemoteConfig.SetActiveConfig(id);
95
95
  }
96
+
97
+ public static void Save()
98
+ {
99
+ StringBuilder sb = new StringBuilder();
100
+
101
+ //Add embedded remote config version to force load from embedded config after app update
102
+ sb.AppendLine($"{VERSION_PREFIX}{EmbedVersion}");
103
+
104
+ foreach (var c in dictConfig)
105
+ {
106
+ sb.AppendLine($"{c.Key}\t{Encode(c.Value)}");
107
+ }
108
+
109
+ string filePath = GDKFileUtils.GetPath(fileName);
110
+ GDKFileUtils.Save(filePath, sb.ToString());
111
+ Log($"[RemoteConfig] Saved remote config to {filePath}");
112
+ }
96
113
  }
97
114
 
98
115
  public partial class RemoteConfig //Internal
@@ -197,19 +214,14 @@ namespace Amanotes.Core
197
214
  static void SaveCache()
198
215
  {
199
216
  _state = FetchState.SaveCache;
200
- StringBuilder sb = new StringBuilder();
201
-
202
- //Add embedded remote config version to force load from embedded config after app update
203
- sb.AppendLine($"{VERSION_PREFIX}{EmbedVersion}");
204
217
 
205
- foreach (var c in dictConfig)
218
+ if (!adapterConfig.autoSaveCache)
206
219
  {
207
- sb.AppendLine($"{c.Key}\t{Encode(c.Value)}");
220
+ NextState();
221
+ return;
208
222
  }
209
223
 
210
- string filePath = GDKFileUtils.GetPath(fileName);
211
- GDKFileUtils.Save(filePath, sb.ToString());
212
- Log($"[RemoteConfig] Saved remote config to {filePath}");
224
+ Save();
213
225
  NextState();
214
226
  }
215
227
 
@@ -365,6 +377,7 @@ namespace Amanotes.Core.Internal
365
377
  internal EmbedRemoteConfigAsset embedRemoteConfig;
366
378
  public float firstFetchTimeOutInSeconds = 10;
367
379
  public float defaultTimeOutInSeconds = 3;
380
+ public bool autoSaveCache = true;
368
381
  }
369
382
 
370
383
  public interface IRemoteConfig
@@ -168,13 +168,13 @@ namespace Amanotes.Core.Internal
168
168
  StringBuilder logBuilder = new StringBuilder();
169
169
  logBuilder.AppendLine("[AmaGDK] All cached data & stats cleared");
170
170
 
171
- if (!Directory.Exists(_basePath))
171
+ if (!Directory.Exists(basePath))
172
172
  {
173
- logBuilder.AppendLine("Cache path not exists: " + _basePath);
173
+ logBuilder.AppendLine("Cache path not exists: " + basePath);
174
174
  return;
175
175
  }
176
176
 
177
- string[] filePaths = Directory.GetFiles(_basePath);
177
+ string[] filePaths = Directory.GetFiles(basePath);
178
178
  foreach (string path in filePaths)
179
179
  {
180
180
  Delete(path);
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.33";
17
+ public const string VERSION = "0.2.34-1";
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.33",
3
+ "version": "0.2.34-1",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",