com.amanotes.gdk 0.2.66 → 0.2.68

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 (53) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/Editor/Extra/GDKAutoUpdateAdapter.cs +67 -0
  3. package/Editor/Extra/GDKAutoUpdateAdapter.cs.meta +11 -0
  4. package/Extra/AmaGDKInstaller.unitypackage +0 -0
  5. package/Extra/CheckDiskSpace.unitypackage +0 -0
  6. package/Extra/ForceUpdate.unitypackage +0 -0
  7. package/Extra/GoogleCMP.unitypackage +0 -0
  8. package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
  9. package/Extra/LegacyGDKUpdateHelper.unitypackage.meta +7 -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/RevenueCatAdapter.unitypackage +0 -0
  20. package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
  21. package/Runtime/Ad/AdExtension.cs +111 -0
  22. package/Runtime/Ad/AdExtension.cs.meta +3 -0
  23. package/Runtime/Ad/AdLogic.cs +530 -0
  24. package/Runtime/Ad/AdLogic.cs.meta +3 -0
  25. package/Runtime/Ad/AdModuleConfig.cs +39 -0
  26. package/Runtime/Ad/AdModuleConfig.cs.meta +3 -0
  27. package/Runtime/Ad/AdShowContext.cs +43 -0
  28. package/Runtime/Ad/AdShowContext.cs.meta +3 -0
  29. package/Runtime/Ad/AmaGDK.Ads.cs +383 -0
  30. package/Runtime/Ad.meta +8 -0
  31. package/Runtime/AmaGDK.Analytics.cs +20 -1
  32. package/Runtime/AmaGDK.Device.cs +105 -0
  33. package/Runtime/AmaGDK.Device.cs.meta +3 -0
  34. package/Runtime/AmaGDK.Mono.cs +0 -1
  35. package/Runtime/AmaGDK.cs +6 -2
  36. package/Runtime/AudioToolkit/AmaGDK.Audio.cs +16 -0
  37. package/Runtime/AudioToolkit/Plugins/Android/GDKAudioDeviceDetector.java +1 -1
  38. package/Runtime/Fps/AmaFPS.Utils.cs +44 -0
  39. package/Runtime/Fps/AmaFPS.Utils.cs.meta +3 -0
  40. package/Runtime/Fps/AmaFPS.cs +197 -0
  41. package/Runtime/Fps/AmaFPS.cs.meta +11 -0
  42. package/Runtime/Fps/AmaFPSVisualizer.cs +246 -0
  43. package/Runtime/Fps/AmaFPSVisualizer.cs.meta +11 -0
  44. package/Runtime/Fps/BollingerBands.cs +99 -0
  45. package/Runtime/Fps/BollingerBands.cs.meta +11 -0
  46. package/Runtime/Fps/FPSVisualizer.prefab +406 -0
  47. package/Runtime/Fps/FPSVisualizer.prefab.meta +7 -0
  48. package/Runtime/Fps/FrameRecorder.cs +172 -0
  49. package/Runtime/Fps/FrameRecorder.cs.meta +3 -0
  50. package/Runtime/Fps.meta +8 -0
  51. package/package.json +1 -1
  52. package/Runtime/AmaGDK.Ads.cs +0 -1077
  53. /package/Runtime/{AmaGDK.Ads.cs.meta → Ad/AmaGDK.Ads.cs.meta} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.68 - 2024-07-08]
4
+ - [Dev] Add IronSource setting to pause game during ad
5
+ - [Fix] Support Android API Version 24 and below
6
+ - [Dev] Add Audio Module flag
7
+
8
+ ## [0.2.67 - 2024-07-04]
9
+ - [Fix] Do retry immediately when OnAdLoadFailed trigger regardless of reason
10
+ - Also: Update default ad request timeout to 30 secs
11
+ - [Feature] Support FPS tracking
12
+ - [Release] 0.2.66-1
13
+ - [Dev] Add a flag to control flushEventDetail (save to file)
14
+ - [Fix] Remove device spec call from constructor of AmaGDK
15
+ - [Feature] classify device performance
16
+ - [Dev] Update GoogleCMP events
17
+ - + cmp_popup_show
18
+ - + cmp_popup_finish
19
+ - [Dev] Handle a special case when Ad close callback is not triggered
20
+ - [Dev] Automatically reimport adapters & extra packages on update
21
+
3
22
  ## [0.2.66 - 2024-06-25]
