com.typhoon.unitysdk 1.0.84 → 1.0.86

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,20 @@
1
1
  # 更新日志
2
+ ## [1.0.86] - 2024-01-07
3
+
4
+ ### 新增
5
+ * 抖音快捷发布拓展按钮
6
+
7
+
8
+ ## [1.0.85] - 2024-01-06
9
+
10
+ ### 新增
11
+ * 发布窗口中抖音发布上线包快捷按钮
12
+ * 发布窗口跳抖音发布自定获取最新的APK和IOS包
13
+
14
+
2
15
  ## [1.0.84] - 2024-01-05
3
16
 
4
- ### 修复
17
+ ### 修复
5
18
  * 微信小游戏android进不去游戏问题
6
19
 
7
20
 
@@ -98,6 +98,7 @@ namespace TyphoonUnitySDK
98
98
  public class DouyinConfig : ScriptableObject
99
99
  {
100
100
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/DouyinConfig.asset";
101
+ public static string INIPath = ".typhoon/unitysdk/douyin.ini";
101
102
 
102
103
  private static DouyinConfig _instance = null;
103
104
 
@@ -8,100 +8,151 @@ namespace TyphoonUnitySDK
8
8
  private static string _folderPath = null;
9
9
  private static string FolderPath => _folderPath ?? $"{UniEditor.PathRoot}/Editor/Texture";
10
10
  private static Texture __dark_active = null;
11
+
11
12
  public static Texture dark_active =>
12
13
  __dark_active
13
14
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/dark_active.png");
15
+
14
16
  private static Texture __dark_hover = null;
17
+
15
18
  public static Texture dark_hover =>
16
19
  __dark_hover ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/dark_hover.png");
20
+
17
21
  private static Texture __dark_normal = null;
22
+
18
23
  public static Texture dark_normal =>
19
24
  __dark_normal
20
25
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/dark_normal.png");
26
+
21
27
  private static Texture __icon_android = null;
28
+
22
29
  public static Texture icon_android =>
23
30
  __icon_android
24
31
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_android.png");
32
+
25
33
  private static Texture __icon_arrow_right = null;
34
+
26
35
  public static Texture icon_arrow_right =>
27
36
  __icon_arrow_right
28
37
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_arrow_right.png");
38
+
29
39
  private static Texture __icon_douyin = null;
40
+
30
41
  public static Texture icon_douyin =>
31
42
  __icon_douyin
32
43
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_douyin.png");
44
+
33
45
  private static Texture __icon_download = null;
46
+
34
47
  public static Texture icon_download =>
35
48
  __icon_download
36
49
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_download.png");
50
+
37
51
  private static Texture __icon_drop_arrow = null;
52
+
38
53
  public static Texture icon_drop_arrow =>
39
54
  __icon_drop_arrow
40
55
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_drop_arrow.png");
56
+
41
57
  private static Texture __icon_error = null;
58
+
42
59
  public static Texture icon_error =>
43
60
  __icon_error ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_error.png");
61
+
44
62
  private static Texture __icon_extension = null;
63
+
45
64
  public static Texture icon_extension =>
46
65
  __icon_extension
47
66
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_extension.png");
67
+
48
68
  private static Texture __icon_googleplay = null;
69
+
49
70
  public static Texture icon_googleplay =>
50
71
  __icon_googleplay
51
72
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_googleplay.png");
73
+
52
74
  private static Texture __icon_html5 = null;
75
+
53
76
  public static Texture icon_html5 =>
54
77
  __icon_html5 ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_html5.png");
78
+
55
79
  private static Texture __icon_import = null;
80
+
56
81
  public static Texture icon_import =>
57
82
  __icon_import
58
83
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_import.png");
84
+
59
85
  private static Texture __icon_ios = null;
86
+
60
87
  public static Texture icon_ios =>
61
88
  __icon_ios ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_ios.png");
89
+
62
90
  private static Texture __icon_oppo = null;
91
+
63
92
  public static Texture icon_oppo =>
64
93
  __icon_oppo ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_oppo.png");
94
+
65
95
  private static Texture __icon_refresh = null;
96
+
66
97
  public static Texture icon_refresh =>
67
98
  __icon_refresh
68
99
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_refresh.png");
100
+
69
101
  private static Texture __icon_save = null;
102
+
70
103
  public static Texture icon_save =>
71
104
  __icon_save ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_save.png");
105
+
72
106
  private static Texture __icon_search = null;
107
+
73
108
  public static Texture icon_search =>
74
109
  __icon_search
75
110
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_search.png");
111
+
76
112
  private static Texture __icon_success = null;
113
+
77
114
  public static Texture icon_success =>
78
115
  __icon_success
79
116
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_success.png");
117
+
80
118
  private static Texture __icon_variable = null;
119
+
81
120
  public static Texture icon_variable =>
82
121
  __icon_variable
83
122
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_variable.png");
123
+
84
124
  private static Texture __icon_vivo = null;
125
+
85
126
  public static Texture icon_vivo =>
86
127
  __icon_vivo ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_vivo.png");
128
+
87
129
  private static Texture __icon_wechat = null;
130
+
88
131
  public static Texture icon_wechat =>
89
132
  __icon_wechat
90
133
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_wechat.png");
134
+
91
135
  private static Texture __light_active = null;
136
+
92
137
  public static Texture light_active =>
93
138
  __light_active
94
139
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/light_active.png");
140
+
95
141
  private static Texture __light_hover = null;
142
+
96
143
  public static Texture light_hover =>
97
144
  __light_hover
98
145
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/light_hover.png");
146
+
99
147
  private static Texture __light_normal = null;
148
+
100
149
  public static Texture light_normal =>
101
150
  __light_normal
102
151
  ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/light_normal.png");
152
+
103
153
  private static Texture __tex_select = null;
154
+
104
155
  public static Texture tex_select =>
105
156
  __tex_select ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/tex_select.png");
106
157
  }
