com.amanotes.gdk 0.2.22 → 0.2.25

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.25 - 2023-10-25]
4
+ Update Ads module:
5
+ - OnRewardedAvailable
6
+ - OnRewardedUnavailable
7
+ - OnAdImpression
8
+ - Report internet condition in ShowAdFail
9
+ - Polish display of ironSource config's inspector
10
+ - Move SKAdnetwork's destination to Editor
11
+
12
+ ## [0.2.23 - 2023-10-18]
13
+ - Fix UserProfile out of main thread
14
+ - Handle multiple Firebase's dependency check
15
+
3
16
  ## [0.2.22 - 2023-10-11]
4
17
  - Get adapter info
5
18
 
@@ -112,14 +112,14 @@ namespace Amanotes.Editor
112
112
  {
113
113
  CreateCachedEditor(configAsset, null, ref editor);
114
114
  float lbWidth = EditorGUIUtility.labelWidth;
115
- EditorGUIUtility.labelWidth = 200f;
115
+ EditorGUIUtility.labelWidth = 220f;
116
116
  editor.OnInspectorGUI();
117
117
  EditorGUIUtility.labelWidth = lbWidth;
118
118
  }
119
119
 
120
120
  private void DrawGUI_ConfigAsset()
121
121
  {
122
- EditorGUILayout.ObjectField(configAsset, configAsset.GetType(), false);
122
+ EditorGUILayout.ObjectField(configAsset, configAsset.GetType(), false, GUILayout.Width(EditorGUIUtility.currentViewWidth - 414), GUILayout.ExpandWidth(true));
123
123
  }
124
124
 
125
125
  private void UpdateListAdapter()
@@ -142,7 +142,7 @@ namespace Amanotes.Core
142
142
 
143
143
  private static string GetSDKName(string packageName)
144
144
  {
145
- return sdkToClassMap.Keys.FirstOrDefault(sdk => packageName.Contains(sdk));
145
+ return sdkToClassMap.Keys.FirstOrDefault(sdk => packageName.Contains(sdk)) ?? "";
146
146
  }
147
147
  }
148
148
  }
@@ -63,9 +63,12 @@ namespace Amanotes.Editor
63
63
 
64
64
  public static bool Toggle(string label, ref bool value)
65
65
  {
66
+ float lbWidth = EditorGUIUtility.labelWidth;
67
+ EditorGUIUtility.labelWidth = 220f;
66
68
  bool newValue = EditorGUILayout.Toggle(label, value);
69
+ EditorGUIUtility.labelWidth = lbWidth;
70
+
67
71
  if (newValue == value) return false;
68
-
69
72
  value = newValue;
70
73
  return true;
71
74
  }
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -64,6 +64,18 @@ namespace Amanotes.Core
64
64
  return ad;
65
65
  }
66
66
 
67
+ public static IAdCallback OnRewardedVideoComplete(this IAdCallback ad, Action<bool> callback)
68
+ {
69
+ if (ad == null)
70
+ return null;
71
+ void RewardedVideoComplete()
72
+ {
73
+ callback(Ads.context.hasReward);
74
+ }
75
+ Ads.context.onClosed -= RewardedVideoComplete;
76
+ Ads.context.onClosed += RewardedVideoComplete;
77
+ return ad;
78
+ }
67
79
  }
68
80
 
69
81
  public partial class AmaGDK // Ads module
@@ -306,6 +318,7 @@ namespace Amanotes.Core.Internal
306
318
  {
307
319
  public readonly AdType adType;
308
320
  public readonly string placementName;
321
+ public string errorMessage;
309
322
  public readonly Dictionary<string, object> userData;
310
323
  public AdCallback adCallback;
311
324
 
@@ -473,6 +486,9 @@ namespace Amanotes.Core.Internal
473
486
  if (Ads._adConfig.checkInternet && !hasInternet)
474
487
  {
475
488
  _showState = ShowAdsState.ShowFail;
489
+ Ads.context.errorMessage = "Please check you internet connection";
490
+ if (_isInterstitial) Ads.Events.OnInterstitialShowFailed?.Invoke();
491
+ else Ads.Events.OnRewardedShowFailed?.Invoke();
476
492
  ShowAdRoutineCompleted(false);
477
493
  yield break;
478
494
  }
@@ -734,6 +750,8 @@ namespace Amanotes.Core.Internal
734
750
 
735
751
  public class AdListener
736
752
  {
753
+ public Action OnRewardedAvailable;
754
+ public Action OnRewardedUnavailable;
737
755
  public Action OnRewardedOpened;
738
756
  public Action OnRewardedReceived;
739
757
  public Action OnRewardedClicked;
@@ -749,5 +767,6 @@ namespace Amanotes.Core.Internal
749
767
  public Action<string> OnInterstitialLoadFailed;
750
768
 
751
769
  public Action OnShowTimeout;
770
+ public Action<object> OnAdImpression;
752
771
  }
753
772
  }
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.22";
17
+ public const string VERSION = "0.2.25";
18
18
 
