Skip to content

Commit 6e0b313

Browse files
authored
Merge pull request #92 from AIO-GAME/1.x
1.x
2 parents ebb4a78 + d732ebf commit 6e0b313

25 files changed

+354
-196
lines changed

.batch/YooAssetBuild.py

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# -*- coding: UTF-8 -*-
2+
3+
import os
4+
import stat
5+
import ctypes, sys
6+
7+
def enum(label, keyList, valueList):
8+
print("\n======================================================================")
9+
print("- 请选择" + label + ":")
10+
for x in range(len(keyList)):
11+
print("- " + str(x + 1) + ":" + keyList[x])
12+
pass
13+
print("- other:忽略")
14+
index = int(input('')) - 1
15+
maxIndex = len(valueList)
16+
if (index > maxIndex):
17+
return "null"
18+
for x in range(maxIndex):
19+
if (x == index):
20+
return valueList[x]
21+
pass
22+
return "null"
23+
24+
def UnityRun(MethodArgs):
25+
print("- 请输入 unity.exe 文件路径:")
26+
value = str(input(''))
27+
unityExe = "D:\\Unity\\Unity2020.3.37f1\\Editor\\Unity.exe"
28+
if (len(value) > 0): unityExe = value
29+
30+
# 项目路径
31+
print("- 请输入 unity 项目路径:")
32+
value = str(input(''))
33+
projectPath = "E:\\TencentGit\\AIO20200337\\"
34+
if (len(value) > 0): projectPath = value
35+
36+
# 日志文件输出路径
37+
print("- 请输入 日志文件输出路径:")
38+
value = str(input(''))
39+
logfile = "E:\\TencentGit\\AIO20200337\\Build\\test\\beedom20230104.android.log"
40+
if (len(value) > 0): logfile = value
41+
42+
# Unity执行函数
43+
print("- 请输入 Unity 执行函数:")
44+
value = str(input(''))
45+
executeMethod = "AIO.Build.Editor.YooAssetBuild.ArtBuild"
46+
if (len(value) > 0): executeMethod = value
47+
48+
command = unityExe + " -projectPath " + projectPath +" -quit -batchmode -logfile " + logfile + " -executeMethod " + executeMethod + " \"" + MethodArgs + "|\""
49+
50+
print(command)
51+
print("\n开始执行 请稍等")
52+
os.system(command)
53+
54+
def main():
55+
os.system("@echo off&@setlocal enabledelayedexpansion")
56+
os.system("@chcp 65001&@color F")
57+
58+
## -----说明文字-----
59+
print("\n======================================================================")
60+
print("- Welcome :美术资源打包")
61+
print("======================================================================\n")
62+
63+
args = []
64+
#--------------------------------------------------------------
65+
keyList = []
66+
keyList.append("BuiltinBuildPipeline (传统内置构建管线)")
67+
keyList.append("ScriptableBuildPipeline (可编程构建管线)")
68+
69+
valueList = []
70+
valueList.append("b@BuildPipeline BuiltinBuildPipeline")
71+
valueList.append("b@BuildPipeline ScriptableBuildPipeline")
72+
73+
value = enum("BuildPipeline 构建管线类型 (必选)", keyList, valueList)
74+
if (value != "null"): args.append(value)
75+
#--------------------------------------------------------------
76+
keyList = []
77+
keyList.append("None (不拷贝任何文件)")
78+
keyList.append("ClearAndCopyAll (先清空已有文件,然后拷贝所有文件)")
79+
keyList.append("ClearAndCopyByTags (先清空已有文件,然后按照资源标签拷贝文件)")
80+
keyList.append("OnlyCopyAll (不清空已有文件,直接拷贝所有文件)")
81+
keyList.append("OnlyCopyByTags (不清空已有文件,直接按照资源标签拷贝文件)")
82+
83+
valueList = []
84+
valueList.append("b@BuildPipeline None")
85+
valueList.append("b@BuildPipeline ClearAndCopyAll")
86+
valueList.append("b@BuildPipeline ClearAndCopyByTags")
87+
valueList.append("b@BuildPipeline OnlyCopyAll")
88+
valueList.append("b@BuildPipeline OnlyCopyByTags")
89+
90+
value = enum("BuildPipeline 首包资源文件的拷贝方式: (可忽略)", keyList, valueList)
91+
if (value != "null"): args.append(value)
92+
#--------------------------------------------------------------
93+
keyList = []
94+
keyList.append("HashName (哈希值名称)")
95+
keyList.append("BundleName_HashName (资源包名称 + 哈希值名称)")
96+
97+
valueList = []
98+
valueList.append("b@OutputNameStyle HashName")
99+
valueList.append("b@OutputNameStyle BundleName_HashName")
100+
101+
value = enum("OutputNameStyle 输出文件名称的样式: (可忽略)", keyList, valueList)
102+
if (value != "null"): args.append(value)
103+
#--------------------------------------------------------------
104+
keyList = []
105+
keyList.append("ForceRebuild (强制重建模式)")
106+
keyList.append("IncrementalBuild (增量构建模式)")
107+
keyList.append("DryRunBuild (演练构建模式)")
108+
keyList.append("SimulateBuild (模拟构建模式)")
109+
110+
valueList = []
111+
valueList.append("b@BuildMode ForceRebuild")
112+
valueList.append("b@BuildMode IncrementalBuild")
113+
valueList.append("b@BuildMode DryRunBuild")
114+
valueList.append("b@BuildMode SimulateBuild")
115+
116+
value = enum("BuildMode 资源包流水线的构建模式: (可忽略)", keyList, valueList)
117+
if (value != "null"): args.append(value)
118+
#--------------------------------------------------------------
119+
keyList = []
120+
keyList.append("Android (安卓)")
121+
keyList.append("iOS (苹果)")
122+
keyList.append("WebGL (Web网页)")
123+
keyList.append("StandaloneWindows (PC)")
124+
125+
valueList = []
126+
valueList.append("b@ActiveTarget Android")
127+
valueList.append("b@ActiveTarget iOS")
128+
valueList.append("b@ActiveTarget WebGL")
129+
valueList.append("b@ActiveTarget StandaloneWindows")
130+
131+
value = enum("ActiveTarget 资源打包目标平台: (可忽略)", keyList, valueList)
132+
if (value != "null"): args.append(value)
133+
#--------------------------------------------------------------
134+
keyList = []
135+
keyList.append("Uncompressed")
136+
keyList.append("LZMA")
137+
keyList.append("LZ4")
138+
139+
valueList = []
140+
valueList.append("b@CompressOption Uncompressed")
141+
valueList.append("b@CompressOption LZMA")
142+
valueList.append("b@CompressOption LZ4")
143+
144+
value = enum("CompressOption AssetBundle压缩选项: (可忽略)", keyList, valueList)
145+
if (value != "null"): args.append(value)
146+
#--------------------------------------------------------------
147+
print("- 请输入 输出根目录:")
148+
value = str(input(''))
149+
if (len(value) > 0): args.append("b@OutputRoot " + value)
150+
#--------------------------------------------------------------
151+
print("- 请输入 资源目标包:")
152+
value = str(input(''))
153+
if (len(value) > 0): args.append("b@BuildPackage " + value)
154+
#--------------------------------------------------------------
155+
print("- 请输入 资源目标版本:")
156+
value = str(input(''))
157+
if (len(value) > 0): args.append("b@PackageVersion " + value)
158+
#--------------------------------------------------------------
159+
print("- 请输入 首包资源文件的标签集合: (可忽略)")
160+
value = str(input(''))
161+
if (len(value) > 0): args.append("b@CopyBuildinFileTags " + value)
162+
#--------------------------------------------------------------
163+
print("- 请输入 加密类名称: (可忽略)")
164+
value = str(input(''))
165+
if (len(value) > 0): args.append("b@EncyptionClassName " + value)
166+
#--------------------------------------------------------------
167+
print("- 请输入 验证构建结果 1:验证 other:忽略 (可忽略)")
168+
value = str(input(''))
169+
if (value == "1"): args.append("b@VerifyBuildingResult ")
170+
171+
print("\n======================================================================")
172+
arg = ''
173+
for index in range(len(args)):
174+
arg = arg + ' ' +args[index]
175+
print(args[index])
176+
pass
177+
print("======================================================================\n")
178+
179+
UnityRun(arg)
180+
181+
182+
print("- 打包完成: 输入任意键退出本程序")
183+
str(input(''))
184+
185+
def is_admin():
186+
try: return ctypes.windll.shell32.IsUserAnAdmin()
187+
except: return False
188+
189+
if is_admin(): main()
190+
else: ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)

