com.typhoon.unitysdk 1.0.34 → 1.0.36

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.
Files changed (49) hide show
  1. package/Editor/ApplyTool.cs +42 -8
  2. package/Editor/ExportModule.cs +23 -0
  3. package/Editor/GUIDrawer.cs +38 -0
  4. package/Editor/MD5Tool.cs +53 -0
  5. package/Editor/MD5Tool.cs.meta +11 -0
  6. package/Editor/Orientation.cs +18 -0
  7. package/Editor/Orientation.cs.meta +11 -0
  8. package/Editor/PluginModuleInstaller.cs +452 -0
  9. package/Editor/PluginModuleInstaller.cs.meta +11 -0
  10. package/Editor/PreferencesWindow.cs +1 -1
  11. package/Editor/PublishProcess.cs +5 -4
  12. package/Editor/PublishSetting.cs +3 -0
  13. package/Editor/PublishSettingGUIDrawer.cs +20 -2
  14. package/Editor/PublishTool.cs +3 -3
  15. package/Editor/PublishWindow.cs +2 -4
  16. package/Editor/UniEditor.cs +249 -13
  17. package/Editor/VivoMiniConfig.cs +436 -0
  18. package/Editor/VivoMiniConfig.cs.meta +11 -0
  19. package/Editor/WxMiniConfig.cs +9 -22
  20. package/Editor/ZipTool.cs +78 -0
  21. package/Editor/ZipTool.cs.meta +11 -0
  22. package/Editor/bats/create-sign.bat +13 -0
  23. package/Editor/bats/create-sign.bat.meta +7 -0
  24. package/Editor/bats.meta +8 -0
  25. package/Editor/dll/AlphaFS.dll +0 -0
  26. package/Editor/dll/AlphaFS.dll.meta +33 -0
  27. package/Editor/dll/XGameDotNetZip.dll +0 -0
  28. package/Editor/dll/XGameDotNetZip.dll.meta +33 -0
  29. package/Editor/dll.meta +8 -0
  30. package/Runtime/AndroidInstance.cs +1 -1
  31. package/Runtime/BaseSdk.cs +64 -0
  32. package/Runtime/Extension.cs +8 -2
  33. package/Runtime/HttpGetSuccessResult.cs +23 -0
  34. package/Runtime/HttpGetSuccessResult.cs.meta +11 -0
  35. package/Runtime/HttpPostSuccessResult.cs +30 -0
  36. package/Runtime/HttpPostSuccessResult.cs.meta +11 -0
  37. package/Runtime/Interface.cs +21 -2
  38. package/Runtime/SDKHttpClient.cs +119 -0
  39. package/Runtime/SDKHttpClient.cs.meta +11 -0
  40. package/Runtime/TyphoonSdk.cs +43 -0
  41. package/Runtime/TyphoonSdkCallback.cs +11 -5
  42. package/Sources~/Package/ChinaAndroid.unitypackage +0 -0
  43. package/Sources~/Package/Douyin.unitypackage +0 -0
  44. package/Sources~/Package/GooglePlay.unitypackage +0 -0
  45. package/Sources~/Package/VivoMini.unitypackage +0 -0
  46. package/Sources~/Package/VivoMini.unitypackage.manifest +261 -0
  47. package/Sources~/Package/WxMini.unitypackage +0 -0
  48. package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
  49. package/package.json +1 -1
@@ -28,9 +28,21 @@ namespace TyphoonUnitySDK
28
28
  { AppChannel.DouyinAndroid, new ApplyDouyinAndroidOrIOS() },
29
29
  { AppChannel.DouyinIOS, new ApplyDouyinAndroidOrIOS() },
30
30
  { AppChannel.GooglePlay, new ApplyGooglePlay() },
31
+ { AppChannel.VivoMini, new ApplyVivoMini() },
31
32
  };
32
33
 
33
34
 
35
+ /// <summary>
36
+ /// 保存所有渠道额外配置
37
+ /// </summary>
38
+ public static void SaveAllChannelConfig()
39
+ {
40
+ VivoMiniConfig.Default.Save();
41
+ WxMiniConfig.Default.Save();
42
+ DouyinConfig.Default.Save();
43
+ VariablePreset.Default.Save();
44
+ }
45
+
34
46
  /// <summary>
35
47
  /// 应用配置
36
48
  /// </summary>