107
- }
158
+ }
@@ -0,0 +1,12 @@
1
+ using UnityEngine;
2
+
3
+ namespace TyphoonUnitySDK
4
+ {
5
+ /// <summary>
6
+ /// 拓展发布窗口底部GUI
7
+ /// </summary>
8
+ public abstract class ExtensionPublishWindowBottomGUI
9
+ {
10
+ public abstract void OnDrawGUI(PublishSetting setting, Rect rect);
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 485e45a044d11b342bbe80e00634cd9d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -20,7 +20,7 @@ namespace TyphoonUnitySDK
20
20
  {
21
21
  if (_styleTooltip == null)
22
22
  {
23
- _styleTooltip = new GUIStyle(Styles.rlabel_italic);
23
+ _styleTooltip = new GUIStyle(Styles.ItalicLabel);
24
24
  _styleTooltip.normal.textColor = new Color(0.47f, 0.8f, 1f, 1f);
25
25
  }
26
26
 
@@ -37,7 +37,7 @@ namespace TyphoonUnitySDK
37
37
  {
38
38
  if (_styleTooltipRight == null)
39
39
  {
40
- _styleTooltipRight = new GUIStyle(Styles.rlabel_italic);
40
+ _styleTooltipRight = new GUIStyle(Styles.ItalicLabel);
41
41
  _styleTooltipRight.normal.textColor = new Color(0.47f, 0.8f, 1f, 1f);
42
42
  _styleTooltipRight.alignment = TextAnchor.MiddleRight;
43
43
  }
@@ -55,7 +55,7 @@ namespace TyphoonUnitySDK
55
55
  {
56
56
  if (_linkstyle == null)
57
57
  {
58
- _linkstyle = new GUIStyle(Styles.rlabel_italic);
58
+ _linkstyle = new GUIStyle(Styles.ItalicLabel);
59
59
  _linkstyle.normal.textColor = EditorGUIUtility.isProSkin
60
60
  ? new Color(0.71f, 0.27f, 0.91f, 1f)
61
61
  : new Color(0.39f, 0.15f, 0.51f, 1f);
@@ -98,7 +98,7 @@ namespace TyphoonUnitySDK
98
98
  {
99
99
  var click = GUILayout.Button(
100
100
  new GUIContent($"{content}", foldout ? EditorIcons.icon_drop_arrow : EditorIcons.icon_arrow_right),
101
- Styles.rbutton_left, option);
101
+ Styles.TitleFoldoutButton, option);
102
102
  if (click)
103
103
  {
104
104
  return !foldout;
@@ -124,7 +124,7 @@ namespace TyphoonUnitySDK
124
124
  {
125
125
  if (History.Count <= 0)
126
126
  {
127
- GUILayout.Label("读取失败,请检查更新后再重试", Styles.rbold_title);
127
+ GUILayout.Label("读取失败,请检查更新后再重试", Styles.BoldTitle);
128
128
  }
129
129
  else
130
130
  {
@@ -230,7 +230,7 @@ namespace TyphoonUnitySDK
230
230
  GUILayout.BeginArea(draw);
231
231
  if (_select == null)
232
232
  {
233
- GUILayout.Label("请从左侧选择配置", Styles.rbold_label);
233
+ GUILayout.Label("请从左侧选择配置", Styles.BoldLabel);
234
234
  }
235
235
  else
236
236
  {
@@ -240,10 +240,10 @@ namespace TyphoonUnitySDK
240
240
  title += $" [重大修复版本]";
241
241
  }
242
242
 
243
- GUILayout.Label(title, Styles.rbold_title, GUILayout.Height(24));
244
- GUILayout.Label($"发布时间: {_select.GetPublishTimeString()}", Styles.rlabel_italic);
243
+ GUILayout.Label(title, Styles.BoldTitle, GUILayout.Height(24));
244
+ GUILayout.Label($"发布时间: {_select.GetPublishTimeString()}", Styles.ItalicLabel);
245
245
  GUILayout.Space(5);
246
- GUILayout.Label("版本更新日志:", Styles.rbold_label);
246
+ GUILayout.Label("版本更新日志:", Styles.BoldLabel);
247
247
  if (string.IsNullOrWhiteSpace(_select.VersionChangeLog))
248
248
  {
249
249
  GUILayout.Label("无");
@@ -289,7 +289,7 @@ namespace TyphoonUnitySDK
289
289
  var used = CurrentVersion.Version == _select.Version;
290
290
  GUI.enabled = !used;
291
291
  var txt = used ? "使用中" : $"安装";
292
- if (GUI.Button(draw, txt, Styles.rbutton_bold))
292
+ if (GUI.Button(draw, txt, Styles.BoldButton))
293
293
  {
294
294
  UniEditor.UpdateInstallVersion(_select);
295
295
  }
package/Editor/INI.cs ADDED
@@ -0,0 +1,41 @@
1
+ namespace TyphoonUnitySDK
2
+ {
3
+ public static class INI
4
+ {
5
+ private static INIConfig _config;
6
+
7
+ private static INIConfig Config
8
+ {
9
+ get
10
+ {
11
+ if (_config == null)
12
+ {
13
+ _config = new INIConfig(".typhoon/unitysdk/user.ini");
14
+ }
15
+
16
+ return _config;
17
+ }
18
+ }
19
+
20
+ //抖音APK发布文件路径
21
+ public static string DouyinApkFilePath
22
+ {
23
+ get => Config.GetString("DouyinApkFilePath");
24
+ set { Config.Set("DouyinApkFilePath", value); }
25
+ }
26
+
27
+ //抖音IOS发布文件路径
28
+ public static string DouyinIOSFilePath
29
+ {
30
+ get => Config.GetString("DouyinIOSFilePath");
31
+ set { Config.Set("DouyinIOSFilePath", value); }
32
+ }
33
+
34
+ //应用设置名
35
+ public static string ApplySettingName
36
+ {
37
+ get => Config.GetString("ApplySettingName");
38
+ set { Config.Set("ApplySettingName", value); }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 41e2f58238e416549b15a3be557cf8e7
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,145 @@
1
+ using System;
2
+ using System.IO;
3
+ using System.Linq;
4
+ using System.Text;
5
+ using UnityEditor;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ /// <summary>
10
+ /// ini配置
11
+ /// </summary>
12
+ public class INIConfig
13
+ {
14
+ private string _filePath;
15
+
16
+ public INIConfig(string filePath)
17
+ {
18
+ _filePath = filePath;
19
+ }
20
+
21
+ private void Set<T>(string key, T value, Func<T, string> func)
22
+ {
23
+ CreateFileIfNotExists();
24
+ var lines = File.ReadAllLines(_filePath).ToList();
25
+ var items = lines.Where(e => !string.IsNullOrWhiteSpace(e) && e.Contains("=")).Select(e =>
26
+ {
27
+ var elements = e.Split('=');
28
+ var key = elements[0];
29
+ var value = "";
30
+ if (elements.Length > 1)
31
+ {
32
+ value = elements[1];
33
+ }
34
+
35
+ return new { key, value };
36
+ }).ToList();
37
+ var match = items.LastOrDefault(e => e.key == key);
38
+ if (match == null)
39
+ {
40
+ //新增条目
41
+ lines.Add($"{key}={func(value)}");
42
+ }
43
+ else
44
+ {
45
+ //找到匹配项
46
+ var index = items.IndexOf(match);
47
+ var item = items[index];
48
+ var str = func(value);
49
+ items[index] = new { key = item.key, value = str };
50
+ }
51
+
52
+ var sb = new StringBuilder();
53
+ foreach (var item in items)
54
+ {
55
+ sb.AppendLine($"{item.key}={item.value}");
56
+ }
57
+
58
+ File.WriteAllText(_filePath, sb.ToString());
59
+ }
60
+
61
+ public void Set(string key, int value)
62
+ {
63
+ Set(key, value, e => e.ToString());
64
+ }
65
+
66
+ public void Set(string key, float value)
67
+ {
68
+ Set(key, value, e => e.ToString());
69
+ }
70
+
71
+ public void Set(string key, string value)
72
+ {
73
+ Set(key, value, e => e.ToString());
74
+ }
75
+
76
+ private string Get(string key)
77
+ {
78
+ CreateFileIfNotExists();
79
+ var lines = File.ReadAllLines(_filePath).ToList();
80
+ var items = lines.Where(e => !string.IsNullOrWhiteSpace(e) && e.Contains("=")).Select(e =>
81
+ {
82
+ var elements = e.Split('=');
83
+ var key = elements[0];
84
+ var value = "";
85
+ if (elements.Length > 1)
86
+ {
87
+ value = elements[1];
88
+ }
89
+
90
+ return new { key, value };
91
+ }).ToList();
92
+ var last = items.LastOrDefault(e => e.key == key);
93
+ if (last == null)
94
+ {
95
+ return "";
96
+ }
97
+
98
+ return last.value;
99
+ }
100
+
101
+
102
+ private void CreateFileIfNotExists()
103
+ {
104
+ var dir = Path.GetDirectoryName(_filePath);
105
+ if (!Directory.Exists(dir))
106
+ {
107
+ Directory.CreateDirectory(dir);
108
+ AssetDatabase.Refresh();
109
+ }
110
+
111
+ if (!File.Exists(_filePath))
112
+ {
113
+ File.WriteAllText(_filePath, "");
114
+ }
115
+ }
116
+
117
+
118
+ public int GetInt(string key, int defaultVal)
119
+ {
120
+ var val = Get(key);
121
+ if (int.TryParse(val, out var match))
122
+ {
123
+ return match;
124
+ }
125
+
126
+ return defaultVal;
127
+ }
128
+
129
+ public float GetFloat(string key, float defaultVal = 0f)
130
+ {
131
+ var val = Get(key);
132
+ if (float.TryParse(val, out var match))
133
+ {
134
+ return match;
135
+ }
136
+
137
+ return defaultVal;
138
+ }
139
+
140
+ public string GetString(string key, string defaultVal = "")
141
+ {
142
+ return Get(key);
143
+ }
144
+ }
145
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a44bc22091f61894fa17a4712741a211
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -64,7 +64,7 @@ namespace TyphoonUnitySDK
64
64
  private static bool DrawProperty_EnableTrack(OppoMiniConfig arg)
65
65
  {
66
66
  GUILayout.Space(10);
67
- GUILayout.Label("事件上报", Styles.rbold_title);
67
+ GUILayout.Label("事件上报", Styles.BoldTitle);
68
68
  GUILayout.BeginHorizontal();
69
69
  GUILayout.Label("开启事件上报", GUILayout.Width(146));
70
70
  GUIDrawer.DrawPopUpToggle(arg.EnableTrack, (v) => arg.EnableTrack = v);
@@ -96,7 +96,7 @@ namespace TyphoonUnitySDK
96
96
  private static bool DrawProperty_PrivacyPolicy(OppoMiniConfig arg)
97
97
  {
98
98
  GUILayout.Space(10);
99
- GUILayout.Label("隐私政策", Styles.rbold_title);
99
+ GUILayout.Label("隐私政策", Styles.BoldTitle);
100
100
  arg.PrivacyPolicyImage =
101
101
  (Texture)EditorGUILayout.ObjectField("文案长图", arg.PrivacyPolicyImage, typeof(Texture), false);
102
102
  GUIDrawer.DrawKeynotes("文本转长图在线转换工具:(点击链接跳转)");
@@ -253,7 +253,7 @@ namespace TyphoonUnitySDK
253
253
  private static bool DrawProperty_BannerEnable(OppoMiniConfig arg)
254
254
  {
255
255
  GUILayout.Space(10);
256
- GUILayout.Label("广告参数", Styles.rbold_title);
256
+ GUILayout.Label("广告参数", Styles.BoldTitle);
257
257
  GUILayout.BeginHorizontal();
258
258
  GUILayout.Label("Banner开关", GUILayout.Width(146));
259
259
  GUIDrawer.DrawPopUpToggle(arg.BannerEnable, (v) => arg.BannerEnable = v);
@@ -284,7 +284,7 @@ namespace TyphoonUnitySDK
284
284
  btnNewRect.height -= 4;
285
285
  btnNewRect.center = center;
286
286
  btnNewRect.x = last.xMax - btnNewRect.width - 2;
287
- if (GUI.Button(btnNewRect, "创建签名", Styles.rbutton_bold))
287
+ if (GUI.Button(btnNewRect, "创建签名", Styles.BoldButton))
288
288
  {
289
289
  //创建openssl 签名
290
290
  UniEditor.CreateOpensslKeystore();
@@ -297,7 +297,7 @@ namespace TyphoonUnitySDK
297
297
  {
298
298
  GUILayout.Space(10);
299
299
 
300
- GUILayout.Label("签名", Styles.rbold_title);
300
+ GUILayout.Label("签名", Styles.BoldTitle);
301
301
  GUILayout.BeginHorizontal();
302
302
  arg.PrivatePem = EditorGUILayout.TextField("private.pem", arg.PrivatePem);
303
303
  if (GUILayout.Button("选择", GUILayout.Width(60)))
@@ -324,7 +324,7 @@ namespace TyphoonUnitySDK
324
324
  rectBtn.y += 2;
325
325
  rectBtn.x = last.xMax - rectBtn.width;
326
326
  rectBtn.x -= 2;
327
- if (GUI.Button(rectBtn, "自动版本号", Styles.rbutton_bold))
327
+ if (GUI.Button(rectBtn, "自动版本号", Styles.BoldButton))
328
328
  {
329
329
  arg.VersionCode += 1;
330
330
  try
@@ -360,7 +360,7 @@ namespace TyphoonUnitySDK
360
360
  private static bool DrawProperty_VersionName(OppoMiniConfig arg)
361
361
  {
362
362
  GUILayout.Space(10);
363
- GUILayout.Label("版本信息", Styles.rbold_title);
363
+ GUILayout.Label("版本信息", Styles.BoldTitle);
364
364
  arg.VersionName = EditorGUILayout.TextField("版本名", arg.VersionName);
365
365
  return true;
366
366
  }
@@ -27,8 +27,8 @@ namespace TyphoonUnitySDK
27
27
  rectTitle.x += 4;
28
28
  rectTitle.width -= 8;
29
29
  rectTitle.height = 32;
30
- EditorGUI.DrawRect(rectTitle, Skins.PublishWindowTitleBgColor);
31
- GUI.Label(rectTitle, "选项", Styles.rbold_title);
30
+ EditorGUI.DrawRect(rectTitle, Styles.TitleBgColor);
31
+ GUI.Label(rectTitle, "选项", Styles.BoldTitle);
32
32
 
33
33
  var rectSave = rectTitle;
34
34
  rectSave.width = 90;
@@ -100,7 +100,7 @@ namespace TyphoonUnitySDK
100
100
  if (!UniEditor.GradleIsMatch())
101
101
  {
102
102
  GUILayout.BeginHorizontal();
103
- GUILayout.Label(new GUIContent("未配置gradle路径", EditorIcons.icon_error), Styles.rbold_label,
103
+ GUILayout.Label(new GUIContent("未配置gradle路径", EditorIcons.icon_error), Styles.BoldLabel,
104
104
  GUILayout.Height(22));
105
105
  if (GUILayout.Button("指引", GUILayout.Width(60)))
106
106
  {
@@ -113,7 +113,7 @@ namespace TyphoonUnitySDK
113
113
  }
114
114
  else
115
115
  {
116
- GUILayout.Label("gradle路径", Styles.rbold_label, GUILayout.Height(22));
116
+ GUILayout.Label("gradle路径", Styles.BoldLabel, GUILayout.Height(22));
117
117
  }
118
118
 
119
119
  GUILayout.BeginHorizontal();
@@ -393,7 +393,7 @@ namespace TyphoonUnitySDK
393
393
  }
394
394
 
395
395
  GUILayout.Space(10);
396
- GUILayout.Label("Addressable支持", Styles.rbold_label);
396
+ GUILayout.Label("Addressable支持", Styles.BoldLabel);
397
397
  setting.AASupportEnable = EditorGUILayout.Toggle("调整AA参数", setting.AASupportEnable);
398
398
  return true;
399
399
  }
@@ -633,7 +633,7 @@ namespace TyphoonUnitySDK
633
633
  private static bool DrawProperty_PresetModifyEnable(PublishSetting setting)
634
634
  {
635
635
  GUILayout.Space(10);
636
- GUILayout.Label("自定义变量", Styles.rbold_label);
636
+ GUILayout.Label("自定义变量", Styles.BoldLabel);
637
637
  setting.PresetModifyEnable = EditorGUILayout.Toggle("调整自定义变量", setting.PresetModifyEnable);
638
638
  return true;
639
639
  }
@@ -10,20 +10,18 @@ namespace TyphoonUnitySDK
10
10
 
11
11
  public override void OnInspectorGUI()
12
12
  {
13
- var temSkin = GUI.skin;
14
- GUI.skin = Skins.Skin;
15
13
  base.OnInspectorGUI();
16
- if (GUILayout.Button("应用", GUILayout.Height(32)))
14
+ if (GUILayout.Button("应用", Styles.BlueButton, GUILayout.Height(32)))
17
15
  {
18
16
  Target.Apply();
19
17
  }
20
18
 
21
- if (GUILayout.Button("发布", GUILayout.Height(32)))
19
+ if (GUILayout.Button("发布", Styles.BlueButton, GUILayout.Height(32)))
22
20
  {
23
21
  Target.Apply();
24
22
  }
25
23
 
26
- GUI.skin = temSkin;
24
+ Repaint();
27
25
  }
28
26
  }
29
27
  }
@@ -79,6 +79,29 @@ namespace TyphoonUnitySDK
79
79
  }
80
80
  }
81
81
 
82
+ //拓展底部GUI绘制
83
+ private List<ExtensionPublishWindowBottomGUI> _extensionBottomGUI = null;
84
+
85
+ private List<ExtensionPublishWindowBottomGUI> ExtensionBottomGUI
86
+ {
87
+ get
88
+ {
89
+ if (_extensionBottomGUI == null)
90
+ {
91
+ _extensionBottomGUI = new List<ExtensionPublishWindowBottomGUI>();
92
+ var child = UniEditor.GetSubClassTypes(typeof(ExtensionPublishWindowBottomGUI));
93
+ foreach (var type in child)
94
+ {
95
+ dynamic instance = Activator.CreateInstance(type);
96
+ _extensionBottomGUI.Add(instance);
97
+ }
98
+ }
99
+
100
+ return _extensionBottomGUI;
101
+ }
102
+ }
103
+
104
+
82
105
  [MenuItem("TyphoonSDK/发布", priority = 20000)]
83
106
  public static void Open()
84
107
  {
@@ -93,11 +116,12 @@ namespace TyphoonUnitySDK
93
116
  private void OnEnable()
94
117
  {
95
118
  ReloadSettings();
96
- if (UniEditor.TryGetApplyHistory(out var match))
119
+ var applyHistory = INI.ApplySettingName;
120
+ if (!string.IsNullOrEmpty(applyHistory))
97
121
  {
98
122
  foreach (var setting in PublishSettings)
99
123
  {
100
- if (setting.name == match)
124
+ if (setting.name == applyHistory)
101
125
  {
102
126
  _select = setting;
103
127
  break;
@@ -120,7 +144,7 @@ namespace TyphoonUnitySDK
120
144
  {
121
145
  var tipRect = rect;
122
146
  tipRect.height = 44;
123
- GUI.TextArea(tipRect, "编译中,请稍等...\n\r", Styles.rbold_title);
147
+ GUI.TextArea(tipRect, "编译中,请稍等...\n\r", Styles.BoldTitle);
124
148
  }
125
149
  else
126
150
  {
@@ -151,23 +175,23 @@ namespace TyphoonUnitySDK
151
175
  rectToolbar.height = 22;
152
176
  GUILayout.BeginArea(rectToolbar);
153
177
  GUILayout.BeginHorizontal();
154
- GUILayout.Label("发布配置", Styles.rbold_label, GUILayout.Width(70));
178
+ GUILayout.Label("发布配置", Styles.BoldLabel, GUILayout.Width(70));
155
179
  GUILayout.Space(1);
156
- if (GUILayout.Button(new GUIContent(EditorIcons.icon_import, "导入常用配置"), Styles.rbutton,
180
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_import, "导入常用配置"), Styles.Button,
157
181
  GUILayout.Width(40), GUILayout.Height(20)))
158
182
  {
159
183
  UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting);
160
184
  }
161
185
 
162
186
  GUILayout.Space(1);
163
- if (GUILayout.Button(new GUIContent(EditorIcons.icon_variable, "自定义变量"), Styles.rbutton,
187
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_variable, "自定义变量"), Styles.Button,
164
188
  GUILayout.Width(40), GUILayout.Height(20)))
165
189
  {
166
190
  VariablePresetWindow.Open();
167
191
  }
168
192
 
169
193
  GUILayout.Space(1);
170
- if (GUILayout.Button(new GUIContent(EditorIcons.icon_refresh, "刷新"), Styles.rbutton,
194
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_refresh, "刷新"), Styles.Button,
171
195
  GUILayout.Width(40), GUILayout.Height(20)))
172
196
  {
173
197
  ReloadSettings();
@@ -176,7 +200,7 @@ namespace TyphoonUnitySDK
176
200
 
177
201
  GUILayout.Space(1);
178
202
 
179
- if (GUILayout.Button(new GUIContent(EditorIcons.icon_extension, "更多"), Styles.rbutton,
203
+ if (GUILayout.Button(new GUIContent(EditorIcons.icon_extension, "更多"), Styles.Button,
180
204
  GUILayout.Width(40), GUILayout.Height(20)))
181
205
  {
182
206
  var menu = new GenericMenu();
@@ -193,7 +217,7 @@ namespace TyphoonUnitySDK
193
217
  InputTxtSearchSetting = GUI.TextField(rectSearch, InputTxtSearchSetting);
194
218
  if (string.IsNullOrEmpty(InputTxtSearchSetting))
195
219
  {
196
- GUI.Label(rectSearch, "搜索...", Styles.rlabel_italic);
220
+ GUI.Label(rectSearch, "搜索...", Styles.ItalicLabel);
197
221
  }
198
222
 
199
223
  /*绘制菜单栏*/
@@ -225,7 +249,7 @@ namespace TyphoonUnitySDK
225
249
  rectItem.height = MENU_ITEM_HEIGHT - 2;
226
250
  if (setting != null)
227
251
  {
228
- var style = _select == setting ? Styles.rbutton_left_active : Styles.rbutton_left;
252
+ var style = _select == setting ? Styles.MenuButtonActive : Styles.MenuButtonNormal;
229
253
 
230
254
  if (Event.current.type == EventType.MouseDown && rectItem.Contains(Event.current.mousePosition))
231
255
  {
@@ -243,8 +267,7 @@ namespace TyphoonUnitySDK
243
267
  //写入apply 历史
244
268
  if (change)
245
269
  {
246
- // Debug.Log("写入历史");
247
- UniEditor.WriteApplyHistory(setting);
270
+ INI.ApplySettingName = setting.name;
248
271
  }
249
272
  }
250
273
 
@@ -253,7 +276,7 @@ namespace TyphoonUnitySDK
253
276
  var lockRect = rectItem;
254
277
  lockRect.width = 60;
255
278
  lockRect.x = rectItem.xMax - lockRect.width;
256
- GUI.Label(lockRect, "未开放", Styles.rlabel_italic);
279
+ GUI.Label(lockRect, "未开放", Styles.ItalicLabel);
257
280
  }
258
281
  }
259
282
 
@@ -265,7 +288,7 @@ namespace TyphoonUnitySDK
265
288
  {
266
289
  var rectImport = rectPos;
267
290
  rectImport.height = MENU_ITEM_HEIGHT;
268
- if (GUI.Button(rectImport, new GUIContent("导入常用配置", EditorIcons.icon_import), Styles.rbutton))
291
+ if (GUI.Button(rectImport, new GUIContent("导入常用配置", EditorIcons.icon_import), Styles.Button))
269
292
  {
270
293
  UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting);
271
294
  }
@@ -324,7 +347,7 @@ namespace TyphoonUnitySDK
324
347
  draw.width -= 4;
325
348
  draw.height -= 4;
326
349
  draw.center = center;
327
- if (GUI.Button(draw, "检查更新", Styles.rbutton))
350
+ if (GUI.Button(draw, "检查更新", Styles.Button))
328
351
  {
329
352
  UniEditor.ManualCheckNewVersion();
330
353
  }
@@ -336,7 +359,7 @@ namespace TyphoonUnitySDK
336
359
  draw.width -= 4;
337
360
  draw.height -= 4;
338
361
  draw.center = center;
339
- if (GUI.Button(draw, "所有版本", Styles.rbutton))
362
+ if (GUI.Button(draw, "所有版本", Styles.Button))
340
363
  {
341
364
  if (CheckUpdateCacheData.Default.AllVersions.Count < 0)
342
365
  {
@@ -356,7 +379,7 @@ namespace TyphoonUnitySDK
356
379
  draw.width -= 4;
357
380
  draw.height -= 4;
358
381
  draw.center = center;
359
- if (GUI.Button(draw, "说明文档", Styles.rbutton))
382
+ if (GUI.Button(draw, "说明文档", Styles.Button))
360
383
  {
361
384
  //读取所有历史版本,弹出右键菜单
362
385
  UniEditor.OpenDoc();
@@ -393,14 +416,14 @@ namespace TyphoonUnitySDK
393
416
  {
394
417
  var tipRect = rectContent;
395
418
  tipRect.height = 44;
396
- GUI.TextArea(tipRect, "请选择配置...\n\r初次使用,可从左侧菜单栏中导入常用配置", Styles.rbold_title);
419
+ GUI.TextArea(tipRect, "请选择配置...\n\r初次使用,可从左侧菜单栏中导入常用配置", Styles.BoldTitle);
397
420
  }
398
421
  else
399
422
  {
400
423
  var rectTitle = rectContent;
401
424
  rectTitle.height = 32;
402
- EditorGUI.DrawRect(rectTitle, Skins.PublishWindowTitleBgColor);
403
- GUI.Label(rectTitle, $"{_select.name}", Styles.rbold_title);
425
+ EditorGUI.DrawRect(rectTitle, Styles.TitleBgColor);
426
+ GUI.Label(rectTitle, $"{_select.name}", Styles.BoldTitle);
404
427
  var rectSave = rectTitle;
405
428
  rectSave.width = 90;
406
429
  rectSave.x = rectTitle.xMax - rectSave.width;
@@ -451,7 +474,7 @@ namespace TyphoonUnitySDK
451
474
  var rectBtnPublish = rectArea;
452
475
  rectBtnPublish.width = 128;
453
476
  rectBtnPublish.x = rectArea.xMax - rectBtnPublish.width;
454
- bool clickPublish = GUI.Button(rectBtnPublish, "发布", Styles.rbutton_bold);
477
+ bool clickPublish = GUI.Button(rectBtnPublish, "发布", Styles.BoldButton);
455
478
 
456
479
  var rectNextBtn = rectBtnPublish;
457
480
  rectNextBtn.x -= 2;
@@ -459,12 +482,18 @@ namespace TyphoonUnitySDK
459
482
  bool clickBuildAA = false;
460
483
  if (UniEditor.HasAddressableSupport())
461
484
  {
462
- clickBuildAA = GUI.Button(rectNextBtn, "构建AA", Styles.rbutton_bold);
485
+ clickBuildAA = GUI.Button(rectNextBtn, "构建AA", Styles.BoldButton);
463
486
  rectNextBtn.x -= 2;
464
487
  rectNextBtn.x -= rectNextBtn.width;
465
488
  }
466
489
 
467
- bool clickApply = GUI.Button(rectNextBtn, "应用", Styles.rbutton_bold);
490
+ bool clickApply = GUI.Button(rectNextBtn, "应用", Styles.BoldButton);
491
+
492
+ foreach (var bottomGUI in ExtensionBottomGUI)
493
+ {
494
+ bottomGUI.OnDrawGUI(_select, rectArea);
495
+ }
496
+
468
497
  GUILayout.EndArea();
469
498
  var rectBarLine = rectBar;
470
499
  rectBarLine.height = 2;
package/Editor/Styles.cs CHANGED
@@ -1,41 +1,264 @@
1
- using System.Collections.Generic;
1
+ using System;
2
+ using UnityEditor;
2
3
  using UnityEngine;
3
4
 
4
5
  namespace TyphoonUnitySDK
5
6
  {
6
- public partial class Styles
7
+ //样式
8
+ public class Styles
7
9
  {
8
- public static Dictionary<string, GUIStyle> Data = new Dictionary<string, GUIStyle>();
10
+ public static Color TitleBgColor => EditorGUIUtility.isProSkin
11
+ ? new Color(0.17f, 0.17f, 0.17f, 1f)
12
+ : new Color(0.65f, 0.65f, 0.65f, 1f);
9
13
 
10
- public static GUIStyle Get(string name)
14
+ private static Color TextColor = EditorGUIUtility.isProSkin
15
+ ? new Color(0.93f, 0.93f, 0.93f, 1f)
16
+ : new Color(0.04f, 0.04f, 0.04f, 1f);
17
+
18
+ private static Color NormalColor = EditorGUIUtility.isProSkin
19
+ ? new Color(0.35f, 0.35f, 0.35f, 1f)
20
+ : new Color(0.88f, 0.88f, 0.88f, 1f);
21
+
22
+ private static Color HoverColor = EditorGUIUtility.isProSkin
23
+ ? new Color(0.4f, 0.4f, 0.4f, 1f)
24
+ : new Color(0.9f, 0.9f, 0.9f, 1f);
25
+
26
+ private static Color ActiveColor = EditorGUIUtility.isProSkin
27
+ ? new Color(0.21f, 0.21f, 0.21f, 1f)
28
+ : new Color(0.69f, 0.69f, 0.69f, 1f);
29
+
30
+ private static Color Blue = EditorGUIUtility.isProSkin
31
+ ? new Color(0.28f, 0.48f, 0.6f, 1f)
32
+ : new Color(0.47f, 0.8f, 1f, 1f);
33
+
34
+ private static GUIStyle _button = null;
35
+
36
+ public static GUIStyle Button => CreateStyle(ref _button, "button", (e) =>
11
37
  {
12
- if (Data.TryGetValue(name, out var match))
38
+ var normal = NormalColor;
39
+ var hover = HoverColor;
40
+ var active = ActiveColor;
41
+ e.margin = new RectOffset(0, 0, 0, 0);
42
+ e.border = new RectOffset(0, 0, 0, 0);
43
+ e.padding = new RectOffset(0, 0, 0, 0);
44
+ SetStyleStateColor(e, normal, hover, active);
45
+ e.normal.textColor = TextColor;
46
+ e.focused.textColor = TextColor;
47
+ e.hover.textColor = TextColor;
48
+ e.active.textColor = TextColor;
49
+ e.alignment = TextAnchor.MiddleCenter;
50
+ e.contentOffset = Vector2.zero;
51
+ e.fixedWidth = 0;
52
+ e.fixedHeight = 0;
53
+ e.stretchHeight = false;
54
+ e.stretchWidth = false;
55
+ });
56
+
57
+
58
+ private static GUIStyle _titleFoldoutButton = null;
59
+
60
+ public static GUIStyle TitleFoldoutButton =>
61
+ CreateStyle(ref _titleFoldoutButton, Button, (e) =>
13
62
  {
14
- return match;
15
- }
63
+ e.fontSize = 16;
64
+ e.padding = new RectOffset(2, 2, 2, 2);
65
+ e.alignment = TextAnchor.MiddleLeft;
66
+ e.stretchWidth = true;
67
+ });
68
+
69
+ private static GUIStyle _menuButtonNormal = null;
70
+
71
+ public static GUIStyle MenuButtonNormal =>
72
+ CreateStyle(ref _menuButtonNormal, Button, (e) =>
73
+ {
74
+ e.padding = new RectOffset(2, 2, 2, 2);
75
+ e.alignment = TextAnchor.MiddleLeft;
76
+ });
77
+
78
+
79
+ private static GUIStyle _menuButtonActive = null;
80
+
81
+ public static GUIStyle MenuButtonActive => CreateStyle(ref _menuButtonActive, "button", (e) =>
82
+ {
83
+ var normal = ActiveColor;
84
+ var hover = ActiveColor;
85
+ var active = ActiveColor;
86
+ e.margin = new RectOffset(0, 0, 0, 0);
87
+ e.border = new RectOffset(0, 0, 0, 0);
88
+ e.padding = new RectOffset(2, 2, 2, 2);
89
+ SetStyleStateColor(e, normal, hover, active);
90
+ e.normal.textColor = TextColor;
91
+ e.focused.textColor = TextColor;
92
+ e.hover.textColor = TextColor;
93
+ e.active.textColor = TextColor;
94
+ e.contentOffset = Vector2.zero;
95
+ e.fixedWidth = 0;
96
+ e.fixedHeight = 0;
97
+ e.stretchHeight = false;
98
+ e.stretchWidth = false;
99
+ e.alignment = TextAnchor.MiddleLeft;
100
+ e.fontSize = 14;
101
+ e.fontStyle = FontStyle.Bold;
102
+ });
103
+
104
+
105
+ private static GUIStyle _boldLabel = null;
106
+
107
+ public static GUIStyle BoldLabel =>
108
+ CreateStyle(ref _boldLabel, "label", (e) => { e.fontStyle = FontStyle.Bold; });
109
+
110
+ private static GUIStyle _boldButton = null;
111
+
112
+ public static GUIStyle BoldButton =>
113
+ CreateStyle(ref _boldButton, Button, (e) =>
114
+ {
115
+ e.fontSize = 16;
116
+ e.fontStyle = FontStyle.Bold;
117
+ });
118
+
119
+ private static GUIStyle _boldTitle = null;
120
+
121
+ public static GUIStyle BoldTitle => CreateStyle(ref _boldTitle, "label", (e) =>
122
+ {
123
+ e.fontSize = 14;
124
+ e.fontStyle = FontStyle.Bold;
125
+ e.alignment = TextAnchor.MiddleLeft;
126
+ });
127
+
128
+ public static GUIStyle _italicLabel = null;
16
129
 
17
- var styles = Skins.Skin.customStyles;
18
- foreach (var element in styles)
130
+ public static GUIStyle ItalicLabel => CreateStyle(ref _italicLabel, "label", (e) =>
131
+ {
132
+ e.fontStyle = FontStyle.Italic;
133
+ e.alignment = TextAnchor.MiddleLeft;
134
+ e.padding = new RectOffset(2, 0, 2, 0);
135
+ e.margin = new RectOffset(2, 2, 2, 2);
136
+ });
137
+
138
+
139
+ public static GUIStyle _blueButton = null;
140
+
141
+ public static GUIStyle BlueButton = CreateStyle(ref _blueButton, Button, (e) =>
142
+ {
143
+ var normal = Blue;
144
+ var hover = Blue * 1.1f;
145
+ var active = Blue * 0.9f;
146
+ e.margin = new RectOffset(2, 2, 2, 2);
147
+ e.border = new RectOffset(2, 2, 2, 2);
148
+ e.padding = new RectOffset(0, 0, 0, 0);
149
+ SetStyleStateOutlineColor(e, normal, hover, active, new Color(0.17f, 0.3f, 0.34f, 1f));
150
+ e.normal.textColor = TextColor;
151
+ e.focused.textColor = TextColor;
152
+ e.hover.textColor = TextColor;
153
+ e.active.textColor = TextColor;
154
+ e.alignment = TextAnchor.MiddleCenter;
155
+ e.contentOffset = Vector2.zero;
156
+ e.fixedWidth = 0;
157
+ e.fixedHeight = 0;
158
+ e.stretchHeight = false;
159
+ e.stretchWidth = true;
160
+ e.fontStyle = FontStyle.Bold;
161
+ });
162
+
163
+
164
+ private static GUIStyle CreateStyle(ref GUIStyle style, string proto, Action<GUIStyle> onCreate)
165
+ {
166
+ if (style == null)
19
167
  {
20
- Data.Add(element.name, element);
168
+ style = new GUIStyle(proto);
169
+ onCreate?.Invoke(style);
21
170
  }
22
171
 
23
- if (Data.TryGetValue(name, out var match2))
172
+ return style;
173
+ }
174
+
175
+ private static GUIStyle CreateStyle(ref GUIStyle style, GUIStyle proto, Action<GUIStyle> onCreate)
176
+ {
177
+ if (style == null)
24
178
  {
25
- return match2;
179
+ style = new GUIStyle(proto);
180
+ onCreate?.Invoke(style);
26
181
  }
27
182
 
28
- Debug.LogError($"找不到匹配Style:{name}");
29
- return null;
183
+ return style;
30
184
  }
31
185
 
32
- public static GUIStyle rbutton => Get("rbutton");
33
- public static GUIStyle rbutton_left => Get("rbutton_left");
34
- public static GUIStyle rbutton_left_active => Get("rbutton_left_active");
35
- public static GUIStyle rbold_label => Get("rbold_label");
36
- public static GUIStyle DropDownButton => Get("DropDownButton");
37
- public static GUIStyle rbutton_bold => Get("rbutton_bold");
38
- public static GUIStyle rbold_title => Get("rbold_title");
39
- public static GUIStyle rlabel_italic => Get("rlabel_italic");
186
+
187
+ //创建一个纯色图
188
+ public static Texture2D MakeColorTex(Color color)
189
+ {
190
+ var tex = new Texture2D(2, 2);
191
+ tex.SetPixels(new[]
192
+ {
193
+ color, color,
194
+ color, color,
195
+ });
196
+ tex.Apply();
197
+ return tex;
198
+ }
199
+
200
+ //创建一个描边背景图
201
+ public static Texture2D MakeOutlineTex(Color baseColor, Color outline)
202
+ {
203
+ var tex = new Texture2D(4, 4);
204
+ tex.SetPixels(new[]
205
+ {
206
+ outline, outline, outline, outline,
207
+ outline, baseColor, baseColor, outline,
208
+ outline, baseColor, baseColor, outline,
209
+ outline, outline, outline, outline,
210
+ });
211
+ tex.Apply();
212
+ return tex;
213
+ }
214
+
215
+
216
+ public static void SetStyleStateColor(GUIStyle style, Color normal, Color hover, Color active)
217
+ {
218
+ style.normal = new GUIStyleState();
219
+ style.hover = new GUIStyleState();
220
+ style.active = new GUIStyleState();
221
+ style.focused = new GUIStyleState();
222
+ style.onNormal = new GUIStyleState();
223
+ style.onHover = new GUIStyleState();
224
+ style.onActive = new GUIStyleState();
225
+ style.onFocused = new GUIStyleState();
226
+ var normalTex = MakeColorTex(normal);
227
+ var hoverTex = MakeColorTex(hover);
228
+ var activeTex = MakeColorTex(active);
229
+ style.normal.background = normalTex;
230
+ style.hover.background = hoverTex;
231
+ style.active.background = activeTex;
232
+ style.focused.background = activeTex;
233
+ style.onNormal.background = normalTex;
234
+ style.onHover.background = hoverTex;
235
+ style.onActive.background = activeTex;
236
+ style.onFocused.background = activeTex;
237
+ }
238
+
239
+
240
+ public static void SetStyleStateOutlineColor(GUIStyle style, Color normal, Color hover, Color active,
241
+ Color outline)
242
+ {
243
+ style.normal = new GUIStyleState();
244
+ style.hover = new GUIStyleState();
245
+ style.active = new GUIStyleState();
246
+ style.focused = new GUIStyleState();
247
+ style.onNormal = new GUIStyleState();
248
+ style.onHover = new GUIStyleState();
249
+ style.onActive = new GUIStyleState();
250
+ style.onFocused = new GUIStyleState();
251
+ var normalTex = MakeOutlineTex(normal, outline);
252
+ var hoverTex = MakeOutlineTex(hover, outline);
253
+ var activeTex = MakeOutlineTex(active, outline);
254
+ style.normal.background = normalTex;
255
+ style.hover.background = hoverTex;
256
+ style.active.background = activeTex;
257
+ style.focused.background = activeTex;
258
+ style.onNormal.background = normalTex;
259
+ style.onHover.background = hoverTex;
260
+ style.onActive.background = activeTex;
261
+ style.onFocused.background = activeTex;
262
+ }
40
263
  }
41
- }
264
+ }
@@ -12,6 +12,7 @@ using UnityEditor;
12
12
  using UnityEngine;
13
13
  using AlphaDirectory = Alphaleonis.Win32.Filesystem.Directory;
14
14
  using Debug = UnityEngine.Debug;
15
+ using AlphaFile = Alphaleonis.Win32.Filesystem.File;
15
16
 
16
17
  namespace TyphoonUnitySDK
17
18
  {
@@ -73,11 +74,6 @@ namespace TyphoonUnitySDK
73
74
  /// </summary>
74
75
  public static readonly string DEFINE_TYPHOON_ADDRESSABLE_NAME = "TYPHOON_ADDRESSABLE";
75
76
 
76
- /// <summary>
77
- /// apply历史记录
78
- /// </summary>
79
- public static readonly string APPLY_HISTORY = ".typhoon/typhoon_sdk_apply_history.txt";
80
-
81
77
  /// <summary>
82
78
  /// 说明文档
83
79
  /// </summary>
@@ -549,36 +545,6 @@ namespace TyphoonUnitySDK
549
545
  }
550
546
 
551
547
 
552
- /// <summary>
553
- /// 尝试获取apply历史记录
554
- /// </summary>
555
- public static bool TryGetApplyHistory(out string match)
556
- {
557
- match = default;
558
- if (File.Exists(APPLY_HISTORY))
559
- {
560
- match = File.ReadAllText(APPLY_HISTORY);
561
- return true;
562
- }
563
-
564
- return false;
565
- }
566
-
567
- /// <summary>
568
- /// 写入apply历史记录
569
- /// </summary>
570
- public static void WriteApplyHistory(PublishSetting setting)
571
- {
572
- var dir = Path.GetDirectoryName(APPLY_HISTORY);
573
- if (!Directory.Exists(dir))
574
- {
575
- Directory.CreateDirectory(dir);
576
- }
577
-
578
- File.WriteAllText(APPLY_HISTORY, setting.name);
579
- }
580
-
581
-
582
548
  /// <summary>
583
549
  /// 写入Txt
584
550
  /// </summary>
@@ -758,7 +724,7 @@ namespace TyphoonUnitySDK
758
724
  fullPath = fullPath.Replace("/", "\\");
759
725
  if (File.Exists(fullPath))
760
726
  {
761
- Alphaleonis.Win32.Filesystem.File.Delete(path, true);
727
+ AlphaFile.Delete(path, true);
762
728
  }
763
729
  }
764
730
 
@@ -30,8 +30,8 @@ namespace TyphoonUnitySDK
30
30
  rectTitle.width -= 8;
31
31
  rectTitle.x += 4;
32
32
  rectTitle.y += 4;
33
- EditorGUI.DrawRect(rectTitle, Skins.PublishWindowTitleBgColor);
34
- GUI.Label(rectTitle, "自定义变量", Styles.rbold_title);
33
+ EditorGUI.DrawRect(rectTitle, Styles.TitleBgColor);
34
+ GUI.Label(rectTitle, "自定义变量", Styles.BoldTitle);
35
35
  var rectSave = rectTitle;
36
36
  rectSave.width = 90;
37
37
  rectSave.x = rectTitle.xMax - rectSave.width - 4;
@@ -66,7 +66,7 @@ namespace TyphoonUnitySDK
66
66
  tipRect.y -= 2;
67
67
  if (string.IsNullOrEmpty(_inputTxt) && GUI.GetNameOfFocusedControl() != "input")
68
68
  {
69
- GUI.Label(tipRect, "请输入变量名...", Styles.rlabel_italic);
69
+ GUI.Label(tipRect, "请输入变量名...", Styles.ItalicLabel);
70
70
  }
71
71
 
72
72
  GUILayout.EndHorizontal();
@@ -61,7 +61,7 @@ namespace TyphoonUnitySDK
61
61
  private static bool DrawProperty_EnableTrack(VivoMiniConfig arg)
62
62
  {
63
63
  GUILayout.Space(10);
64
- GUILayout.Label("事件上报", Styles.rbold_title);
64
+ GUILayout.Label("事件上报", Styles.BoldTitle);
65
65
  GUILayout.BeginHorizontal();
66
66
  GUILayout.Label("开启事件上报", GUILayout.Width(146));
67
67
  GUIDrawer.DrawPopUpToggle(arg.EnableTrack, (v) => arg.EnableTrack = v);
@@ -93,7 +93,7 @@ namespace TyphoonUnitySDK
93
93
  private static bool DrawProperty_PrivacyPolicy(VivoMiniConfig arg)
94
94
  {
95
95
  GUILayout.Space(10);
96
- GUILayout.Label("隐私政策", Styles.rbold_title);
96
+ GUILayout.Label("隐私政策", Styles.BoldTitle);
97
97
  GUILayout.BeginHorizontal();
98
98
  GUILayout.Label("文案", GUILayout.Width(146));
99
99
  arg.PrivacyPolicyFile =
@@ -205,7 +205,7 @@ namespace TyphoonUnitySDK
205
205
  private static bool DrawProperty_BannerEnable(VivoMiniConfig arg)
206
206
  {
207
207
  GUILayout.Space(10);
208
- GUILayout.Label("广告参数", Styles.rbold_title);
208
+ GUILayout.Label("广告参数", Styles.BoldTitle);
209
209
  GUILayout.BeginHorizontal();
210
210
  GUILayout.Label("Banner开关", GUILayout.Width(146));
211
211
  GUIDrawer.DrawPopUpToggle(arg.BannerEnable, (v) => arg.BannerEnable = v);
@@ -236,7 +236,7 @@ namespace TyphoonUnitySDK
236
236
  btnNewRect.height -= 4;
237
237
  btnNewRect.center = center;
238
238
  btnNewRect.x = last.xMax - btnNewRect.width - 2;
239
- if (GUI.Button(btnNewRect, "创建签名", Styles.rbutton_bold))
239
+ if (GUI.Button(btnNewRect, "创建签名", Styles.BoldButton))
240
240
  {
241
241
  //创建openssl 签名
242
242
  UniEditor.CreateOpensslKeystore();
@@ -249,7 +249,7 @@ namespace TyphoonUnitySDK
249
249
  {
250
250
  GUILayout.Space(10);
251
251
 
252
- GUILayout.Label("签名", Styles.rbold_title);
252
+ GUILayout.Label("签名", Styles.BoldTitle);
253
253
  GUILayout.BeginHorizontal();
254
254
  arg.PrivatePem = EditorGUILayout.TextField("private.pem", arg.PrivatePem);
255
255
  if (GUILayout.Button("选择", GUILayout.Width(60)))
@@ -276,7 +276,7 @@ namespace TyphoonUnitySDK
276
276
  rectBtn.y += 2;
277
277
  rectBtn.x = last.xMax - rectBtn.width;
278
278
  rectBtn.x -= 2;
279
- if (GUI.Button(rectBtn, "自动版本号", Styles.rbutton_bold))
279
+ if (GUI.Button(rectBtn, "自动版本号", Styles.BoldButton))
280
280
  {
281
281
  arg.VersionCode += 1;
282
282
  try
@@ -312,7 +312,7 @@ namespace TyphoonUnitySDK
312
312
  private static bool DrawProperty_VersionName(VivoMiniConfig arg)
313
313
  {
314
314
  GUILayout.Space(10);
315
- GUILayout.Label("版本信息", Styles.rbold_title);
315
+ GUILayout.Label("版本信息", Styles.BoldTitle);
316
316
  arg.VersionName = EditorGUILayout.TextField("版本名", arg.VersionName);
317
317
  return true;
318
318
  }
@@ -94,6 +94,8 @@ Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinBannerAd.cs.meta
94
94
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinSdk.cs
95
95
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinSdk.cs.meta
96
96
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor.meta
97
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/DouyinPublishBottomGUI.cs
98
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/DouyinPublishBottomGUI.cs.meta
97
99
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinAndroid.cs
98
100
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinAndroid.cs.meta
99
101
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinIOS.cs
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.84","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.0.84] - 2024-01-05\r\n\r\n### 修复\n* 微信小游戏android进不去游戏问题\r\n\r\n","major_flag":false,"write_time_stamp":1704432506000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.86","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.0.86] - 2024-01-07\r\n\r\n### 新增\n* 抖音快捷发布拓展按钮\r\n\r\n","major_flag":false,"write_time_stamp":1704616370000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}