com.typhoon.unitysdk 1.1.8 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # 更新日志
2
+ ## [1.1.10] - 2025-08-08
3
+
4
+ ### 新增
5
+ * 喜中游新增事件上报接口
6
+
7
+
8
+ ## [1.1.9] - 2025-08-08
9
+
10
+ ### 新增
11
+ * 新增喜中游渠道
12
+
13
+
2
14
  ## [1.1.8] - 2025-08-05
3
15
 
4
- ### 优化
16
+ ### 优化
5
17
  * 微游去除下滑条
6
18
 
7
19
 
@@ -33,6 +33,7 @@ namespace TyphoonUnitySDK
33
33
  { AppChannel.OppoMini, new ApplyOppoMini() },
34
34
  { AppChannel.KuaiShouWebgl, new ApplyKuaiShouWebgl() },
35
35
  { AppChannel.MiniGame, new ApplyMiniGame() },
36
+ { AppChannel.XiZhongYou, new ApplyXiZhongYou() }
36
37
  };
37
38
 
38
39
 
@@ -63,6 +64,7 @@ namespace TyphoonUnitySDK
63
64
  ChinaAndroidConfig.Default.Save();
64
65
  KuaiShouWebglConfig.Default.Save();
65
66
  MiniGameWebglConfig.Default.Save();
67
+ XiZhongYouConfig.Default.Save();
66
68
  }
67
69
 
68
70
  /// <summary>
@@ -719,5 +721,29 @@ namespace TyphoonUnitySDK
719
721
  AssetDatabase.SaveAssets();
720
722
  }
721
723
  }
724
+
725
+ /*喜中游*/
726
+ public class ApplyXiZhongYou : IApply
727
+ {
728
+ public void Apply(PublishSetting setting)
729
+ {
730
+ var pack = UniEditor.PackagePath_XiZhongYou;
731
+ Debug.Log($"导入... {pack}");
732
+ ImportUnityPackage(pack);
733
+ var manifest_path = $"{pack}.manifest";
734
+ Debug.Log($"读取资源清单...{manifest_path}");
735
+ var manifest = ReadManifest(manifest_path);
736
+ Debug.Log($"清理多余文件...");
737
+ foreach (var folder in MaybeFolder)
738
+ {
739
+ ClearFilesInDirectory(folder, manifest);
740
+ }
741
+
742
+ ReimportScript(manifest);
743
+ AssetDatabase.Refresh();
744
+ EditorUtility.SetDirty(AppConfigAsset.Instance);
745
+ AssetDatabase.SaveAssets();
746
+ }
747
+ }
722
748
  }
723
749
  }
@@ -192,6 +192,29 @@ namespace TyphoonUnitySDK
192
192
  }
193
193
 
194
194
 
195
+ [MenuItem("TyphoonSDK/开发者/导出-Android-喜中游.unitypackage")]
196
+ public static void ExportXiZhongYou()
197
+ {
198
+ var manifest = new List<string>()
199
+ {
200
+ "Assets/Plugins/Android/libs/union-sdk.aar",
201
+ "Assets/Plugins/Android/AndroidManifest.xml",
202
+ "Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou",
203
+ };
204
+ if (!MakeSureExport(manifest))
205
+ {
206
+ return;
207
+ }
208
+
209
+ if (!CheckMissFiles(manifest))
210
+ {
211
+ return;
212
+ }
213
+
214
+ ExportUnityPackage(manifest, UniEditor.PackagePath_XiZhongYou, out var detail);
215
+ }
216
+
217
+
195
218
  /// <summary>
196
219
  /// 导出清单文件到模块
197
220
  /// </summary>
@@ -17,5 +17,6 @@ namespace TyphoonUnitySDK
17
17
  OppoMini, //oppo小游戏
18
18
  KuaiShouWebgl, //快手WEBGL
19
19
  MiniGame, //微游
20
+ XiZhongYou, //喜中游
20
21
  }
21
22
  }
@@ -129,7 +129,8 @@ namespace TyphoonUnitySDK
129
129
  public bool KuaishouWebglGUIFoldout = true;
130
130
  //mini gmae webgl
131
131
  public bool MiniGameGUIFoldout = true;
132
-
132
+ //xi zhong you
133
+ public bool XiZhongYouGUIFoldout = true;
133
134
 
134
135
  //使用配置
135
136
  public virtual void Apply()
@@ -59,6 +59,7 @@ namespace TyphoonUnitySDK
59
59
  { nameof(PublishSetting.ChinaAndroidGUIFoldout), DrawProperty_ChinaAndroidGUIFoldout },
