com.amanotes.gdk 0.2.29 → 0.2.31

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.31 - 2023-11-06]
4
+ - [Fix] False alarm when video reward ready
5
+ - [Fix] Callbacks should trigger earlier (being delayed like 1s)
6
+
7
+ ## [0.2.3 - 2023-11-06]
8
+ - [Fix] GDK should base on realtime instead of game time (which may be pause due to timescale)
9
+
3
10
  ## [0.2.29 - 2023-11-03]
4
11
  - Fix accumulated_count
5
12
  - Fix missing IDFA
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -216,7 +216,7 @@ namespace Amanotes.Core
216
216
  return context.adType == AdType.VideoReward;
217
217
  }
218
218
  }
219
-
219
+
220
220
  private static bool _isBannerShowing;
221
221
  public static void ShowBanner(BannerPosition? bannerPosition = null)
222
222
  {
@@ -369,7 +369,7 @@ namespace Amanotes.Core.Internal
369
369
 
370
370
  public abstract class AdLogic
371
371
  {
372
- private static readonly WaitForSeconds wait1Sec = new WaitForSeconds(1f);
372
+ private static readonly WaitForSecondsRealtime wait1Sec = new WaitForSecondsRealtime(1f);
373
373
 
374
374
  internal LoadAdsState _loadState = LoadAdsState.None;
375
375
  internal bool hasAd
@@ -589,7 +589,7 @@ namespace Amanotes.Core.Internal
589
589
  ShowAdContext context = Ads.context;
590
590
  while (!context.potentiallyCompleted)
591
591
  {
592
- yield return wait1Sec;
592
+ yield return null; // callback as quickly as possible
593
593
  }
594
594
 
595
595
  if (adType == AdType.Interstitial)
@@ -601,7 +601,7 @@ namespace Amanotes.Core.Internal
601
601
  if (context.hasFailedOrCancelled)
602
602
  {
603
603
  Log($"[Ad] {adType} Waiting for [close]");
604
- yield return wait1Sec; // wait for close (1s)
604
+ yield return null;
605
605
  ShowAdRoutineCompleted(false);
606
606
  yield break;
607
607
  }
@@ -611,17 +611,17 @@ namespace Amanotes.Core.Internal
611
611
  while (!context.hasFailedOrCancelled && !context.hasReward)
612
612
  {
613
613
  Log($"[Ad] {adType} Waiting for [cancel] or [reward]");
614
- yield return wait1Sec;
614
+ yield return null;
615
615
  }
616
616
 
617
617
  ShowAdRoutineCompleted(!context.hasFailedOrCancelled);
618
618
  yield break;
619
619
  }
620
-
620
+
621
621
  while (!context.hasClosed)
622
622
  {
623
623
  Log($"[Ad] {adType} Waiting for [close]");
624
- yield return wait1Sec;
624
+ yield return null;
625
625
  }
626
626
 
627
627
  ShowAdRoutineCompleted(true);
@@ -809,7 +809,7 @@ namespace Amanotes.Core.Internal
809
809
  {
810
810
  Log($"[Ad] {adType} OnAdLoadSuccess");
811
811
 
812
- if (!_isRequesting)
812
+ if (!_isRequesting && adType == AdType.Interstitial)
813
813
  {
814
814
  LogWarning("[Ad] Something wrong? OnAdReady called when no ad is loading! AdType=" + adType);
815
815
  }
@@ -52,7 +52,7 @@ namespace Amanotes.Core
52
52
  private const string AMA_DEVICE_ID_KEY = "ama_device_id";
53
53
  private const float TIME_OUT = 5f;
54
54
  private const float WAIT_TIME = 0.5f;
55
- private WaitForSeconds waitForDuration = new WaitForSeconds(WAIT_TIME);
55
+ private WaitForSecondsRealtime waitForDuration = new WaitForSecondsRealtime(WAIT_TIME);
56
56
 
57
57
  internal IEnumerator Init()
58
58
  {
@@ -9,7 +9,7 @@ using static Amanotes.Core.Internal.Logging;
9
9
 
10
10
  namespace Amanotes.Core.Internal
11
11
  {
12
- public class GDKUtils
12
+ public static class GDKUtils
13
13
  {
14
14
  public static void DelayCall(float seconds, Action action)
15
15
  {
@@ -18,14 +18,13 @@ namespace Amanotes.Core.Internal
18
18
 
19
19
  private static IEnumerator DelayCallRoutine(float seconds, Action callback)
20
20
  {
21
- yield return new WaitForSeconds(seconds);
21
+ yield return new WaitForSecondsRealtime(seconds);
22
22
  callback();
23
23
  }
24
24
  }
25
25
 
26
- internal class GDKFileUtils
26
+ internal static class GDKFileUtils
27
27
  {
28
-
29
28
  private static string _basePath;
30
29
  private static string basePath
31
30
  {
@@ -83,7 +82,7 @@ namespace Amanotes.Core.Internal
83
82
  LogWarningOnce("File name must be not null or empty");
84
83
  return;
85
84
  }
86
-
85
+
87
86
  if (contents == null || !contents.GetEnumerator().MoveNext())
88
87
  {
89
88
  LogWarningOnce($"Content for {fileName} is empty");
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.29";
17
+ public const string VERSION = "0.2.31";
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.29",
3
+ "version": "0.2.31",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",