19
19
  internal static AmaGDK _instance;
20
20
  internal static Status _status = Status.None;
@@ -25,6 +25,7 @@ namespace Amanotes.Core
25
25
 
26
26
  private static ConfigAsset _config = null;
27
27
  private static readonly Dictionary<string, AdapterInfo> _adapters = new Dictionary<string, AdapterInfo>();
28
+ private static readonly List<string> _firebaseServices = new List<string>() { AdapterID.FIREBASE_REMOTE_CONFIG, AdapterID.FIREBASE_ANALYTICS };
28
29
 
29
30
  internal static ConfigAsset Config
30
31
  {
@@ -56,7 +57,7 @@ namespace Amanotes.Core
56
57
  _allowInit = _allowInit || autoInit;
57
58
  StartCoroutine(InitRoutine());
58
59
  }
59
-
60
+
60
61
  IEnumerator InitRoutine()
61
62
  {
62
63
  if (Config == null)
@@ -64,7 +65,7 @@ namespace Amanotes.Core
64
65
  throw new Exception("[AmaGDK] " + CONFIG_NOT_FOUND);
65
66
  }
66
67
 
67
- yield return User.Init();
68
+ yield return StartCoroutine(User.Init());
68
69
 
69
70
  float time = 0;
70
71
  float timeout = 10;
@@ -95,7 +96,7 @@ namespace Amanotes.Core
95
96
  Log($"Initiating {adapter.adapterId} --> initOrder: {adapter.initOrder}");
96
97
  adapter.Init();
97
98
  RegisterUnityCallback(adapter);
98
-
99
+
99
100
  time = 0;
100
101
 
101
102
  while (!adapter.IsReady)
@@ -106,6 +107,11 @@ namespace Amanotes.Core
106
107
  LogWarning($"{adapter.adapterId} init time out: {timeout}");
107
108
  break;
108
109
  }
110
+
111
+ if (adapter.IsReady && _firebaseServices.Contains(adapter.adapterId))
112
+ {
113
+ firebaseResolved = true;
114
+ }
109
115
 
110
116
  var adapterInfo = new AdapterInfo(adapter.adapterId, adapter.adapterVersion, adapter.IsReady);
111
117
  _adapters.Add(adapter.adapterId, adapterInfo);
@@ -130,15 +136,13 @@ namespace Amanotes.Core
130
136
  {
131
137
  switch (adapter)
132
138
  {
133
- case IOnFrameUpdate a:
134
- {
139
+ case IOnFrameUpdate a: {
135
140
  onFrameUpdate -= a.OnFrameUpdate;
136
141
  onFrameUpdate += a.OnFrameUpdate;
137
142
  break;
138
143
  }
139
144
 
140
- case IOnApplicationPause a:
141
- {
145
+ case IOnApplicationPause a: {
142
146
  onApplicationPause -= a.OnApplicationPause;
143
147
  onApplicationPause += a.OnApplicationPause;
144
148
  break;
@@ -150,21 +154,22 @@ namespace Amanotes.Core
150
154
  applicationFocus += a.OnApplicationFocus;
151
155
  break;
152
156
  }
153
-
157
+
154
158
  case IOnApplicationQuit a:
155
159
  {
156
160
  applicationQuit -= a.OnApplicationQuit;
157
161
  applicationQuit += a.OnApplicationQuit;
158
- break;
162
+ break;
159
163
  }
160
164
  }
161
165
  }
162
-
166
+
163
167
  }
164
168
 
165
169
  public partial class AmaGDK // PUBLIC APIS
166
170
  {
167
171
  public static bool isReady => _status == Status.Ready;
172
+ public static bool firebaseResolved { get; private set; }
168
173
 
169
174
  public static void Init(Action onReady = null)
170
175
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.22",
3
+ "version": "0.2.25",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",