com.typhoon.unitysdk 1.0.2

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 (207) hide show
  1. package/Editor/AddressableSupport.cs +269 -0
  2. package/Editor/AddressableSupport.cs.meta +11 -0
  3. package/Editor/ApplyTool.cs +315 -0
  4. package/Editor/ApplyTool.cs.meta +11 -0
  5. package/Editor/EditorIcons.cs +113 -0
  6. package/Editor/EditorIcons.cs.meta +11 -0
  7. package/Editor/ExportModule.cs +218 -0
  8. package/Editor/ExportModule.cs.meta +11 -0
  9. package/Editor/InstallModule.cs +38 -0
  10. package/Editor/InstallModule.cs.meta +11 -0
  11. package/Editor/Interactive/SDKInteractiveUI.prefab +3026 -0
  12. package/Editor/Interactive/SDKInteractiveUI.prefab.meta +7 -0
  13. package/Editor/Interactive/sdk_banner.png +0 -0
  14. package/Editor/Interactive/sdk_banner.png.meta +144 -0
  15. package/Editor/Interactive/sdk_close.png +0 -0
  16. package/Editor/Interactive/sdk_close.png.meta +120 -0
  17. package/Editor/Interactive/sdk_inters.png +0 -0
  18. package/Editor/Interactive/sdk_inters.png.meta +120 -0
  19. package/Editor/Interactive/sdk_white_4x4.png +0 -0
  20. package/Editor/Interactive/sdk_white_4x4.png.meta +120 -0
  21. package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png +0 -0
  22. package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png.meta +120 -0
  23. package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png +0 -0
  24. package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png.meta +120 -0
  25. package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png +0 -0
  26. package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png.meta +120 -0
  27. 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
  28. 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 +120 -0
  29. 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
  30. 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 +120 -0
  31. 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
  32. 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 +120 -0
  33. package/Editor/Interactive.meta +8 -0
  34. package/Editor/OnApplyProcessor.cs +22 -0
  35. package/Editor/OnApplyProcessor.cs.meta +11 -0
  36. package/Editor/OnBuildAAProcessor.cs +12 -0
  37. package/Editor/OnBuildAAProcessor.cs.meta +11 -0
  38. package/Editor/OnPublicProcessor.cs +12 -0
  39. package/Editor/OnPublicProcessor.cs.meta +11 -0
  40. package/Editor/OriginalStyles.cs +708 -0
  41. package/Editor/OriginalStyles.cs.meta +11 -0
  42. package/Editor/Preferences.cs +43 -0
  43. package/Editor/Preferences.cs.meta +11 -0
  44. package/Editor/PreferencesWindow.cs +178 -0
  45. package/Editor/PreferencesWindow.cs.meta +11 -0
  46. package/Editor/PropertyInspectorEditor.cs +6 -0
  47. package/Editor/PropertyInspectorEditor.cs.meta +11 -0
  48. package/Editor/PublishProcess.cs +13 -0
  49. package/Editor/PublishProcess.cs.meta +11 -0
  50. package/Editor/PublishResult.cs +17 -0
  51. package/Editor/PublishResult.cs.meta +11 -0
  52. package/Editor/PublishSetting.cs +111 -0
  53. package/Editor/PublishSetting.cs.meta +11 -0
  54. package/Editor/PublishSettingGUIDrawer.cs +412 -0
  55. package/Editor/PublishSettingGUIDrawer.cs.meta +11 -0
  56. package/Editor/PublishSettingInspector.cs +29 -0
  57. package/Editor/PublishSettingInspector.cs.meta +11 -0
  58. package/Editor/PublishTool.cs +137 -0
  59. package/Editor/PublishTool.cs.meta +11 -0
  60. package/Editor/PublishVivoBatSetting.cs +62 -0
  61. package/Editor/PublishVivoBatSetting.cs.meta +11 -0
  62. package/Editor/PublishVivoBatSettingInspector.cs +371 -0
  63. package/Editor/PublishVivoBatSettingInspector.cs.meta +11 -0
  64. package/Editor/PublishVivoBatSettingWindow.cs +69 -0
  65. package/Editor/PublishVivoBatSettingWindow.cs.meta +11 -0
  66. package/Editor/PublishWindow.cs +364 -0
  67. package/Editor/PublishWindow.cs.meta +11 -0
  68. package/Editor/SdkFont.otf +0 -0
  69. package/Editor/SdkFont.otf.meta +21 -0
  70. package/Editor/SdkTestInUnityEditor.cs +20 -0
  71. package/Editor/SdkTestInUnityEditor.cs.meta +11 -0
  72. package/Editor/SdkTestInUnityWindow.cs +37 -0
  73. package/Editor/SdkTestInUnityWindow.cs.meta +11 -0
  74. package/Editor/Skin.guiskin +2673 -0
  75. package/Editor/Skin.guiskin.meta +8 -0
  76. package/Editor/Skins.cs +26 -0
  77. package/Editor/Skins.cs.meta +11 -0
  78. package/Editor/StyleEditorWindow.cs +23 -0
  79. package/Editor/StyleEditorWindow.cs.meta +11 -0
  80. package/Editor/Styles.cs +52 -0
  81. package/Editor/Styles.cs.meta +11 -0
  82. package/Editor/StylesExtension.cs +25 -0
  83. package/Editor/StylesExtension.cs.meta +11 -0
  84. package/Editor/Texture/btn_active.png +0 -0
  85. package/Editor/Texture/btn_active.png.meta +120 -0
  86. package/Editor/Texture/btn_blue_active.png +0 -0
  87. package/Editor/Texture/btn_blue_active.png.meta +120 -0
  88. package/Editor/Texture/btn_blue_hover.png +0 -0
  89. package/Editor/Texture/btn_blue_hover.png.meta +120 -0
  90. package/Editor/Texture/btn_blue_normal.png +0 -0
  91. package/Editor/Texture/btn_blue_normal.png.meta +120 -0
  92. package/Editor/Texture/btn_green_active.png +0 -0
  93. package/Editor/Texture/btn_green_active.png.meta +120 -0
  94. package/Editor/Texture/btn_green_hover.png +0 -0
  95. package/Editor/Texture/btn_green_hover.png.meta +120 -0
  96. package/Editor/Texture/btn_green_normal.png +0 -0
  97. package/Editor/Texture/btn_green_normal.png.meta +120 -0
  98. package/Editor/Texture/btn_hover.png +0 -0
  99. package/Editor/Texture/btn_hover.png.meta +120 -0
  100. package/Editor/Texture/btn_normal.png +0 -0
  101. package/Editor/Texture/btn_normal.png.meta +120 -0
  102. package/Editor/Texture/btn_yellow_active.png +0 -0
  103. package/Editor/Texture/btn_yellow_active.png.meta +120 -0
  104. package/Editor/Texture/btn_yellow_hover.png +0 -0
  105. package/Editor/Texture/btn_yellow_hover.png.meta +120 -0
  106. package/Editor/Texture/btn_yellow_normal.png +0 -0
  107. package/Editor/Texture/btn_yellow_normal.png.meta +120 -0
  108. package/Editor/Texture/icon_android.png +0 -0
  109. package/Editor/Texture/icon_android.png.meta +120 -0
  110. package/Editor/Texture/icon_douyin.png +0 -0
  111. package/Editor/Texture/icon_douyin.png.meta +120 -0
  112. package/Editor/Texture/icon_download.png +0 -0
  113. package/Editor/Texture/icon_download.png.meta +120 -0
  114. package/Editor/Texture/icon_error.png +0 -0
  115. package/Editor/Texture/icon_error.png.meta +144 -0
  116. package/Editor/Texture/icon_extension.png +0 -0
  117. package/Editor/Texture/icon_extension.png.meta +120 -0
  118. package/Editor/Texture/icon_googleplay.png +0 -0
  119. package/Editor/Texture/icon_googleplay.png.meta +120 -0
  120. package/Editor/Texture/icon_html5.png +0 -0
  121. package/Editor/Texture/icon_html5.png.meta +120 -0
  122. package/Editor/Texture/icon_import.png +0 -0
  123. package/Editor/Texture/icon_import.png.meta +144 -0
  124. package/Editor/Texture/icon_ios.png +0 -0
  125. package/Editor/Texture/icon_ios.png.meta +120 -0
  126. package/Editor/Texture/icon_oppo.png +0 -0
  127. package/Editor/Texture/icon_oppo.png.meta +120 -0
  128. package/Editor/Texture/icon_refresh.png +0 -0
  129. package/Editor/Texture/icon_refresh.png.meta +120 -0
  130. package/Editor/Texture/icon_save.png +0 -0
  131. package/Editor/Texture/icon_save.png.meta +120 -0
  132. package/Editor/Texture/icon_success.png +0 -0
  133. package/Editor/Texture/icon_success.png.meta +144 -0
  134. package/Editor/Texture/icon_vivo.png +0 -0
  135. package/Editor/Texture/icon_vivo.png.meta +120 -0
  136. package/Editor/Texture/icon_wechat.png +0 -0
  137. package/Editor/Texture/icon_wechat.png.meta +120 -0
  138. package/Editor/Texture/tex_select.png +0 -0
  139. package/Editor/Texture/tex_select.png.meta +120 -0
  140. package/Editor/Texture.meta +8 -0
  141. package/Editor/UniEditor.cs +451 -0
  142. package/Editor/UniEditor.cs.meta +11 -0
  143. package/Editor/com.typhoon.unitysdk.editor.asmdef +20 -0
  144. package/Editor/com.typhoon.unitysdk.editor.asmdef.meta +7 -0
  145. package/Editor.meta +8 -0
  146. package/Runtime/AndroidInstance.cs +125 -0
  147. package/Runtime/AndroidInstance.cs.meta +11 -0
  148. package/Runtime/AppChannel.cs +55 -0
  149. package/Runtime/AppChannel.cs.meta +11 -0
  150. package/Runtime/AppConfig.cs +28 -0
  151. package/Runtime/AppConfig.cs.meta +11 -0
  152. package/Runtime/AppConfigAsset.cs +50 -0
  153. package/Runtime/AppConfigAsset.cs.meta +11 -0
  154. package/Runtime/BannerPosition.cs +11 -0
  155. package/Runtime/BannerPosition.cs.meta +11 -0
  156. package/Runtime/BaseSdk.cs +78 -0
  157. package/Runtime/BaseSdk.cs.meta +11 -0
  158. package/Runtime/Extension.cs +58 -0
  159. package/Runtime/Extension.cs.meta +11 -0
  160. package/Runtime/Interface.cs +115 -0
  161. package/Runtime/Interface.cs.meta +11 -0
  162. package/Runtime/MonoSingleton.cs +76 -0
  163. package/Runtime/MonoSingleton.cs.meta +11 -0
  164. package/Runtime/Resources/TYPHOON_SDK_TEST.prefab +45 -0
  165. package/Runtime/Resources/TYPHOON_SDK_TEST.prefab.meta +7 -0
  166. package/Runtime/Resources.meta +8 -0
  167. package/Runtime/SDKInteractiveUI.cs +353 -0
  168. package/Runtime/SDKInteractiveUI.cs.meta +11 -0
  169. package/Runtime/SdkDebug.cs +23 -0
  170. package/Runtime/SdkDebug.cs.meta +11 -0
  171. package/Runtime/SdkTestInUnity.cs +45 -0
  172. package/Runtime/SdkTestInUnity.cs.meta +11 -0
  173. package/Runtime/SessionItem.cs +72 -0
  174. package/Runtime/SessionItem.cs.meta +11 -0
  175. package/Runtime/SimpleMap.cs +11 -0
  176. package/Runtime/SimpleMap.cs.meta +11 -0
  177. package/Runtime/TestSdk.cs +22 -0
  178. package/Runtime/TestSdk.cs.meta +11 -0
  179. package/Runtime/TyphoonSdk.cs +407 -0
  180. package/Runtime/TyphoonSdk.cs.meta +11 -0
  181. package/Runtime/TyphoonSdkCallback.cs +48 -0
  182. package/Runtime/TyphoonSdkCallback.cs.meta +11 -0
  183. package/Runtime/VersionType.cs +33 -0
  184. package/Runtime/VersionType.cs.meta +11 -0
  185. package/Runtime/com.typhoon.unitysdk.asmdef +3 -0
  186. package/Runtime/com.typhoon.unitysdk.asmdef.meta +7 -0
  187. package/Runtime.meta +8 -0
  188. package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml +18 -0
  189. package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml.meta +7 -0
  190. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar +0 -0
  191. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar.meta +32 -0
  192. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar +0 -0
  193. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar.meta +32 -0
  194. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar +0 -0
  195. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar.meta +32 -0
  196. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs +154 -0
  197. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs.meta +11 -0
  198. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs +56 -0
  199. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs.meta +11 -0
  200. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor.meta +8 -0
  201. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab +45 -0
  202. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab.meta +7 -0
  203. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources.meta +8 -0
  204. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid.meta +8 -0
  205. package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
  206. package/package.json +1 -0
  207. package/package.json.meta +7 -0
