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,364 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using UnityEditor;
4
+ using UnityEngine;
5
+
6
+ namespace TyphoonUnitySDK
7
+ {
8
+ public class PublishWindow : StyleEditorWindow
9
+ {
10
+ //锁定,未开放
11
+ private static HashSet<AppChannel> _LockChannel = new HashSet<AppChannel>()
12
+ {
13
+ AppChannel.ChinaIOS,
14
+ AppChannel.GooglePlay,
15
+ AppChannel.SeaIOS,
16
+ AppChannel.WxMini,
17
+ AppChannel.VivoMini,
18
+ AppChannel.OppoMini,
19
+ AppChannel.DouyinAndroid,
20
+ AppChannel.DouyinIOS,
21
+ };
22
+
23
+ private static bool IsLocked(PublishSetting setting)
24
+ {
25
+ return _LockChannel.Contains(setting.Channel);
26
+ }
27
+
28
+ //获取logo
29
+ public Texture GetLogo(AppChannel channel)
30
+ {
31
+ switch (channel)
32
+ {
33
+ case AppChannel.Test:
34
+ case AppChannel.ChinaAndroid:
35
+ return EditorIcons.icon_android;
36
+ case AppChannel.GooglePlay:
37
+ return EditorIcons.icon_googleplay;
38
+ case AppChannel.ChinaIOS:
39
+ case AppChannel.SeaIOS:
40
+ return EditorIcons.icon_ios;
41
+ case AppChannel.DouyinAndroid:
42
+ case AppChannel.DouyinIOS:
43
+ return EditorIcons.icon_douyin;
44
+ case AppChannel.WxMini:
45
+ return EditorIcons.icon_wechat;
46
+ case AppChannel.VivoMini:
47
+ return EditorIcons.icon_vivo;
48
+ case AppChannel.OppoMini:
49
+ return EditorIcons.icon_oppo;
50
+ default:
51
+ return null;
52
+ }
53
+
54
+ return null;
55
+ }
56
+
57
+ public const float LEFT_MENU_WITH = 238;
58
+ public const float MENU_ITEM_HEIGHT = 32;
59
+ public HashSet<PublishSetting> PublishSettings = new HashSet<PublishSetting>();
60
+ public string InputTxtSearchSetting = "";
61
+ private PublishSetting _select = null;
62
+ private Vector2 _scrollMenu;
63
+ private Vector2 _scrollContent;
64
+
65
+ [MenuItem("TyphoonSDK/发布", priority = 20000)]
66
+ public static void Open()
67
+ {
68
+ var win = GetWindow<PublishWindow>();
69
+ win.minSize = new Vector2(800, 500);
70
+ win.titleContent = new GUIContent("发布");
71
+ win.Show();
72
+ }
73
+
74
+ private void OnEnable()
75
+ {
76
+ ReloadSettings();
77
+ }
78
+
79
+ protected override void OnDrawGUI()
80
+ {
81
+ base.OnDrawGUI();
82
+ var temEnable = GUI.enabled;
83
+ if (EditorApplication.isPlaying)
84
+ {
85
+ GUI.enabled = false;
86
+ }
87
+
88
+ //左侧,选择渠道设置
89
+ var rect = new Rect(0, 0, position.width, position.height);
90
+ if (EditorApplication.isCompiling)
91
+ {
92
+ GUI.TextArea(rect, "编译中,请稍等...\n\r", Styles.rbold_label);
93
+ }
94
+ else
95
+ {
96
+ DrawLeftMenuGUI();
97
+ DrawContentGUI();
98
+ DrawBottomBarGUI();
99
+ }
100
+
101
+ Repaint();
102
+ GUI.enabled = temEnable;
103
+ }
104
+
105
+ /*绘制菜单栏*/
106
+ public void DrawLeftMenuGUI()
107
+ {
108
+ var rect = new Rect(0, 0, position.width, position.height);
109
+ var rectLeftMenu = rect;
110
+ rectLeftMenu.width = LEFT_MENU_WITH;
111
+ var rectLine = rectLeftMenu;
112
+ rectLine.width = 2;
113
+ rectLine.x = rectLeftMenu.xMax;
114
+ EditorGUI.DrawRect(rectLine, new Color(0.16f, 0.16f, 0.16f));
115
+ var center = rectLeftMenu.center;
116
+ rectLeftMenu.width -= 8;
117
+ rectLeftMenu.height -= 8;
118
+ rectLeftMenu.center = center;
119
+ var rectToolbar = rectLeftMenu;
120
+ rectToolbar.height = 22;
121
+ GUILayout.BeginArea(rectToolbar);
122
+ GUILayout.BeginHorizontal();
123
+ GUILayout.Label("发布配置", Styles.ToolbarBoldLabel);
124
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_import, "导入常用配置"), Styles.toolbarbuttonRight,
125
+ GUILayout.Width(40)))
126
+ {
127
+ UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting);
128
+ }
129
+
130
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_refresh, "刷新"), Styles.toolbarbuttonRight,
131
+ GUILayout.Width(40)))
132
+ {
133
+ ReloadSettings();
134
+ Repaint();
135
+ }
136
+
137
+
138
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_extension, "更多"), Styles.toolbarbuttonRight,
139
+ GUILayout.Width(40)))
140
+ {
141
+ var menu = new GenericMenu();
142
+ menu.AddItem(new GUIContent("导入常用配置"), false,
143
+ () => { UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting); });
144
+ menu.ShowAsContext();
145
+ }
146
+
147
+ GUILayout.EndHorizontal();
148
+ GUILayout.EndArea();
149
+ var rectSearch = rectLeftMenu;
150
+ rectSearch.y = rectToolbar.yMax;
151
+ rectSearch.height = 22;
152
+ InputTxtSearchSetting = GUI.TextField(rectSearch, InputTxtSearchSetting, Styles.SearchTextField);
153
+
154
+ /*绘制菜单栏*/
155
+ var rectPos = rectLeftMenu;
156
+ rectPos.y = rectSearch.yMax;
157
+ rectPos.height = rectLeftMenu.yMax - rectPos.y;
158
+ GUILayout.BeginArea(rectPos);
159
+ rectPos.x = 0;
160
+ rectPos.y = 0;
161
+ var rectView = rectPos;
162
+ rectView.height = MENU_ITEM_HEIGHT * PublishSettings.Count;
163
+ rectView.height += 50;
164
+ _scrollMenu = GUI.BeginScrollView(rectPos, _scrollMenu, rectView, GUIStyle.none, GUIStyle.none);
165
+ var index = 0;
166
+ var searchLow = !string.IsNullOrEmpty(InputTxtSearchSetting) ? InputTxtSearchSetting.ToLower() : "";
167
+ foreach (var setting in PublishSettings)
168
+ {
169
+ if (!string.IsNullOrEmpty(searchLow))
170
+ {
171
+ if (!setting.name.ToLower().Contains(searchLow))
172
+ {
173
+ continue;
174
+ }
175
+ }
176
+
177
+ var rectItem = rectView;
178
+ rectItem.y = index * MENU_ITEM_HEIGHT;
179
+ rectItem.height = MENU_ITEM_HEIGHT - 2;
180
+ if (setting != null)
181
+ {
182
+ var style = _select == setting ? Styles.rbutton_left_active : Styles.rbutton_left;
183
+
184
+ if (Event.current.type == EventType.MouseDown && rectItem.Contains(Event.current.mousePosition))
185
+ {
186
+ if (Event.current.clickCount >= 2)
187
+ {
188
+ EditorApplication.ExecuteMenuItem("Window/General/Project");
189
+ EditorGUIUtility.PingObject(setting);
190
+ }
191
+ }
192
+
193
+ if (GUI.Button(rectItem, new GUIContent(setting.name, GetLogo(setting.Channel)), style))
194
+ {
195
+ _select = setting;
196
+ }
197
+ }
198
+
199
+ index += 1;
200
+ }
201
+
202
+ GUI.EndScrollView();
203
+ if (PublishSettings.Count <= 0)
204
+ {
205
+ var rectImport = rectPos;
206
+ rectImport.height = MENU_ITEM_HEIGHT;
207
+ if (GUI.Button(rectImport, new GUIContent("导入常用配置", EditorIcons.icon_import), Styles.rbutton_left))
208
+ {
209
+ UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting);
210
+ }
211
+ }
212
+
213
+ GUILayout.EndArea();
214
+ }
215
+
216
+ /*绘制内容栏*/
217
+ public void DrawContentGUI()
218
+ {
219
+ var rect = position;
220
+ rect.x = 0;
221
+ rect.y = 0;
222
+ rect.width -= LEFT_MENU_WITH;
223
+ rect.width -= 2;
224
+ rect.x = LEFT_MENU_WITH + 2;
225
+ rect.height -= 46;
226
+ var rectContent = rect;
227
+ rectContent.height -= 8;
228
+ rectContent.width -= 8;
229
+ rectContent.center = rect.center;
230
+ if (_select == null)
231
+ {
232
+ GUI.TextArea(rectContent, "请选择配置...\n\r初次使用,可从左侧菜单栏中导入常用配置", Styles.rbold_label);
233
+ }
234
+ else
235
+ {
236
+ var rectTitle = rectContent;
237
+ rectTitle.height = 32;
238
+ EditorGUI.DrawRect(rectTitle, new Color(0.17f, 0.17f, 0.17f, 1f));
239
+ GUI.Label(rectTitle, $"{_select.name}", Styles.ToolbarTitleLab);
240
+ var rectSave = rectTitle;
241
+ rectSave.width = 60;
242
+ rectSave.x = rectTitle.xMax - rectSave.width;
243
+ var center = rectSave.center;
244
+ rectSave.width -= 8;
245
+ rectSave.height -= 8;
246
+ rectSave.center = center;
247
+ if (GUI.Button(rectSave, EditorIcons.icon_save))
248
+ {
249
+ EditorUtility.SetDirty(_select);
250
+ AssetDatabase.SaveAssets();
251
+ }
252
+
253
+
254
+ var rectView = rectTitle;
255
+ rectView.y = rectTitle.yMax;
256
+ rectView.height = rectContent.yMax - rectView.y;
257
+ //TODO//绘制配置详情
258
+ PublishSettingGUIDrawer.Draw(rectView, _select, ref _scrollContent);
259
+ }
260
+ }
261
+
262
+ /*绘制底部菜单*/
263
+ public void DrawBottomBarGUI()
264
+ {
265
+ if (_select != null)
266
+ {
267
+ var isLocked = IsLocked(_select);
268
+ var temEnable = GUI.enabled;
269
+ GUI.enabled = !isLocked;
270
+ var rect = new Rect(0, 0, position.width, position.height);
271
+ var rectBar = rect;
272
+ rectBar.height = 46;
273
+ rectBar.width = rect.width - LEFT_MENU_WITH - 2;
274
+ rectBar.x = LEFT_MENU_WITH + 2;
275
+ rectBar.y = rect.yMax - rectBar.height;
276
+ var rectArea = rectBar;
277
+ rectArea.height -= 8;
278
+ rectArea.width -= 8;
279
+ rectArea.center = rectBar.center;
280
+ GUILayout.BeginArea(rectArea);
281
+ rectArea.x = 0;
282
+ rectArea.y = 0;
283
+ var rectBtn = rectArea;
284
+ rectBtn.width = 128;
285
+ rectBtn.x = rectArea.xMax - rectBtn.width;
286
+ var rectBtnPublish = rectArea;
287
+ rectBtnPublish.width = 128;
288
+ rectBtnPublish.x = rectArea.xMax - rectBtnPublish.width;
289
+ bool clickPublish = GUI.Button(rectBtnPublish, "发布", Styles.rbutton_green);
290
+
291
+ var rectNextBtn = rectBtnPublish;
292
+ rectNextBtn.x -= 2;
293
+ rectNextBtn.x -= rectNextBtn.width;
294
+ bool clickBuildAA = false;
295
+ var index = 0;
296
+ if (UniEditor.HasAddressableSupport())
297
+ {
298
+ clickBuildAA = GUI.Button(rectNextBtn, "构建AA", Styles.rbutton_yellow);
299
+ rectNextBtn.x -= 2;
300
+ rectNextBtn.x -= rectNextBtn.width;
301
+ }
302
+
303
+ bool clickApply = GUI.Button(rectNextBtn, "应用", Styles.rbutton_blue);
304
+ GUILayout.EndArea();
305
+ var rectBarLine = rectBar;
306
+ rectBarLine.height = 2;
307
+ EditorGUI.DrawRect(rectBar, Color.black * 0.2f);
308
+
309
+ if (clickApply)
310
+ {
311
+ UniEditor.LogInfo($"应用...{_select}");
312
+ _select.Apply();
313
+ UniEditor.LogInfo($"应用完毕");
314
+ }
315
+
316
+ if (clickBuildAA)
317
+ {
318
+ UniEditor.LogInfo("构建AA...");
319
+ AddressableSupport.BuildAASource(_select);
320
+ UniEditor.LogInfo("构建AA结束");
321
+ }
322
+
323
+ if (clickPublish)
324
+ {
325
+ UniEditor.LogInfo("//TODO//点击了发布");
326
+ _select.Publish();
327
+ }
328
+
329
+ GUI.enabled = temEnable;
330
+ if (isLocked)
331
+ {
332
+ var temColor = GUI.color;
333
+ GUI.color = Color.red;
334
+ GUI.Label(rectBar, "未开放", Styles.ToolbarTitleLab);
335
+ GUI.color = temColor;
336
+ }
337
+ }
338
+ }
339
+
340
+ public void OnFocus()
341
+ {
342
+ //更新渠道选择
343
+ ReloadSettings();
344
+ }
345
+
346
+ public void ReloadSettings()
347
+ {
348
+ PublishSettings.Clear();
349
+ var hash = new HashSet<PublishSetting>();
350
+ var guids = AssetDatabase.FindAssets($"t:{typeof(PublishSetting).FullName}", new[] { "Assets" });
351
+ foreach (var guid in guids)
352
+ {
353
+ var path = AssetDatabase.GUIDToAssetPath(guid);
354
+ var asset = AssetDatabase.LoadAssetAtPath<PublishSetting>(path);
355
+ if (asset != null)
356
+ {
357
+ hash.Add(asset);
358
+ }
359
+ }
360
+
361
+ PublishSettings = hash;
362
+ }
363
+ }
364
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 7acf6729f6092d54abd34a23a011fd17
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
Binary file
@@ -0,0 +1,21 @@
1
+ fileFormatVersion: 2
2
+ guid: cc71c8df38c4cbc488bf89567ae58dc9
3
+ TrueTypeFontImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 4
6
+ fontSize: 16
7
+ forceTextureCase: -2
8
+ characterSpacing: 0
9
+ characterPadding: 1
10
+ includeFontData: 1
11
+ fontNames:
12
+ - ZiZhiQuXiMaiTi
13
+ fallbackFontReferences: []
14
+ customCharacters:
15
+ fontRenderingMode: 0
16
+ ascentCalculationMode: 1
17
+ useLegacyBoundsCalculation: 0
18
+ shouldRoundAdvanceValue: 1
19
+ userData:
20
+ assetBundleName:
21
+ assetBundleVariant:
@@ -0,0 +1,20 @@
1
+ using UnityEditor;
2
+ using UnityEngine;
3
+
4
+ namespace TyphoonUnitySDK
5
+ {
6
+ [CustomEditor(typeof(SdkTestInUnity))]
7
+ public class SdkTestInUnityEditor : Editor
8
+ {
9
+ public override void OnInspectorGUI()
10
+ {
11
+ base.OnInspectorGUI();
12
+ GUILayout.Space(10);
13
+ if (GUILayout.Button("保存", GUILayout.Height(30)))
14
+ {
15
+ EditorUtility.SetDirty(target);
16
+ AssetDatabase.SaveAssets();
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1b5b262b37b501c4e8eb81e6a098aa8f
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,37 @@
1
+ using UnityEditor;
2
+ using UnityEngine;
3
+
4
+ namespace TyphoonUnitySDK
5
+ {
6
+ public class SdkTestInUnityWindow : EditorWindow
7
+ {
8
+ private Editor _editor = null;
9
+
10
+ public Editor EditorInstance
11
+ {
12
+ get
13
+ {
14
+ if (_editor == null || _editor.target != SdkTestInUnity.Instance)
15
+ {
16
+ DestroyImmediate(_editor);
17
+ }
18
+
19
+ _editor = Editor.CreateEditor(SdkTestInUnity.Instance, typeof(SdkTestInUnityEditor));
20
+ return _editor;
21
+ }
22
+ }
23
+
24
+ private void OnGUI()
25
+ {
26
+ EditorInstance.OnInspectorGUI();
27
+ }
28
+
29
+ [MenuItem("TyphoonSDK/模拟测试", priority = 10)]
30
+ public static void Open()
31
+ {
32
+ var win = GetWindow<SdkTestInUnityWindow>();
33
+ win.titleContent = new GUIContent("SDK 模拟测试 (unity)");
34
+ win.Show();
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: e75c66fc13ff9d441af874c7fc647d6a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: