com.typhoon.unitysdk 1.1.20 → 1.1.22
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 +14 -1
- package/Editor/Preferences.cs +5 -3
- package/Editor/PreferencesWindow.cs +57 -57
- package/Editor/PublishTool.cs +1 -0
- package/Editor/PublishUnityDefaultApk.cs +44 -0
- package/Editor/PublishUnityDefaultApk.cs.meta +11 -0
- package/Editor/UniEditor.cs +30 -5
- package/Sources~/Package/ChinaAndroid.unitypackage +0 -0
- package/Sources~/Package/GooglePlay.unitypackage +0 -0
- package/Sources~/Package/XiZhongYou.unitypackage +0 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
# 更新日志
|
|
2
|
+
## [1.1.22] - 2025-10-25
|
|
3
|
+
|
|
4
|
+
### 优化
|
|
5
|
+
* 优化gradle路径获取,取preference的gradle路径
|
|
6
|
+
* 优化发布名称使其更有意义
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [1.1.21] - 2025-10-25
|
|
10
|
+
|
|
11
|
+
### 新增
|
|
12
|
+
* 调整发布名称
|
|
13
|
+
|
|
14
|
+
|
|
2
15
|
## [1.1.20] - 2025-10-25
|
|
3
16
|
|
|
4
|
-
### 新增
|
|
17
|
+
### 新增
|
|
5
18
|
* 更新google play sdk
|
|
6
19
|
|
|
7
20
|
|
package/Editor/Preferences.cs
CHANGED
|
@@ -35,8 +35,10 @@ namespace TyphoonUnitySDK
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
[Header("gradle目录")] public string GradlePath = string.Empty;
|
|
39
|
-
[LabelOverride("有重大更新时提醒我")]
|
|
40
|
-
|
|
38
|
+
// [Header("gradle目录")] public string GradlePath = string.Empty;
|
|
39
|
+
[LabelOverride("有重大更新时提醒我")]
|
|
40
|
+
public bool CheckMajor = true;
|
|
41
|
+
[LabelOverride("自定检查更新")]
|
|
42
|
+
public bool CheckUpdate = true;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -64,7 +64,7 @@ namespace TyphoonUnitySDK
|
|
|
64
64
|
new Dictionary<string, Func<Preferences, bool>>()
|
|
65
65
|
{
|
|
66
66
|
{ "m_Script", DrawProperty_mScript },
|
|
67
|
-
{ nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
67
|
+
// { nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
|
|
@@ -93,62 +93,62 @@ namespace TyphoonUnitySDK
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
private static bool DrawProperty_GradlePath(Preferences preferences)
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
96
|
+
// private static bool DrawProperty_GradlePath(Preferences preferences)
|
|
97
|
+
// {
|
|
98
|
+
// GUILayout.Space(5);
|
|
99
|
+
// if (!UniEditor.GradleIsMatch())
|
|
100
|
+
// {
|
|
101
|
+
// GUILayout.BeginHorizontal();
|
|
102
|
+
// GUILayout.Label(new GUIContent("未配置gradle路径", EditorIcons.icon_error), Styles.BoldLabel,
|
|
103
|
+
// GUILayout.Height(22));
|
|
104
|
+
// if (GUILayout.Button("指引", GUILayout.Width(60)))
|
|
105
|
+
// {
|
|
106
|
+
// UniEditor.ShowMessageBox(
|
|
107
|
+
// "目录选到bin的文件夹即可\n例如:C:\\Users\\Jan\\.gradle\\wrapper\\dists\\gradle-6.8-bin\\1jblhjyydfkclfzx1agp92nyl\\gradle-6.8\\bin",
|
|
108
|
+
// null);
|
|
109
|
+
// }
|
|
110
|
+
//
|
|
111
|
+
// GUILayout.EndHorizontal();
|
|
112
|
+
// }
|
|
113
|
+
// else
|
|
114
|
+
// {
|
|
115
|
+
// GUILayout.Label("gradle路径", Styles.BoldLabel, GUILayout.Height(22));
|
|
116
|
+
// }
|
|
117
|
+
//
|
|
118
|
+
// GUILayout.BeginHorizontal();
|
|
119
|
+
// preferences.GradlePath = GUILayout.TextArea(preferences.GradlePath, GUILayout.Height(44));
|
|
120
|
+
// if (GUILayout.Button("选择", GUILayout.Width(60), GUILayout.Height(44)))
|
|
121
|
+
// {
|
|
122
|
+
// // 获取当前用户的 Windows 用户文件夹路径
|
|
123
|
+
// var userFolder = UniEditor.GetWindowUserFolder();
|
|
124
|
+
// var fastPath = "";
|
|
125
|
+
// if (Directory.Exists(userFolder))
|
|
126
|
+
// {
|
|
127
|
+
// var maybe = $"{userFolder}/.gradle/wrapper/dists";
|
|
128
|
+
// if (Directory.Exists(maybe))
|
|
129
|
+
// {
|
|
130
|
+
// fastPath = maybe;
|
|
131
|
+
// }
|
|
132
|
+
// }
|
|
133
|
+
//
|
|
134
|
+
// var select = EditorUtility.OpenFolderPanel("请选择Gradle目录", fastPath, "");
|
|
135
|
+
// if (!string.IsNullOrEmpty(select))
|
|
136
|
+
// {
|
|
137
|
+
// preferences.GradlePath = select;
|
|
138
|
+
// EditorUtility.SetDirty(preferences);
|
|
139
|
+
// var check = $"{select}/gradle";
|
|
140
|
+
// if (!File.Exists(check))
|
|
141
|
+
// {
|
|
142
|
+
// UniEditor.ShowMessageBox($"gardle目录不匹配,找不到:{check}", null);
|
|
143
|
+
// }
|
|
144
|
+
// }
|
|
145
|
+
//
|
|
146
|
+
// GUI.FocusControl("");
|
|
147
|
+
// }
|
|
148
|
+
//
|
|
149
|
+
// GUILayout.EndHorizontal();
|
|
150
|
+
// return true;
|
|
151
|
+
// }
|
|
152
152
|
|
|
153
153
|
#endregion
|
|
154
154
|
}
|
package/Editor/PublishTool.cs
CHANGED
|
@@ -21,6 +21,7 @@ namespace TyphoonUnitySDK
|
|
|
21
21
|
/// </summary>
|
|
22
22
|
public static Dictionary<PublishProcess, string> PublicClasses = new Dictionary<PublishProcess, string>()
|
|
23
23
|
{
|
|
24
|
+
{ PublishProcess.Apk, "TyphoonUnitySDK.PublishUnityDefaultApk" },
|
|
24
25
|
{ PublishProcess.ChinaAndroidAAR, "TyphoonUnitySDK.PublishChinaAndroidAAR" },
|
|
25
26
|
{ PublishProcess.WxMini, "TyphoonUnitySDK.PublishWxMini" },
|
|
26
27
|
{ PublishProcess.DouyinAndroid, "TyphoonUnitySDK.PublishDouyinAndroid" },
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using UnityEditor;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TyphoonUnitySDK
|
|
7
|
+
{
|
|
8
|
+
public class PublishUnityDefaultApk : IPublish
|
|
9
|
+
{
|
|
10
|
+
public void Publish(PublishSetting setting)
|
|
11
|
+
{
|
|
12
|
+
PublishResult result = new PublishResult();
|
|
13
|
+
var dateString = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
|
14
|
+
var path = string.IsNullOrEmpty(setting.PackageName)
|
|
15
|
+
? $".typhoonoutput/android_{dateString}.apk"
|
|
16
|
+
: $".typhoonoutput/{setting.PackageName}_{dateString}.apk";
|
|
17
|
+
if (!UniEditor.IsAsciiPath(path))
|
|
18
|
+
{
|
|
19
|
+
UniEditor.ShowMessageBox($"路径不符合要求,不支持中文路径:\n当前:{path}", null);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
PublishTool.InvokeOnPublishStart(setting);
|
|
24
|
+
//设置android打包为apk模式,非export project
|
|
25
|
+
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
|
26
|
+
EditorUserBuildSettings.buildAppBundle = false;
|
|
27
|
+
EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
|
|
28
|
+
BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, path, BuildTarget.Android, BuildOptions.None);
|
|
29
|
+
if (File.Exists(path))
|
|
30
|
+
{
|
|
31
|
+
EditorUtility.RevealInFinder(path);
|
|
32
|
+
result.IsSuccess = true;
|
|
33
|
+
result.AndroidApk = path;
|
|
34
|
+
Debug.Log($"发布成功:{path}");
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
{
|
|
38
|
+
throw new Exception($"发布失败,生成apk失败,找不到文件:{path}");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
PublishTool.InvokeOnPublishEnd(setting, result);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/Editor/UniEditor.cs
CHANGED
|
@@ -85,12 +85,12 @@ namespace TyphoonUnitySDK
|
|
|
85
85
|
/// </summary>
|
|
86
86
|
public static string PackagePath_XiZhongYou = $"{PathRoot}/Sources~/Package/XiZhongYou.unitypackage";
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
/// <summary>
|
|
90
90
|
/// 华为鸿蒙 资源包
|
|
91
91
|
/// </summary>
|
|
92
92
|
public static string PackagePath_HuaweiHarmony = $"{PathRoot}/Sources~/Package/HuaweiHarmony.unitypackage";
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
|
|
95
95
|
/// <summary>
|
|
96
96
|
/// Toast模块
|
|
@@ -561,13 +561,32 @@ namespace TyphoonUnitySDK
|
|
|
561
561
|
/// gradle是否设置成功
|
|
562
562
|
/// </summary>
|
|
563
563
|
/// <returns></returns>
|
|
564
|
-
public static bool GradleIsMatch()
|
|
564
|
+
public static bool GradleIsMatch(out string error)
|
|
565
565
|
{
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
error = string.Empty;
|
|
567
|
+
var gradlePath = EditorPrefs.GetString("GradlePath");
|
|
568
|
+
if (string.IsNullOrEmpty(gradlePath))
|
|
569
|
+
{
|
|
570
|
+
error = "未配置gradle\n注意:请不要使用unity自带的gradle,改为自定义gradle路径";
|
|
571
|
+
return false;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
var gradleFile = ($"{gradlePath}/bin/gradle");
|
|
575
|
+
if (!File.Exists(gradleFile))
|
|
576
|
+
{
|
|
577
|
+
error =
|
|
578
|
+
$"{gradlePath} 不是一个有效的gradle路径,缺少:{Path.GetFullPath(gradleFile)}\n注意:请不要使用unity自带的gradle,改为自定义gradle路径";
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return true;
|
|
568
582
|
}
|
|
569
583
|
|
|
570
584
|
|
|
585
|
+
public static string GetGradlePath()
|
|
586
|
+
{
|
|
587
|
+
return EditorPrefs.GetString("GradlePath");
|
|
588
|
+
}
|
|
589
|
+
|
|
571
590
|
/// <summary>
|
|
572
591
|
/// 写入Txt
|
|
573
592
|
/// </summary>
|
|
@@ -1172,5 +1191,11 @@ namespace TyphoonUnitySDK
|
|
|
1172
1191
|
|
|
1173
1192
|
return false;
|
|
1174
1193
|
}
|
|
1194
|
+
|
|
1195
|
+
public static void OpenUnityPreferencesExternalTool()
|
|
1196
|
+
{
|
|
1197
|
+
// 打开 Preferences 窗口并定位到 External Tools 页面
|
|
1198
|
+
SettingsService.OpenUserPreferences("Preferences/External Tools");
|
|
1199
|
+
}
|
|
1175
1200
|
}
|
|
1176
1201
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.
|
|
1
|
+
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.22","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.1.22] - 2025-10-25\r\n\r\n### 优化\n* 优化gradle路径获取,取preference的gradle路径\r\n* 优化发布名称使其更有意义\r\n\r\n","major_flag":false,"write_time_stamp":1761400545000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
|