@@ -0,0 +1,412 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using UnityEditor;
4
+ using UnityEngine;
5
+ using Object = UnityEngine.Object;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ /// <summary>
10
+ /// 绘制发布配置GUI
11
+ /// </summary>
12
+ public static class PublishSettingGUIDrawer
13
+ {
14
+ private static AddressableVariableModify _cacheDelete = null;
15
+ private static AddressableVariableModify _cacheMoveUp = null;
16
+ private static AddressableVariableModify _cacheMoveDown = null;
17
+
18
+ /// <summary>
19
+ /// 绑定重绘逻辑
20
+ /// </summary>
21
+ public static Dictionary<string, Func<PublishSetting, bool>> RedrawBinding =
22
+ new Dictionary<string, Func<PublishSetting, bool>>()
23
+ {
24
+ { "m_Script", (s) => true },
25
+ { nameof(PublishSetting.PackageName), DrawProperty_PackageName },
26
+ { nameof(PublishSetting.VersionString), DrawProperty_VersionString },
27
+ { nameof(PublishSetting.EnableSignature), DrawProperty_EnableSignature },
28
+ { nameof(PublishSetting.KeystorePassword), DrawProperty_KeystorePassword },
29
+ { nameof(PublishSetting.KeystoreName), DrawProperty_KeystoreName },
30
+ { nameof(PublishSetting.KeyAliasName), DrawProperty_KeyAliasName },
31
+ { nameof(PublishSetting.KeyAliasPassword), DrawProperty_KeyAliasPassword },
32
+ { nameof(PublishSetting.AAUseProfile), DrawProperty_AAUseProfile },
33
+ { nameof(PublishSetting.AASupportEnable), DrawProperty_EnableAASupport },
34
+ { nameof(PublishSetting.AAVariableModify), DrawProperty_AAVariableModify },
35
+ { nameof(PublishSetting.OverrideWebglTemplate), DrawProperty_OverrideWebglTemplate },
36
+ { nameof(PublishSetting.WebglTemplate), DrawProperty_WebglTemplate },
37
+ { nameof(PublishSetting.OverrideWebglCompressionFormat), DrawProperty_OverrideWebglCompressionFormat },
38
+ { nameof(PublishSetting.CompressionFormat), DrawProperty_CompressionFormat },
39
+ { nameof(PublishSetting.ArmV7), DrawProperty_ArmV7 },
40
+ { nameof(PublishSetting.ArmV64), DrawProperty_ArmV64 },
41
+ { nameof(PublishSetting.MinApiVersion), DrawProperty_MinApiVersion },
42
+ { nameof(PublishSetting.TargetApiVersion), DrawProperty_TargetApiVersion },
43
+ { nameof(PublishSetting.GraphicsAPIs), DrawProperty_GraphicsAPIs },
44
+ };
45
+
46
+
47
+ /// <summary>
48
+ /// 绘制GUI
49
+ /// </summary>
50
+ public static void Draw(Rect view, PublishSetting setting, ref Vector2 scroll)
51
+ {
52
+ var rect = view;
53
+ rect.height = 24;
54
+ var area = view;
55
+ area.height -= 8;
56
+ area.width -= 8;
57
+ area.center = view.center;
58
+ var obj = new SerializedObject(setting);
59
+ GUILayout.BeginArea(area);
60
+ scroll = GUILayout.BeginScrollView(scroll, GUIStyle.none, GUIStyle.none);
61
+ DrawPropertyGUI(setting);
62
+ GUILayout.Space(30);
63
+ GUILayout.EndScrollView();
64
+ GUILayout.EndArea();
65
+ }
66
+
67
+ /*绘制GUI*/
68
+ public static void DrawPropertyGUI(PublishSetting setting)
69
+ {
70
+ DrawProperty(setting, (property) =>
71
+ {
72
+ if (RedrawBinding.TryGetValue(property, out var match))
73
+ {
74
+ return match.Invoke(setting);
75
+ }
76
+
77
+ return false;
78
+ });
79
+ }
80
+
81
+ /*重绘GraphicsAPIs*/
82
+ private static bool DrawProperty_GraphicsAPIs(PublishSetting setting)
83
+ {
84
+ if (setting.BuildTarget == BuildTarget.iOS)
85
+ {
86
+ return true;
87
+ }
88
+
89
+ return false;
90
+ }
91
+
92
+
93
+ /*重绘TargetApiVersion*/
94
+ private static bool DrawProperty_TargetApiVersion(PublishSetting setting)
95
+ {
96
+ return setting.BuildTarget != BuildTarget.Android;
97
+ }
98
+
99
+ /*重绘MinApiVersion*/
100
+ private static bool DrawProperty_MinApiVersion(PublishSetting setting)
101
+ {
102
+ return setting.BuildTarget != BuildTarget.Android;
103
+ }
104
+
105
+ /*重绘ArmV64*/
106
+ private static bool DrawProperty_ArmV64(PublishSetting setting)
107
+ {
108
+ return setting.BuildTarget != BuildTarget.Android;
109
+ }
110
+
111
+ /*重绘ArmV7*/
112
+ private static bool DrawProperty_ArmV7(PublishSetting setting)
113
+ {
114
+ return setting.BuildTarget != BuildTarget.Android;
115
+ }
116
+
117
+
118
+ /*重绘PackageName*/
119
+ private static bool DrawProperty_PackageName(PublishSetting setting)
120
+ {
121
+ return setting.BuildTarget != BuildTarget.Android;
122
+ }
123
+
124
+ /*绘制版本号*/
125
+ public static bool DrawProperty_VersionString(PublishSetting setting)
126
+ {
127
+ GUILayout.BeginHorizontal();
128
+ setting.VersionString = EditorGUILayout.TextField("版本号", setting.VersionString);
129
+ if (GUILayout.Button("自动版本号", GUILayout.Width(100)))
130
+ {
131
+ setting.VersionString = UniEditor.AutoVersionSting(setting.VersionString);
132
+ EditorUtility.SetDirty(setting);
133
+ GUI.FocusControl("");
134
+ }
135
+
136
+ GUILayout.EndHorizontal();
137
+ return true;
138
+ }
139
+
140
+
141
+ /*重绘EnableSignature*/
142
+ private static bool DrawProperty_EnableSignature(PublishSetting setting)
143
+ {
144
+ return setting.BuildTarget != BuildTarget.Android;
145
+ }
146
+
147
+ /*重绘KeystorePassword*/
148
+ public static bool DrawProperty_KeystorePassword(PublishSetting setting)
149
+ {
150
+ if (setting.BuildTarget != BuildTarget.Android)
151
+ {
152
+ return true;
153
+ }
154
+
155
+ if (!setting.EnableSignature)
156
+ {
157
+ return true;
158
+ }
159
+
160
+ setting.KeystorePassword =
161
+ EditorGUILayout.PasswordField(nameof(setting.KeystorePassword),
162
+ setting.KeystorePassword);
163
+ return true;
164
+ }
165
+
166
+ /*重绘KeyAliasPassword*/
167
+ public static bool DrawProperty_KeyAliasPassword(PublishSetting setting)
168
+ {
169
+ if (setting.BuildTarget != BuildTarget.Android)
170
+ {
171
+ return true;
172
+ }
173
+
174
+ if (!setting.EnableSignature)
175
+ {
176
+ return true;
177
+ }
178
+
179
+ setting.KeyAliasPassword =
180
+ EditorGUILayout.PasswordField(nameof(setting.KeyAliasPassword),
181
+ setting.KeyAliasPassword);
182
+ return true;
183
+ }
184
+
185
+ /*重绘KeystoreName*/
186
+ public static bool DrawProperty_KeystoreName(PublishSetting setting)
187
+ {
188
+ if (setting.BuildTarget != BuildTarget.Android)
189
+ {
190
+ return true;
191
+ }
192
+
193
+ if (!setting.EnableSignature)
194
+ {
195
+ return true;
196
+ }
197
+
198
+ GUILayout.BeginHorizontal();
199
+ setting.KeystoreName = EditorGUILayout.TextField("签名文件", setting.KeystoreName);
200
+ if (GUILayout.Button("浏览", GUILayout.Width(60)))
201
+ {
202
+ setting.KeystoreName = UniEditor.BrowseKeystoreFile();
203
+ EditorUtility.SetDirty(setting);
204
+ GUI.FocusControl("");
205
+ }
206
+
207
+ GUILayout.EndHorizontal();
208
+
209
+ return true;
210
+ }
211
+
212
+ /*重绘KeyAliasName*/
213
+ public static bool DrawProperty_KeyAliasName(PublishSetting setting)
214
+ {
215
+ if (setting.BuildTarget != BuildTarget.Android)
216
+ {
217
+ return true;
218
+ }
219
+
220
+ return !setting.EnableSignature;
221
+ }
222
+
223
+
224
+ /*重绘CompressionFormat*/
225
+ private static bool DrawProperty_CompressionFormat(PublishSetting setting)
226
+ {
227
+ return setting.BuildTarget != BuildTarget.WebGL;
228
+ }
229
+
230
+ /*重绘OverrideWebglCompressionFormat*/
231
+ private static bool DrawProperty_OverrideWebglCompressionFormat(PublishSetting setting)
232
+ {
233
+ return setting.BuildTarget != BuildTarget.WebGL;
234
+ }
235
+
236
+ /*重绘WebglTemplate*/
237
+ private static bool DrawProperty_WebglTemplate(PublishSetting setting)
238
+ {
239
+ return setting.BuildTarget != BuildTarget.WebGL;
240
+ }
241
+
242
+ /*重绘OverrideWebglTemplate*/
243
+ private static bool DrawProperty_OverrideWebglTemplate(PublishSetting setting)
244
+ {
245
+ return setting.BuildTarget != BuildTarget.WebGL;
246
+ }
247
+
248
+
249
+ /*重绘AAUseProfile*/
250
+ public static bool DrawProperty_AAUseProfile(PublishSetting setting)
251
+ {
252
+ if (!setting.IsAACanBeSetting())
253
+ {
254
+ return true;
255
+ }
256
+
257
+ GUILayout.BeginHorizontal();
258
+ GUILayout.Label("关联profile", GUILayout.Width(142));
259
+ if (GUILayout.Button(setting.AAUseProfile, Styles.DropDownButtonLeft))
260
+ {
261
+ AddressableSupport.PopUpProfileSelectorMenu(setting);
262
+ }
263
+
264
+ GUILayout.EndHorizontal();
265
+ return true;
266
+ }
267
+
268
+ /*重绘EnableAASupport*/
269
+ public static bool DrawProperty_EnableAASupport(PublishSetting setting)
270
+ {
271
+ if (!UniEditor.HasAddressableSupport())
272
+ {
273
+ return true;
274
+ }
275
+
276
+ GUILayout.Space(10);
277
+ GUILayout.Label("Addressable支持", Styles.rbold_label);
278
+ setting.AASupportEnable = EditorGUILayout.Toggle("调整AA参数", setting.AASupportEnable);
279
+ return true;
280
+ }
281
+
282
+ /*重绘AAVariableModify*/
283
+ public static bool DrawProperty_AAVariableModify(PublishSetting setting)
284
+ {
285
+ if (!setting.IsAACanBeSetting())
286
+ {
287
+ return true;
288
+ }
289
+
290
+ var modifies = setting.AAVariableModify;
291
+ for (int i = modifies.Count - 1; i >= 0; i--)
292
+ {
293
+ if (modifies[i] == null)
294
+ {
295
+ modifies.RemoveAt(i);
296
+ }
297
+ }
298
+
299
+ var variables = AddressableSupport.GetVariables();
300
+ if (GUILayout.Button("覆写 Veriable", Styles.DropDownButtonLeft))
301
+ {
302
+ var used = new HashSet<string>();
303
+ foreach (var modify in modifies)
304
+ {
305
+ used.Add(modify.VariableName);
306
+ }
307
+
308
+ var menu = new GenericMenu();
309
+ foreach (var variable in variables)
310
+ {
311
+ var isUsed = used.Contains(variable);
312
+ var desc = isUsed ? $"{variable} (使用中)" : variable;
313
+ menu.AddItem(new GUIContent(desc), false, () =>
314
+ {
315
+ if (isUsed)
316
+ {
317
+ Debug.Log("使用中,已加入");
318
+ }
319
+ else
320
+ {
321
+ Debug.Log($"加入新的参数:{variable}");
322
+ setting.AAVariableModify.Add(new AddressableVariableModify(variable,
323
+ AddressableSupport.GetVariableValue(variable)));
324
+ EditorUtility.SetDirty(setting);
325
+ }
326
+ });
327
+ }
328
+
329
+ menu.ShowAsContext();
330
+ }
331
+
332
+ foreach (var modify in modifies)
333
+ {
334
+ var isValid = !string.IsNullOrEmpty(modify.VariableName) && variables.Contains(modify.VariableName);
335
+ var varName = isValid ? modify.VariableName : $"{modify.VariableName}(missing)";
336
+ GUILayout.BeginHorizontal();
337
+ if (GUILayout.Button(varName, Styles.DropDownButtonLeft, GUILayout.Width(200)))
338
+ {
339
+ var menu = new GenericMenu();
340
+ menu.AddItem(new GUIContent("删除"), false, () => { _cacheDelete = modify; });
341
+ menu.AddItem(new GUIContent("上移"), false, () => { _cacheMoveUp = modify; });
342
+ menu.AddItem(new GUIContent("下移"), false, () => { _cacheMoveDown = modify; });
343
+ menu.ShowAsContext();
344
+ }
345
+
346
+ modify.VariableValue = GUILayout.TextField(modify.VariableValue);
347
+ GUILayout.EndHorizontal();
348
+ }
349
+
350
+ /*删除*/
351
+ if (_cacheDelete != null)
352
+ {
353
+ setting.AAVariableModify.Remove(_cacheDelete);
354
+ EditorUtility.SetDirty(setting);
355
+ _cacheDelete = null;
356
+ }
357
+
358
+ /*上移*/
359
+ if (_cacheMoveUp != null)
360
+ {
361
+ var index = setting.AAVariableModify.IndexOf(_cacheMoveUp);
362
+ if (index >= 0 && (index - 1) >= 0)
363
+ {
364
+ (setting.AAVariableModify[index], setting.AAVariableModify[index - 1]) = (
365
+ setting.AAVariableModify[index - 1], setting.AAVariableModify[index]);
366
+ EditorUtility.SetDirty(setting);
367
+ }
368
+
369
+ _cacheMoveUp = null;
370
+ }
371
+
372
+ /*下移*/
373
+ if (_cacheMoveDown != null)
374
+ {
375
+ var index = setting.AAVariableModify.IndexOf(_cacheMoveDown);
376
+ if (index >= 0 && (index + 1) < setting.AAVariableModify.Count)
377
+ {
378
+ (setting.AAVariableModify[index + 1], setting.AAVariableModify[index]) = (
379
+ setting.AAVariableModify[index], setting.AAVariableModify[index + 1]);
380
+ EditorUtility.SetDirty(setting);
381
+ }
382
+
383
+ _cacheMoveDown = null;
384
+ }
385
+
386
+ return true;
387
+ }
388
+
389
+ /*绘制属性*/
390
+ public static void DrawProperty(Object target, Func<string, bool> ignoreFunc)
391
+ {
392
+ var obj = new SerializedObject(target);
393
+ EditorGUI.BeginChangeCheck();
394
+ obj.UpdateIfRequiredOrScript();
395
+ SerializedProperty iterator = obj.GetIterator();
396
+ for (var enterChildren = true; iterator.NextVisible(enterChildren); enterChildren = false)
397
+ {
398
+ using (new EditorGUI.DisabledScope("m_Script" == iterator.propertyPath))
399
+ {
400
+ var cover = ignoreFunc.Invoke(iterator.propertyPath);
401
+ if (!cover)
402
+ {
403
+ EditorGUILayout.PropertyField(iterator, true);
404
+ }
405
+ }
406
+ }
407
+
408
+ obj.ApplyModifiedProperties();
409
+ EditorGUI.EndChangeCheck();
410
+ }
411
+ }
412
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: d6094f30162ec634fad34402d966659d
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,29 @@
1
+ using UnityEditor;
2
+ using UnityEngine;
3
+
4
+ namespace TyphoonUnitySDK
5
+ {
6
+ [CustomEditor(typeof(PublishSetting), true, isFallback = true)]
7
+ public class PublishSettingInspector : Editor
8
+ {
9
+ private PublishSetting Target => target as PublishSetting;
10
+
11
+ public override void OnInspectorGUI()
12
+ {
13
+ var temSkin = GUI.skin;
14
+ GUI.skin = Skins.Skin;
15
+ base.OnInspectorGUI();
16
+ if (GUILayout.Button("应用", GUILayout.Height(32)))
17
+ {
18
+ Target.Apply();
19
+ }
20
+
21
+ if (GUILayout.Button("发布", GUILayout.Height(32)))
22
+ {
23
+ Target.Apply();
24
+ }
25
+
26
+ GUI.skin = temSkin;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: f24f978e99c7033449bbf42e1773e46e
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,137 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.IO;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ /// <summary>
10
+ /// 发布接口
11
+ /// </summary>
12
+ public interface IPublish
13
+ {
14
+ PublishResult Publish(PublishSetting setting);
15
+ }
16
+
17
+ public class PublishTool
18
+ {
19
+ /// <summary>
20
+ /// 发布绑定类
21
+ /// </summary>
22
+ public static Dictionary<PublishProcess, string> PublicClasses = new Dictionary<PublishProcess, string>()
23
+ {
24
+ { PublishProcess.ChinaAndroidAAR, "TyphoonUnitySDK.PublishChinaAndroidAAR" }
25
+ };
26
+
27
+ /// <summary>
28
+ /// 发布
29
+ /// </summary>
30
+ public static void Publish(PublishSetting setting)
31
+ {
32
+ var sure = EditorUtility.DisplayDialog("提示", $"发布{setting.name}?", "是", "否");
33
+ if (!sure)
34
+ {
35
+ return;
36
+ }
37
+
38
+ //检查渠道设置是否一致
39
+ if (AppConfig.Channel != setting.Channel)
40
+ {
41
+ var apply = EditorUtility.DisplayDialog("提示",
42
+ $"当前渠道和发布渠道不匹配,去应用?\n当前渠道:{AppConfig.Channel}\n发布渠道:{setting.Channel}", "是");
43
+ if (apply)
44
+ {
45
+ setting.Apply();
46
+ }
47
+
48
+ return;
49
+ }
50
+
51
+ if (!PublicClasses.TryGetValue(setting.PublishProcess, out var className))
52
+ {
53
+ Debug.LogError($"未关联发布流程:{setting.PublishProcess}");
54
+ }
55
+
56
+ Type publishClass = UniEditor.GetType(className);
57
+ if (publishClass == null)
58
+ {
59
+ throw new Exception($"发布失败,找不到发布实现类:{className},检查是否未应用配置");
60
+ }
61
+
62
+ //执行发布
63
+ dynamic instance = Activator.CreateInstance(publishClass);
64
+ instance.Publish(setting);
65
+ }
66
+
67
+ public static void InvokeOnPublishStart(PublishSetting setting)
68
+ {
69
+ var sub = UniEditor.GetSubClasTypes(typeof(OnPublicProcessor));
70
+ var match = new List<OnPublicProcessor>();
71
+ foreach (var type in sub)
72
+ {
73
+ match.Add(Activator.CreateInstance(type) as OnPublicProcessor);
74
+ }
75
+
76
+ foreach (var processor in match)
77
+ {
78
+ processor.OnBeforeBuild(setting);
79
+ }
80
+ }
81
+
82
+
83
+ /// <summary>
84
+ /// 发布后执行
85
+ /// </summary>
86
+ public static void InvokeOnPublishEnd(PublishSetting setting, PublishResult publishResult)
87
+ {
88
+ var sub = UniEditor.GetSubClasTypes(typeof(OnPublicProcessor));
89
+ var match = new List<OnPublicProcessor>();
90
+ foreach (var type in sub)
91
+ {
92
+ match.Add(Activator.CreateInstance(type) as OnPublicProcessor);
93
+ }
94
+
95
+ foreach (var processor in match)
96
+ {
97
+ processor.OnAfterBuild(setting, publishResult);
98
+ }
99
+ }
100
+
101
+
102
+ /// <summary>
103
+ /// 切换到apk模式
104
+ /// </summary>
105
+ public static void SwitchToApk()
106
+ {
107
+ EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
108
+ #if UNITY_2019_1_OR_NEWER
109
+ EditorUserBuildSettings.buildAppBundle = false;
110
+ #endif
111
+ }
112
+
113
+ /// <summary>
114
+ /// 切换到工程模式
115
+ /// </summary>
116
+ public static void SwitchToProject()
117
+ {
118
+ EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
119
+ #if UNITY_2019_1_OR_NEWER
120
+ EditorUserBuildSettings.buildAppBundle = false;
121
+ #endif
122
+ }
123
+
124
+ /// <summary>
125
+ /// 切换到AAB模式
126
+ /// </summary>
127
+ public static void SwitchToAAB()
128
+ {
129
+ #if UNITY_2019_1_OR_NEWER
130
+ EditorUserBuildSettings.buildAppBundle = true;
131
+ #endif
132
+ }
133
+
134
+
135
+
136
+ }
137
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 56f3fceb93c2caf4fa4931452b13cadd
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,62 @@
1
+ using UnityEditor;
2
+ using UnityEngine;
3
+
4
+ namespace TyphoonUnitySDK
5
+ {
6
+ [CreateAssetMenu]
7
+ public class PublishVivoBatSetting : ScriptableObject
8
+ {
9
+ [Header("安卓发布工具项目路径")] public string AndroidPublishProj;
10
+ [Header("基本参数")] public string GameName;
11
+ public Texture Icon;
12
+ public string PackageName;
13
+ public string AppId;
14
+ public string PrivacyPolicyYNoteUrl;
15
+
16
+ [Header("签名相关")] public string KeystoreName;
17
+ public string KeystorePassword;
18
+ public string KeyAliasName;
19
+ public string KeyAliasPassword;
20
+
21
+ [Header("广告相关")] public string MediaID;
22
+ public string IntersID;
23
+ public string VideoID;
24
+ public string SplashID;
25
+ public string FloatIconID;
26
+ public string NativeID;
27
+ public string BannerID;
28
+
29
+ [Header("版本号")] public string Version = "1.0.0.0";
30
+
31
+ private static string PATH = "Assets/Editor/PublishVivoBatSetting.asset";
32
+
33
+ public static PublishVivoBatSetting _default = null;
34
+
35
+ public static PublishVivoBatSetting Default
36
+ {
37
+ get
38
+ {
39
+ if (_default == null)
40
+ {
41
+ _default = AssetDatabase.LoadAssetAtPath<PublishVivoBatSetting>(PATH);
42
+ }
43
+
44
+ if (_default == null)
45
+ {
46
+ _default = CreateInstance<PublishVivoBatSetting>();
47
+ AssetDatabase.CreateAsset(_default, PATH);
48
+ AssetDatabase.Refresh();
49
+ }
50
+
51
+ return _default;
52
+ }
53
+ }
54
+
55
+
56
+ public void Save()
57
+ {
58
+ EditorUtility.SetDirty(this);
59
+ AssetDatabase.SaveAssets();
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: d420ea4990245a64bb058105d44f2664
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: