com.typhoon.unitysdk 1.1.13 → 1.1.15

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,7 +1,19 @@
1
1
  # 更新日志
2
+ ## [1.1.15] - 2025-08-09
3
+
4
+ ### 修复
5
+ * 修复测试参数bug
6
+
7
+
8
+ ## [1.1.14] - 2025-08-09
9
+
10
+ ### 修复
11
+ * 修复sdktestunity构建时间不对时的bug
12
+
13
+
2
14
  ## [1.1.13] - 2025-08-08
3
15
 
4
- ### 新增
16
+ ### 新增
5
17
  * 调整喜中游打包配置
6
18
 
7
19
 
@@ -18,7 +18,18 @@ namespace TyphoonUnitySDK
18
18
  public static Color Blue = new Color(0.02f, 0.49f, 0.84f, 0.8f);
19
19
  public static Color DarkBlue = new Color(0.05f, 0.33f, 0.61f, 1f);
20
20
 
21
- public static float HOLD_TIME = SdkTestInUnity.Instance.InteractiveHoldCloseTime;
21
+ public static float HOLD_TIME
22
+ {
23
+ get
24
+ {
25
+ if (SdkTestInUnity.HasInstance())
26
+ {
27
+ return SdkTestInUnity.Instance.InteractiveHoldCloseTime;
28
+ }
29
+
30
+ return 1.2f;
31
+ }
32
+ }
22
33
 
23
34
  public static string PathRoot => RuntimeUtil.GetPathRoot();
24
35
 
@@ -229,7 +240,6 @@ namespace TyphoonUnitySDK
229
240
  DrawViewTxtLabel(rectClose, "关闭");
230
241
  //悬停/关闭
231
242
  HoldHide(rectClose, ref HoldTime, Hide);
232
-
233
243
  var rectTitle = view;
234
244
  rectTitle.width = 300;
235
245
  rectTitle.height = 66;
@@ -292,15 +302,12 @@ namespace TyphoonUnitySDK
292
302
  var process = 1 - Mathf.Clamp01((CloseTime - Time.realtimeSinceStartup) / DURATION);
293
303
  var center = Vector2.Lerp(startCenter, endCenter, process);
294
304
  rectToast.center = center;
295
-
296
305
  var rectOutline = rectToast;
297
306
  rectOutline.width += 8;
298
307
  rectOutline.height += 8;
299
308
  rectOutline.center = rectToast.center;
300
-
301
309
  EditorGUI.DrawRect(rectOutline, DarkBlue);
302
310
  EditorGUI.DrawRect(rectToast, Blue);
303
-
304
311
  _labelStyle.fontSize = (int)(Mathf.Min(rectToast.width * 0.5f / Length, 48));
305
312
  GUI.Label(rectToast, $"弹出插页:{Scene}", _labelStyle);
306
313
  if (Time.realtimeSinceStartup > CloseTime)
@@ -360,29 +367,24 @@ namespace TyphoonUnitySDK
360
367
  rectYes.width = 346;
361
368
  rectYes.height = 80;
362
369
  rectYes.center = rect.center;
363
-
364
370
  var rectNo = rectYes;
365
371
  rectNo.y = rectYes.yMax;
366
372
  rectNo.y += 40;
367
-
368
373
  var rectTitle = rectYes;
369
374
  rectTitle.y = rectYes.yMin - rectTitle.height;
370
375
  rectTitle.y -= 40;
371
376
  var center = rectTitle.center;
372
377
  rectTitle.width = 500;
373
378
  rectTitle.center = center;
374
-
375
379
  var rectBg = new Rect();
376
380
  rectBg.width = rectTitle.width;
377
381
  rectBg.height = rectNo.yMax - rectTitle.yMin;
378
382
  rectBg.width += 20;
379
383
  rectBg.height += 20;
380
384
  rectBg.center = rect.center;
381
-
382
385
  EditorGUI.DrawRect(rect, Color.black * 0.7f);
383
386
  EditorGUI.DrawRect(rectBg, Blue);
384
387
 
385
-
386
388
  //失败返回
387
389
  DrawViewTxtLabel(rectYes, "成功返回");
388
390
  DrawViewTxtLabel(rectNo, "失败返回");
@@ -552,7 +554,6 @@ namespace TyphoonUnitySDK
552
554
  rectClose.y += 10;
553
555
  DrawViewTxtLabel(rectClose, "关闭");
554
556
  HoldHide(rectClose, ref HoldTime, Hide);
555
-
556
557
  var rectTitle = imageRect;
557
558
  rectTitle.width = 400;
558
559
  rectTitle.height = 128;
@@ -572,7 +573,6 @@ namespace TyphoonUnitySDK
572
573
  private void OnGUI()
573
574
  {
574
575
  #if UNITY_EDITOR
575
-
576
576
  var mode = GetMode();
577
577
  var rect = new Rect(0, 0, Screen.width, Screen.height);
578
578
  Banner.OnGUI(rect, mode);
@@ -90,6 +90,8 @@ public class SdkTestInUnity : ScriptableObject
90
90
 
91
91
 
92
92
  private static SdkTestInUnity _instance = null;
93
+ private static object _lock = new object();
94
+ public static bool HasInstance() => _instance != null;
93
95
 
94
96
  public static SdkTestInUnity Instance
95
97
  {
@@ -99,18 +101,21 @@ public class SdkTestInUnity : ScriptableObject
99
101
  if (_instance == null)
100
102
  {
101
103
  _instance = AssetDatabase.LoadAssetAtPath<SdkTestInUnity>(ASSET_PATH);
102
- if (_instance == null)
104
+ lock (_lock)
103
105
  {
104
- _instance = CreateInstance<SdkTestInUnity>();
105
- var folder = Path.GetDirectoryName(ASSET_PATH);
106
- if (!Directory.Exists(folder))
106
+ if (_instance == null)
107
107
  {
108
- Directory.CreateDirectory(folder);
108
+ _instance = CreateInstance<SdkTestInUnity>();
109
+ var folder = Path.GetDirectoryName(ASSET_PATH);
110
+ if (!Directory.Exists(folder))
111
+ {
112
+ Directory.CreateDirectory(folder);
113
+ AssetDatabase.Refresh();
114
+ }
115
+
116
+ AssetDatabase.CreateAsset(_instance, ASSET_PATH);
109
117
  AssetDatabase.Refresh();
110
118
  }
111
-
112
- AssetDatabase.CreateAsset(_instance, ASSET_PATH);
113
- AssetDatabase.Refresh();
114
119
  }
115
120
  }
116
121
  #endif
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.13","description":"","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"}],"version_log":"## [1.1.13] - 2025-08-08\r\n\r\n### 新增\n* 调整喜中游打包配置\r\n\r\n","major_flag":false,"write_time_stamp":1754667770000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.15","description":"","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"}],"version_log":"## [1.1.15] - 2025-08-09\r\n\r\n### 修复\n* 修复测试参数bug\r\n\r\n","major_flag":false,"write_time_stamp":1754673872000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}