com.typhoon.unitysdk 1.1.4 → 1.1.6
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 +13 -1
- package/Editor/ApplyTool.cs +44 -6
- package/Editor/CheckPayCallBack/CheckCallBackScript.cs +24 -0
- package/Editor/CheckPayCallBack/CheckCallBackScript.cs.meta +11 -0
- package/Editor/CheckPayCallBack/OnPayCallBack.template +26 -0
- package/Editor/CheckPayCallBack/OnPayCallBack.template.meta +7 -0
- package/Editor/CheckPayCallBack.meta +8 -0
- package/Editor/EditorIcons.cs +4 -0
- package/Editor/EditorKit.cs.meta +11 -11
- package/Editor/ExportModule.cs +21 -3
- package/Editor/KuaiShouWebglConfig.cs.meta +11 -11
- package/Editor/LightmapEncoding.cs.meta +11 -11
- package/Editor/MiniGameWebglConfig.cs +172 -0
- package/Editor/MiniGameWebglConfig.cs.meta +11 -0
- package/Editor/PublishProcess.cs +1 -0
- package/Editor/PublishSetting.cs +32 -4
- package/Editor/PublishSettingGUIDrawer.cs +92 -7
- package/Editor/PublishTool.cs +1 -0
- package/Editor/PublishWindow.cs +2 -0
- package/Editor/SdkTestInUnityWindow.cs +2 -1
- package/Editor/Texture/icon_kuaishou.png.meta +166 -166
- package/Editor/Texture/icon_minigame.png +0 -0
- package/Editor/Texture/icon_minigame.png.meta +145 -0
- package/Editor/UniEditor.cs +7 -10
- package/Runtime/AppChannel.cs +4 -0
- package/Runtime/BaseSdk.cs +67 -1
- package/Runtime/Extension.cs +0 -2
- package/Runtime/IapProductType.cs +8 -0
- package/Runtime/IapProductType.cs.meta +11 -0
- package/Runtime/Interface.cs +36 -2
- package/Runtime/LabelOverride.cs +20 -4
- package/Runtime/Paths.cs +17 -0
- package/Runtime/Paths.cs.meta +11 -0
- package/Runtime/PayCallBackExtraInfo.cs +12 -0
- package/Runtime/PayCallBackExtraInfo.cs.meta +11 -0
- package/Runtime/PayCallBackResult.cs +19 -0
- package/Runtime/PayCallBackResult.cs.meta +11 -0
- package/Runtime/RequestProductInfoResult.cs +37 -0
- package/Runtime/RequestProductInfoResult.cs.meta +11 -0
- package/Runtime/SdkDebug.cs +1 -1
- package/Runtime/SdkLite.cs +61 -17
- package/Runtime/SdkTestInUnity.cs +72 -12
- package/Runtime/SimulateOnShow.cs +5 -0
- package/Runtime/TyphoonSdkCallback.cs +29 -18
- package/Sources~/Package/ChinaAndroid.unitypackage +0 -0
- package/Sources~/Package/GooglePlay.unitypackage +0 -0
- package/Sources~/Package/MiniGame.unitypackage +0 -0
- package/Sources~/Package/MiniGame.unitypackage.manifest +40 -0
- package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
- package/package.json +1 -1
package/Editor/UniEditor.cs
CHANGED
|
@@ -68,6 +68,13 @@ namespace TyphoonUnitySDK
|
|
|
68
68
|
/// </summary>
|
|
69
69
|
public static string PackagePath_KuaiShouWebgl = $"{PathRoot}/Sources~/Package/KuaiShouWebgl.unitypackage";
|
|
70
70
|
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
/// minigame webgl模式资源包
|
|
74
|
+
/// </summary>
|
|
75
|
+
public static string PackagePath_MiniGame = $"{PathRoot}/Sources~/Package/MiniGame.unitypackage";
|
|
76
|
+
|
|
77
|
+
|
|
71
78
|
/// <summary>
|
|
72
79
|
/// Toast模块
|
|
73
80
|
/// </summary>
|
|
@@ -146,7 +153,6 @@ namespace TyphoonUnitySDK
|
|
|
146
153
|
public static void ClearScriptingDefineSymbol(params string[] removes)
|
|
147
154
|
{
|
|
148
155
|
var currentTarget = EditorUserBuildSettings.selectedBuildTargetGroup;
|
|
149
|
-
|
|
150
156
|
if (currentTarget == BuildTargetGroup.Unknown)
|
|
151
157
|
{
|
|
152
158
|
return;
|
|
@@ -154,10 +160,8 @@ namespace TyphoonUnitySDK
|
|
|
154
160
|
|
|
155
161
|
var definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTarget).Trim();
|
|
156
162
|
var defines = definesString.Split(';');
|
|
157
|
-
|
|
158
163
|
bool changed = false;
|
|
159
164
|
definesString = string.Empty;
|
|
160
|
-
|
|
161
165
|
foreach (var define in removes)
|
|
162
166
|
{
|
|
163
167
|
if (defines.Contains(define))
|
|
@@ -192,7 +196,6 @@ namespace TyphoonUnitySDK
|
|
|
192
196
|
public static void AppendScriptingDefineSymbol(params string[] append)
|
|
193
197
|
{
|
|
194
198
|
var currentTarget = EditorUserBuildSettings.selectedBuildTargetGroup;
|
|
195
|
-
|
|
196
199
|
if (currentTarget == BuildTargetGroup.Unknown)
|
|
197
200
|
{
|
|
198
201
|
return;
|
|
@@ -200,9 +203,7 @@ namespace TyphoonUnitySDK
|
|
|
200
203
|
|
|
201
204
|
var definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTarget).Trim();
|
|
202
205
|
var defines = definesString.Split(';');
|
|
203
|
-
|
|
204
206
|
bool changed = false;
|
|
205
|
-
|
|
206
207
|
foreach (var define in append)
|
|
207
208
|
{
|
|
208
209
|
if (defines.Contains(define) == false)
|
|
@@ -236,7 +237,6 @@ namespace TyphoonUnitySDK
|
|
|
236
237
|
foreach (var element in assemblies)
|
|
237
238
|
{
|
|
238
239
|
var type = element.GetType(typeName);
|
|
239
|
-
|
|
240
240
|
if (type != null)
|
|
241
241
|
{
|
|
242
242
|
return type;
|
|
@@ -520,7 +520,6 @@ namespace TyphoonUnitySDK
|
|
|
520
520
|
public static bool IsAsciiPath(string path)
|
|
521
521
|
{
|
|
522
522
|
byte[] bytes = Encoding.ASCII.GetBytes(path);
|
|
523
|
-
|
|
524
523
|
foreach (byte b in bytes)
|
|
525
524
|
{
|
|
526
525
|
if (b > 127) // 非ASCII字符的值大于127
|
|
@@ -1001,7 +1000,6 @@ namespace TyphoonUnitySDK
|
|
|
1001
1000
|
}
|
|
1002
1001
|
}
|
|
1003
1002
|
|
|
1004
|
-
|
|
1005
1003
|
if (map.TryGetValue("version_log", out var out_version_log))
|
|
1006
1004
|
{
|
|
1007
1005
|
changelog = out_version_log.ToString();
|
|
@@ -1077,7 +1075,6 @@ namespace TyphoonUnitySDK
|
|
|
1077
1075
|
try
|
|
1078
1076
|
{
|
|
1079
1077
|
HttpResponseMessage response = await client.GetAsync(url);
|
|
1080
|
-
|
|
1081
1078
|
response.EnsureSuccessStatusCode();
|
|
1082
1079
|
string content = await response.Content.ReadAsStringAsync();
|
|
1083
1080
|
if (response.IsSuccessStatusCode)
|
package/Runtime/AppChannel.cs
CHANGED
package/Runtime/BaseSdk.cs
CHANGED
|
@@ -25,9 +25,17 @@ namespace TyphoonUnitySDK
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
protected IOnPayCallback PayCallback { get; set; }
|
|
29
|
+
|
|
29
30
|
public abstract void OnCreate();
|
|
30
31
|
|
|
32
|
+
/*OnCreate*/
|
|
33
|
+
public void OnCreate(IOnPayCallback payCallback)
|
|
34
|
+
{
|
|
35
|
+
PayCallback = payCallback;
|
|
36
|
+
OnCreate();
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
#region 初始化
|
|
32
40
|
|
|
33
41
|
/*初始化SDK*/
|
|
@@ -280,5 +288,63 @@ namespace TyphoonUnitySDK
|
|
|
280
288
|
}
|
|
281
289
|
|
|
282
290
|
#endregion
|
|
291
|
+
|
|
292
|
+
#region 请求商品信息
|
|
293
|
+
|
|
294
|
+
public virtual void RequestProductInfosAsync(Action<List<IapProductInfo>> success, Action<string> fail)
|
|
295
|
+
{
|
|
296
|
+
SdkDebug.Log($"[BaseSdk] RequestProductInfosAsync 默认返回true ");
|
|
297
|
+
SdkLite.Instance.WaitTo(1, () =>
|
|
298
|
+
{
|
|
299
|
+
success?.Invoke(new List<IapProductInfo>()
|
|
300
|
+
{
|
|
301
|
+
new IapProductInfo()
|
|
302
|
+
{
|
|
303
|
+
desc = "商品1 描述...",
|
|
304
|
+
display_price = "$0.99",
|
|
305
|
+
name = "商品1",
|
|
306
|
+
id = "iap.product.test",
|
|
307
|
+
type = 1,
|
|
308
|
+
},
|
|
309
|
+
new IapProductInfo()
|
|
310
|
+
{
|
|
311
|
+
desc = "订阅1 描述...",
|
|
312
|
+
display_price = "$0.99",
|
|
313
|
+
name = "订阅1",
|
|
314
|
+
id = "iap.product.test.sub",
|
|
315
|
+
type = 2,
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
#endregion
|
|
322
|
+
|
|
323
|
+
#region 内购
|
|
324
|
+
|
|
325
|
+
public virtual void Pay(string productId, int price, string productName, string productDesc)
|
|
326
|
+
{
|
|
327
|
+
SdkDebug.Log(
|
|
328
|
+
$"[BaseSdk] Pay 默认触发支付成功, productId: {productId}, price:{price}, productName :{productName} ,productDesc:{productDesc} ");
|
|
329
|
+
SdkLite.Instance.WaitTo(1, () =>
|
|
330
|
+
{
|
|
331
|
+
PayCallback?.OnPayCallback(productId, true, new PayCallBackExtraInfo()
|
|
332
|
+
{
|
|
333
|
+
order_id = Guid.NewGuid().ToString(),
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
public virtual void RequestOrders()
|
|
339
|
+
{
|
|
340
|
+
SdkDebug.Log($"[BaseSdk] 请求补单 空实现");
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
public virtual void ReceivePayCallBackResult(PayCallBackResult result)
|
|
344
|
+
{
|
|
345
|
+
SdkDebug.Log($"[BaseSdk] ReceivePayCallBackResult {result.ToXJson()}");
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
#endregion
|
|
283
349
|
}
|
|
284
350
|
}
|
package/Runtime/Extension.cs
CHANGED
package/Runtime/Interface.cs
CHANGED
|
@@ -7,7 +7,8 @@ namespace TyphoonUnitySDK
|
|
|
7
7
|
/// SDK全功能接口
|
|
8
8
|
/// </summary>
|
|
9
9
|
public interface ISdk : IOnCreate, IInitSdk, ILogin, IExitGame, IBannerAD, IVideoAD, IIntersAD, IFloatIconAD,
|
|
10
|
-
INativeAD, IRecordGame, IHttpGet, IHttpPost, ISideBarReturn, IShowToast, ITrack,IQuitGameWithKeep
|
|
10
|
+
INativeAD, IRecordGame, IHttpGet, IHttpPost, ISideBarReturn, IShowToast, ITrack, IQuitGameWithKeep,
|
|
11
|
+
IRequestProductInfosAsync, IPay
|
|
11
12
|
{
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -15,7 +16,7 @@ namespace TyphoonUnitySDK
|
|
|
15
16
|
|
|
16
17
|
public interface IOnCreate
|
|
17
18
|
{
|
|
18
|
-
void OnCreate();
|
|
19
|
+
void OnCreate(IOnPayCallback payCallback);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
#endregion
|
|
@@ -225,4 +226,37 @@ namespace TyphoonUnitySDK
|
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
#endregion
|
|
229
|
+
|
|
230
|
+
#region 请求商品信息
|
|
231
|
+
|
|
232
|
+
public interface IRequestProductInfosAsync
|
|
233
|
+
{
|
|
234
|
+
void RequestProductInfosAsync(Action<List<IapProductInfo>> success, Action<string> fail);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
#endregion
|
|
238
|
+
|
|
239
|
+
#region 内购
|
|
240
|
+
|
|
241
|
+
public interface IPay
|
|
242
|
+
{
|
|
243
|
+
//支付
|
|
244
|
+
void Pay(string productId, int price, string productName, string productDesc);
|
|
245
|
+
|
|
246
|
+
//请求补单
|
|
247
|
+
void RequestOrders();
|
|
248
|
+
|
|
249
|
+
void ReceivePayCallBackResult(PayCallBackResult result);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
#endregion
|
|
253
|
+
|
|
254
|
+
#region 支付回调
|
|
255
|
+
|
|
256
|
+
public interface IOnPayCallback
|
|
257
|
+
{
|
|
258
|
+
void OnPayCallback(string product, bool state, PayCallBackExtraInfo extraInfo);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
#endregion
|
|
228
262
|
}
|
package/Runtime/LabelOverride.cs
CHANGED
|
@@ -9,13 +9,21 @@ namespace TyphoonUnitySDK
|
|
|
9
9
|
|
|
10
10
|
public class LabelOverride : PropertyAttribute
|
|
11
11
|
{
|
|
12
|
-
public string
|
|
12
|
+
public string Label;
|
|
13
|
+
public int? LabelWidth;
|
|
13
14
|
|
|
14
15
|
public LabelOverride(string label)
|
|
15
16
|
{
|
|
16
|
-
|
|
17
|
+
Label = label;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
public LabelOverride(string label, int labelWidth)
|
|
21
|
+
{
|
|
22
|
+
Label = label;
|
|
23
|
+
LabelWidth = labelWidth;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
19
27
|
#if UNITY_EDITOR
|
|
20
28
|
[CustomPropertyDrawer(typeof(LabelOverride))]
|
|
21
29
|
public class ThisPropertyDrawer : PropertyDrawer
|
|
@@ -25,20 +33,28 @@ namespace TyphoonUnitySDK
|
|
|
25
33
|
try
|
|
26
34
|
{
|
|
27
35
|
var propertyAttribute = this.attribute as LabelOverride;
|
|
36
|
+
var labelWidth = propertyAttribute.LabelWidth;
|
|
28
37
|
if (IsItBloodyArrayTho(property) == false)
|
|
29
38
|
{
|
|
30
|
-
label.text = propertyAttribute.
|
|
39
|
+
label.text = propertyAttribute.Label;
|
|
31
40
|
}
|
|
32
41
|
else
|
|
33
42
|
{
|
|
34
43
|
Debug.LogWarningFormat(
|
|
35
44
|
"{0}(\"{1}\") doesn't support arrays ",
|
|
36
45
|
typeof(LabelOverride).Name,
|
|
37
|
-
propertyAttribute.
|
|
46
|
+
propertyAttribute.Label
|
|
38
47
|
);
|
|
39
48
|
}
|
|
40
49
|
|
|
50
|
+
var defaultWidth = EditorGUIUtility.labelWidth;
|
|
51
|
+
if (labelWidth != null)
|
|
52
|
+
{
|
|
53
|
+
EditorGUIUtility.labelWidth = labelWidth.Value;
|
|
54
|
+
}
|
|
55
|
+
|
|
41
56
|
EditorGUI.PropertyField(position, property, label);
|
|
57
|
+
EditorGUIUtility.labelWidth = defaultWidth;
|
|
42
58
|
}
|
|
43
59
|
catch (System.Exception ex)
|
|
44
60
|
{
|
package/Runtime/Paths.cs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
using System.IO;
|
|
2
|
+
|
|
3
|
+
namespace TyphoonUnitySDK
|
|
4
|
+
{
|
|
5
|
+
public class Paths
|
|
6
|
+
{
|
|
7
|
+
public static string GetRoot()
|
|
8
|
+
{
|
|
9
|
+
if (!Directory.Exists("Assets/com.typhoon.unitysdk"))
|
|
10
|
+
{
|
|
11
|
+
return "Packages/com.typhoon.unitysdk";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return "Assets/com.typhoon.unitysdk";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
|
|
4
|
+
namespace TyphoonUnitySDK
|
|
5
|
+
{
|
|
6
|
+
[Serializable]
|
|
7
|
+
public class PayCallBackResult
|
|
8
|
+
{
|
|
9
|
+
public List<PayResultItem> items = new List<PayResultItem>();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[Serializable]
|
|
13
|
+
public class PayResultItem
|
|
14
|
+
{
|
|
15
|
+
public string product_id; //商品ID
|
|
16
|
+
public bool state; //支付状态
|
|
17
|
+
public PayCallBackExtraInfo extra; //拓展信息
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine.Scripting;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
[Preserve]
|
|
8
|
+
[Serializable]
|
|
9
|
+
public class RequestProductInfoResult
|
|
10
|
+
{
|
|
11
|
+
public bool state;
|
|
12
|
+
public List<IapProductInfo> infos;
|
|
13
|
+
public string failMsg;
|
|
14
|
+
|
|
15
|
+
[Preserve]
|
|
16
|
+
public RequestProductInfoResult()
|
|
17
|
+
{
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[Preserve]
|
|
22
|
+
[Serializable]
|
|
23
|
+
public class IapProductInfo
|
|
24
|
+
{
|
|
25
|
+
public string id;
|
|
26
|
+
public string name;
|
|
27
|
+
public string desc;
|
|
28
|
+
public string display_price;
|
|
29
|
+
public int type; //(1:一般消耗品,2:订阅项)
|
|
30
|
+
public IapProductType GetProductType() => (IapProductType)type;
|
|
31
|
+
|
|
32
|
+
[Preserve]
|
|
33
|
+
public IapProductInfo()
|
|
34
|
+
{
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/Runtime/SdkDebug.cs
CHANGED
|
@@ -10,7 +10,7 @@ namespace TyphoonUnitySDK
|
|
|
10
10
|
public class SdkDebug
|
|
11
11
|
{
|
|
12
12
|
public static bool IsDebug = false;
|
|
13
|
-
public static string Prefix = "[
|
|
13
|
+
public static string Prefix = "[typhoon-from-unity] ";
|
|
14
14
|
|
|
15
15
|
#if UNITY_EDITOR
|
|
16
16
|
public static string BlueHex => UnityEditor.EditorGUIUtility.isProSkin ? "26ade9" : "092415";
|
package/Runtime/SdkLite.cs
CHANGED
|
@@ -48,10 +48,14 @@ namespace TyphoonUnitySDK
|
|
|
48
48
|
{ AppChannel.GooglePlay, "TyphoonUnitySDK.GooglePlaySdk" }, //GooglePlay
|
|
49
49
|
{ AppChannel.VivoMini, "TyphoonUnitySDK.VivoMiniSdk" }, //Vivo小游戏
|
|
50
50
|
{ AppChannel.OppoMini, "TyphoonUnitySDK.OppoMiniSdk" }, //Oppo小游戏
|
|
51
|
+
{ AppChannel.MiniGame, "TyphoonUnitySDK.MiniGameSdk" }, //微游
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
//支付回调类名
|
|
55
|
+
public const string PAY_CALL_BACK_CLASS_NAME = "TyphoonUnitySDK.OnPayCallBack";
|
|
54
56
|
|
|
57
|
+
private ISdk _sdk;
|
|
58
|
+
private IOnPayCallback _payCallBackInUnity;
|
|
55
59
|
private SDKHttpClient _sdkHttpClient = null;
|
|
56
60
|
|
|
57
61
|
public SDKHttpClient SDKHttpClient
|
|
@@ -61,7 +65,7 @@ namespace TyphoonUnitySDK
|
|
|
61
65
|
if (_sdkHttpClient == null)
|
|
62
66
|
{
|
|
63
67
|
_sdkHttpClient = SDKHttpClient.CreateInstance();
|
|
64
|
-
|
|
68
|
+
DontDestroyOnLoad(_sdkHttpClient.gameObject);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
return _sdkHttpClient;
|
|
@@ -83,6 +87,8 @@ namespace TyphoonUnitySDK
|
|
|
83
87
|
{
|
|
84
88
|
#if UNITY_EDITOR
|
|
85
89
|
SimulateOnShow.Instance.Build();
|
|
90
|
+
Debug.Log("[TYPHOON SDK] 初始话完毕 可从‘TyphoonSDK/模拟测试’ 可调整参数返回");
|
|
91
|
+
_payCallBackInUnity = CreateOnPayCallbackInstance();
|
|
86
92
|
return;
|
|
87
93
|
#endif
|
|
88
94
|
//动态日志开启android端调试日志
|
|
@@ -97,7 +103,9 @@ namespace TyphoonUnitySDK
|
|
|
97
103
|
|
|
98
104
|
var instance = Activator.CreateInstance(type);
|
|
99
105
|
_sdk = instance as ISdk;
|
|
100
|
-
|
|
106
|
+
Log("创建---- pay call back");
|
|
107
|
+
_sdk.OnCreate(CreateOnPayCallbackInstance());
|
|
108
|
+
Log("创建完毕---- pay call back");
|
|
101
109
|
}
|
|
102
110
|
else
|
|
103
111
|
{
|
|
@@ -106,6 +114,15 @@ namespace TyphoonUnitySDK
|
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
|
|
117
|
+
private IOnPayCallback CreateOnPayCallbackInstance()
|
|
118
|
+
{
|
|
119
|
+
var type = GetType(PAY_CALL_BACK_CLASS_NAME);
|
|
120
|
+
Log($"pay call back type : {type}");
|
|
121
|
+
var instance = Activator.CreateInstance(type);
|
|
122
|
+
Log($"pay call back instance : {instance}");
|
|
123
|
+
return (IOnPayCallback)instance;
|
|
124
|
+
}
|
|
125
|
+
|
|
109
126
|
// 反射获取type
|
|
110
127
|
private Type GetType(string typeName)
|
|
111
128
|
{
|
|
@@ -177,7 +194,6 @@ namespace TyphoonUnitySDK
|
|
|
177
194
|
success?.Invoke();
|
|
178
195
|
return;
|
|
179
196
|
#endif
|
|
180
|
-
|
|
181
197
|
_sdk.InitSdk(success, fail);
|
|
182
198
|
}
|
|
183
199
|
|
|
@@ -205,7 +221,6 @@ namespace TyphoonUnitySDK
|
|
|
205
221
|
|
|
206
222
|
return;
|
|
207
223
|
#endif
|
|
208
|
-
|
|
209
224
|
_sdk.Login(success, fail);
|
|
210
225
|
}
|
|
211
226
|
|
|
@@ -323,7 +338,6 @@ namespace TyphoonUnitySDK
|
|
|
323
338
|
|
|
324
339
|
return;
|
|
325
340
|
#endif
|
|
326
|
-
|
|
327
341
|
_sdk.ShowVideo(scene, success, fail);
|
|
328
342
|
}
|
|
329
343
|
|
|
@@ -370,7 +384,6 @@ namespace TyphoonUnitySDK
|
|
|
370
384
|
|
|
371
385
|
return;
|
|
372
386
|
#endif
|
|
373
|
-
|
|
374
387
|
_sdk.ShowBanner(scene, position);
|
|
375
388
|
}
|
|
376
389
|
|
|
@@ -426,7 +439,6 @@ namespace TyphoonUnitySDK
|
|
|
426
439
|
|
|
427
440
|
return;
|
|
428
441
|
#endif
|
|
429
|
-
|
|
430
442
|
_sdk.HideNative(scene);
|
|
431
443
|
}
|
|
432
444
|
|
|
@@ -450,7 +462,6 @@ namespace TyphoonUnitySDK
|
|
|
450
462
|
|
|
451
463
|
return;
|
|
452
464
|
#endif
|
|
453
|
-
|
|
454
465
|
_sdk.ShowFloatIcon(scene, spx, spy);
|
|
455
466
|
}
|
|
456
467
|
|
|
@@ -518,7 +529,6 @@ namespace TyphoonUnitySDK
|
|
|
518
529
|
}
|
|
519
530
|
|
|
520
531
|
result += $"_{AppConfig.PublishTime}";
|
|
521
|
-
|
|
522
532
|
switch (AppConfig.VersionType)
|
|
523
533
|
{
|
|
524
534
|
case VersionType.Base:
|
|
@@ -805,7 +815,6 @@ namespace TyphoonUnitySDK
|
|
|
805
815
|
}
|
|
806
816
|
|
|
807
817
|
fail?.Invoke("not support");
|
|
808
|
-
Debug.Log($"<color=#{SdkDebug.BlueHex}> [SDK模拟] 导航到侧边栏-回调结果==false,可从'TyphoonSDK/模拟测试'修改</color>");
|
|
809
818
|
}
|
|
810
819
|
|
|
811
820
|
return;
|
|
@@ -825,11 +834,6 @@ namespace TyphoonUnitySDK
|
|
|
825
834
|
case AppChannel.DouyinAndroid:
|
|
826
835
|
case AppChannel.DouyinIOS:
|
|
827
836
|
{
|
|
828
|
-
if (!SdkTestInUnity.Instance.IsEnterFromSideBar)
|
|
829
|
-
{
|
|
830
|
-
Debug.Log($"<color=#{SdkDebug.BlueHex}> [SDK模拟] 侧边栏进入标记==false,可从'TyphoonSDK/模拟测试'修改</color>");
|
|
831
|
-
}
|
|
832
|
-
|
|
833
837
|
return SdkTestInUnity.Instance.IsEnterFromSideBar;
|
|
834
838
|
}
|
|
835
839
|
}
|
|
@@ -875,7 +879,7 @@ namespace TyphoonUnitySDK
|
|
|
875
879
|
{
|
|
876
880
|
//开启日志
|
|
877
881
|
Debug.Log(
|
|
878
|
-
$"<color=#{SdkDebug.BlueHex}>
|
|
882
|
+
$"<color=#{SdkDebug.BlueHex}> 【事件上报日志】 Track [eventName]:{eventName} [map]:{map.ToXJson()} 可从'TyphoonSDK/模拟测试'中修改</color>");
|
|
879
883
|
}
|
|
880
884
|
|
|
881
885
|
return;
|
|
@@ -899,5 +903,45 @@ namespace TyphoonUnitySDK
|
|
|
899
903
|
}
|
|
900
904
|
|
|
901
905
|
#endregion
|
|
906
|
+
|
|
907
|
+
#region 请求商品信息
|
|
908
|
+
|
|
909
|
+
public virtual void RequestProductInfosAsync(Action<List<IapProductInfo>> success, Action<string> fail)
|
|
910
|
+
{
|
|
911
|
+
#if UNITY_EDITOR
|
|
912
|
+
WaitTo(SdkTestInUnity.Instance.RequestProductInfoResultDelay, () =>
|
|
913
|
+
{
|
|
914
|
+
if (SdkTestInUnity.Instance.RequestProductInfoResult)
|
|
915
|
+
{
|
|
916
|
+
success?.Invoke(SdkTestInUnity.Instance.ProductInfos);
|
|
917
|
+
}
|
|
918
|
+
else
|
|
919
|
+
{
|
|
920
|
+
fail?.Invoke("测试参数返回为false");
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
return;
|
|
924
|
+
#endif
|
|
925
|
+
_sdk.RequestProductInfosAsync(success, fail);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
#endregion
|
|
929
|
+
|
|
930
|
+
#region 内购
|
|
931
|
+
|
|
932
|
+
public virtual void Pay(string productId, int price, string productName, string productDesc)
|
|
933
|
+
{
|
|
934
|
+
#if UNITY_EDITOR
|
|
935
|
+
_payCallBackInUnity.OnPayCallback(productId, SdkTestInUnity.Instance.PayResultFlag,
|
|
936
|
+
new PayCallBackExtraInfo()
|
|
937
|
+
{
|
|
938
|
+
order_id = Guid.NewGuid().ToString(),
|
|
939
|
+
});
|
|
940
|
+
return;
|
|
941
|
+
#endif
|
|
942
|
+
_sdk.Pay(productId, price, productName, productDesc);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
#endregion
|
|
902
946
|
}
|
|
903
947
|
}
|