60
60
  { nameof(PublishSetting.KuaishouWebglGUIFoldout), DrawProperty_KuaiShouWebglGUIFoldout },
61
61
  { nameof(PublishSetting.MiniGameGUIFoldout), DrawProperty_MiniGameGUIFoldout },
62
+ { nameof(PublishSetting.XiZhongYouGUIFoldout), DrawProperty_XiZhongYouGUIFoldout }
62
63
  };
63
64
 
64
65
  private static bool DrawProperty_ChinaAndroidGUIFoldout(PublishSetting arg)
@@ -222,6 +223,26 @@ namespace TyphoonUnitySDK
222
223
  }
223
224
 
224
225
 
226
+ //绘制 minigame
227
+ private static bool DrawProperty_XiZhongYouGUIFoldout(PublishSetting arg)
228
+ {
229
+ if (arg.Channel != AppChannel.XiZhongYou)
230
+ {
231
+ return true;
232
+ }
233
+
234
+ GUILayout.Space(10);
235
+ arg.MiniGameGUIFoldout =
236
+ GUIDrawer.DrawFoldout("Android-喜中游", arg.MiniGameGUIFoldout, GUILayout.Height(26));
237
+ if (arg.MiniGameGUIFoldout)
238
+ {
239
+ XiZhongYouConfigGUIDrawer.DrawGUI();
240
+ }
241
+
242
+ return true;
243
+ }
244
+
245
+
225
246
  /// <summary>
226
247
  /// 绘制GUI
227
248
  /// </summary>
@@ -29,6 +29,7 @@ namespace TyphoonUnitySDK
29
29
  { PublishProcess.VivoMini, "TyphoonUnitySDK.PublishVivoMini" },
30
30
  { PublishProcess.OppoMini, "TyphoonUnitySDK.PublishOppoMini" },
31
31
  { PublishProcess.MiniGame, "TyphoonUnitySDK.PublishMiniGame" },
32
+ { PublishProcess.XiZhongYou, "TyphoonUnitySDK.PublishXiZhongYou" }
32
33
  };
33
34
 
34
35
  /// <summary>
@@ -33,6 +33,7 @@ namespace TyphoonUnitySDK
33
33
  {
34
34
  case AppChannel.Test:
35
35
  case AppChannel.ChinaAndroid:
36
+ case AppChannel.XiZhongYou:
36
37
  return EditorIcons.icon_android;
37
38
  case AppChannel.GooglePlay:
38
39
  return EditorIcons.icon_googleplay;
@@ -203,7 +204,6 @@ namespace TyphoonUnitySDK
203
204
  }
204
205
 
205
206
  GUILayout.Space(1);
206
-
207
207
  if (GUILayout.Button(new GUIContent(EditorIcons.icon_extension, "更多"), Styles.Square.Btn,
208
208
  GUILayout.Width(40), GUILayout.Height(20)))
209
209
  {
@@ -256,7 +256,6 @@ namespace TyphoonUnitySDK
256
256
  if (setting != null)
257
257
  {
258
258
  var style = _select == setting ? Styles.Square.MenuButtonActive : Styles.Square.MenuButton;
259
-
260
259
  if (Event.current.type == EventType.MouseDown && rectItem.Contains(Event.current.mousePosition))
261
260
  {
262
261
  if (Event.current.clickCount >= 2)
@@ -330,7 +329,6 @@ namespace TyphoonUnitySDK
330
329
  var labRect = rect;
331
330
  labRect.width -= 70;
332
331
  GUILayout.BeginArea(labRect);
333
-
334
332
  GUIDrawer.DrawKeynotes(
335
333
  $"当前 {CurrentVersionInfo.Version} {CurrentVersionInfo.GetWriteTimeDateString()}");
336
334
  if (CheckUpdateCacheData.Default.Latest != null)
@@ -344,8 +342,6 @@ namespace TyphoonUnitySDK
344
342
  }
345
343
 
346
344
  GUILayout.EndArea();
347
-
348
-
349
345
  var btnUpdateRect = rect;
350
346
  btnUpdateRect.height = 22;
351
347
  btnUpdateRect.width = 70;
@@ -419,7 +415,6 @@ namespace TyphoonUnitySDK
419
415
  rectContent.height -= 8;
420
416
  rectContent.width -= 8;
421
417
  rectContent.center = rect.center;
422
-
423
418
  if (_select == null)
424
419
  {
425
420
  var tipRect = rectContent;
@@ -445,7 +440,6 @@ namespace TyphoonUnitySDK
445
440
  AssetDatabase.SaveAssets();
446
441
  }
447
442
 
448
-
449
443
  var rectView = rectTitle;
450
444
  rectView.y = rectTitle.yMax;
451
445
  rectView.height = rectContent.yMax - rectView.y;
@@ -482,7 +476,6 @@ namespace TyphoonUnitySDK
482
476
  rectBtnPublish.width = 128;
483
477
  rectBtnPublish.x = rectArea.xMax - rectBtnPublish.width;
484
478
  bool clickPublish = GUI.Button(rectBtnPublish, "发布", Styles.Square.BtnBold);
485
-
486
479
  var rectNextBtn = rectBtnPublish;
487
480
  rectNextBtn.x -= 2;
488
481
  rectNextBtn.x -= rectNextBtn.width;
@@ -495,7 +488,6 @@ namespace TyphoonUnitySDK
495
488
  }
496
489
 
497
490
  bool clickApply = GUI.Button(rectNextBtn, "应用", Styles.Square.BtnBold);
498
-
499
491
  foreach (var bottomGUI in ExtensionBottomGUI)
500
492
  {
501
493
  bottomGUI.OnDrawGUI(_select, rectArea);
@@ -505,7 +497,6 @@ namespace TyphoonUnitySDK
505
497
  var rectBarLine = rectBar;
506
498
  rectBarLine.height = 2;
507
499
  // EditorGUI.DrawRect(rectBar, Color.black * 0.2f);
508
-
509
500
  if (clickApply)
510
501
  {
511
502
  Debug.Log($"<color=#{SdkDebug.BlueHex}>应用...{_select}</color>");
@@ -526,7 +517,6 @@ namespace TyphoonUnitySDK
526
517
  _select.Publish();
527
518
  }
528
519
 
529
-
530
520
  GUI.enabled = temEnable;
531
521
  }
532
522
  }
