com.typhoon.unitysdk 1.0.19 → 1.0.21
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/Editor/ApplyTool.cs +93 -7
- package/Editor/DouyinConfig.cs +132 -0
- package/Editor/DouyinConfig.cs.meta +11 -0
- package/Editor/EditorIcons.cs +8 -0
- package/Editor/ExportModule.cs +45 -4
- package/Editor/GUIDrawer.cs +113 -0
- package/Editor/GUIDrawer.cs.meta +11 -0
- package/Editor/Preferences.cs +3 -0
- package/Editor/PreferencesWindow.cs +84 -88
- package/Editor/PublishProcess.cs +2 -0
- package/Editor/PublishResult.cs +10 -0
- package/Editor/PublishSetting.cs +21 -4
- package/Editor/PublishSettingGUIDrawer.cs +185 -7
- package/Editor/PublishTool.cs +5 -5
- package/Editor/PublishVivoBatSettingInspector.cs +1 -2
- package/Editor/PublishWindow.cs +16 -6
- package/Editor/Texture/black_32x32.png +0 -0
- package/Editor/Texture/black_32x32.png.meta +144 -0
- package/Editor/Texture/icon_arrow_right.png +0 -0
- package/Editor/Texture/icon_arrow_right.png.meta +144 -0
- package/Editor/Texture/icon_variable.png +0 -0
- package/Editor/Texture/icon_variable.png.meta +144 -0
- package/Editor/UniEditor.cs +28 -0
- package/Editor/VariablePreset.cs +160 -0
- package/Editor/VariablePreset.cs.meta +11 -0
- package/Editor/VariablePresetWindow.cs +153 -0
- package/Editor/VariablePresetWindow.cs.meta +11 -0
- package/Editor/WxMiniConfig.cs +285 -0
- package/Editor/WxMiniConfig.cs.meta +11 -0
- package/Runtime/AppConfig.cs +16 -0
- package/Runtime/AppConfigAsset.cs +5 -2
- package/Runtime/TyphoonSdk.cs +31 -0
- package/Runtime/UnityToJs.cs +66 -0
- package/Runtime/UnityToJs.cs.meta +11 -0
- package/Runtime/WxMiniTouchInputSupport.cs +33 -0
- package/Runtime/WxMiniTouchInputSupport.cs.meta +11 -0
- package/Sources~/Package/Douyin.unitypackage +0 -0
- package/Sources~/Package/Douyin.unitypackage.manifest +107 -0
- package/Sources~/Package/WxMini.unitypackage +0 -0
- package/Sources~/Package/WxMini.unitypackage.manifest +395 -0
- package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
- package/package.json +1 -1
|
@@ -9,16 +9,12 @@ namespace TyphoonUnitySDK
|
|
|
9
9
|
{
|
|
10
10
|
public class PreferencesWindow : EditorWindow
|
|
11
11
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
new Dictionary<string, Func<Preferences, bool>>()
|
|
17
|
-
{
|
|
18
|
-
{ "m_Script", (s) => true },
|
|
19
|
-
{ nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
20
|
-
};
|
|
12
|
+
private static bool _preferenceFoldout = false;
|
|
13
|
+
|
|
14
|
+
private static bool _wxMiniConfigFoldout = false;
|
|
15
|
+
|
|
21
16
|
|
|
17
|
+
private static Vector2 _scroll;
|
|
22
18
|
|
|
23
19
|
[MenuItem("TyphoonSDK/选项", priority = 10000)]
|
|
24
20
|
public static void Open()
|
|
@@ -29,60 +25,77 @@ namespace TyphoonUnitySDK
|
|
|
29
25
|
win.Show();
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
private Editor _editor;
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
protected void OnGUI()
|
|
35
30
|
{
|
|
36
|
-
|
|
31
|
+
var rect = new Rect(0, 0, position.width, position.height);
|
|
32
|
+
var rectTitle = rect;
|
|
33
|
+
rectTitle.y += 4;
|
|
34
|
+
rectTitle.x += 4;
|
|
35
|
+
rectTitle.width -= 8;
|
|
36
|
+
rectTitle.height = 32;
|
|
37
|
+
EditorGUI.DrawRect(rectTitle, Skins.PublishWindowTitleBgColor);
|
|
38
|
+
GUI.Label(rectTitle, "选项", Styles.rbold_title);
|
|
39
|
+
|
|
40
|
+
var rectSave = rectTitle;
|
|
41
|
+
rectSave.width = 90;
|
|
42
|
+
rectSave.x = rectTitle.xMax - rectSave.width - 4;
|
|
43
|
+
var center = rectSave.center;
|
|
44
|
+
rectSave.height -= 8;
|
|
45
|
+
rectSave.center = center;
|
|
46
|
+
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save)))
|
|
37
47
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
EditorUtility.SetDirty(Preferences.Default);
|
|
49
|
+
WxMiniConfig.Default.Save();
|
|
50
|
+
AssetDatabase.SaveAssets();
|
|
51
|
+
Debug.Log("保存完毕");
|
|
52
|
+
}
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
var area = rectTitle;
|
|
55
|
+
area.y = rectTitle.yMax;
|
|
56
|
+
area.y += 4;
|
|
57
|
+
area.width -= 8;
|
|
58
|
+
area.x += 4;
|
|
59
|
+
area.height = rect.yMax - area.yMin - 4;
|
|
60
|
+
GUILayout.BeginArea(area);
|
|
47
61
|
|
|
48
|
-
|
|
62
|
+
_scroll = GUILayout.BeginScrollView(_scroll);
|
|
63
|
+
_preferenceFoldout = GUIDrawer.DrawFoldout("偏好设置", _preferenceFoldout, GUILayout.Height(26));
|
|
64
|
+
if (_preferenceFoldout)
|
|
65
|
+
{
|
|
66
|
+
DrawPreferencesPropertyGUI(Preferences.Default);
|
|
49
67
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
68
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var area = rect;
|
|
57
|
-
area.height -= 8;
|
|
58
|
-
area.width -= 12;
|
|
59
|
-
area.center = rect.center;
|
|
60
|
-
GUILayout.BeginArea(area);
|
|
61
|
-
var rectSave = new Rect(0, 0, area.width, area.height);
|
|
62
|
-
rectSave.width = 100;
|
|
63
|
-
rectSave.height = 32;
|
|
64
|
-
rectSave.x = area.width - rectSave.width;
|
|
65
|
-
rectSave.x -= 4;
|
|
66
|
-
rectSave.y += 4;
|
|
67
|
-
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save), Styles.rbutton))
|
|
69
|
+
GUILayout.Space(10);
|
|
70
|
+
_wxMiniConfigFoldout = GUIDrawer.DrawFoldout("微信小游戏", _wxMiniConfigFoldout, GUILayout.Height(26));
|
|
71
|
+
if (_wxMiniConfigFoldout)
|
|
68
72
|
{
|
|
69
|
-
|
|
70
|
-
AssetDatabase.SaveAssets();
|
|
71
|
-
Debug.Log("保存完毕");
|
|
73
|
+
WxMiniConfigGUIDrawer.DrawWxMiniConfig();
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
GUILayout.EndScrollView();
|
|
75
77
|
GUILayout.EndArea();
|
|
76
78
|
Repaint();
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
|
|
82
|
+
#region 偏好设置
|
|
83
|
+
|
|
84
|
+
public static Dictionary<string, Func<Preferences, bool>> OverrideDrawGUIPreferences =
|
|
85
|
+
new Dictionary<string, Func<Preferences, bool>>()
|
|
86
|
+
{
|
|
87
|
+
{ "m_Script", (s) => true },
|
|
88
|
+
{ nameof(Preferences.CheckInstallAddressablePlug), DrawProperty_CheckInstallAddressablePlug },
|
|
89
|
+
{ nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
80
93
|
/*绘制GUI*/
|
|
81
|
-
public static void
|
|
94
|
+
public static void DrawPreferencesPropertyGUI(Preferences preferences)
|
|
82
95
|
{
|
|
83
|
-
DrawProperty(preferences, (property) =>
|
|
96
|
+
GUIDrawer.DrawProperty(preferences, (property) =>
|
|
84
97
|
{
|
|
85
|
-
if (
|
|
98
|
+
if (OverrideDrawGUIPreferences.TryGetValue(property, out var match))
|
|
86
99
|
{
|
|
87
100
|
return match.Invoke(preferences);
|
|
88
101
|
}
|
|
@@ -91,60 +104,38 @@ namespace TyphoonUnitySDK
|
|
|
91
104
|
});
|
|
92
105
|
}
|
|
93
106
|
|
|
94
|
-
|
|
95
|
-
/*绘制属性*/
|
|
96
|
-
public static void DrawProperty(Object target, Func<string, bool> ignoreFunc)
|
|
107
|
+
private static bool DrawProperty_CheckInstallAddressablePlug(Preferences arg)
|
|
97
108
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
SerializedProperty iterator = obj.GetIterator();
|
|
102
|
-
for (var enterChildren = true; iterator.NextVisible(enterChildren); enterChildren = false)
|
|
103
|
-
{
|
|
104
|
-
using (new EditorGUI.DisabledScope("m_Script" == iterator.propertyPath))
|
|
105
|
-
{
|
|
106
|
-
var cover = ignoreFunc.Invoke(iterator.propertyPath);
|
|
107
|
-
if (!cover)
|
|
108
|
-
{
|
|
109
|
-
EditorGUILayout.PropertyField(iterator, true);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
obj.ApplyModifiedProperties();
|
|
115
|
-
EditorGUI.EndChangeCheck();
|
|
109
|
+
arg.CheckInstallAddressablePlug =
|
|
110
|
+
GUILayout.Toggle(arg.CheckInstallAddressablePlug, "自动检查Addressabled Supoort");
|
|
111
|
+
return true;
|
|
116
112
|
}
|
|
117
113
|
|
|
118
114
|
|
|
119
115
|
private static bool DrawProperty_GradlePath(Preferences preferences)
|
|
120
116
|
{
|
|
121
|
-
GUILayout.Space(10);
|
|
122
|
-
var error = false;
|
|
123
|
-
var color = GUI.color;
|
|
124
117
|
if (!UniEditor.GradleIsMatch())
|
|
125
118
|
{
|
|
119
|
+
GUILayout.BeginHorizontal();
|
|
126
120
|
GUILayout.Label(new GUIContent("未配置gradle路径", EditorIcons.icon_error), Styles.rbold_label,
|
|
127
|
-
GUILayout.Height(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
GUILayout.Height(22));
|
|
122
|
+
if (GUILayout.Button("指引", GUILayout.Width(60)))
|
|
123
|
+
{
|
|
124
|
+
UniEditor.ShowMessageBox(
|
|
125
|
+
"目录选到bin的文件夹即可\n例如:C:\\Users\\Jan\\.gradle\\wrapper\\dists\\gradle-6.8-bin\\1jblhjyydfkclfzx1agp92nyl\\gradle-6.8\\bin",
|
|
126
|
+
null);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
GUILayout.EndHorizontal();
|
|
134
130
|
}
|
|
135
131
|
else
|
|
136
132
|
{
|
|
137
|
-
GUILayout.Label(
|
|
138
|
-
GUILayout.Height(24));
|
|
133
|
+
GUILayout.Label("gradle路径", Styles.rbold_label, GUILayout.Height(22));
|
|
139
134
|
}
|
|
140
135
|
|
|
141
136
|
GUILayout.BeginHorizontal();
|
|
142
|
-
GUILayout.Label("目录:", Styles.rbold_title, GUILayout.Width(40),GUILayout.Height(44));
|
|
143
|
-
color = GUI.color;
|
|
144
|
-
GUI.color = error ? Color.red*0.7f : color;
|
|
145
137
|
preferences.GradlePath = GUILayout.TextArea(preferences.GradlePath, GUILayout.Height(44));
|
|
146
|
-
|
|
147
|
-
if (GUILayout.Button("选择", GUILayout.Width(60),GUILayout.Height(44)))
|
|
138
|
+
if (GUILayout.Button("选择", GUILayout.Width(60), GUILayout.Height(44)))
|
|
148
139
|
{
|
|
149
140
|
// 获取当前用户的 Windows 用户文件夹路径
|
|
150
141
|
var userFolder = UniEditor.GetWindowUserFolder();
|
|
@@ -159,12 +150,15 @@ namespace TyphoonUnitySDK
|
|
|
159
150
|
}
|
|
160
151
|
|
|
161
152
|
var select = EditorUtility.OpenFolderPanel("请选择Gradle目录", fastPath, "");
|
|
162
|
-
|
|
163
|
-
EditorUtility.SetDirty(preferences);
|
|
164
|
-
var check = $"{select}/gradle";
|
|
165
|
-
if (!File.Exists(check))
|
|
153
|
+
if (!string.IsNullOrEmpty(select))
|
|
166
154
|
{
|
|
167
|
-
|
|
155
|
+
preferences.GradlePath = select;
|
|
156
|
+
EditorUtility.SetDirty(preferences);
|
|
157
|
+
var check = $"{select}/gradle";
|
|
158
|
+
if (!File.Exists(check))
|
|
159
|
+
{
|
|
160
|
+
UniEditor.ShowMessageBox($"gardle目录不匹配,找不到:{check}", null);
|
|
161
|
+
}
|
|
168
162
|
}
|
|
169
163
|
|
|
170
164
|
GUI.FocusControl("");
|
|
@@ -173,5 +167,7 @@ namespace TyphoonUnitySDK
|
|
|
173
167
|
GUILayout.EndHorizontal();
|
|
174
168
|
return true;
|
|
175
169
|
}
|
|
170
|
+
|
|
171
|
+
#endregion
|
|
176
172
|
}
|
|
177
173
|
}
|
package/Editor/PublishProcess.cs
CHANGED
package/Editor/PublishResult.cs
CHANGED
|
@@ -13,5 +13,15 @@ namespace TyphoonUnitySDK
|
|
|
13
13
|
/// 导出的android工程
|
|
14
14
|
/// </summary>
|
|
15
15
|
public string AndroidProj;
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// 导出的微信工程
|
|
19
|
+
/// </summary>
|
|
20
|
+
public string WxMiniProj;
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// 抖音发布APK输出工程
|
|
24
|
+
/// </summary>
|
|
25
|
+
public string DouyinApkOutPath;
|
|
16
26
|
}
|
|
17
27
|
}
|
package/Editor/PublishSetting.cs
CHANGED
|
@@ -8,15 +8,15 @@ using UnityEngine.Serialization;
|
|
|
8
8
|
namespace TyphoonUnitySDK
|
|
9
9
|
{
|
|
10
10
|
/// <summary>
|
|
11
|
-
///
|
|
11
|
+
/// 参数修改
|
|
12
12
|
/// </summary>
|
|
13
13
|
[Serializable]
|
|
14
|
-
public class
|
|
14
|
+
public class VariableModify
|
|
15
15
|
{
|
|
16
16
|
public string VariableName;
|
|
17
17
|
public string VariableValue;
|
|
18
18
|
|
|
19
|
-
public
|
|
19
|
+
public VariableModify(string variableName, string variableValue)
|
|
20
20
|
{
|
|
21
21
|
VariableName = variableName;
|
|
22
22
|
VariableValue = variableValue;
|
|
@@ -84,7 +84,17 @@ public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel22;
|
|
|
84
84
|
[FormerlySerializedAs("AddressableUseProfile")]
|
|
85
85
|
public string AAUseProfile = "";
|
|
86
86
|
|
|
87
|
-
public List<
|
|
87
|
+
public List<VariableModify> AAVariableModify = new List<VariableModify>();
|
|
88
|
+
|
|
89
|
+
/*自定义参数修改*/
|
|
90
|
+
public bool PresetModifyEnable = false;
|
|
91
|
+
public List<VariableModify> PresetModify = new List<VariableModify>();
|
|
92
|
+
|
|
93
|
+
/*微信拓展配置*/
|
|
94
|
+
public bool WxMiniGUIFoldout = true;
|
|
95
|
+
|
|
96
|
+
/*抖音小游戏拓展配置*/
|
|
97
|
+
public bool DouyinGUIFoldout = true;
|
|
88
98
|
|
|
89
99
|
|
|
90
100
|
//使用配置
|
|
@@ -107,5 +117,12 @@ public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel22;
|
|
|
107
117
|
{
|
|
108
118
|
return UniEditor.HasAddressableSupport() & AASupportEnable;
|
|
109
119
|
}
|
|
120
|
+
|
|
121
|
+
/*保存*/
|
|
122
|
+
public void Save()
|
|
123
|
+
{
|
|
124
|
+
EditorUtility.SetDirty(this);
|
|
125
|
+
AssetDatabase.SaveAssets();
|
|
126
|
+
}
|
|
110
127
|
}
|
|
111
128
|
}
|
|
@@ -11,9 +11,13 @@ namespace TyphoonUnitySDK
|
|
|
11
11
|
/// </summary>
|
|
12
12
|
public static class PublishSettingGUIDrawer
|
|
13
13
|
{
|
|
14
|
-
private static
|
|
15
|
-
private static
|
|
16
|
-
private static
|
|
14
|
+
private static VariableModify _cacheDelete = null;
|
|
15
|
+
private static VariableModify _cacheMoveUp = null;
|
|
16
|
+
private static VariableModify _cacheMoveDown = null;
|
|
17
|
+
|
|
18
|
+
private static VariableModify _cachePresetDelete = null;
|
|
19
|
+
private static VariableModify _cachePresetMoveUp = null;
|
|
20
|
+
private static VariableModify _cachePresetMoveDown = null;
|
|
17
21
|
|
|
18
22
|
/// <summary>
|
|
19
23
|
/// 绑定重绘逻辑
|
|
@@ -41,8 +45,48 @@ namespace TyphoonUnitySDK
|
|
|
41
45
|
{ nameof(PublishSetting.MinApiVersion), DrawProperty_MinApiVersion },
|
|
42
46
|
{ nameof(PublishSetting.TargetApiVersion), DrawProperty_TargetApiVersion },
|
|
43
47
|
{ nameof(PublishSetting.GraphicsAPIs), DrawProperty_GraphicsAPIs },
|
|
48
|
+
{ nameof(PublishSetting.PresetModifyEnable), DrawProperty_PresetModifyEnable },
|
|
49
|
+
{ nameof(PublishSetting.PresetModify), DrawProperty_PresetModify },
|
|
50
|
+
{ nameof(PublishSetting.WxMiniGUIFoldout), DrawProperty_WxMiniGUIFoldout },
|
|
51
|
+
{ nameof(PublishSetting.DouyinGUIFoldout), DrawProperty_DouyinGUIFoldout },
|
|
44
52
|
};
|
|
45
53
|
|
|
54
|
+
/*绘制抖音小游戏GUI*/
|
|
55
|
+
private static bool DrawProperty_DouyinGUIFoldout(PublishSetting arg)
|
|
56
|
+
{
|
|
57
|
+
if (arg.Channel != AppChannel.DouyinAndroid && arg.Channel != AppChannel.DouyinIOS)
|
|
58
|
+
{
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
GUILayout.Space(10);
|
|
63
|
+
arg.DouyinGUIFoldout = GUIDrawer.DrawFoldout("抖音小游戏", arg.DouyinGUIFoldout, GUILayout.Height(26));
|
|
64
|
+
if (arg.DouyinGUIFoldout)
|
|
65
|
+
{
|
|
66
|
+
DouyinConfigGUIDrawer.DrawGUI();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/*绘制微信GUI*/
|
|
73
|
+
private static bool DrawProperty_WxMiniGUIFoldout(PublishSetting arg)
|
|
74
|
+
{
|
|
75
|
+
if (arg.Channel != AppChannel.WxMini)
|
|
76
|
+
{
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
GUILayout.Space(10);
|
|
81
|
+
arg.WxMiniGUIFoldout = GUIDrawer.DrawFoldout("微信小游戏", arg.WxMiniGUIFoldout, GUILayout.Height(26));
|
|
82
|
+
if (arg.WxMiniGUIFoldout)
|
|
83
|
+
{
|
|
84
|
+
WxMiniConfigGUIDrawer.DrawWxMiniConfig();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
|
|
46
90
|
|
|
47
91
|
/// <summary>
|
|
48
92
|
/// 绘制GUI
|
|
@@ -57,7 +101,7 @@ namespace TyphoonUnitySDK
|
|
|
57
101
|
area.center = view.center;
|
|
58
102
|
var obj = new SerializedObject(setting);
|
|
59
103
|
GUILayout.BeginArea(area);
|
|
60
|
-
scroll = GUILayout.BeginScrollView(scroll, GUIStyle.none
|
|
104
|
+
scroll = GUILayout.BeginScrollView(scroll, GUIStyle.none);
|
|
61
105
|
DrawPropertyGUI(setting);
|
|
62
106
|
GUILayout.Space(30);
|
|
63
107
|
GUILayout.EndScrollView();
|
|
@@ -258,7 +302,7 @@ namespace TyphoonUnitySDK
|
|
|
258
302
|
GUILayout.Label("关联profile", GUILayout.Width(142));
|
|
259
303
|
var txt = setting.AAUseProfile;
|
|
260
304
|
txt = string.IsNullOrEmpty(txt) ? "请选择" : txt;
|
|
261
|
-
if (GUILayout.Button(txt,"Popup"))
|
|
305
|
+
if (GUILayout.Button(txt, "Popup"))
|
|
262
306
|
{
|
|
263
307
|
AddressableSupport.PopUpProfileSelectorMenu(setting);
|
|
264
308
|
}
|
|
@@ -299,7 +343,7 @@ namespace TyphoonUnitySDK
|
|
|
299
343
|
}
|
|
300
344
|
|
|
301
345
|
var variables = AddressableSupport.GetVariables();
|
|
302
|
-
if (GUILayout.Button("覆写 Veriable","Popup"))
|
|
346
|
+
if (GUILayout.Button("覆写 Veriable", "Popup"))
|
|
303
347
|
{
|
|
304
348
|
var used = new HashSet<string>();
|
|
305
349
|
foreach (var modify in modifies)
|
|
@@ -321,7 +365,7 @@ namespace TyphoonUnitySDK
|
|
|
321
365
|
else
|
|
322
366
|
{
|
|
323
367
|
Debug.Log($"加入新的参数:{variable}");
|
|
324
|
-
setting.AAVariableModify.Add(new
|
|
368
|
+
setting.AAVariableModify.Add(new VariableModify(variable,
|
|
325
369
|
AddressableSupport.GetVariableValue(variable)));
|
|
326
370
|
EditorUtility.SetDirty(setting);
|
|
327
371
|
}
|
|
@@ -388,6 +432,140 @@ namespace TyphoonUnitySDK
|
|
|
388
432
|
return true;
|
|
389
433
|
}
|
|
390
434
|
|
|
435
|
+
|
|
436
|
+
/*自定义参数修改*/
|
|
437
|
+
private static bool DrawProperty_PresetModify(PublishSetting setting)
|
|
438
|
+
{
|
|
439
|
+
if (!setting.PresetModifyEnable)
|
|
440
|
+
{
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
var modifies = setting.PresetModify;
|
|
446
|
+
for (int i = modifies.Count - 1; i >= 0; i--)
|
|
447
|
+
{
|
|
448
|
+
if (modifies[i] == null)
|
|
449
|
+
{
|
|
450
|
+
modifies.RemoveAt(i);
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
var variables = new HashSet<string>();
|
|
456
|
+
var presets = VariablePreset.Default.Presets;
|
|
457
|
+
foreach (var preset in presets)
|
|
458
|
+
{
|
|
459
|
+
variables.Add(preset.VariableName);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (GUILayout.Button("覆写 Veriable", "Popup"))
|
|
463
|
+
{
|
|
464
|
+
var used = new HashSet<string>();
|
|
465
|
+
foreach (var modify in modifies)
|
|
466
|
+
{
|
|
467
|
+
used.Add(modify.VariableName);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
var menu = new GenericMenu();
|
|
471
|
+
menu.AddItem(new GUIContent("新增变量"), false, VariablePresetWindow.Open);
|
|
472
|
+
foreach (var item in presets)
|
|
473
|
+
{
|
|
474
|
+
var isUsed = used.Contains(item.VariableName);
|
|
475
|
+
var desc = isUsed ? $"{item.VariableName} (使用中)" : item.VariableName;
|
|
476
|
+
menu.AddItem(new GUIContent(desc), false, () =>
|
|
477
|
+
{
|
|
478
|
+
if (isUsed)
|
|
479
|
+
{
|
|
480
|
+
Debug.Log("使用中,已加入");
|
|
481
|
+
}
|
|
482
|
+
else
|
|
483
|
+
{
|
|
484
|
+
Debug.Log($"加入新的变量:{item}");
|
|
485
|
+
setting.PresetModify.Add(new VariableModify(item.VariableName, item.VariableValue));
|
|
486
|
+
EditorUtility.SetDirty(setting);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
menu.ShowAsContext();
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
foreach (var modify in modifies)
|
|
496
|
+
{
|
|
497
|
+
var isValid = !string.IsNullOrEmpty(modify.VariableName) && variables.Contains(modify.VariableName);
|
|
498
|
+
var varName = isValid ? modify.VariableName : $"{modify.VariableName}(missing)";
|
|
499
|
+
GUILayout.BeginHorizontal();
|
|
500
|
+
if (GUILayout.Button(varName, "Popup", GUILayout.Width(200)))
|
|
501
|
+
{
|
|
502
|
+
var menu = new GenericMenu();
|
|
503
|
+
menu.AddItem(new GUIContent("删除"), false, () => { _cachePresetDelete = modify; });
|
|
504
|
+
menu.AddItem(new GUIContent("上移"), false, () => { _cachePresetMoveUp = modify; });
|
|
505
|
+
menu.AddItem(new GUIContent("下移"), false, () => { _cachePresetMoveDown = modify; });
|
|
506
|
+
menu.ShowAsContext();
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
var tem = modify.VariableValue;
|
|
510
|
+
modify.VariableValue = GUILayout.TextField(modify.VariableValue);
|
|
511
|
+
if (tem != modify.VariableValue)
|
|
512
|
+
{
|
|
513
|
+
//修改自定义变量
|
|
514
|
+
VariablePreset.Default.Modify(modify.VariableName, modify.VariableValue);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
GUILayout.EndHorizontal();
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/*删除*/
|
|
521
|
+
if (_cachePresetDelete != null)
|
|
522
|
+
{
|
|
523
|
+
setting.PresetModify.Remove(_cachePresetDelete);
|
|
524
|
+
EditorUtility.SetDirty(setting);
|
|
525
|
+
_cachePresetDelete = null;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/*上移*/
|
|
529
|
+
if (_cachePresetMoveUp != null)
|
|
530
|
+
{
|
|
531
|
+
var index = setting.PresetModify.IndexOf(_cachePresetMoveUp);
|
|
532
|
+
if (index >= 0 && (index - 1) >= 0)
|
|
533
|
+
{
|
|
534
|
+
(setting.PresetModify[index], setting.PresetModify[index - 1]) = (
|
|
535
|
+
setting.PresetModify[index - 1], setting.PresetModify[index]);
|
|
536
|
+
EditorUtility.SetDirty(setting);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
_cachePresetMoveUp = null;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/*下移*/
|
|
543
|
+
if (_cachePresetMoveDown != null)
|
|
544
|
+
{
|
|
545
|
+
var index = setting.PresetModify.IndexOf(_cachePresetMoveDown);
|
|
546
|
+
if (index >= 0 && (index + 1) < setting.PresetModify.Count)
|
|
547
|
+
{
|
|
548
|
+
(setting.PresetModify[index + 1], setting.PresetModify[index]) = (
|
|
549
|
+
setting.PresetModify[index], setting.PresetModify[index + 1]);
|
|
550
|
+
EditorUtility.SetDirty(setting);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
_cachePresetMoveDown = null;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
private static bool DrawProperty_PresetModifyEnable(PublishSetting setting)
|
|
561
|
+
{
|
|
562
|
+
GUILayout.Space(10);
|
|
563
|
+
GUILayout.Label("自定义变量", Styles.rbold_label);
|
|
564
|
+
setting.PresetModifyEnable = EditorGUILayout.Toggle("调整自定义变量", setting.PresetModifyEnable);
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
|
|
391
569
|
/*绘制属性*/
|
|
392
570
|
public static void DrawProperty(Object target, Func<string, bool> ignoreFunc)
|
|
393
571
|
{
|
package/Editor/PublishTool.cs
CHANGED
|
@@ -17,11 +17,14 @@ namespace TyphoonUnitySDK
|
|
|
17
17
|
public class PublishTool
|
|
18
18
|
{
|
|
19
19
|
/// <summary>
|
|
20
|
-
///
|
|
20
|
+
/// 绑定发布实现
|
|
21
21
|
/// </summary>
|
|
22
22
|
public static Dictionary<PublishProcess, string> PublicClasses = new Dictionary<PublishProcess, string>()
|
|
23
23
|
{
|
|
24
|
-
{ PublishProcess.ChinaAndroidAAR, "TyphoonUnitySDK.PublishChinaAndroidAAR" }
|
|
24
|
+
{ PublishProcess.ChinaAndroidAAR, "TyphoonUnitySDK.PublishChinaAndroidAAR" },
|
|
25
|
+
{ PublishProcess.WxMini, "TyphoonUnitySDK.PublishWxMini" },
|
|
26
|
+
{ PublishProcess.DouyinAndroid, "TyphoonUnitySDK.PublishDouyinAndroid" }
|
|
27
|
+
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
/// <summary>
|
|
@@ -130,8 +133,5 @@ namespace TyphoonUnitySDK
|
|
|
130
133
|
EditorUserBuildSettings.buildAppBundle = true;
|
|
131
134
|
#endif
|
|
132
135
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -2,7 +2,6 @@ using System;
|
|
|
2
2
|
using System.Collections.Generic;
|
|
3
3
|
using System.IO;
|
|
4
4
|
using System.Linq;
|
|
5
|
-
using System.Text;
|
|
6
5
|
using System.Text.RegularExpressions;
|
|
7
6
|
using UnityEditor;
|
|
8
7
|
using UnityEngine;
|
|
@@ -220,7 +219,7 @@ android {{
|
|
|
220
219
|
|
|
221
220
|
defaultConfig {{
|
|
222
221
|
minSdkVersion 21
|
|
223
|
-
targetSdkVersion
|
|
222
|
+
targetSdkVersion 32
|
|
224
223
|
versionCode {Setting.VersionCode}
|
|
225
224
|
versionName '{Setting.Version}'
|
|
226
225
|
applicationId '{Setting.PackageName}'
|
package/Editor/PublishWindow.cs
CHANGED
|
@@ -13,10 +13,10 @@ namespace TyphoonUnitySDK
|
|
|
13
13
|
AppChannel.ChinaIOS,
|
|
14
14
|
AppChannel.GooglePlay,
|
|
15
15
|
AppChannel.SeaIOS,
|
|
16
|
-
AppChannel.WxMini,
|
|
16
|
+
// AppChannel.WxMini,
|
|
17
17
|
AppChannel.VivoMini,
|
|
18
18
|
AppChannel.OppoMini,
|
|
19
|
-
AppChannel.DouyinAndroid,
|
|
19
|
+
// AppChannel.DouyinAndroid,
|
|
20
20
|
AppChannel.DouyinIOS,
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -132,7 +132,7 @@ namespace TyphoonUnitySDK
|
|
|
132
132
|
rectToolbar.height = 22;
|
|
133
133
|
GUILayout.BeginArea(rectToolbar);
|
|
134
134
|
GUILayout.BeginHorizontal();
|
|
135
|
-
GUILayout.Label("发布配置", Styles.rbold_label, GUILayout.Width(
|
|
135
|
+
GUILayout.Label("发布配置", Styles.rbold_label, GUILayout.Width(70));
|
|
136
136
|
GUILayout.Space(1);
|
|
137
137
|
if (GUILayout.Button(new GUIContent(EditorIcons.icon_import, "导入常用配置"), Styles.rbutton,
|
|
138
138
|
GUILayout.Width(40), GUILayout.Height(20)))
|
|
@@ -140,6 +140,13 @@ namespace TyphoonUnitySDK
|
|
|
140
140
|
UniEditor.ImportPackage(UniEditor.PackagePath_PublishSetting);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
GUILayout.Space(1);
|
|
144
|
+
if (GUILayout.Button(new GUIContent(EditorIcons.icon_variable, "自定义变量"), Styles.rbutton,
|
|
145
|
+
GUILayout.Width(40), GUILayout.Height(20)))
|
|
146
|
+
{
|
|
147
|
+
VariablePresetWindow.Open();
|
|
148
|
+
}
|
|
149
|
+
|
|
143
150
|
GUILayout.Space(1);
|
|
144
151
|
if (GUILayout.Button(new GUIContent(EditorIcons.icon_refresh, "刷新"), Styles.rbutton,
|
|
145
152
|
GUILayout.Width(40), GUILayout.Height(20)))
|
|
@@ -268,15 +275,18 @@ namespace TyphoonUnitySDK
|
|
|
268
275
|
EditorGUI.DrawRect(rectTitle, Skins.PublishWindowTitleBgColor);
|
|
269
276
|
GUI.Label(rectTitle, $"{_select.name}", Styles.rbold_title);
|
|
270
277
|
var rectSave = rectTitle;
|
|
271
|
-
rectSave.width =
|
|
278
|
+
rectSave.width = 90;
|
|
272
279
|
rectSave.x = rectTitle.xMax - rectSave.width;
|
|
273
280
|
var center = rectSave.center;
|
|
274
281
|
rectSave.width -= 8;
|
|
275
282
|
rectSave.height -= 8;
|
|
276
283
|
rectSave.center = center;
|
|
277
|
-
if (GUI.Button(rectSave, EditorIcons.icon_save))
|
|
284
|
+
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save)))
|
|
278
285
|
{
|
|
279
286
|
EditorUtility.SetDirty(_select);
|
|
287
|
+
//保存其它配置
|
|
288
|
+
WxMiniConfig.Default.Save();
|
|
289
|
+
DouyinConfig.Default.Save();
|
|
280
290
|
AssetDatabase.SaveAssets();
|
|
281
291
|
}
|
|
282
292
|
|
|
@@ -356,6 +366,7 @@ namespace TyphoonUnitySDK
|
|
|
356
366
|
_select.Publish();
|
|
357
367
|
}
|
|
358
368
|
|
|
369
|
+
|
|
359
370
|
GUI.enabled = temEnable;
|
|
360
371
|
}
|
|
361
372
|
}
|
|
@@ -383,6 +394,5 @@ namespace TyphoonUnitySDK
|
|
|
383
394
|
|
|
384
395
|
PublishSettings = hash;
|
|
385
396
|
}
|
|
386
|
-
|
|
387
397
|
}
|
|
388
398
|
}
|
|
Binary file
|