@@ -45,19 +57,19 @@ namespace TyphoonUnitySDK
45
57
  case BuildTarget.Android:
46
58
  {
47
59
  ModifyAndroidPlayerSetting(setting);
48
- Debug.Log($"<color=#3ac9f3>根据发布模式导入更换资源包</color>");
60
+ // Debug.Log($"<color=#3ac9f3>根据发布模式导入更换资源包</color>");
49
61
  }
50
62
  break;
51
63
  case BuildTarget.iOS:
52
64
  {
53
65
  ModifyIOSSetting(setting);
54
- Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
66
+ // Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
55
67
  }
56
68
  break;
57
69
  case BuildTarget.WebGL:
58
70
  {
59
71
  ModifyWebglSetting(setting);
60
- Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
72
+ // Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
61
73
  }
62
74
  break;
63
75
  default:
@@ -67,8 +79,7 @@ namespace TyphoonUnitySDK
67
79
 
68
80
  //保存所有配置
69
81
  setting.Save();
70
- WxMiniConfig.Default.Save();
71
- DouyinConfig.Default.Save();
82
+ SaveAllChannelConfig();
72
83
  InvokeOnApplyStart(setting);
73
84
  if (!Applies.TryGetValue(setting.Channel, out var match))
74
85
  {
@@ -141,7 +152,7 @@ namespace TyphoonUnitySDK
141
152
  AddressableSupport.ModifyAAProfileAndVariables(setting);
142
153
  //写入App config
143
154
  WriteAppConfig(setting);
144
- Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
155
+ // Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
145
156
  }
146
157
 
147
158
  /// <summary>
@@ -156,7 +167,7 @@ namespace TyphoonUnitySDK
156
167
  AddressableSupport.ModifyAAProfileAndVariables(setting);
157
168
  //写入App config
158
169
  WriteAppConfig(setting);
159
- Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
170
+ // Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
160
171
  }
161
172
 
162
173
  /// <summary>
@@ -195,7 +206,7 @@ namespace TyphoonUnitySDK
195
206
  AddressableSupport.ModifyAAProfileAndVariables(setting);
196
207
  //写入App config
197
208
  WriteAppConfig(setting);
198
- Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
209
+ // Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
199
210
  }
200
211
 
201
212
  /// <summary>
@@ -403,6 +414,7 @@ namespace TyphoonUnitySDK
403
414
  "Assets/WX-WASM-SDK-V2",
404
415
  "Assets/WebGLTemplates",
405
416
  "Assets/Plugins/ByteGame",
417
+ "Assets/VIVO-GAME-SDK",
406
418
  };
407
419
 
408
420
 
@@ -502,5 +514,27 @@ namespace TyphoonUnitySDK
502
514
  AssetDatabase.Refresh();
503
515
  }
504
516
  }
517
+
518
+
519
+ /*vivo mini*/
520
+ public class ApplyVivoMini : IApply
521
+ {
522
+ public void Apply(PublishSetting setting)
523
+ {
524
+ var pack = UniEditor.PackagePath_VivoMini;
525
+ Debug.Log($"导入... {pack}");
526
+ ImportUnityPackage(pack);
527
+ var manifest_path = $"{pack}.manifest";
528
+ Debug.Log($"读取资源清单...{manifest_path}");
529
+ var manifest = ReadManifest(manifest_path);
530
+ Debug.Log($"清理多余文件...");
531
+ foreach (var folder in MaybeFolder)
532
+ {
533
+ ClearFilesInDirectory(folder, manifest);
534
+ }
535
+
536
+ AssetDatabase.Refresh();
537
+ }
538
+ }
505
539
  }
506
540
  }
@@ -102,6 +102,29 @@ namespace TyphoonUnitySDK
102
102
  ExportUnityPackage(manifest, UniEditor.PackagePath_GooglePlay, out var detail);
103
103
  }
104
104
 
105
+
106
+ [MenuItem("TyphoonSDK/开发者/导出-VivoMini.unitypackage")]
107
+ public static void ExportVivoMini()
108
+ {
109
+ var manifest = new List<string>()
110
+ {
111
+ "Assets/Typhoon_Gen/TyphoonSDK/Runtime/VivoMini",
112
+ "Assets/VIVO-GAME-SDK",
113
+ };
114
+ if (!MakeSureExport(manifest))
115
+ {
116
+ return;
117
+ }
118
+
119
+ if (!CheckMissFiles(manifest))
120
+ {
121
+ return;
122
+ }
123
+
124
+ ExportUnityPackage(manifest, UniEditor.PackagePath_VivoMini, out var detail);
125
+ }
126
+
127
+
105
128
  /// <summary>