@@ -74,6 +74,11 @@ namespace TyphoonUnitySDK
74
74
  /// </summary>
75
75
  public static string PackagePath_MiniGame = $"{PathRoot}/Sources~/Package/MiniGame.unitypackage";
76
76
 
77
+ /// <summary>
78
+ /// 喜中游 资源包
79
+ /// </summary>
80
+ public static string PackagePath_XiZhongYou = $"{PathRoot}/Sources~/Package/XiZhongYou.unitypackage";
81
+
77
82
 
78
83
  /// <summary>
79
84
  /// Toast模块
@@ -405,6 +410,8 @@ namespace TyphoonUnitySDK
405
410
  public static void CopyFolder(string source, string dest)
406
411
  {
407
412
  // Debug.Log($"复制文件夹{source}-->{dest}");
413
+ source=Path.GetFullPath(source);
414
+ dest = Path.GetFullPath(dest);
408
415
  if (!Directory.Exists(dest))
409
416
  {
410
417
  Directory.CreateDirectory(dest);
@@ -0,0 +1,129 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.IO;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ public static class XiZhongYouConfigGUIDrawer
10
+ {
11
+ public static Dictionary<string, Func<XiZhongYouConfig, bool>> OverrideDrawGUIFunc =
12
+ new Dictionary<string, Func<XiZhongYouConfig, bool>>()
13
+ {
14
+ { "m_Script", DrawProperty_m_Script },
15
+ { $"{nameof(Orientation)}", DrawProperty_Orientation },
16
+ };
17
+
18
+ private static bool DrawProperty_Orientation(XiZhongYouConfig arg)
19
+ {
20
+ var txt = arg.Orientation == XiZhongYouConfig.ScreenOrientation.Portrait ? "竖屏" : "横屏";
21
+ GUILayout.Label("横竖屏模式", Styles.BoldLabel);
22
+ if (GUILayout.Button(txt, "PopUp"))
23
+ {
24
+ var menu = new GenericMenu();
25
+ menu.AddItem(new GUIContent("竖屏"), arg.Orientation == XiZhongYouConfig.ScreenOrientation.Portrait,
26
+ () =>
27
+ {
28
+ arg.Orientation = XiZhongYouConfig.ScreenOrientation.Portrait;
29
+ arg.Save();
30
+ });
31
+ menu.AddItem(new GUIContent("横屏"), arg.Orientation == XiZhongYouConfig.ScreenOrientation.Landscape,
32
+ () =>
33
+ {
34
+ arg.Orientation = XiZhongYouConfig.ScreenOrientation.Landscape;
35
+ arg.Save();
36
+ });
37
+ menu.ShowAsContext();
38
+ }
39
+
40
+ return true;
41
+ }
42
+
43
+ private static bool DrawProperty_m_Script(XiZhongYouConfig arg)
44
+ {
45
+ var tmpEnable = GUI.enabled;
46
+ GUI.enabled = true;
47
+ GUILayout.Space(6);
48
+ GUIDrawer.DrawKeynotes("①需要Unity 2019.3+ 或以上,即新版 android 目录结构");
49
+ GUIDrawer.DrawKeynotes("②剔除第三方SDK,避免与渠道冲突或不兼容");
50
+ GUILayout.Space(6);
51
+ GUI.enabled = tmpEnable;
52
+ return true;
53
+ }
54
+
55
+
56
+ /*绘制GUI*/
57
+ public static void DrawGUI()
58
+ {
59
+ var config = XiZhongYouConfig.Default;
60
+ GUIDrawer.DrawProperty(config, (property) =>
61
+ {
62
+ if (OverrideDrawGUIFunc.TryGetValue(property, out var match))
63
+ {
64
+ return match.Invoke(config);
65
+ }
66
+ return false;
67
+ });
68
+ }
69
+ }
70
+
71
+ public class XiZhongYouConfig : ScriptableObject
72
+ {
73
+ private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/XiZhongYouConfig.asset";
74
+
75
+ private static XiZhongYouConfig _instance = null;
76
+
77
+ public static XiZhongYouConfig Default
78
+ {
79
+ get
80
+ {
81
+ if (_instance == null)
82
+ {
83
+ _instance = AssetDatabase.LoadAssetAtPath<XiZhongYouConfig>(ConfigPath);
84
+ }
85
+
86
+ if (_instance == null)
87
+ {
88
+ _instance = CreateInstance<XiZhongYouConfig>();
89
+ var folder = Path.GetDirectoryName(ConfigPath);
90
+ if (!Directory.Exists(folder))
91
+ {
92
+ Directory.CreateDirectory(folder);
93
+ AssetDatabase.Refresh();
94
+ }
95
+
96
+ AssetDatabase.CreateAsset(_instance, ConfigPath);
97
+ }
98
+
99
+ return _instance;
100
+ }
101
+ }
102
+
103
+ /// <summary>
104
+ /// 横竖屏模式
105
+ /// </summary>
106
+ public enum ScreenOrientation
107
+ {
108
+ Portrait,
109
+ Landscape,
110
+ }
111
+
112
+ [Header("横竖屏模式")]
113
+ public ScreenOrientation Orientation = ScreenOrientation.Portrait;
114
+
115
+ [LabelOverride("保留导出工程")] public bool KeepProj = false;
116
+
117
+
118
+ public void Save()
119
+ {
120
+ EditorUtility.SetDirty(this);
121
+ AssetDatabase.SaveAssets();
122
+ }
123
+
124
+ public void SaveConfig()
125
+ {
126
+ Save();
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a7b9f6a3fd97a21468a2856a010d2751
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -60,5 +60,10 @@ namespace TyphoonUnitySDK
60
60
  /// 微游
61
61
  /// </summary>
62
62
  MiniGame = 11,
63
+
64
+ /// <summary>
65
+ /// 喜中游
66
+ /// </summary>
67
+ XiZhongYou = 12,
63
68
  }
64
69
  }
@@ -49,6 +49,7 @@ namespace TyphoonUnitySDK
49
49
  { AppChannel.VivoMini, "TyphoonUnitySDK.VivoMiniSdk" }, //Vivo小游戏
50
50
  { AppChannel.OppoMini, "TyphoonUnitySDK.OppoMiniSdk" }, //Oppo小游戏
51
51
  { AppChannel.MiniGame, "TyphoonUnitySDK.MiniGameSdk" }, //微游
52
+ { AppChannel.XiZhongYou, "TyphoonUnitySDK.XiZhongYouSdk" }, //喜中游
52
53
  };
53
54
 
54
55
  //支付回调类名
@@ -0,0 +1,12 @@
1
+ Assets/Plugins/Android/libs/union-sdk.aar
2
+ Assets/Plugins/Android/AndroidManifest.xml
3
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou
4
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/Editor.meta
5
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/XiZhongYouCallBack.cs
6
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/XiZhongYouCallBack.cs.meta
7
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/XiZhongYouSdk.cs
8
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/XiZhongYouSdk.cs.meta
9
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/Editor/PublishXiZhongYou.cs
10
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/Editor/PublishXiZhongYou.cs.meta
11
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/Editor/UnionAppActivity.txt
12
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/XiZhongYou/Editor/UnionAppActivity.txt.meta
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.8","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.8] - 2025-08-05\r\n\r\n### 优化\n* 微游去除下滑条\r\n\r\n","major_flag":false,"write_time_stamp":1754371387000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.10","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.10] - 2025-08-08\r\n\r\n### 新增\n* 喜中游新增事件上报接口\r\n\r\n","major_flag":false,"write_time_stamp":1754643006000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}