4
23
  - [Dev] Verify all fields are reset in Init EventParams
5
24
  - [Dev] Add try catch to prevent coroutines to stop silently
@@ -0,0 +1,67 @@
1
+ using Amanotes.Core.Internal;
2
+ using System;
3
+ using System.Collections.Generic;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace Amanotes.Editor
8
+ {
9
+ internal class GDKAutoUpdateAdapter: AssetPostprocessor
10
+ {
11
+ private static readonly Dictionary<string, string> packageMap = new Dictionary<string, string>()
12
+ {
13
+ { "AmaGDKConfigAsset", $"{Res.AMAGDK_CONFIG_PACKAGE}" },
14
+
15
+ // Adapters
16
+ { "AppsFlyerAdapter", $"{Res.PACKAGE_PATH}AppsFlyerAdapter.unitypackage" },
17
+ { "FirebaseAnalyticsAdapter", $"{Res.PACKAGE_PATH}FirebaseAnalyticsAdapter.unitypackage" },
18
+ { "FirebaseRemoteConfigAdapter", $"{Res.PACKAGE_PATH}FirebaseRemoteConfigAdapter.unitypackage" },
19
+ { "IronSourceAdapter", $"{Res.PACKAGE_PATH}IronSourceAdapter.unitypackage" },
20
+ { "RevenueCatAdapter", $"{Res.PACKAGE_PATH}RevenueCatAdapter.unitypackage" },
21
+ { "SqliteAnalyticsAdapter", $"{Res.PACKAGE_PATH}SqliteAnalyticsAdapter.unitypackage" },
22
+
23
+ // Extra packages
24
+ { "DiskSpacePopup", $"{Res.EXTRA_PATH}CheckDiskSpace.unitypackage" },
25
+ { "ForceUpdatePopup", $"{Res.EXTRA_PATH}ForceUpdate.unitypackage" },
26
+ { "GoogleCMPSupport", $"{Res.EXTRA_PATH}GoogleCMP.unitypackage" },
27
+ { "AndroidPostProcessor", $"{Res.EXTRA_PATH}PostProcessor.unitypackage" }
28
+ };
29
+
30
+ private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
31
+ {
32
+ if (importedAssets.Length == 0) return;
33
+ // Debug.LogWarning($"importedAssets: {string.Join("\n", importedAssets)}");
34
+
35
+ foreach (string path in importedAssets)
36
+ {
37
+ if (!path.EndsWith("AmaGDK.cs", StringComparison.InvariantCulture)) continue;
38
+ ImportAdapters();
39
+ break;
40
+ }
41
+ }
42
+
43
+ [MenuItem("Window/AmaGDK/Reimport Adapters")]
44
+ private static void ImportAdapters()
45
+ {
46
+ var packages = new List<string>();
47
+ foreach (KeyValuePair<string, string> kvp in packageMap)
48
+ {
49
+ string[] assets = AssetDatabase.FindAssets($"t:monoscript {kvp.Key}");
50
+ if (assets.Length == 0)
51
+ {
52
+ // Debug.LogWarning($"Not found: {kvp.Key}");
53
+ continue;
54
+ }
55
+
56
+ packages.Add(kvp.Value);
57
+ }
58
+
59
+ // import packages
60
+ for (var i = 0; i < packages.Count; i++)
61
+ {
62
+ Debug.Log($"Reimport: {packages[i]}");
63
+ AssetDatabase.ImportPackage(packages[i], false);
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0e051138a935049638e3e732edfe4a74
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: c102aff69c45748fb9a44760cfb9b490
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,111 @@
1
+ using Amanotes.Core.Internal;
2
+ using System;
3
+ namespace Amanotes.Core
4
+ {
5
+ public static class AdExtension
6
+ {
7
+ /// <summary>
8
+ /// Invoke when ad view has opened
9
+ /// </summary>
10
+ public static IAdCallback OnAdOpened(this IAdCallback ad, Action callback)
11
+ {
12
+ if (!MakeSureAdNotNull(ad)) return null;
13
+ AmaGDK.Ads.context.onOpened -= callback;
14
+ AmaGDK.Ads.context.onOpened += callback;
15
+ return ad;
16
+ }
17
+ /// <summary>
18
+ /// The user finished watching the video, and should be rewarded.
19
+ /// </summary>
20
+ public static IAdCallback OnRewardReceived(this IAdCallback ad, Action callback)
21
+ {
22
+ if (!MakeSureAdNotNull(ad)) return null;
23
+ AmaGDK.Ads.context.onRewardReceived -= callback;
24
+ AmaGDK.Ads.context.onRewardReceived += callback;
25
+ return ad;
26
+ }
27
+ /// <summary>
28
+ /// Invoked when the video ad was clicked.
29
+ /// </summary>
30
+ public static IAdCallback OnAdClicked(this IAdCallback ad, Action callback)
31
+ {
32
+ if (!MakeSureAdNotNull(ad)) return null;
33
+ AmaGDK.Ads.context.onClicked -= callback;
34
+ AmaGDK.Ads.context.onClicked += callback;
35
+ return ad;
36
+ }
37
+ /// <summary>
38
+ /// Callback when the rewarded video ad was failed to show
39
+ /// </summary>
40
+ public static IAdCallback OnAdShowFailed(this IAdCallback ad, Action callback)
41
+ {
42
+ if (!MakeSureAdNotNull(ad)) return null;
43
+ AmaGDK.Ads.context.onShowFailed -= callback;
44
+ AmaGDK.Ads.context.onShowFailed += callback;
45
+ return ad;
46
+ }
47
+ /// <summary>
48
+ /// Invoked before OnAdOpened but is not reliable (not supported by all adNetworks)
49
+ /// </summary>
50
+ public static IAdCallback OnAdShowSuccess(this IAdCallback ad, Action callback)
51
+ {
52
+ if (!MakeSureAdNotNull(ad)) return null;
53
+ AmaGDK.Ads.context.onShowSuccess -= callback;
54
+ AmaGDK.Ads.context.onShowSuccess += callback;
55
+ return ad;
56
+ }
57
+ /// <summary>
58
+ /// Invoke when ad view is about to be closed
59
+ /// </summary>
60
+ public static IAdCallback OnAdClosed(this IAdCallback ad, Action callback)
61
+ {
62
+ if (!MakeSureAdNotNull(ad)) return null;
63
+ AmaGDK.Ads.context.onClosed -= callback;
64
+ AmaGDK.Ads.context.onClosed += callback;
65
+ return ad;
66
+ }
67
+ /// <summary>
68
+ /// This callback may invokes several times according to the AdShowReadyStatus
69
+ /// - When there is no ad cached (wifi disabled / no internet / wait4Ad / timeout)
70
+ /// - When the ad is cached & ready to show
71
+ /// </summary>
72
+ public static IAdCallback OnAdShowReadyStatus(this IAdCallback ad, Action<AdShowReadyStatus> callback)
73
+ {
74
+ if (!MakeSureAdNotNull(ad)) return null;
75
+ AmaGDK.Ads.context.onAdShowReadyStatus -= callback;
76
+ AmaGDK.Ads.context.onAdShowReadyStatus += callback;
77
+ return ad;
78
+ }
79
+ /// <summary>
80
+ /// The finalize callback that will always trigger to mark an end for the AdShowRoutine
81
+ ///
82
+ /// </summary>
83
+ public static IAdCallback OnAdResult(this IAdCallback ad, Action<bool> callback)
84
+ {
85
+ if (!MakeSureAdNotNull(ad)) return null;
86
+ AmaGDK.Ads.context.onAdResult -= callback;
87
+ AmaGDK.Ads.context.onAdResult += callback;
88
+ return ad;
89
+ }
90
+ /// <summary>
91
+ /// Call right before the ad actually open (that means Ad has already been cached & available to show).
92
+ /// This callback will not be triggered in case Ad is not available or no internet (in those case use OnAdShowReadyStatus callback)
93
+ /// </summary>
94
+ public static IAdCallback OnBeforeAdOpen(this IAdCallback ad, Action callback)
95
+ {
96
+ if (!MakeSureAdNotNull(ad)) return null;
97
+ AmaGDK.Ads.context.onBeforeAdOpen -= callback;
98
+ AmaGDK.Ads.context.onBeforeAdOpen += callback;
99
+ return ad;
100
+ }
101
+ private static bool MakeSureAdNotNull(IAdCallback ad)
102
+ {
103
+ bool isValid = (ad != null);
104
+ if (!isValid)
105
+ {
106
+ Logging.LogWarning("Something wrong:: no AdShowContext");
107
+ }
108
+ return isValid;
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: ea59d18629b44bd29b26316c9025f27e
3
+ timeCreated: 1719302222