.github/qodana.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/code_quality.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Editor/Data/AssetBuildConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ namespace AIO.UEditor
1111
[Serializable]
1212
[Description("资源打包配置")]
1313
[HelpURL("https://github.com/AIO-GAME/Unity.Asset.CLI/blob/main/.github/API_USAGE/ToolWindow.md#-%E6%89%93%E5%8C%85%E5%B7%A5%E5%85%B7-")]
14+
#if UNITY_2021_1_OR_NEWER
15+
[Icon("Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")]
16+
#else
17+
[ScriptIcon(IconRelative = "Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")]
18+
#endif
1419
public partial class AssetBuildConfig : ScriptableObject
1520
{
1621
private static AssetBuildConfig _instance;

Editor/Data/Collect/Item/AssetCollectItemEx.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public static string[] GetDisPlayNames(this IEnumerable<AssetCollectItem> collec
1414
where item.Type == EAssetCollectItemType.MainAssetCollector
1515
where !string.IsNullOrEmpty(item.CollectPath)
1616
select item.CollectPath
17-
).Distinct()
18-
.ToArray();
17+
).Distinct().
18+
ToArray();
1919
}
2020
}
21-
}
21+
}

Editor/Data/Collect/Root/AssetCollectRoot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ namespace AIO.UEditor
1919
[Serializable]
2020
[HelpURL("https://github.com/AIO-GAME/Unity.Asset.CLI/blob/main/.github/API_USAGE/ToolWindow.md#asset-system-%E5%B7%A5%E5%85%B7%E8%AF%B4%E6%98%8E")]
2121
#if UNITY_2021_1_OR_NEWER
22-
[Icon("Packages/com.aio.package/Resources/Editor/Setting/icon_interests.png")]
22+
[Icon("Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")]
2323
#else
24-
[ScriptIcon(IconRelative = "Packages/com.aio.package/Resources/Editor/Setting/icon_interests.png")]
24+
[ScriptIcon(IconRelative = "Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")]
2525
#endif
2626
public partial class AssetCollectRoot : ScriptableObject
2727
{

Editor/Data/Collect/Root/AssetCollectRoot.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
88

99
[assembly: InternalsVisibleTo("AIO.CLI.YooAsset.Editor")]
10+
[assembly: UnityAPICompatibilityVersion("2019.4.0", true)]
1011

1112
#endregion
1213

@@ -132,4 +133,4 @@ private static SettingsProvider CreateSettingsProvider()
132133
return provider;
133134
}
134135
}
135-
}
136+
}

Editor/Windows/AssetWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static T OpenPage<T>()
150150
if (!Instance)
151151
{
152152
EditorApplication.ExecuteMenuItem(MENU_WINDOW);
153-
return default;
153+
return default(T);
154154
}
155155

156156
Instance.PageIndex = Instance.Pages.IndexOf(Instance.Pages.FirstOrDefault(p => p is T));
@@ -166,4 +166,4 @@ public static bool IsOpenPage<T>()
166166

167167
#endregion
168168
}
169-
}
169+
}

Editor/Windows/AssetWindow.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)