106
129
  /// 导出清单文件到模块
107
130
  /// </summary>
@@ -109,5 +109,43 @@ namespace TyphoonUnitySDK
109
109
  handler?.Invoke();
110
110
  }
111
111
  }
112
+
113
+ /// <summary>
114
+ /// 绘制单选框
115
+ /// </summary>
116
+ public static void DrawPopUpToggle(bool on, Action<bool> setter,
117
+ params GUILayoutOption[] option)
118
+ {
119
+ var txt = on ? "开" : "关";
120
+ if (GUILayout.Button(txt, "PopUp", option))
121
+ {
122
+ var menu = new GenericMenu();
123
+ menu.AddItem(new GUIContent("开"), false, () => setter?.Invoke(true));
124
+ menu.AddItem(new GUIContent("关"), false, () => setter?.Invoke(false));
125
+ menu.ShowAsContext();
126
+ }
127
+ }
128
+
129
+ /// <summary>
130
+ /// 绘制单选框
131
+ /// </summary>
132
+ public static void DrawPopUpToggleCustomTxt(bool on, Action<bool> setter, string yesTxt, string noTxt,
133
+ params GUILayoutOption[] option)
134
+ {
135
+ var txt = on ? yesTxt : noTxt;
136
+ if (GUILayout.Button(txt, "PopUp", option))
137
+ {
138
+ var menu = new GenericMenu();
139
+ menu.AddItem(new GUIContent("开"), false, () => setter?.Invoke(true));
140
+ menu.AddItem(new GUIContent("关"), false, () => setter?.Invoke(false));
141
+ menu.ShowAsContext();
142
+ }
143
+ }
144
+
145
+
146
+ private static void ClickOn(ref bool on, bool setter)
147
+ {
148
+ on = setter;
149
+ }
112
150
  }
113
151
  }
@@ -0,0 +1,53 @@
1
+ using System;
2
+ using System.IO;
3
+ using System.Security.Cryptography;
4
+ using System.Text;
5
+
6
+ namespace TyphoonUnitySDK
7
+ {
8
+ /// <summary>
9
+ /// MD5工具
10
+ /// </summary>
11
+ public static class MD5Tool
12
+ {
13
+ public static string GetMD5HashCodeFromFile(string filePath)
14
+ {
15
+ try
16
+ {
17
+ using (FileStream fStream = new FileStream(filePath, FileMode.Open))
18
+ {
19
+ MD5 md5 = new MD5CryptoServiceProvider();
20
+ byte[] retVal = md5.ComputeHash(fStream);
21
+
22
+ StringBuilder builder = new StringBuilder();
23
+ for (int i = 0; i < retVal.Length; i++)
24
+ {
25
+ builder.Append(retVal[i].ToString("X2"));
26
+ }
27
+
28
+ return builder.ToString().ToLower();
29
+ }
30
+ }
31
+ catch (Exception ex)
32
+ {
33
+ throw new Exception("GetMD5HashCodeFromFile() fail,error:" + ex.Message);
34
+ }
35
+ }
36
+
37
+ public static byte[] GetMD5HashBytesFromFile(string filePath)
38
+ {
39
+ try
40
+ {
41
+ using (FileStream fStream = new FileStream(filePath, FileMode.Open))
42
+ {
43
+ MD5 md5 = new MD5CryptoServiceProvider();
44
+ return md5.ComputeHash(fStream);
45
+ }
46
+ }
47
+ catch (Exception ex)
48
+ {
49
+ throw new Exception("GetMD5HashBytesFromFile() fail,error:" + ex.Message);
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 3d13e3175f3b3994ab8d40fe982d62b2
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,18 @@
1
+ using System.Collections;
2
+ using System.Collections.Generic;
3
+ using UnityEngine;
4
+
5
+ namespace TyphoonUnitySDK
6
+ {
7
+ /// <summary>
8
+ /// 朝向
9
+ /// </summary>
10
+ public enum Orientation
11
+ {
12
+ //横屏
13
+ Portrait,
14
+
15
+ //竖屏
16
+ Landscape,
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 7844005f90cef14458bc68bffc3f69bc
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: