com.typhoon.unitysdk 1.0.9 → 1.0.10
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/Editor/Interactive/test_banner.png +0 -0
- package/Editor/Interactive/{sdk_banner.png.meta → test_banner.png.meta} +6 -6
- package/Editor/Interactive/test_banner_2.png +0 -0
- package/Editor/Interactive/{sdk_close.png.meta → test_banner_2.png.meta} +25 -1
- package/Editor/Interactive/test_float_icon_1.png +0 -0
- package/Editor/Interactive/{sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png.meta → test_float_icon_1.png.meta} +25 -1
- package/Editor/Interactive/test_float_icon_2.png +0 -0
- package/Editor/Interactive/{sdk_white_4x4.png.meta → test_float_icon_2.png.meta} +25 -1
- package/Editor/Interactive/test_float_icon_3.png +0 -0
- package/Editor/Interactive/test_float_icon_3.png.meta +144 -0
- package/Editor/Interactive/test_float_icon_4.png +0 -0
- package/Editor/Interactive/test_float_icon_4.png.meta +144 -0
- package/Editor/Interactive/test_inters.png +0 -0
- package/Editor/Interactive/test_inters.png.meta +144 -0
- package/Editor/Interactive/test_native.png +0 -0
- package/Editor/Interactive/test_native.png.meta +144 -0
- package/Editor/InteractiveSources.asset +23 -0
- package/Editor/{Interactive/SDKInteractiveUI.prefab.meta → InteractiveSources.asset.meta} +3 -2
- package/Editor/PreferencesWindow.cs +6 -6
- package/Editor/PublishSettingGUIDrawer.cs +4 -1
- package/Editor/PublishVivoBatSettingWindow.cs +1 -1
- package/Editor/PublishWindow.cs +32 -25
- package/Editor/Skin.guiskin +116 -859
- package/Editor/SkinLight.guiskin +1996 -0
- package/Editor/SkinLight.guiskin.meta +8 -0
- package/Editor/Skins.cs +20 -1
- package/Editor/SkinsTexture.asset +133 -0
- package/Editor/SkinsTexture.asset.meta +8 -0
- package/Editor/Styles.cs +2 -12
- package/Editor/Texture/{btn_active.png.meta → dark_active.png.meta} +120 -120
- package/Editor/Texture/{btn_hover.png.meta → dark_hover.png.meta} +120 -120
- package/Editor/Texture/{btn_normal.png.meta → dark_normal.png.meta} +120 -120
- package/Editor/Texture/icon_android.png.meta +120 -120
- package/Editor/Texture/icon_douyin.png.meta +120 -120
- package/Editor/Texture/icon_download.png +0 -0
- package/Editor/Texture/icon_download.png.meta +120 -120
- package/Editor/Texture/icon_extension.png +0 -0
- package/Editor/Texture/icon_extension.png.meta +120 -120
- package/Editor/Texture/icon_googleplay.png.meta +120 -120
- package/Editor/Texture/icon_html5.png.meta +120 -120
- package/Editor/Texture/icon_import.png +0 -0
- package/Editor/Texture/icon_ios.png.meta +120 -120
- package/Editor/Texture/icon_oppo.png.meta +120 -120
- package/Editor/Texture/icon_refresh.png +0 -0
- package/Editor/Texture/icon_refresh.png.meta +120 -120
- package/Editor/Texture/icon_save.png +0 -0
- package/Editor/Texture/icon_save.png.meta +120 -120
- package/Editor/Texture/icon_vivo.png.meta +120 -120
- package/Editor/Texture/icon_wechat.png.meta +120 -120
- package/Editor/Texture/light_active.png +0 -0
- package/Editor/Texture/{btn_blue_active.png.meta → light_active.png.meta} +25 -1
- package/Editor/Texture/light_hover.png +0 -0
- package/Editor/Texture/{btn_blue_hover.png.meta → light_hover.png.meta} +25 -1
- package/Editor/Texture/light_normal.png +0 -0
- package/Editor/Texture/light_normal.png.meta +144 -0
- package/Editor/Texture/tex_select.png.meta +120 -120
- package/Runtime/InteractiveSources.cs +34 -0
- package/{Editor/OriginalStyles.cs.meta → Runtime/InteractiveSources.cs.meta} +1 -1
- package/Runtime/SDKInteractiveUI.cs +432 -117
- package/Runtime/SdkTestInUnity.cs +2 -0
- package/Runtime/TyphoonSdk.cs +75 -97
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs +2 -2
- package/package.json +1 -1
- package/Editor/Interactive/SDKInteractiveUI.prefab +0 -3026
- package/Editor/Interactive/sdk_banner.png +0 -0
- package/Editor/Interactive/sdk_close.png +0 -0
- package/Editor/Interactive/sdk_inters.png +0 -0
- package/Editor/Interactive/sdk_inters.png.meta +0 -120
- package/Editor/Interactive/sdk_white_4x4.png +0 -0
- package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png +0 -0
- package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png.meta +0 -120
- package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png +0 -0
- package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png.meta +0 -120
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/345/216/237/347/224/237/346/250/241/346/235/277.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/345/216/237/347/224/237/346/250/241/346/235/277.png.meta +0 -120
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/346/217/222/351/241/265/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/346/217/222/351/241/265/345/271/277/345/221/212.png.meta +0 -120
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/350/247/206/351/242/221/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/350/247/206/351/242/221/345/271/277/345/221/212.png.meta +0 -120
- package/Editor/OriginalStyles.cs +0 -708
- package/Editor/Texture/btn_blue_active.png +0 -0
- package/Editor/Texture/btn_blue_hover.png +0 -0
- package/Editor/Texture/btn_blue_normal.png +0 -0
- package/Editor/Texture/btn_blue_normal.png.meta +0 -120
- package/Editor/Texture/btn_green_active.png +0 -0
- package/Editor/Texture/btn_green_active.png.meta +0 -120
- package/Editor/Texture/btn_green_hover.png +0 -0
- package/Editor/Texture/btn_green_hover.png.meta +0 -120
- package/Editor/Texture/btn_green_normal.png +0 -0
- package/Editor/Texture/btn_green_normal.png.meta +0 -120
- package/Editor/Texture/btn_yellow_active.png +0 -0
- package/Editor/Texture/btn_yellow_active.png.meta +0 -120
- package/Editor/Texture/btn_yellow_hover.png +0 -0
- package/Editor/Texture/btn_yellow_hover.png.meta +0 -120
- package/Editor/Texture/btn_yellow_normal.png +0 -0
- package/Editor/Texture/btn_yellow_normal.png.meta +0 -120
- /package/Editor/Texture/{btn_active.png → dark_active.png} +0 -0
- /package/Editor/Texture/{btn_hover.png → dark_hover.png} +0 -0
- /package/Editor/Texture/{btn_normal.png → dark_normal.png} +0 -0
|
@@ -12,8 +12,10 @@ public class SdkTestInUnity : ScriptableObject
|
|
|
12
12
|
[Header("登录回调")] public bool LoginResult = true;
|
|
13
13
|
[Header("是否支持ExitGame")] public bool IsSupportExitGame = true;
|
|
14
14
|
[Header("开启交互式测试")] public bool OpenInteractive = true;
|
|
15
|
+
[Header("交互式测试悬停关闭检测时间")] public float InteractiveHoldCloseTime = 1.2f;
|
|
15
16
|
[Header("视频广告回调")] public bool ShowVideoResult = true;
|
|
16
17
|
|
|
18
|
+
|
|
17
19
|
private static SdkTestInUnity _instance = null;
|
|
18
20
|
|
|
19
21
|
public static SdkTestInUnity Instance
|
package/Runtime/TyphoonSdk.cs
CHANGED
|
@@ -15,15 +15,11 @@ namespace TyphoonUnitySDK
|
|
|
15
15
|
{ AppChannel.ChinaAndroid, "TYPHOON_SDK_CHINA_ANDROID" }, //国内安卓
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
public static bool InUnity = false;
|
|
19
18
|
private ISdk _sdk;
|
|
20
19
|
|
|
21
20
|
protected override void Init()
|
|
22
21
|
{
|
|
23
22
|
base.Init();
|
|
24
|
-
#if UNITY_EDITOR
|
|
25
|
-
InUnity = true;
|
|
26
|
-
#endif
|
|
27
23
|
DontDestroyOnLoad(gameObject);
|
|
28
24
|
//构建SDK实例
|
|
29
25
|
CreateSDK();
|
|
@@ -57,12 +53,11 @@ namespace TyphoonUnitySDK
|
|
|
57
53
|
public void InitSdk(Action success, Action<string> fail)
|
|
58
54
|
{
|
|
59
55
|
Log("InitSdk");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
56
|
+
#if UNITY_EDITOR
|
|
57
|
+
//直接成功
|
|
58
|
+
success?.Invoke();
|
|
59
|
+
return;
|
|
60
|
+
#endif
|
|
66
61
|
|
|
67
62
|
_sdk.InitSdk(success, fail);
|
|
68
63
|
}
|
|
@@ -77,20 +72,19 @@ namespace TyphoonUnitySDK
|
|
|
77
72
|
public void Login(Action success, Action<string> fail)
|
|
78
73
|
{
|
|
79
74
|
Log("Login");
|
|
80
|
-
|
|
75
|
+
#if UNITY_EDITOR
|
|
76
|
+
if (SdkTestInUnity.Instance.LoginResult)
|
|
81
77
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
fail?.Invoke("test in unity login result false ");
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return;
|
|
78
|
+
success?.Invoke();
|
|
79
|
+
}
|
|
80
|
+
else
|
|
81
|
+
{
|
|
82
|
+
fail?.Invoke("test in unity login result false ");
|
|
92
83
|
}
|
|
93
84
|
|
|
85
|
+
return;
|
|
86
|
+
#endif
|
|
87
|
+
|
|
94
88
|
_sdk.Login(success, fail);
|
|
95
89
|
}
|
|
96
90
|
|
|
@@ -103,11 +97,9 @@ namespace TyphoonUnitySDK
|
|
|
103
97
|
/// </summary>
|
|
104
98
|
public bool IsSupportExitGame()
|
|
105
99
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
100
|
+
#if UNITY_EDITOR
|
|
101
|
+
return SdkTestInUnity.Instance.IsSupportExitGame;
|
|
102
|
+
#endif
|
|
111
103
|
return _sdk.IsSupportExitGame();
|
|
112
104
|
}
|
|
113
105
|
|
|
@@ -117,11 +109,9 @@ namespace TyphoonUnitySDK
|
|
|
117
109
|
public void ExitGame()
|
|
118
110
|
{
|
|
119
111
|
Log("ExitGame");
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
112
|
+
#if UNITY_EDITOR
|
|
113
|
+
return;
|
|
114
|
+
#endif
|
|
125
115
|
if (IsSupportExitGame())
|
|
126
116
|
{
|
|
127
117
|
_sdk.ExitGame();
|
|
@@ -150,27 +140,26 @@ namespace TyphoonUnitySDK
|
|
|
150
140
|
public void ShowVideo(string scene, Action success, Action<string> fail)
|
|
151
141
|
{
|
|
152
142
|
Log($"ShowVideo:{scene}");
|
|
153
|
-
|
|
143
|
+
#if UNITY_EDITOR
|
|
144
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
154
145
|
{
|
|
155
|
-
|
|
156
|
-
{
|
|
157
|
-
SDKInteractiveUI.Instance.ShowVideo(success, fail);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
//弹窗提示Unity广告
|
|
162
|
-
if (SdkTestInUnity.Instance.ShowVideoResult)
|
|
163
|
-
{
|
|
164
|
-
success?.Invoke();
|
|
165
|
-
}
|
|
166
|
-
else
|
|
167
|
-
{
|
|
168
|
-
fail?.Invoke("test result fail");
|
|
169
|
-
}
|
|
170
|
-
|
|
146
|
+
SDKInteractiveUI.Instance.ShowVideo(success, fail);
|
|
171
147
|
return;
|
|
172
148
|
}
|
|
173
149
|
|
|
150
|
+
//弹窗提示Unity广告
|
|
151
|
+
if (SdkTestInUnity.Instance.ShowVideoResult)
|
|
152
|
+
{
|
|
153
|
+
success?.Invoke();
|
|
154
|
+
}
|
|
155
|
+
else
|
|
156
|
+
{
|
|
157
|
+
fail?.Invoke("test result fail");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return;
|
|
161
|
+
#endif
|
|
162
|
+
|
|
174
163
|
_sdk.ShowVideo(scene, success, fail);
|
|
175
164
|
}
|
|
176
165
|
|
|
@@ -185,17 +174,15 @@ namespace TyphoonUnitySDK
|
|
|
185
174
|
public void ShowInters(string scene)
|
|
186
175
|
{
|
|
187
176
|
Log($"ShowInters:{scene}");
|
|
188
|
-
|
|
177
|
+
#if UNITY_EDITOR
|
|
178
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
189
179
|
{
|
|
190
|
-
|
|
191
|
-
{
|
|
192
|
-
SDKInteractiveUI.Instance.ShowInters();
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
|
|
180
|
+
SDKInteractiveUI.Instance.ShowInters();
|
|
196
181
|
return;
|
|
197
182
|
}
|
|
198
183
|
|
|
184
|
+
return;
|
|
185
|
+
#endif
|
|
199
186
|
_sdk.ShowInters(scene);
|
|
200
187
|
}
|
|
201
188
|
|
|
@@ -210,17 +197,16 @@ namespace TyphoonUnitySDK
|
|
|
210
197
|
/// <param name="position">banner位置</param>
|
|
211
198
|
public void ShowBanner(string scene, BannerPosition position)
|
|
212
199
|
{
|
|
213
|
-
|
|
200
|
+
#if UNITY_EDITOR
|
|
201
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
214
202
|
{
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
SDKInteractiveUI.Instance.ShowBanner(position);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
|
|
203
|
+
SDKInteractiveUI.Instance.ShowBanner(position);
|
|
221
204
|
return;
|
|
222
205
|
}
|
|
223
206
|
|
|
207
|
+
return;
|
|
208
|
+
#endif
|
|
209
|
+
|
|
224
210
|
_sdk.ShowBanner(scene, position);
|
|
225
211
|
}
|
|
226
212
|
|
|
@@ -230,16 +216,14 @@ namespace TyphoonUnitySDK
|
|
|
230
216
|
/// <param name="scene"></param>
|
|
231
217
|
public void HideBanner(string scene)
|
|
232
218
|
{
|
|
233
|
-
|
|
219
|
+
#if UNITY_EDITOR
|
|
220
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
234
221
|
{
|
|
235
|
-
|
|
236
|
-
{
|
|
237
|
-
SDKInteractiveUI.Instance.HideBanner();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return;
|
|
222
|
+
SDKInteractiveUI.Instance.HideBanner();
|
|
241
223
|
}
|
|
242
224
|
|
|
225
|
+
return;
|
|
226
|
+
#endif
|
|
243
227
|
_sdk.HideBanner(scene);
|
|
244
228
|
}
|
|
245
229
|
|
|
@@ -253,16 +237,14 @@ namespace TyphoonUnitySDK
|
|
|
253
237
|
/// <param name="scene">广告场景</param>
|
|
254
238
|
public void ShowNative(string scene)
|
|
255
239
|
{
|
|
256
|
-
|
|
240
|
+
#if UNITY_EDITOR
|
|
241
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
257
242
|
{
|
|
258
|
-
|
|
259
|
-
{
|
|
260
|
-
SDKInteractiveUI.Instance.ShowNative();
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return;
|
|
243
|
+
SDKInteractiveUI.Instance.ShowNative();
|
|
264
244
|
}
|
|
265
245
|
|
|
246
|
+
return;
|
|
247
|
+
#endif
|
|
266
248
|
_sdk.ShowNative(scene);
|
|
267
249
|
}
|
|
268
250
|
|
|
@@ -272,16 +254,15 @@ namespace TyphoonUnitySDK
|
|
|
272
254
|
/// <param name="scene">广告场景</param>
|
|
273
255
|
public void HideNative(string scene)
|
|
274
256
|
{
|
|
275
|
-
|
|
257
|
+
#if UNITY_EDITOR
|
|
258
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
276
259
|
{
|
|
277
|
-
|
|
278
|
-
{
|
|
279
|
-
SDKInteractiveUI.Instance.HideNative();
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
return;
|
|
260
|
+
SDKInteractiveUI.Instance.HideNative();
|
|
283
261
|
}
|
|
284
262
|
|
|
263
|
+
return;
|
|
264
|
+
#endif
|
|
265
|
+
|
|
285
266
|
_sdk.HideNative(scene);
|
|
286
267
|
}
|
|
287
268
|
|
|
@@ -297,16 +278,15 @@ namespace TyphoonUnitySDK
|
|
|
297
278
|
/// <param name="spy">屏幕百分比Y(左上角)</param>
|
|
298
279
|
public void ShowFloatIcon(string scene, float spx, float spy)
|
|
299
280
|
{
|
|
300
|
-
|
|
281
|
+
#if UNITY_EDITOR
|
|
282
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
301
283
|
{
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
SDKInteractiveUI.Instance.ShowFlatIcon(scene, spx, spy);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return;
|
|
284
|
+
SDKInteractiveUI.Instance.ShowFlatIcon(scene, spx, spy);
|
|
308
285
|
}
|
|
309
286
|
|
|
287
|
+
return;
|
|
288
|
+
#endif
|
|
289
|
+
|
|
310
290
|
_sdk.ShowFloatIcon(scene, spx, spy);
|
|
311
291
|
}
|
|
312
292
|
|
|
@@ -316,16 +296,14 @@ namespace TyphoonUnitySDK
|
|
|
316
296
|
/// <param name="scene">广告场景</param>
|
|
317
297
|
public void HideFloatIcon(string scene)
|
|
318
298
|
{
|
|
319
|
-
|
|
299
|
+
#if UNITY_EDITOR
|
|
300
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
320
301
|
{
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
SDKInteractiveUI.Instance.HideFloatIcon(scene);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return;
|
|
302
|
+
SDKInteractiveUI.Instance.HideFloatIcon(scene);
|
|
327
303
|
}
|
|
328
304
|
|
|
305
|
+
return;
|
|
306
|
+
#endif
|
|
329
307
|
_sdk.HideFloatIcon(scene);
|
|
330
308
|
}
|
|
331
309
|
|
|
@@ -45,9 +45,9 @@ namespace TyphoonUnitySDK
|
|
|
45
45
|
Debug.Log($"发布完成 {path}");
|
|
46
46
|
EditorUtility.RevealInFinder(path);
|
|
47
47
|
//生成发布bat
|
|
48
|
-
var gradle =
|
|
48
|
+
var gradle = Preferences.Default.GradlePath;
|
|
49
49
|
var publish_bat = $"{path}/publish.bat";
|
|
50
|
-
File.WriteAllText(publish_bat, $"{gradle} assembleRelease --max-workers=8");
|
|
50
|
+
File.WriteAllText(publish_bat, $"{gradle}\\gradle assembleRelease --max-workers=8");
|
|
51
51
|
result.AndroidProj = path;
|
|
52
52
|
PublishTool.InvokeOnPublishEnd(setting, result);
|
|
53
53
|
return result;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.
|
|
1
|
+
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.10","description":"unity端个汇总渠道的sdk,统一接口,一键发布","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
|