mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-14 19:40:47 +00:00
Compare commits
359 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
101236db8a | ||
|
|
37de007b3f | ||
|
|
d570ba8d74 | ||
|
|
2a956099ae | ||
|
|
74037a5a29 | ||
|
|
861f850a32 | ||
|
|
8b1b5f988a | ||
|
|
efafd1173f | ||
|
|
03e49ff1fb | ||
|
|
ea34be1f00 | ||
|
|
831a9981e3 | ||
|
|
9de4aaa658 | ||
|
|
3579a23bd5 | ||
|
|
c865ddc7f2 | ||
|
|
0bde506aec | ||
|
|
15005b3d30 | ||
|
|
4caf733ac6 | ||
|
|
014b17f5cb | ||
|
|
f3ebda0c04 | ||
|
|
5602addaca | ||
|
|
c4ae67aa8e | ||
|
|
bbcc3bf971 | ||
|
|
8b0e75b9b3 | ||
|
|
b1f02049cc | ||
|
|
512886cdf6 | ||
|
|
0c3ccc5c2f | ||
|
|
b0ea03170f | ||
|
|
2c3b890329 | ||
|
|
0f39cb9444 | ||
|
|
8acc16d3f6 | ||
|
|
fd1715a89b | ||
|
|
0934c813d1 | ||
|
|
be71d38cd8 | ||
|
|
4cdfde31da | ||
|
|
0133549ef8 | ||
|
|
81d9eb47c8 | ||
|
|
5fde689f1f | ||
|
|
5d51bfe751 | ||
|
|
ed86edd2b0 | ||
|
|
f627b5b59a | ||
|
|
549ec74519 | ||
|
|
247ee31348 | ||
|
|
90d3a53bc3 | ||
|
|
19f1d67a61 | ||
|
|
a71c46d1c4 | ||
|
|
82d7bc8fef | ||
|
|
cc85099253 | ||
|
|
d392b02bd4 | ||
|
|
a5138b9846 | ||
|
|
e1b6458c26 | ||
|
|
0f73dc3047 | ||
|
|
a85e49c22a | ||
|
|
6b291de922 | ||
|
|
a4b1300195 | ||
|
|
6f34951a74 | ||
|
|
c798250258 | ||
|
|
6fc82bb55a | ||
|
|
c22cf5ffeb | ||
|
|
36bc24f9fd | ||
|
|
addb0ecdfe | ||
|
|
89e23e0df8 | ||
|
|
e2f582834e | ||
|
|
d2c2844f61 | ||
|
|
1de64278ad | ||
|
|
227f2332a9 | ||
|
|
131614687c | ||
|
|
b8ec902f60 | ||
|
|
eb3e29b6ad | ||
|
|
11ed9d391a | ||
|
|
9cd50bc7f3 | ||
|
|
e92505ba88 | ||
|
|
06a670730c | ||
|
|
ccd21e56cb | ||
|
|
522bcc529a | ||
|
|
2254ac9f5e | ||
|
|
956b3db71d | ||
|
|
fb56959c61 | ||
|
|
b9b9f4e37d | ||
|
|
c050d6d172 | ||
|
|
baf76a454b | ||
|
|
385d343262 | ||
|
|
1f5ad24d44 | ||
|
|
fefc0043cf | ||
|
|
f49143d4f7 | ||
|
|
fd760b12a3 | ||
|
|
14cf8e9ca3 | ||
|
|
3595219a71 | ||
|
|
a4c7d4b8f5 | ||
|
|
43c5c7fb53 | ||
|
|
48d2b36d4e | ||
|
|
2fd87f4d4b | ||
|
|
0fd75b835a | ||
|
|
4489ca570b | ||
|
|
268792b576 | ||
|
|
33907ea967 | ||
|
|
5d7afff3e4 | ||
|
|
fa15f83d85 | ||
|
|
1801974c8a | ||
|
|
bfd476d59c | ||
|
|
7dd08e9634 | ||
|
|
b2776b933a | ||
|
|
9f09b6c526 | ||
|
|
01f6103b48 | ||
|
|
053b4a00d7 | ||
|
|
db159428c6 | ||
|
|
ac7ee16017 | ||
|
|
c2fb7c3cbb | ||
|
|
e70b0d37cd | ||
|
|
53db012fc8 | ||
|
|
b3622167da | ||
|
|
dd6fab46f9 | ||
|
|
f0796dccc9 | ||
|
|
f383c59327 | ||
|
|
e34b9270d2 | ||
|
|
b90ab01fe9 | ||
|
|
236468b4a8 | ||
|
|
6f5fcd55b1 | ||
|
|
4b8f2e3acc | ||
|
|
090e4f4b15 | ||
|
|
53163a75ae | ||
|
|
273401cb20 | ||
|
|
97fe3b0681 | ||
|
|
d401086fd1 | ||
|
|
e3a12ef361 | ||
|
|
1b0288fcd0 | ||
|
|
3ee94fb3b9 | ||
|
|
a0ea80c158 | ||
|
|
264415b362 | ||
|
|
6a76d44c38 | ||
|
|
cebfd57851 | ||
|
|
60eb1c3522 | ||
|
|
40c82835bf | ||
|
|
a13913f572 | ||
|
|
150b46a0a7 | ||
|
|
ebde5a52d3 | ||
|
|
e57466e9e2 | ||
|
|
6f7fca7b34 | ||
|
|
756331fe0b | ||
|
|
5139e2f3a7 | ||
|
|
1c4aba6db5 | ||
|
|
44faa0c5e6 | ||
|
|
72c97341b1 | ||
|
|
9acc240b5a | ||
|
|
ed89e73d26 | ||
|
|
9e33df0375 | ||
|
|
6c98f9a09d | ||
|
|
9ed85afb29 | ||
|
|
560a395173 | ||
|
|
8bce963588 | ||
|
|
f8a3fe47e5 | ||
|
|
48356a4f9e | ||
|
|
d2a28bd801 | ||
|
|
3949abb53f | ||
|
|
06a50a049e | ||
|
|
6f049e2427 | ||
|
|
01c08a46ab | ||
|
|
31dc5b494d | ||
|
|
18e74e906e | ||
|
|
4f62b249b4 | ||
|
|
fe7f9bff08 | ||
|
|
e71077f294 | ||
|
|
eabebf3d8f | ||
|
|
4ef789520a | ||
|
|
4322f3c58c | ||
|
|
c40a796170 | ||
|
|
32841d4773 | ||
|
|
e469b32d94 | ||
|
|
c0e5315953 | ||
|
|
7b5f366533 | ||
|
|
e674d5bf97 | ||
|
|
9b0bebd981 | ||
|
|
dc46462bfa | ||
|
|
51c9943cf2 | ||
|
|
3db9b750e3 | ||
|
|
1b57a0b7df | ||
|
|
bd5ce1e6bd | ||
|
|
7eb74d4dd1 | ||
|
|
a384ca1f18 | ||
|
|
c7253a3f23 | ||
|
|
b296abb27e | ||
|
|
999ede6bab | ||
|
|
bd1569c34d | ||
|
|
3c265c1ab4 | ||
|
|
570a3a817c | ||
|
|
7a8f344927 | ||
|
|
b2c9cb3a7e | ||
|
|
06a5c90b23 | ||
|
|
dcd8ced42a | ||
|
|
76b31bd3cf | ||
|
|
009e8ece79 | ||
|
|
4e257ab27d | ||
|
|
927400b669 | ||
|
|
c0d42e79d8 | ||
|
|
b843c6b0ed | ||
|
|
9fb7f8bbfe | ||
|
|
b0382afad0 | ||
|
|
1ab7689174 | ||
|
|
29d456c065 | ||
|
|
b0dc829b04 | ||
|
|
b3ead90832 | ||
|
|
7bf00d4ff6 | ||
|
|
030e94d8ff | ||
|
|
cf05254121 | ||
|
|
3f786bca3b | ||
|
|
98719d212f | ||
|
|
3409f7ce4d | ||
|
|
f57b354e9b | ||
|
|
974493f88d | ||
|
|
69a69988a1 | ||
|
|
4e9c1955eb | ||
|
|
b6c68a533e | ||
|
|
38aa1c3509 | ||
|
|
eb2f783417 | ||
|
|
8556e071fa | ||
|
|
6155256fb6 | ||
|
|
0d4f2bc893 | ||
|
|
600e928ab4 | ||
|
|
4599ff098c | ||
|
|
4d2df5b705 | ||
|
|
79a7732cfd | ||
|
|
79467bbf13 | ||
|
|
c7d678282b | ||
|
|
d376afc217 | ||
|
|
a62f808591 | ||
|
|
b334a4986b | ||
|
|
a4111349a0 | ||
|
|
bdcf95384f | ||
|
|
d910af589d | ||
|
|
0531864534 | ||
|
|
72b1278f5c | ||
|
|
875cd24cba | ||
|
|
fcc729a0bf | ||
|
|
d10e54248b | ||
|
|
b84800a905 | ||
|
|
8ccd7e552c | ||
|
|
772ba484eb | ||
|
|
cdbedee705 | ||
|
|
10cce48e71 | ||
|
|
13e8410d80 | ||
|
|
6f07faf4da | ||
|
|
e3228d406e | ||
|
|
daf2133535 | ||
|
|
9bcbc10862 | ||
|
|
e6958d205e | ||
|
|
b03d9db2b0 | ||
|
|
30853b6d62 | ||
|
|
a7cafcb328 | ||
|
|
d03bca5512 | ||
|
|
af3fc50188 | ||
|
|
b71eeeb855 | ||
|
|
317c42521a | ||
|
|
064d69269e | ||
|
|
9e6401d3c0 | ||
|
|
2aaba328ee | ||
|
|
62fdc93a82 | ||
|
|
408f0942ee | ||
|
|
ddda9e29db | ||
|
|
c2b33f5ec4 | ||
|
|
e58999e484 | ||
|
|
ed9692574c | ||
|
|
f7e078e064 | ||
|
|
b74a44dc36 | ||
|
|
6b36cdb5ee | ||
|
|
56ae1a8f95 | ||
|
|
3069b1d1f1 | ||
|
|
e7d346e4e1 | ||
|
|
7d9e00a574 | ||
|
|
7382afe535 | ||
|
|
af7d4774d6 | ||
|
|
520a8a0623 | ||
|
|
fbd0d8ec40 | ||
|
|
3fea98ce4c | ||
|
|
7c561ce254 | ||
|
|
522ddb5115 | ||
|
|
47f5790507 | ||
|
|
0cdcfe7f52 | ||
|
|
e4d69d869b | ||
|
|
61afb70cb9 | ||
|
|
79580697a1 | ||
|
|
6cb74760b0 | ||
|
|
c758aa81ff | ||
|
|
400c2ccefe | ||
|
|
64e9734bbe | ||
|
|
f6244885be | ||
|
|
82c57c382f | ||
|
|
7eacb46555 | ||
|
|
d9c911d89b | ||
|
|
a3ceb3dcb6 | ||
|
|
a5b68b28b2 | ||
|
|
bd285faf37 | ||
|
|
8a4960b560 | ||
|
|
83c6ae2057 | ||
|
|
b71563e889 | ||
|
|
79e0cf85f9 | ||
|
|
e996eaa008 | ||
|
|
5088c9e985 | ||
|
|
610b3c6d32 | ||
|
|
cc7290f10e | ||
|
|
576b842368 | ||
|
|
d23c0ba715 | ||
|
|
98e19baebd | ||
|
|
f5947db44a | ||
|
|
e978164329 | ||
|
|
966c8f2efa | ||
|
|
a57fec3d71 | ||
|
|
84844eda20 | ||
|
|
698cdcba61 | ||
|
|
1d6c9393d4 | ||
|
|
b654ac156d | ||
|
|
d133a9a692 | ||
|
|
d55db19f0e | ||
|
|
e3fc3df32c | ||
|
|
f2334da72d | ||
|
|
2902b6c2cf | ||
|
|
dfa95b57b9 | ||
|
|
33a2cf66d0 | ||
|
|
5f52cf5b51 | ||
|
|
9d07905f2d | ||
|
|
26dbe9dfdd | ||
|
|
98c5851071 | ||
|
|
a6ee571d65 | ||
|
|
a138701afe | ||
|
|
e52bdea255 | ||
|
|
068a712a30 | ||
|
|
80a5300648 | ||
|
|
0c36e458f7 | ||
|
|
b2fa52e4c4 | ||
|
|
151e978e5b | ||
|
|
9e806861ec | ||
|
|
a9a9368b9b | ||
|
|
7936ba31ea | ||
|
|
afc456de9a | ||
|
|
a98db0ba83 | ||
|
|
fb8720edd3 | ||
|
|
2aa2a0ac3a | ||
|
|
0531b6ef3a | ||
|
|
24142de11f | ||
|
|
7fad6eb70b | ||
|
|
f60227abdf | ||
|
|
18d6a74c53 | ||
|
|
03d06ba657 | ||
|
|
07086b68c8 | ||
|
|
0a85f3126f | ||
|
|
efa4180340 | ||
|
|
fb06f2aa11 | ||
|
|
ce023cedb8 | ||
|
|
3d1a28a50e | ||
|
|
5d2d0b4168 | ||
|
|
fa985a5a93 | ||
|
|
40f9937b60 | ||
|
|
c543c629c3 | ||
|
|
f861279c49 | ||
|
|
ee89f81d46 | ||
|
|
6d216561f8 | ||
|
|
0a96e583d3 | ||
|
|
c9d263c60d | ||
|
|
2d6488abf4 | ||
|
|
7dfbac4a24 | ||
|
|
7cfe4cb2c9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -20,6 +20,8 @@
|
|||||||
/Assets/StreamingAssets.meta
|
/Assets/StreamingAssets.meta
|
||||||
/Assets/Samples
|
/Assets/Samples
|
||||||
/Assets/Samples.meta
|
/Assets/Samples.meta
|
||||||
|
/Assets/csc.rsp
|
||||||
|
/Assets/csc.rsp.meta
|
||||||
/UserSettings
|
/UserSettings
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,704 @@
|
|||||||
|
|
||||||
All notable changes to this package will be documented in this file.
|
All notable changes to this package will be documented in this file.
|
||||||
|
|
||||||
|
## [2.3.17] - 2025-10-30
|
||||||
|
|
||||||
|
**非常重要**:修复了#627优化导致的资源清单CRC值为空的问题。
|
||||||
|
|
||||||
|
该问题会导致下载的损坏文件验证通过。
|
||||||
|
|
||||||
|
影响范围:v2.3.15版本,v2.3.16版本。
|
||||||
|
|
||||||
|
**非常重要**:(#661) 修复了Package销毁过程中,遇到正在加载的AssetBundle会导致无法卸载的问题。
|
||||||
|
|
||||||
|
该问题是偶现,引擎会提示AssetBundle已经加载,无法加载新的文件,导致资源对象加载失败!
|
||||||
|
|
||||||
|
影响范围:所有版本!
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 重构并统一了资源清单的反序列化逻辑。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#645) 修复了着色器变种收集工具,在极端情况下变种收集不完整的问题。
|
||||||
|
- (#646) 修复了EditorSimulateMode模式下开启模拟下载tag不生效的问题。
|
||||||
|
- (#667) 修复了所有编辑器窗口针对中文IME的输入问题。
|
||||||
|
- (#670) 修复了Catalog文件生成过程中白名单未考虑自定义清单前缀名。
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- (#650) 解决互相依赖的资源包无法卸载的问题。需要开启宏定义:YOOASSET_EXPERIMENTAL
|
||||||
|
- (#655) 优化了初始化的时候,缓存文件搜索效率。安卓平台性能提升1倍,IOS平台性能提升3倍。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- (#643) 新增构建参数,可以节省资源清单运行时内存
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class ScriptableBuildParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 使用可寻址地址代替资源路径
|
||||||
|
/// 说明:开启此项可以节省运行时清单占用的内存!
|
||||||
|
/// </summary>
|
||||||
|
public bool ReplaceAssetPathWithAddress = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#648) 新增初始化参数,可以自动释放引用计数为零的资源包
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class InitializeParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 当资源引用计数为零的时候自动释放资源包
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoUnloadBundleWhenUnused = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 程序集宏定义代码转移到扩展工程。参考MacroSupport文件夹。
|
||||||
|
|
||||||
|
## [2.3.16] - 2025-09-17
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- (#638) 优化了Provider加载机制,引用计数为零时自动挂起!
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#644) [**严重**] 修复了2.3.15版本,资产量巨大的情况下,编辑器下模拟模式初始化耗时很久的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- (#639) 新增了文件系统参数:VIRTUAL_DOWNLOAD_MODE 和 VIRTUAL_DOWNLOAD_SPEED
|
||||||
|
|
||||||
|
编辑器下不需要构建AB,也可以模拟远端资源下载,等同真机运行环境。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class DefaultEditorFIleSystem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 模拟虚拟下载模式
|
||||||
|
/// </summary>
|
||||||
|
public bool VirtualDownloadMode { private set; get; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模拟虚拟下载的网速(单位:字节)
|
||||||
|
/// </summary>
|
||||||
|
public int VirtualDownloadSpeed { private set; get; } = 1024;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#640) 新增了文件系统参数:VIRTUAL_WEBGL_MODE
|
||||||
|
|
||||||
|
编辑器下不需要构建AB,也可以模拟小游戏开发环境,等同真机运行环境。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class DefaultEditorFIleSystem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 模拟WebGL平台模式
|
||||||
|
/// </summary>
|
||||||
|
public bool VirtualWebGLMode { private set; get; } = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#642) 新增了文件系统参数:DOWNLOAD_WATCH_DOG_TIME
|
||||||
|
|
||||||
|
监控时间范围内,如果没有接收到任何下载数据,那么直接终止任务!
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class DefaultCacheFIleSystem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义参数:下载任务的看门狗机制监控时间
|
||||||
|
/// </summary>
|
||||||
|
public int DownloadWatchDogTime { private set; get; } = int.MaxValue;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 下载器参数timeout移除。
|
||||||
|
|
||||||
|
可以使用文件系统的看门狗机制代替。
|
||||||
|
|
||||||
|
- (#632) IFilterRule接口变动。
|
||||||
|
|
||||||
|
收集器可以指定搜寻的资源类型,在收集目录资产量巨大的情况下,可以极大加快打包速度!
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public interface IFilterRule
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 搜寻的资源类型
|
||||||
|
/// 说明:使用引擎方法搜索获取所有资源列表
|
||||||
|
/// </summary>
|
||||||
|
string FindAssetType { get; }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.15] - 2025-09-09
|
||||||
|
|
||||||
|
**重要**:升级了资源清单版本,不兼容老版本。建议重新提审安装包。
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 重构了UniTask扩展库的目录结构和说明文档。
|
||||||
|
- 重构了内置文件系统类的加载和拷贝逻辑,解决在一些特殊机型上遇到的偶发性拷贝失败问题。
|
||||||
|
- 增加了生成内置清单文件的窗口工具,详情见扩展工程里CreateBuildinCatalog目录。
|
||||||
|
- 优化了异步操作系统的繁忙检测机制。
|
||||||
|
- (#621) 资源配置页面可以展示DependCollector和StaticCollector包含的文件列表内容。
|
||||||
|
- (#627) 优化了资源清单部分字段类型,CRC字段从字符串类型调整为整形,可以降低清单尺寸。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复了构建页面扩展类缺少指定属性报错的问题。
|
||||||
|
- (#611) 修复了资源扫描器配置页面,修改备注信息后会丢失焦点的问题。
|
||||||
|
- (#622) 修复了纯鸿蒙系统读取内置加密文件失败的问题。
|
||||||
|
- (#620) 修复了LINUX系统URL地址转换失败的问题。
|
||||||
|
- (#631) 修复了NET 4.x程序集库Math.Clamp导致的编译错误。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了支持支付宝小游戏的文件系统扩展类。
|
||||||
|
|
||||||
|
- 新增了支持Taptap小游戏的文件系统扩展类。
|
||||||
|
|
||||||
|
- 新增了资源系统初始化参数:UseWeakReferenceHandle
|
||||||
|
|
||||||
|
目前处于预览版,可以在引擎设置页面开启宏:YOOASSET_EXPERIMENTAL
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 启用弱引用资源句柄
|
||||||
|
/// </summary>
|
||||||
|
public bool UseWeakReferenceHandle = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
- 内置文件系统和缓存文件系统新增初始化参数:FILE_VERIFY_MAX_CONCURRENCY
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义参数:初始化的时候缓存文件校验最大并发数
|
||||||
|
/// </summary>
|
||||||
|
public int FileVerifyMaxConcurrency { private set; get; }
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#623) 内置构建管线新增构建参数:StripUnityVersion
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 从文件头里剥离Unity版本信息
|
||||||
|
/// </summary>
|
||||||
|
public bool StripUnityVersion = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
- 可编程构建管线新增构建参数:TrackSpriteAtlasDependencies
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 自动建立资源对象对图集的依赖关系
|
||||||
|
/// </summary>
|
||||||
|
public bool TrackSpriteAtlasDependencies = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#617) 新增资源收集配置参数:SupportExtensionless
|
||||||
|
|
||||||
|
在不需要模糊加载模式的前提下,关闭此选项,可以降低运行时内存大小。
|
||||||
|
|
||||||
|
该选项默认开启!
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class CollectCommand
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支持无后缀名的资源定位地址
|
||||||
|
/// </summary>
|
||||||
|
public bool SupportExtensionless { set; get; }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#625) 异步操作系统类新增监听方法。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class OperationSystem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 监听任务开始
|
||||||
|
/// </summary>
|
||||||
|
public static void RegisterStartCallback(Action<string, AsyncOperationBase> callback);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 监听任务结束
|
||||||
|
/// </summary>
|
||||||
|
public static void RegisterFinishCallback(Action<string, AsyncOperationBase> callback);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.14] - 2025-07-23
|
||||||
|
|
||||||
|
**重要**:**所有下载相关的超时参数(timeout)已更新判定逻辑**
|
||||||
|
|
||||||
|
超时不再以‘指定时间内未接收到任何数据’为判定条件,而是以‘指定时间内未完成整个下载任务’为判定条件。
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 重构了核心代码的下载逻辑,解决了同步加载触发的下载任务没有完成的问题。
|
||||||
|
- 扩展工程里新增了PreprocessBuildCatalog类,用于处理在构建应用程序前自动生成内置资源目录文件。
|
||||||
|
- (#592) 优化了资源清单逻辑里不必要产生的GC逻辑。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#590) 修复了TryUnloadUnusedAsset方法,在依赖嵌套层数过深导致没有卸载的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了支持Google Play的文件系统扩展示例。
|
||||||
|
|
||||||
|
- 新增了支持DefaultCacheFileSystem的单元测试用例。
|
||||||
|
|
||||||
|
- 新增了文件系统配置参数:DISABLE_ONDEMAND_DOWNLOAD
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class FileSystemParametersDefine
|
||||||
|
{
|
||||||
|
// 禁用边玩边下机制
|
||||||
|
public const string DISABLE_ONDEMAND_DOWNLOAD = "DISABLE_ONDEMAND_DOWNLO";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- IManifestServices接口拆分为了IManifestProcessServices和IManifestRestoreServices
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public interface IManifestProcessServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 处理资源清单(压缩或加密)
|
||||||
|
/// </summary>
|
||||||
|
byte[] ProcessManifest(byte[] fileData);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IManifestRestoreServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 还原资源清单(解压或解密)
|
||||||
|
/// </summary>
|
||||||
|
byte[] RestoreManifest(byte[] fileData);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.12] - 2025-07-01
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 优化了同步接口导致的资源拷贝和资源验证性能开销高的现象。
|
||||||
|
- 微信小游戏和抖音小游戏支持资源清单加密。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#579) 修复了2.3.10版本资源包构建页面里CopyBuildinFileParam无法编辑问题。
|
||||||
|
- (#572) 修复了资源收集页面指定收集的预制体名称变动的问题。
|
||||||
|
- (#582) 修复了非递归收集依赖时,依赖列表中才包含主资源的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增初始化参数:WebGLForceSyncLoadAsset
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public abstract class InitializeParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// WebGL平台强制同步加载资源对象
|
||||||
|
/// </summary>Add commentMore actions
|
||||||
|
public bool WebGLForceSyncLoadAsset = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#576) 新增了资源清单服务类:IManifestServices
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 资源清单文件处理服务接口
|
||||||
|
/// </summary>
|
||||||
|
public interface IManifestServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 处理资源清单(压缩和加密)
|
||||||
|
/// </summary>
|
||||||
|
byte[] ProcessManifest(byte[] fileData);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 还原资源清单(解压和解密)
|
||||||
|
/// </summary>
|
||||||
|
byte[] RestoreManifest(byte[] fileData);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#585) 新增了本地文件拷贝服务类:ICopyLocalFileServices
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 本地文件拷贝服务类
|
||||||
|
/// </summary>
|
||||||
|
public interface ICopyLocalFileServices
|
||||||
|
{
|
||||||
|
void CopyFile(LocalFileInfo sourceFileInfo, string destFilePath);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.10] - 2025-06-17
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 小游戏扩展库已经独立,可以单独导入到项目工程。
|
||||||
|
- 编辑器里的TableView视图新增了AssetObjectCell类。
|
||||||
|
- (#552) 微信小游戏文件系统类,增加了URL合法性的初始化检测机制。
|
||||||
|
- (#566) 重构了资源构建页面,方便扩展自定义界面。
|
||||||
|
- (#573) 完善了AssetDependencyDB的输出日志,可以正确输出丢失的引用资产信息。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复太空战机DEMO在退出运行模式时的报错。
|
||||||
|
- (#551) 修复了Unity2019, Unity2020的代码兼容性报错。
|
||||||
|
- (#569) 修复了TVOS平台的兼容问题。
|
||||||
|
- (#564) 修复了TiktokFileSystem文件系统里appendTimeTicks无效的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- (#562) 新增了解密方法。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public interface IDecryptionServices
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 后备方式获取解密的资源包对象
|
||||||
|
/// 注意:当正常解密方法失败后,会触发后备加载!
|
||||||
|
/// 说明:建议通过LoadFromMemory()方法加载资源对象作为保底机制。
|
||||||
|
/// issues : https://github.com/tuyoogame/YooAsset/issues/562
|
||||||
|
/// </summary>
|
||||||
|
DecryptResult LoadAssetBundleFallback(DecryptFileInfo fileInfo);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.9] - 2025-05-13
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 增加了YOO_ASSET_EXPERIMENT宏,用于控制实验性代码的开关。
|
||||||
|
- 构建管线目前会输出构建日志到输出目录下,方便查看引擎在构建时主动清空的控制台日志。
|
||||||
|
- 优化了收集器tag传染扩散逻辑,避免Group里配置了Tag导致的无意义的警告信息。
|
||||||
|
- 扩展工程内PanelMonitor代码默认关闭状态。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#528) 修复了AssetDependencyDatabase在查询引擎资源对象是否存在的时效问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- (#542) 新增了资源管理系统销毁方法。
|
||||||
|
|
||||||
|
该方法会销毁所有的资源包裹和异步操作任务,以及卸载所有AssetBundle对象!
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class YooAssets
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 销毁资源系统
|
||||||
|
/// </summary>
|
||||||
|
public static void Destroy();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增了SBP构建管线的构建参数
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 从AssetBundle文件头里剥离Unity版本信息
|
||||||
|
/// </summary>
|
||||||
|
public bool StripUnityVersion = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增了构建错误码:BuiltinShadersBundleNameIsNull
|
||||||
|
|
||||||
|
## [2.3.8] - 2025-04-17
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 扩展工程里增加了“图集丢失变白块的解决方案”的相关代码。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#528) 修复了微信小游戏平台WXFSClearUnusedBundleFiles无法清理的问题。
|
||||||
|
- (#531) 修复了微信小游戏平台WXFSClearUnusedBundleFiles没有适配BundleName_HashName命名方式。
|
||||||
|
- (#533) 修复了Editor程序集下无法访问YooAsset.Editor程序集里的internal字段的问题。
|
||||||
|
- (#534) 修复了资源报告窗口AssetView视图里,依赖资源包列表显示不准确的问题。
|
||||||
|
|
||||||
|
## [2.3.7] - 2025-04-01
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- (#526) 运行时资源清单的哈希值验证兼容了MD5和CRC32两种方式。
|
||||||
|
- (#515) 优化了资源路径大小写不敏感的逻辑代码,减少字符串操作产生的GC。
|
||||||
|
- (#523) UnloadUnusedAssetsOperation方法支持了分帧处理。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#520) 修复了UWP平台获取WWW加载路径未适配的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了文件系统初始化参数:INSTALL_CLEAR_MODE
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 覆盖安装清理模式
|
||||||
|
/// </summary>
|
||||||
|
public enum EOverwriteInstallClearMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 不做任何处理
|
||||||
|
/// </summary>
|
||||||
|
None = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存文件(包含资源文件和清单文件)
|
||||||
|
/// </summary>
|
||||||
|
ClearAllCacheFiles = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存的资源文件
|
||||||
|
/// </summary>
|
||||||
|
ClearAllBundleFiles = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存的清单文件
|
||||||
|
/// </summary>
|
||||||
|
ClearAllManifestFiles = 3,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增了初始化参数:BundleLoadingMaxConcurrency
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public abstract class InitializeParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 同时加载Bundle文件的最大并发数
|
||||||
|
/// </summary>
|
||||||
|
public int BundleLoadingMaxConcurrency = int.MaxValue;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.6] - 2025-03-25
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 构建管线新增了TaskCreateCatalog任务节点。
|
||||||
|
- 内置文件系统的catalog文件现在存储在streammingAssets目录下。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#486) 修复了微信小游戏文件系统调用ClearUnusedBundleFiles时候的异常。
|
||||||
|
|
||||||
|
## [2.3.5-preview] - 2025-03-14
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#502) 修复了原生缓存文件由于文件格式变动导致的加载本地缓存文件失败的问题。
|
||||||
|
- (#504) 修复了MacOS平台Offline Play Mode模式请求本地资源清单失败的问题。
|
||||||
|
- (#506) 修复了v2.3x版本LoadAllAssets方法计算依赖Bundle不完整的问题。
|
||||||
|
- (#506) 修复了微信小游戏文件系统,在启用加密算法后卸载bundle报错的问题。
|
||||||
|
|
||||||
|
## [2.3.4-preview] - 2025-03-08
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- YooAsset支持了版本宏定义。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
YOO_ASSET_2
|
||||||
|
YOO_ASSET_2_3
|
||||||
|
YOO_ASSET_2_3_OR_NEWER
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#389) 修复了禁用域重载(Reload Domain)的情况下,再次启动游戏报错的问题。
|
||||||
|
- (#496) 修复了文件系统参数RESUME_DOWNLOAD_MINMUM_SIZE传入int值会导致异常的错误。
|
||||||
|
- (#498) 修复了v2.3版本尝试加载安卓包内的原生资源包失败的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了YooAssets.GetAllPackages()方法
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 获取所有资源包裹
|
||||||
|
/// </summary>
|
||||||
|
public static List<ResourcePackage> GetAllPackages()
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.3-preview] - 2025-03-06
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 新增了异步操作任务调试器,AssetBundleDebugger窗口-->OperationView视图模式
|
||||||
|
- 编辑器下模拟构建默认启用依赖关系数据库,可以大幅降低编辑器下启动游戏的时间。
|
||||||
|
- 单元测试用例增加加密解密测试用例。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#492) 修复了发布的MAC平台应用,在启动的时候提示权限无法获取的问题。
|
||||||
|
|
||||||
|
## [2.3.2-preview] - 2025-02-27
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (2.3.1) 修复小游戏平台下载器不生效的问题。
|
||||||
|
- (#480) 修复了Unity工程打包导出时的报错。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 下载器新增参数:recursiveDownload
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 创建资源下载器,用于下载指定的资源依赖的资源包文件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="recursiveDownload">下载资源对象所属资源包内所有资源对象依赖的资源包
|
||||||
|
public ResourceDownloaderOperation CreateBundleDownloader()
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增CustomPlayMode模式
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义运行模式的初始化参数
|
||||||
|
/// </summary>
|
||||||
|
public class CustomPlayModeParameters : InitializeParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件系统初始化参数列表
|
||||||
|
/// 注意:列表最后一个元素作为主文件系统!
|
||||||
|
/// </summary>
|
||||||
|
public List<FileSystemParameters> FileSystemParameterList;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.3.1-preview] - 2025-02-25
|
||||||
|
|
||||||
|
**资源加载依赖计算方式还原为了1.5x版本的模式,只加载资源对象实际依赖的资源包,不再以资源对象所在资源包的依赖关系为加载标准**。
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 优化OperationSystem的更新机制,异步加载的耗时降低了50%。
|
||||||
|
- 优化了Debugger窗口的显示页面,BundleView页面增加资源包的引用列表。
|
||||||
|
- 优化了Reporter窗口的显示页面。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复了怀旧依赖模式下,TAG传染不正确的问题。
|
||||||
|
|
||||||
|
## [2.3.0-preview] - 2025-02-19
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
资源收集窗口列表元素支持手动上下拖拽排序!
|
||||||
|
|
||||||
|
资源扫描窗口列表元素支持手动上下拖拽排序!
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了UIElements扩展类ReorderableListView
|
||||||
|
|
||||||
|
- 新增初始化方法
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class YooAssets
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设置异步系统参数,快速启动模式的开关
|
||||||
|
/// 注意:该模式默认开启
|
||||||
|
/// </summary>
|
||||||
|
public static void SetOperationSystemQuickStartMode(bool state)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 新增打包构建参数
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class BuildParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 旧版依赖模式
|
||||||
|
/// 说明:兼容YooAssets1.5.x版本
|
||||||
|
/// </summary>
|
||||||
|
public bool LegacyDependency = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#472) 修复了Unity6平台,TableView视图无法显示问题。
|
||||||
|
- 修复了微信小游戏和抖音小游戏未正确使用插件的卸载方法。
|
||||||
|
|
||||||
|
## [2.2.12] - 2025-02-14
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- WebGL网页平台支持文件加密。
|
||||||
|
- 微信小游戏平台支持文件加密。
|
||||||
|
- 抖音小游戏平台支持文件加密。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#466) 修复了微信小游戏文件系统查询机制不生效!
|
||||||
|
- (#341) 修复了微信小游戏的下载进度异常问题。
|
||||||
|
- (#471) 修复了Unity2019,Unity2020平台上,TableView视图无法显示的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增了ResourcePackage.UnloadAllAssetsAsync(UnloadAllAssetsOptions options)方法
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public sealed class UnloadAllAssetsOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 释放所有资源句柄,防止卸载过程中触发完成回调!
|
||||||
|
/// </summary>
|
||||||
|
public bool ReleaseAllHandles = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卸载过程中锁定加载操作,防止新的任务请求!
|
||||||
|
/// </summary>
|
||||||
|
public bool LockLoadOperation = true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## [2.2.11] - 2025-02-10
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- AssetArtScanner配置和生成报告的容错性检测。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#465) 修复了特殊情况下,没有配置资源包文件后缀名构建失败的问题。
|
||||||
|
- (#468) 修复了安卓平台二次启动加载原生文件或加密文件失败的问题。
|
||||||
|
|
||||||
## [2.2.10] - 2025-02-08
|
## [2.2.10] - 2025-02-08
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 97923f5987c469a4898718033af09e99
|
guid: fab3cd742c11be2479b07f5d447a78c9
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
5
Assets/YooAsset/Editor/Assembly/AssemblyInfo.cs
Normal file
5
Assets/YooAsset/Editor/Assembly/AssemblyInfo.cs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
// 外部友元
|
||||||
|
[assembly: InternalsVisibleTo("YooAsset.EditorExtension")]
|
||||||
|
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor")]
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 0c3f4136cf7142346ae33e8a82cbdb27
|
guid: ef774f01e50ab0a4d88122041938a6b9
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -97,7 +97,7 @@ namespace YooAsset.Editor
|
|||||||
private Button _passesVisibleBtn;
|
private Button _passesVisibleBtn;
|
||||||
private Label _titleLabel;
|
private Label _titleLabel;
|
||||||
private Label _descLabel;
|
private Label _descLabel;
|
||||||
private TableView _elementTableView;
|
private TableViewer _elementTableView;
|
||||||
|
|
||||||
private ScanReportCombiner _reportCombiner;
|
private ScanReportCombiner _reportCombiner;
|
||||||
private string _lastestOpenFolder;
|
private string _lastestOpenFolder;
|
||||||
@@ -152,7 +152,7 @@ namespace YooAsset.Editor
|
|||||||
_descLabel = root.Q<Label>("ReportDesc");
|
_descLabel = root.Q<Label>("ReportDesc");
|
||||||
|
|
||||||
// 列表相关
|
// 列表相关
|
||||||
_elementTableView = root.Q<TableView>("TopTableView");
|
_elementTableView = root.Q<TableViewer>("TopTableView");
|
||||||
_elementTableView.ClickTableDataEvent = OnClickTableViewItem;
|
_elementTableView.ClickTableDataEvent = OnClickTableViewItem;
|
||||||
|
|
||||||
_lastestOpenFolder = EditorTools.GetProjectPath();
|
_lastestOpenFolder = EditorTools.GetProjectPath();
|
||||||
@@ -196,6 +196,32 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 导入单个报告对象
|
||||||
|
/// </summary>
|
||||||
|
public void ImportSingleReprotFile(ScanReport report)
|
||||||
|
{
|
||||||
|
_reportCombiner = new ScanReportCombiner();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_reportCombiner.Combine(report);
|
||||||
|
|
||||||
|
// 刷新页面
|
||||||
|
RefreshToolbar();
|
||||||
|
FillTableView();
|
||||||
|
RebuildView();
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
_reportCombiner = null;
|
||||||
|
_titleLabel.text = "导入报告失败!";
|
||||||
|
_descLabel.text = e.Message;
|
||||||
|
UnityEngine.Debug.LogError(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ImportSingleBtn_clicked()
|
private void ImportSingleBtn_clicked()
|
||||||
{
|
{
|
||||||
string selectFilePath = EditorUtility.OpenFilePanel("导入报告", _lastestOpenFolder, "json");
|
string selectFilePath = EditorUtility.OpenFilePanel("导入报告", _lastestOpenFolder, "json");
|
||||||
@@ -326,7 +352,7 @@ namespace YooAsset.Editor
|
|||||||
var column = new TableColumn("眼睛框", string.Empty, columnStyle);
|
var column = new TableColumn("眼睛框", string.Empty, columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
var toggle = new DisplayToggle();
|
var toggle = new ToggleDisplay();
|
||||||
toggle.text = string.Empty;
|
toggle.text = string.Empty;
|
||||||
toggle.style.unityTextAlign = TextAnchor.MiddleCenter;
|
toggle.style.unityTextAlign = TextAnchor.MiddleCenter;
|
||||||
toggle.RegisterValueChangedCallback((evt) => { OnDisplayToggleValueChange(toggle, evt); });
|
toggle.RegisterValueChangedCallback((evt) => { OnDisplayToggleValueChange(toggle, evt); });
|
||||||
@@ -334,11 +360,10 @@ namespace YooAsset.Editor
|
|||||||
};
|
};
|
||||||
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
||||||
{
|
{
|
||||||
var toggle = element as DisplayToggle;
|
var toggle = element as ToggleDisplay;
|
||||||
toggle.userData = data;
|
toggle.userData = data;
|
||||||
var tableData = data as ElementTableData;
|
var tableData = data as ElementTableData;
|
||||||
toggle.SetValueWithoutNotify(tableData.Element.Hidden);
|
toggle.SetValueWithoutNotify(tableData.Element.Hidden);
|
||||||
toggle.RefreshIcon();
|
|
||||||
};
|
};
|
||||||
_elementTableView.AddColumn(column);
|
_elementTableView.AddColumn(column);
|
||||||
var headerElement = _elementTableView.GetHeaderElement("眼睛框");
|
var headerElement = _elementTableView.GetHeaderElement("眼睛框");
|
||||||
@@ -442,18 +467,36 @@ namespace YooAsset.Editor
|
|||||||
columnStyle.Stretchable = header.Stretchable;
|
columnStyle.Stretchable = header.Stretchable;
|
||||||
columnStyle.Searchable = header.Searchable;
|
columnStyle.Searchable = header.Searchable;
|
||||||
columnStyle.Sortable = header.Sortable;
|
columnStyle.Sortable = header.Sortable;
|
||||||
|
columnStyle.Counter = header.Counter;
|
||||||
|
columnStyle.Units = header.Units;
|
||||||
var column = new TableColumn(header.HeaderTitle, header.HeaderTitle, columnStyle);
|
var column = new TableColumn(header.HeaderTitle, header.HeaderTitle, columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
var label = new Label();
|
if (header.HeaderType == EHeaderType.AssetObject)
|
||||||
label.style.marginLeft = 3f;
|
{
|
||||||
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
var objectFiled = new ObjectField();
|
||||||
return label;
|
return objectFiled;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var label = new Label();
|
||||||
|
label.style.marginLeft = 3f;
|
||||||
|
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||||
|
return label;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
column.BindCell = (VisualElement element, ITableData data, ITableCell cell) =>
|
||||||
{
|
{
|
||||||
var infoLabel = element as Label;
|
if (header.HeaderType == EHeaderType.AssetObject)
|
||||||
infoLabel.text = (string)cell.GetDisplayObject();
|
{
|
||||||
|
var objectFiled = element as ObjectField;
|
||||||
|
objectFiled.value = (UnityEngine.Object)cell.GetDisplayObject();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var infoLabel = element as Label;
|
||||||
|
infoLabel.text = (string)cell.GetDisplayObject();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
_elementTableView.AddColumn(column);
|
_elementTableView.AddColumn(column);
|
||||||
}
|
}
|
||||||
@@ -479,6 +522,10 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
tableData.AddAssetPathCell(scanInfo.HeaderTitle, scanInfo.ScanInfo);
|
tableData.AddAssetPathCell(scanInfo.HeaderTitle, scanInfo.ScanInfo);
|
||||||
}
|
}
|
||||||
|
else if (header.HeaderType == EHeaderType.AssetObject)
|
||||||
|
{
|
||||||
|
tableData.AddAssetObjectCell(scanInfo.HeaderTitle, scanInfo.ScanInfo);
|
||||||
|
}
|
||||||
else if (header.HeaderType == EHeaderType.StringValue)
|
else if (header.HeaderType == EHeaderType.StringValue)
|
||||||
{
|
{
|
||||||
tableData.AddStringValueCell(scanInfo.HeaderTitle, scanInfo.ScanInfo);
|
tableData.AddStringValueCell(scanInfo.HeaderTitle, scanInfo.ScanInfo);
|
||||||
@@ -577,10 +624,8 @@ namespace YooAsset.Editor
|
|||||||
// 重绘视图
|
// 重绘视图
|
||||||
RebuildView();
|
RebuildView();
|
||||||
}
|
}
|
||||||
private void OnDisplayToggleValueChange(DisplayToggle toggle, ChangeEvent<bool> e)
|
private void OnDisplayToggleValueChange(ToggleDisplay toggle, ChangeEvent<bool> e)
|
||||||
{
|
{
|
||||||
toggle.RefreshIcon();
|
|
||||||
|
|
||||||
// 处理自身
|
// 处理自身
|
||||||
toggle.SetValueWithoutNotify(e.newValue);
|
toggle.SetValueWithoutNotify(e.newValue);
|
||||||
|
|
||||||
@@ -593,7 +638,8 @@ namespace YooAsset.Editor
|
|||||||
foreach (var selectedItem in selectedItems)
|
foreach (var selectedItem in selectedItems)
|
||||||
{
|
{
|
||||||
var selectElement = selectedItem as ElementTableData;
|
var selectElement = selectedItem as ElementTableData;
|
||||||
selectElement.Element.Hidden = e.newValue;
|
if (selectElement != null)
|
||||||
|
selectElement.Element.Hidden = e.newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重绘视图
|
// 重绘视图
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
<ui:Button text="显示白名单元素" display-tooltip-when-elided="true" name="WhiteListVisibleButton" style="width: 100px;" />
|
<ui:Button text="显示白名单元素" display-tooltip-when-elided="true" name="WhiteListVisibleButton" style="width: 100px;" />
|
||||||
</uie:Toolbar>
|
</uie:Toolbar>
|
||||||
<ui:VisualElement name="AssetGroup" style="flex-grow: 1; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 2px; margin-bottom: 1px; display: flex;">
|
<ui:VisualElement name="AssetGroup" style="flex-grow: 1; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px; border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); margin-left: 0; margin-right: 0; margin-top: 2px; margin-bottom: 1px; display: flex;">
|
||||||
<YooAsset.Editor.TableView name="TopTableView" />
|
<YooAsset.Editor.TableViewer name="TopTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|||||||
@@ -3,9 +3,29 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
public enum EHeaderType
|
public enum EHeaderType
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 资源路径
|
||||||
|
/// </summary>
|
||||||
AssetPath,
|
AssetPath,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 资源对象
|
||||||
|
/// </summary>
|
||||||
|
AssetObject,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 字符串
|
||||||
|
/// </summary>
|
||||||
StringValue,
|
StringValue,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整数数值
|
||||||
|
/// </summary>
|
||||||
LongValue,
|
LongValue,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 浮点数数值
|
||||||
|
/// </summary>
|
||||||
DoubleValue,
|
DoubleValue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,12 +31,28 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加扫描信息
|
/// 添加扫描信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AddScanInfo(string headerTitle, string scanInfo)
|
public void AddScanInfo(string headerTitle, string value)
|
||||||
{
|
{
|
||||||
var reportScanInfo = new ReportScanInfo(headerTitle, scanInfo);
|
var reportScanInfo = new ReportScanInfo(headerTitle, value);
|
||||||
ScanInfos.Add(reportScanInfo);
|
ScanInfos.Add(reportScanInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加扫描信息
|
||||||
|
/// </summary>
|
||||||
|
public void AddScanInfo(string headerTitle, long value)
|
||||||
|
{
|
||||||
|
AddScanInfo(headerTitle, value.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加扫描信息
|
||||||
|
/// </summary>
|
||||||
|
public void AddScanInfo(string headerTitle, double value)
|
||||||
|
{
|
||||||
|
AddScanInfo(headerTitle, value.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取扫描信息
|
/// 获取扫描信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
@@ -42,6 +43,16 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Sortable = false;
|
public bool Sortable = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 统计数量
|
||||||
|
/// </summary>
|
||||||
|
public bool Counter = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 展示单位
|
||||||
|
/// </summary>
|
||||||
|
public string Units = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数值类型
|
/// 数值类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -88,10 +99,56 @@ namespace YooAsset.Editor
|
|||||||
Sortable = true;
|
Sortable = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public ReportHeader SetCounter()
|
||||||
|
{
|
||||||
|
Counter = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public ReportHeader SetUnits(string units)
|
||||||
|
{
|
||||||
|
Units = units;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
public ReportHeader SetHeaderType(EHeaderType value)
|
public ReportHeader SetHeaderType(EHeaderType value)
|
||||||
{
|
{
|
||||||
HeaderType = value;
|
HeaderType = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测数值有效性
|
||||||
|
/// </summary>
|
||||||
|
public void CheckValueValid(string value)
|
||||||
|
{
|
||||||
|
if (HeaderType == EHeaderType.AssetPath)
|
||||||
|
{
|
||||||
|
string guid = AssetDatabase.AssetPathToGUID(value);
|
||||||
|
if (string.IsNullOrEmpty(guid))
|
||||||
|
throw new Exception($"{HeaderTitle} value is invalid asset path : {value}");
|
||||||
|
}
|
||||||
|
else if (HeaderType == EHeaderType.AssetObject)
|
||||||
|
{
|
||||||
|
string guid = AssetDatabase.AssetPathToGUID(value);
|
||||||
|
if (string.IsNullOrEmpty(guid))
|
||||||
|
throw new Exception($"{HeaderTitle} value is invalid asset object : {value}");
|
||||||
|
}
|
||||||
|
else if (HeaderType == EHeaderType.DoubleValue)
|
||||||
|
{
|
||||||
|
if (double.TryParse(value, out double doubleValue) == false)
|
||||||
|
throw new Exception($"{HeaderTitle} value is invalid double value : {value}");
|
||||||
|
}
|
||||||
|
else if (HeaderType == EHeaderType.LongValue)
|
||||||
|
{
|
||||||
|
if (long.TryParse(value, out long longValue) == false)
|
||||||
|
throw new Exception($"{HeaderTitle} value is invalid long value : {value}");
|
||||||
|
}
|
||||||
|
else if (HeaderType == EHeaderType.StringValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException(HeaderType.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,9 +29,9 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报告标题
|
/// 报告名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ReportTitle;
|
public string ReportName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报告介绍
|
/// 报告介绍
|
||||||
@@ -41,7 +41,7 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报告的标题列表
|
/// 报告的标题列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ReportHeader> HeaderTitles = new List<ReportHeader>();
|
public List<ReportHeader> ReportHeaders = new List<ReportHeader>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 扫描的元素列表
|
/// 扫描的元素列表
|
||||||
@@ -49,23 +49,70 @@ namespace YooAsset.Editor
|
|||||||
public List<ReportElement> ReportElements = new List<ReportElement>();
|
public List<ReportElement> ReportElements = new List<ReportElement>();
|
||||||
|
|
||||||
|
|
||||||
public ScanReport(string reportTitle, string reportDesc)
|
public ScanReport(string reportName, string reportDesc)
|
||||||
{
|
{
|
||||||
ReportTitle = reportTitle;
|
ReportName = reportName;
|
||||||
ReportDesc = reportDesc;
|
ReportDesc = reportDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加标题
|
||||||
|
/// </summary>
|
||||||
public ReportHeader AddHeader(string headerTitle, int width)
|
public ReportHeader AddHeader(string headerTitle, int width)
|
||||||
{
|
{
|
||||||
var reportHeader = new ReportHeader(headerTitle, width);
|
var reportHeader = new ReportHeader(headerTitle, width);
|
||||||
HeaderTitles.Add(reportHeader);
|
ReportHeaders.Add(reportHeader);
|
||||||
return reportHeader;
|
return reportHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加标题
|
||||||
|
/// </summary>
|
||||||
public ReportHeader AddHeader(string headerTitle, int width, int minWidth, int maxWidth)
|
public ReportHeader AddHeader(string headerTitle, int width, int minWidth, int maxWidth)
|
||||||
{
|
{
|
||||||
var reportHeader = new ReportHeader(headerTitle, width, minWidth, maxWidth);
|
var reportHeader = new ReportHeader(headerTitle, width, minWidth, maxWidth);
|
||||||
HeaderTitles.Add(reportHeader);
|
ReportHeaders.Add(reportHeader);
|
||||||
return reportHeader;
|
return reportHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测错误
|
||||||
|
/// </summary>
|
||||||
|
public void CheckError()
|
||||||
|
{
|
||||||
|
// 检测标题
|
||||||
|
Dictionary<string, ReportHeader> headerMap = new Dictionary<string, ReportHeader>();
|
||||||
|
foreach (var header in ReportHeaders)
|
||||||
|
{
|
||||||
|
string headerTitle = header.HeaderTitle;
|
||||||
|
if (headerMap.ContainsKey(headerTitle))
|
||||||
|
throw new Exception($"The header title {headerTitle} already exists !");
|
||||||
|
else
|
||||||
|
headerMap.Add(headerTitle, header);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测扫描元素
|
||||||
|
HashSet<string> elementMap = new HashSet<string>();
|
||||||
|
foreach (var element in ReportElements)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(element.GUID))
|
||||||
|
throw new Exception($"The report element GUID is null or empty !");
|
||||||
|
|
||||||
|
if (elementMap.Contains(element.GUID))
|
||||||
|
throw new Exception($"The report element GUID already exists ! {element.GUID}");
|
||||||
|
else
|
||||||
|
elementMap.Add(element.GUID);
|
||||||
|
|
||||||
|
foreach (var scanInfo in element.ScanInfos)
|
||||||
|
{
|
||||||
|
if (headerMap.ContainsKey(scanInfo.HeaderTitle) == false)
|
||||||
|
throw new Exception($"The report element header {scanInfo.HeaderTitle} is missing !");
|
||||||
|
|
||||||
|
// 检测数值有效性
|
||||||
|
var header = headerMap[scanInfo.HeaderTitle];
|
||||||
|
header.CheckValueValid(scanInfo.ScanInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,9 +55,9 @@ namespace YooAsset.Editor
|
|||||||
if (string.IsNullOrEmpty(SchemaType))
|
if (string.IsNullOrEmpty(SchemaType))
|
||||||
{
|
{
|
||||||
SchemaType = scanReport.SchemaType;
|
SchemaType = scanReport.SchemaType;
|
||||||
ReportTitle = scanReport.ReportTitle;
|
ReportTitle = scanReport.ReportName;
|
||||||
ReportDesc = scanReport.ReportDesc;
|
ReportDesc = scanReport.ReportDesc;
|
||||||
Headers = scanReport.HeaderTitles;
|
Headers = scanReport.ReportHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SchemaType != scanReport.SchemaType)
|
if (SchemaType != scanReport.SchemaType)
|
||||||
@@ -82,7 +82,7 @@ namespace YooAsset.Editor
|
|||||||
List<ReportElement> elements = scanReport.ReportElements;
|
List<ReportElement> elements = scanReport.ReportElements;
|
||||||
|
|
||||||
// 设置白名单
|
// 设置白名单
|
||||||
var scanner = AssetArtScannerSettingData.GetScannerByGUID(scannerGUID);
|
var scanner = AssetArtScannerSettingData.Setting.GetScanner(scannerGUID);
|
||||||
if (scanner != null)
|
if (scanner != null)
|
||||||
{
|
{
|
||||||
foreach (var element in elements)
|
foreach (var element in elements)
|
||||||
@@ -144,7 +144,7 @@ namespace YooAsset.Editor
|
|||||||
string scannerGUID = scanReport.ScannerGUID;
|
string scannerGUID = scanReport.ScannerGUID;
|
||||||
var elements = scanReport.ReportElements;
|
var elements = scanReport.ReportElements;
|
||||||
|
|
||||||
var scanner = AssetArtScannerSettingData.GetScannerByGUID(scannerGUID);
|
var scanner = AssetArtScannerSettingData.Setting.GetScanner(scannerGUID);
|
||||||
if (scanner != null)
|
if (scanner != null)
|
||||||
{
|
{
|
||||||
List<string> whiteList = new List<string>(elements.Count);
|
List<string> whiteList = new List<string>(elements.Count);
|
||||||
@@ -207,7 +207,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
private void FixInternal(string scannerGUID, List<ReportElement> fixList)
|
private void FixInternal(string scannerGUID, List<ReportElement> fixList)
|
||||||
{
|
{
|
||||||
AssetArtScanner scanner = AssetArtScannerSettingData.GetScannerByGUID(scannerGUID);
|
AssetArtScanner scanner = AssetArtScannerSettingData.Setting.GetScanner(scannerGUID);
|
||||||
if (scanner != null)
|
if (scanner != null)
|
||||||
{
|
{
|
||||||
var schema = scanner.LoadSchema();
|
var schema = scanner.LoadSchema();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace YooAsset.Editor
|
|||||||
// 检测标题数和内容是否匹配
|
// 检测标题数和内容是否匹配
|
||||||
foreach (var element in report.ReportElements)
|
foreach (var element in report.ReportElements)
|
||||||
{
|
{
|
||||||
if (element.ScanInfos.Count != report.HeaderTitles.Count)
|
if (element.ScanInfos.Count != report.ReportHeaders.Count)
|
||||||
{
|
{
|
||||||
throw new Exception($"报告的标题数和内容不匹配!");
|
throw new Exception($"报告的标题数和内容不匹配!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -46,6 +47,17 @@ namespace YooAsset.Editor
|
|||||||
public List<string> WhiteList = new List<string>();
|
public List<string> WhiteList = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测关键字匹配
|
||||||
|
/// </summary>
|
||||||
|
public bool CheckKeyword(string keyword)
|
||||||
|
{
|
||||||
|
if (ScannerName.Contains(keyword) || ScannerDesc.Contains(keyword))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否在白名单里
|
/// 是否在白名单里
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -54,6 +66,24 @@ namespace YooAsset.Editor
|
|||||||
return WhiteList.Contains(guid);
|
return WhiteList.Contains(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测配置错误
|
||||||
|
/// </summary>
|
||||||
|
public void CheckConfigError()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(ScannerName))
|
||||||
|
throw new Exception($"Scanner name is null or empty !");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(ScannerSchema))
|
||||||
|
throw new Exception($"Scanner {ScannerName} schema is null !");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(SaveDirectory) == false)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(SaveDirectory) == false)
|
||||||
|
throw new Exception($"Scanner {ScannerName} save directory is invalid : {SaveDirectory}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载扫描模式实例
|
/// 加载扫描模式实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -85,14 +115,11 @@ namespace YooAsset.Editor
|
|||||||
public ScanReport RunScanner()
|
public ScanReport RunScanner()
|
||||||
{
|
{
|
||||||
if (Collectors.Count == 0)
|
if (Collectors.Count == 0)
|
||||||
{
|
Debug.LogWarning($"Scanner {ScannerName} collector is empty !");
|
||||||
Debug.LogWarning($"Scanner collector is empty : {ScannerName}");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
ScannerSchema schema = LoadSchema();
|
ScannerSchema schema = LoadSchema();
|
||||||
if (schema == null)
|
if (schema == null)
|
||||||
return null;
|
throw new Exception($"Failed to load schema : {ScannerSchema}");
|
||||||
|
|
||||||
var report = schema.RunScanner(this);
|
var report = schema.RunScanner(this);
|
||||||
report.FileSign = ScannerDefine.ReportFileSign;
|
report.FileSign = ScannerDefine.ReportFileSign;
|
||||||
@@ -101,13 +128,5 @@ namespace YooAsset.Editor
|
|||||||
report.ScannerGUID = ScannerGUID;
|
report.ScannerGUID = ScannerGUID;
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckKeyword(string keyword)
|
|
||||||
{
|
|
||||||
if (ScannerName.Contains(keyword) || ScannerDesc.Contains(keyword))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using NUnit.Framework.Constraints;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
@@ -13,5 +14,48 @@ namespace YooAsset.Editor
|
|||||||
/// 扫描器列表
|
/// 扫描器列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<AssetArtScanner> Scanners = new List<AssetArtScanner>();
|
public List<AssetArtScanner> Scanners = new List<AssetArtScanner>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 开始扫描
|
||||||
|
/// </summary>
|
||||||
|
public ScannerResult BeginScan(string scannerGUID)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 获取扫描器配置
|
||||||
|
var scanner = GetScanner(scannerGUID);
|
||||||
|
if (scanner == null)
|
||||||
|
throw new Exception($"Invalid scanner GUID : {scannerGUID}");
|
||||||
|
|
||||||
|
// 检测配置合法性
|
||||||
|
scanner.CheckConfigError();
|
||||||
|
|
||||||
|
// 开始扫描工作
|
||||||
|
ScanReport report = scanner.RunScanner();
|
||||||
|
report.CheckError();
|
||||||
|
|
||||||
|
// 返回扫描结果
|
||||||
|
return new ScannerResult(report);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return new ScannerResult(e.Message, e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取指定的扫描器
|
||||||
|
/// </summary>
|
||||||
|
public AssetArtScanner GetScanner(string scannerGUID)
|
||||||
|
{
|
||||||
|
foreach (var scanner in Scanners)
|
||||||
|
{
|
||||||
|
if (scanner.ScannerGUID == scannerGUID)
|
||||||
|
return scanner;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.LogWarning($"Not found scanner : {scannerGUID}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,10 +61,10 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
foreach (var scanner in Setting.Scanners)
|
foreach (var scanner in Setting.Scanners)
|
||||||
{
|
{
|
||||||
var scanResult = ScanInternal(scanner);
|
var scanResult = Setting.BeginScan(scanner.ScannerGUID);
|
||||||
if (scanResult.Succeed == false)
|
if (scanResult.Succeed == false)
|
||||||
{
|
{
|
||||||
Debug.LogError($"Scanner {scanner.ScannerName} failed ! {scanResult.ErrorInfo}");
|
Debug.LogError($"{scanner.ScannerName} failed : {scanResult.ErrorInfo}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,10 +82,10 @@ namespace YooAsset.Editor
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var scanResult = ScanInternal(scanner);
|
var scanResult = Setting.BeginScan(scanner.ScannerGUID);
|
||||||
if (scanResult.Succeed == false)
|
if (scanResult.Succeed == false)
|
||||||
{
|
{
|
||||||
Debug.LogError($"Scanner {scanner.ScannerName} failed ! {scanResult.ErrorInfo}");
|
Debug.LogError($"{scanner.ScannerName} failed : {scanResult.ErrorInfo}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,30 +95,14 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static ScannerResult Scan(string scannerGUID)
|
public static ScannerResult Scan(string scannerGUID)
|
||||||
{
|
{
|
||||||
AssetArtScanner scanner = GetScannerByGUID(scannerGUID);
|
var scanResult = Setting.BeginScan(scannerGUID);
|
||||||
var scanResult = ScanInternal(scanner);
|
|
||||||
if (scanResult.Succeed == false)
|
if (scanResult.Succeed == false)
|
||||||
{
|
{
|
||||||
Debug.LogError($"Scanner {scanner.ScannerName} failed ! {scanResult.ErrorInfo}");
|
Debug.LogError(scanResult.ErrorInfo);
|
||||||
}
|
}
|
||||||
return scanResult;
|
return scanResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取指定的扫描器
|
|
||||||
/// </summary>
|
|
||||||
public static AssetArtScanner GetScannerByGUID(string scannerGUID)
|
|
||||||
{
|
|
||||||
foreach (var scanner in Setting.Scanners)
|
|
||||||
{
|
|
||||||
if (scanner.ScannerGUID == scannerGUID)
|
|
||||||
return scanner;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.LogWarning($"Not found scanner : {scannerGUID}");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扫描器编辑相关
|
// 扫描器编辑相关
|
||||||
public static AssetArtScanner CreateScanner(string name, string desc)
|
public static AssetArtScanner CreateScanner(string name, string desc)
|
||||||
{
|
{
|
||||||
@@ -173,31 +157,5 @@ namespace YooAsset.Editor
|
|||||||
IsDirty = true;
|
IsDirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ScannerResult ScanInternal(AssetArtScanner scanner)
|
|
||||||
{
|
|
||||||
if (scanner == null)
|
|
||||||
return new ScannerResult("Scanner is null !");
|
|
||||||
|
|
||||||
string saveDirectory = "Assets/";
|
|
||||||
if (string.IsNullOrEmpty(scanner.SaveDirectory) == false)
|
|
||||||
{
|
|
||||||
saveDirectory = scanner.SaveDirectory;
|
|
||||||
if (Directory.Exists(saveDirectory) == false)
|
|
||||||
return new ScannerResult($"Scanner save directory is invalid : {saveDirectory}");
|
|
||||||
}
|
|
||||||
|
|
||||||
ScanReport report = scanner.RunScanner();
|
|
||||||
if (report != null)
|
|
||||||
{
|
|
||||||
string filePath = $"{saveDirectory}/{scanner.ScannerName}_{scanner.ScannerDesc}.json";
|
|
||||||
ScanReportConfig.ExportJsonConfig(filePath, report);
|
|
||||||
return new ScannerResult(filePath, report);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return new ScannerResult($"Scanner run failed : {scanner.ScannerName}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,6 @@ namespace YooAsset.Editor
|
|||||||
_scannerListView = root.Q<ListView>("ScannerListView");
|
_scannerListView = root.Q<ListView>("ScannerListView");
|
||||||
_scannerListView.makeItem = MakeScannerListViewItem;
|
_scannerListView.makeItem = MakeScannerListViewItem;
|
||||||
_scannerListView.bindItem = BindScannerListViewItem;
|
_scannerListView.bindItem = BindScannerListViewItem;
|
||||||
|
|
||||||
#if UNITY_2022_3_OR_NEWER
|
#if UNITY_2022_3_OR_NEWER
|
||||||
_scannerListView.selectionChanged += ScannerListView_onSelectionChange;
|
_scannerListView.selectionChanged += ScannerListView_onSelectionChange;
|
||||||
#elif UNITY_2020_1_OR_NEWER
|
#elif UNITY_2020_1_OR_NEWER
|
||||||
@@ -277,8 +276,24 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
_scannerListView.Clear();
|
_scannerListView.Clear();
|
||||||
_scannerListView.ClearSelection();
|
_scannerListView.ClearSelection();
|
||||||
_scannerListView.itemsSource = FilterScanners();
|
|
||||||
_scannerListView.Rebuild();
|
var filterItems = FilterScanners();
|
||||||
|
if (AssetArtScannerSettingData.Setting.Scanners.Count == filterItems.Count)
|
||||||
|
{
|
||||||
|
#if UNITY_2020_3_OR_NEWER
|
||||||
|
_scannerListView.reorderable = true;
|
||||||
|
#endif
|
||||||
|
_scannerListView.itemsSource = AssetArtScannerSettingData.Setting.Scanners;
|
||||||
|
_scannerListView.Rebuild();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if UNITY_2020_3_OR_NEWER
|
||||||
|
_scannerListView.reorderable = false;
|
||||||
|
#endif
|
||||||
|
_scannerListView.itemsSource = filterItems;
|
||||||
|
_scannerListView.Rebuild();
|
||||||
|
}
|
||||||
|
|
||||||
if (_lastModifyScannerIndex >= 0 && _lastModifyScannerIndex < _scannerListView.itemsSource.Count)
|
if (_lastModifyScannerIndex >= 0 && _lastModifyScannerIndex < _scannerListView.itemsSource.Count)
|
||||||
{
|
{
|
||||||
@@ -344,31 +359,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 显示检视面板
|
// 显示检视面板
|
||||||
var scanSchema = selectScanner.LoadSchema();
|
var scanSchema = selectScanner.LoadSchema();
|
||||||
if (scanSchema != null)
|
RefreshInspector(scanSchema);
|
||||||
{
|
|
||||||
var inspector = scanSchema.CreateInspector();
|
|
||||||
if (inspector == null)
|
|
||||||
{
|
|
||||||
UIElementsTools.SetElementVisible(_inspectorContainer, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (inspector.Containner is VisualElement container)
|
|
||||||
{
|
|
||||||
UIElementsTools.SetElementVisible(_inspectorContainer, true);
|
|
||||||
_inspectorContainer.Clear();
|
|
||||||
_inspectorContainer.Add(container);
|
|
||||||
_inspectorContainer.style.width = inspector.Width;
|
|
||||||
_inspectorContainer.style.minWidth = inspector.MinWidth;
|
|
||||||
_inspectorContainer.style.maxWidth = inspector.MaxWidth;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogWarning($"{nameof(ScannerSchema)} inspector container is invalid !");
|
|
||||||
UIElementsTools.SetElementVisible(_inspectorContainer, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置Schema对象
|
// 设置Schema对象
|
||||||
if (scanSchema == null)
|
if (scanSchema == null)
|
||||||
@@ -521,6 +512,38 @@ namespace YooAsset.Editor
|
|||||||
AssetArtScannerSettingData.RemoveCollector(selectSacnner, selectCollector);
|
AssetArtScannerSettingData.RemoveCollector(selectSacnner, selectCollector);
|
||||||
FillCollectorViewData();
|
FillCollectorViewData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 属性面板相关
|
||||||
|
private void RefreshInspector(ScannerSchema scanSchema)
|
||||||
|
{
|
||||||
|
if (scanSchema == null)
|
||||||
|
{
|
||||||
|
UIElementsTools.SetElementVisible(_inspectorContainer, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var inspector = scanSchema.CreateInspector();
|
||||||
|
if (inspector == null)
|
||||||
|
{
|
||||||
|
UIElementsTools.SetElementVisible(_inspectorContainer, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inspector.Containner is VisualElement container)
|
||||||
|
{
|
||||||
|
UIElementsTools.SetElementVisible(_inspectorContainer, true);
|
||||||
|
_inspectorContainer.Clear();
|
||||||
|
_inspectorContainer.Add(container);
|
||||||
|
_inspectorContainer.style.width = inspector.Width;
|
||||||
|
_inspectorContainer.style.minWidth = inspector.MinWidth;
|
||||||
|
_inspectorContainer.style.maxWidth = inspector.MaxWidth;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"{nameof(ScannerSchema)} inspector container is invalid !");
|
||||||
|
UIElementsTools.SetElementVisible(_inspectorContainer, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<ui:VisualElement name="ScannerListContainer" style="width: 250px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
<ui:VisualElement name="ScannerListContainer" style="width: 250px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
||||||
<ui:Label text="Scanner List" display-tooltip-when-elided="true" name="ScannerListTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 3px; border-right-width: 3px; border-top-width: 3px; border-bottom-width: 3px; font-size: 12px;" />
|
<ui:Label text="Scanner List" display-tooltip-when-elided="true" name="ScannerListTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 3px; border-right-width: 3px; border-top-width: 3px; border-bottom-width: 3px; font-size: 12px;" />
|
||||||
<uie:ToolbarSearchField focusable="true" name="ScannerSearchField" style="width: 230px;" />
|
<uie:ToolbarSearchField focusable="true" name="ScannerSearchField" style="width: 230px;" />
|
||||||
<ui:ListView focusable="true" name="ScannerListView" item-height="20" virtualization-method="DynamicHeight" style="flex-grow: 1;" />
|
<ui:ListView focusable="true" name="ScannerListView" item-height="20" virtualization-method="DynamicHeight" reorder-mode="Animated" reorderable="true" style="flex-grow: 1;" />
|
||||||
<ui:VisualElement name="ScannerAddContainer" style="justify-content: center; flex-direction: row; flex-shrink: 0;">
|
<ui:VisualElement name="ScannerAddContainer" style="justify-content: center; flex-direction: row; flex-shrink: 0;">
|
||||||
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
||||||
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
public class ScannerResult
|
public class ScannerResult
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 生成的报告文件路径
|
|
||||||
/// </summary>
|
|
||||||
public string ReprotFilePath { private set; get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报告对象
|
/// 报告对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -18,6 +13,11 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ErrorInfo { private set; get; }
|
public string ErrorInfo { private set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 错误堆栈
|
||||||
|
/// </summary>
|
||||||
|
public string ErrorStack { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否成功
|
/// 是否成功
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -33,15 +33,14 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ScannerResult(string error)
|
public ScannerResult(string error, string stack)
|
||||||
{
|
{
|
||||||
ErrorInfo = error;
|
ErrorInfo = error;
|
||||||
|
ErrorStack = stack;
|
||||||
}
|
}
|
||||||
public ScannerResult(string filePath, ScanReport report)
|
public ScannerResult(ScanReport report)
|
||||||
{
|
{
|
||||||
ReprotFilePath = filePath;
|
|
||||||
Report = report;
|
Report = report;
|
||||||
ErrorInfo = string.Empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -52,8 +51,22 @@ namespace YooAsset.Editor
|
|||||||
if (Succeed)
|
if (Succeed)
|
||||||
{
|
{
|
||||||
var reproterWindow = AssetArtReporterWindow.OpenWindow();
|
var reproterWindow = AssetArtReporterWindow.OpenWindow();
|
||||||
reproterWindow.ImportSingleReprotFile(ReprotFilePath);
|
reproterWindow.ImportSingleReprotFile(Report);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存报告文件
|
||||||
|
/// </summary>
|
||||||
|
public void SaveReportFile(string saveDirectory)
|
||||||
|
{
|
||||||
|
if (Report == null)
|
||||||
|
throw new System.Exception("Scan report is invalid !");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(saveDirectory))
|
||||||
|
saveDirectory = "Assets/";
|
||||||
|
string filePath = $"{saveDirectory}/{Report.ReportName}_{Report.ReportDesc}.json";
|
||||||
|
ScanReportConfig.ExportJsonConfig(filePath, Report);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检视界面的UI元素容器(UIElements元素)
|
/// 检视界面的UI元素容器(UIElements元素)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object Containner;
|
public object Containner { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检视界面宽度
|
/// 检视界面宽度
|
||||||
@@ -22,5 +22,24 @@ namespace YooAsset.Editor
|
|||||||
/// 检视界面最大宽度
|
/// 检视界面最大宽度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaxWidth = 250;
|
public int MaxWidth = 250;
|
||||||
|
|
||||||
|
public SchemaInspector(object containner)
|
||||||
|
{
|
||||||
|
Containner = containner;
|
||||||
|
}
|
||||||
|
public SchemaInspector(object containner, int width)
|
||||||
|
{
|
||||||
|
Containner = containner;
|
||||||
|
Width = width;
|
||||||
|
MinWidth = width;
|
||||||
|
MaxWidth = width;
|
||||||
|
}
|
||||||
|
public SchemaInspector(object containner, int width, int minWidth, int maxWidth)
|
||||||
|
{
|
||||||
|
Containner = containner;
|
||||||
|
Width = width;
|
||||||
|
MinWidth = minWidth;
|
||||||
|
MaxWidth = maxWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,8 +32,9 @@ namespace YooAsset.Editor
|
|||||||
var buildParametersContext = new BuildParametersContext(buildParameters);
|
var buildParametersContext = new BuildParametersContext(buildParameters);
|
||||||
_buildContext.SetContextObject(buildParametersContext);
|
_buildContext.SetContextObject(buildParametersContext);
|
||||||
|
|
||||||
// 初始化日志
|
// 初始化日志系统
|
||||||
BuildLogger.InitLogger(enableLog);
|
string logFilePath = $"{buildParametersContext.GetPipelineOutputDirectory()}/buildInfo.log";
|
||||||
|
BuildLogger.InitLogger(enableLog, logFilePath);
|
||||||
|
|
||||||
// 执行构建流程
|
// 执行构建流程
|
||||||
BuildLogger.Log($"Begin to build package : {buildParameters.PackageName} by {buildParameters.BuildPipeline}");
|
BuildLogger.Log($"Begin to build package : {buildParameters.PackageName} by {buildParameters.BuildPipeline}");
|
||||||
@@ -50,6 +51,9 @@ namespace YooAsset.Editor
|
|||||||
BuildLogger.Error(buildResult.ErrorInfo);
|
BuildLogger.Error(buildResult.ErrorInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭日志系统
|
||||||
|
BuildLogger.Shuntdown();
|
||||||
|
|
||||||
return buildResult;
|
return buildResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,97 +6,122 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
public static class AssetBundleBuilderSetting
|
public static class AssetBundleBuilderSetting
|
||||||
{
|
{
|
||||||
// EBuildPipeline
|
// BuildPipelineName
|
||||||
public static EBuildPipeline GetPackageBuildPipeline(string packageName)
|
public static string GetPackageBuildPipeline(string packageName)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{nameof(EBuildPipeline)}";
|
string key = $"{Application.productName}_{packageName}_BuildPipelineName";
|
||||||
return (EBuildPipeline)EditorPrefs.GetInt(key, (int)EBuildPipeline.BuiltinBuildPipeline);
|
string defaultValue = EBuildPipeline.ScriptableBuildPipeline.ToString();
|
||||||
|
return EditorPrefs.GetString(key, defaultValue);
|
||||||
}
|
}
|
||||||
public static void SetPackageBuildPipeline(string packageName, EBuildPipeline buildPipeline)
|
public static void SetPackageBuildPipeline(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{nameof(EBuildPipeline)}";
|
string key = $"{Application.productName}_{packageName}_BuildPipelineName";
|
||||||
EditorPrefs.SetInt(key, (int)buildPipeline);
|
EditorPrefs.SetString(key, buildPipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ECompressOption
|
// ECompressOption
|
||||||
public static ECompressOption GetPackageCompressOption(string packageName, EBuildPipeline buildPipeline)
|
public static ECompressOption GetPackageCompressOption(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(ECompressOption)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(ECompressOption)}";
|
||||||
return (ECompressOption)EditorPrefs.GetInt(key, (int)ECompressOption.LZ4);
|
return (ECompressOption)EditorPrefs.GetInt(key, (int)ECompressOption.LZ4);
|
||||||
}
|
}
|
||||||
public static void SetPackageCompressOption(string packageName, EBuildPipeline buildPipeline, ECompressOption compressOption)
|
public static void SetPackageCompressOption(string packageName, string buildPipeline, ECompressOption compressOption)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(ECompressOption)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(ECompressOption)}";
|
||||||
EditorPrefs.SetInt(key, (int)compressOption);
|
EditorPrefs.SetInt(key, (int)compressOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
// EFileNameStyle
|
// EFileNameStyle
|
||||||
public static EFileNameStyle GetPackageFileNameStyle(string packageName, EBuildPipeline buildPipeline)
|
public static EFileNameStyle GetPackageFileNameStyle(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EFileNameStyle)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EFileNameStyle)}";
|
||||||
return (EFileNameStyle)EditorPrefs.GetInt(key, (int)EFileNameStyle.HashName);
|
return (EFileNameStyle)EditorPrefs.GetInt(key, (int)EFileNameStyle.HashName);
|
||||||
}
|
}
|
||||||
public static void SetPackageFileNameStyle(string packageName, EBuildPipeline buildPipeline, EFileNameStyle fileNameStyle)
|
public static void SetPackageFileNameStyle(string packageName, string buildPipeline, EFileNameStyle fileNameStyle)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EFileNameStyle)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EFileNameStyle)}";
|
||||||
EditorPrefs.SetInt(key, (int)fileNameStyle);
|
EditorPrefs.SetInt(key, (int)fileNameStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// EBuildinFileCopyOption
|
// EBuildinFileCopyOption
|
||||||
public static EBuildinFileCopyOption GetPackageBuildinFileCopyOption(string packageName, EBuildPipeline buildPipeline)
|
public static EBuildinFileCopyOption GetPackageBuildinFileCopyOption(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EBuildinFileCopyOption)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EBuildinFileCopyOption)}";
|
||||||
return (EBuildinFileCopyOption)EditorPrefs.GetInt(key, (int)EBuildinFileCopyOption.None);
|
return (EBuildinFileCopyOption)EditorPrefs.GetInt(key, (int)EBuildinFileCopyOption.None);
|
||||||
}
|
}
|
||||||
public static void SetPackageBuildinFileCopyOption(string packageName, EBuildPipeline buildPipeline, EBuildinFileCopyOption buildinFileCopyOption)
|
public static void SetPackageBuildinFileCopyOption(string packageName, string buildPipeline, EBuildinFileCopyOption buildinFileCopyOption)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EBuildinFileCopyOption)}";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_{nameof(EBuildinFileCopyOption)}";
|
||||||
EditorPrefs.SetInt(key, (int)buildinFileCopyOption);
|
EditorPrefs.SetInt(key, (int)buildinFileCopyOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
// BuildFileCopyParams
|
// BuildFileCopyParams
|
||||||
public static string GetPackageBuildinFileCopyParams(string packageName, EBuildPipeline buildPipeline)
|
public static string GetPackageBuildinFileCopyParams(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_BuildFileCopyParams";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_BuildFileCopyParams";
|
||||||
return EditorPrefs.GetString(key, string.Empty);
|
return EditorPrefs.GetString(key, string.Empty);
|
||||||
}
|
}
|
||||||
public static void SetPackageBuildinFileCopyParams(string packageName, EBuildPipeline buildPipeline, string buildinFileCopyParams)
|
public static void SetPackageBuildinFileCopyParams(string packageName, string buildPipeline, string buildinFileCopyParams)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_BuildFileCopyParams";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_BuildFileCopyParams";
|
||||||
EditorPrefs.SetString(key, buildinFileCopyParams);
|
EditorPrefs.SetString(key, buildinFileCopyParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncyptionClassName
|
// EncyptionServicesClassName
|
||||||
public static string GetPackageEncyptionClassName(string packageName, EBuildPipeline buildPipeline)
|
public static string GetPackageEncyptionServicesClassName(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_EncyptionClassName";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_EncyptionServicesClassName";
|
||||||
return EditorPrefs.GetString(key, string.Empty);
|
return EditorPrefs.GetString(key, $"{typeof(EncryptionNone).FullName}");
|
||||||
}
|
}
|
||||||
public static void SetPackageEncyptionClassName(string packageName, EBuildPipeline buildPipeline, string encyptionClassName)
|
public static void SetPackageEncyptionServicesClassName(string packageName, string buildPipeline, string encyptionClassName)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_EncyptionClassName";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_EncyptionServicesClassName";
|
||||||
|
EditorPrefs.SetString(key, encyptionClassName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ManifestProcessServicesClassName
|
||||||
|
public static string GetPackageManifestProcessServicesClassName(string packageName, string buildPipeline)
|
||||||
|
{
|
||||||
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ManifestProcessServicesClassName";
|
||||||
|
return EditorPrefs.GetString(key, $"{typeof(ManifestProcessNone).FullName}");
|
||||||
|
}
|
||||||
|
public static void SetPackageManifestProcessServicesClassName(string packageName, string buildPipeline, string encyptionClassName)
|
||||||
|
{
|
||||||
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ManifestProcessServicesClassName";
|
||||||
|
EditorPrefs.SetString(key, encyptionClassName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ManifestRestoreServicesClassName
|
||||||
|
public static string GetPackageManifestRestoreServicesClassName(string packageName, string buildPipeline)
|
||||||
|
{
|
||||||
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ManifestRestoreServicesClassName";
|
||||||
|
return EditorPrefs.GetString(key, $"{typeof(ManifestRestoreNone).FullName}");
|
||||||
|
}
|
||||||
|
public static void SetPackageManifestRestoreServicesClassName(string packageName, string buildPipeline, string encyptionClassName)
|
||||||
|
{
|
||||||
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ManifestRestoreServicesClassName";
|
||||||
EditorPrefs.SetString(key, encyptionClassName);
|
EditorPrefs.SetString(key, encyptionClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearBuildCache
|
// ClearBuildCache
|
||||||
public static bool GetPackageClearBuildCache(string packageName, EBuildPipeline buildPipeline)
|
public static bool GetPackageClearBuildCache(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ClearBuildCache";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ClearBuildCache";
|
||||||
return EditorPrefs.GetInt(key, 0) > 0;
|
return EditorPrefs.GetInt(key, 0) > 0;
|
||||||
}
|
}
|
||||||
public static void SetPackageClearBuildCache(string packageName, EBuildPipeline buildPipeline, bool clearBuildCache)
|
public static void SetPackageClearBuildCache(string packageName, string buildPipeline, bool clearBuildCache)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ClearBuildCache";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_ClearBuildCache";
|
||||||
EditorPrefs.SetInt(key, clearBuildCache ? 1 : 0);
|
EditorPrefs.SetInt(key, clearBuildCache ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// UseAssetDependencyDB
|
// UseAssetDependencyDB
|
||||||
public static bool GetPackageUseAssetDependencyDB(string packageName, EBuildPipeline buildPipeline)
|
public static bool GetPackageUseAssetDependencyDB(string packageName, string buildPipeline)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_UseAssetDependencyDB";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_UseAssetDependencyDB";
|
||||||
return EditorPrefs.GetInt(key, 0) > 0;
|
return EditorPrefs.GetInt(key, 0) > 0;
|
||||||
}
|
}
|
||||||
public static void SetPackageUseAssetDependencyDB(string packageName, EBuildPipeline buildPipeline, bool useAssetDependencyDB)
|
public static void SetPackageUseAssetDependencyDB(string packageName, string buildPipeline, bool useAssetDependencyDB)
|
||||||
{
|
{
|
||||||
string key = $"{Application.productName}_{packageName}_{buildPipeline}_UseAssetDependencyDB";
|
string key = $"{Application.productName}_{packageName}_{buildPipeline}_UseAssetDependencyDB";
|
||||||
EditorPrefs.SetInt(key, useAssetDependencyDB ? 1 : 0);
|
EditorPrefs.SetInt(key, useAssetDependencyDB ? 1 : 0);
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
private string _buildPackage;
|
private string _buildPackage;
|
||||||
private EBuildPipeline _buildPipeline;
|
private string _buildPipeline;
|
||||||
|
|
||||||
|
private Dictionary<string, Type> _viewClassDic = new Dictionary<string, Type>(10);
|
||||||
|
|
||||||
private Toolbar _toolbar;
|
private Toolbar _toolbar;
|
||||||
private ToolbarMenu _packageMenu;
|
private ToolbarMenu _packageMenu;
|
||||||
@@ -69,11 +71,29 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
_pipelineMenu = new ToolbarMenu();
|
_pipelineMenu = new ToolbarMenu();
|
||||||
_pipelineMenu.style.width = 200;
|
_pipelineMenu.style.width = 200;
|
||||||
_pipelineMenu.menu.AppendAction(EBuildPipeline.EditorSimulateBuildPipeline.ToString(), PipelineMenuAction, PipelineMenuFun, EBuildPipeline.EditorSimulateBuildPipeline);
|
|
||||||
_pipelineMenu.menu.AppendAction(EBuildPipeline.BuiltinBuildPipeline.ToString(), PipelineMenuAction, PipelineMenuFun, EBuildPipeline.BuiltinBuildPipeline);
|
|
||||||
_pipelineMenu.menu.AppendAction(EBuildPipeline.ScriptableBuildPipeline.ToString(), PipelineMenuAction, PipelineMenuFun, EBuildPipeline.ScriptableBuildPipeline);
|
|
||||||
_pipelineMenu.menu.AppendAction(EBuildPipeline.RawFileBuildPipeline.ToString(), PipelineMenuAction, PipelineMenuFun, EBuildPipeline.RawFileBuildPipeline);
|
|
||||||
_toolbar.Add(_pipelineMenu);
|
_toolbar.Add(_pipelineMenu);
|
||||||
|
|
||||||
|
var viewerClassTypes = EditorTools.GetAssignableTypes(typeof(BuildPipelineViewerBase));
|
||||||
|
foreach (var classType in viewerClassTypes)
|
||||||
|
{
|
||||||
|
var buildPipelineAttribute = EditorTools.GetAttribute<BuildPipelineAttribute>(classType);
|
||||||
|
if (buildPipelineAttribute == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"The class {classType.FullName} need attribute {nameof(BuildPipelineAttribute)}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
string pipelineName = buildPipelineAttribute.PipelineName;
|
||||||
|
if (_viewClassDic.ContainsKey(pipelineName))
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"The pipeline has already exist : {pipelineName}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_viewClassDic.Add(pipelineName, classType);
|
||||||
|
_pipelineMenu.menu.AppendAction(pipelineName, PipelineMenuAction, PipelineMenuFun);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshBuildPipelineView();
|
RefreshBuildPipelineView();
|
||||||
@@ -91,28 +111,18 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
_buildPipeline = AssetBundleBuilderSetting.GetPackageBuildPipeline(_buildPackage);
|
_buildPipeline = AssetBundleBuilderSetting.GetPackageBuildPipeline(_buildPackage);
|
||||||
_packageMenu.text = _buildPackage;
|
_packageMenu.text = _buildPackage;
|
||||||
_pipelineMenu.text = _buildPipeline.ToString();
|
_pipelineMenu.text = _buildPipeline;
|
||||||
|
|
||||||
var buildTarget = EditorUserBuildSettings.activeBuildTarget;
|
if (_viewClassDic.TryGetValue(_buildPipeline, out Type value))
|
||||||
if (_buildPipeline == EBuildPipeline.EditorSimulateBuildPipeline)
|
|
||||||
{
|
{
|
||||||
var viewer = new EditorSimulateBuildPipelineViewer(_buildPackage, buildTarget, _container);
|
var buildTarget = EditorUserBuildSettings.activeBuildTarget;
|
||||||
}
|
var viewer = Activator.CreateInstance(value) as BuildPipelineViewerBase;
|
||||||
else if (_buildPipeline == EBuildPipeline.BuiltinBuildPipeline)
|
viewer.InitView(_buildPackage, _buildPipeline, buildTarget);
|
||||||
{
|
viewer.CreateView(_container);
|
||||||
var viewer = new BuiltinBuildPipelineViewer(_buildPackage, buildTarget, _container);
|
|
||||||
}
|
|
||||||
else if (_buildPipeline == EBuildPipeline.ScriptableBuildPipeline)
|
|
||||||
{
|
|
||||||
var viewer = new ScriptableBuildPipelineViewer(_buildPackage, buildTarget, _container);
|
|
||||||
}
|
|
||||||
else if (_buildPipeline == EBuildPipeline.RawFileBuildPipeline)
|
|
||||||
{
|
|
||||||
var viewer = new RawfileBuildpipelineViewer(_buildPackage, buildTarget, _container);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException(_buildPipeline.ToString());
|
Debug.LogError($"Not found build pipeline : {_buildPipeline}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private List<string> GetBuildPackageNames()
|
private List<string> GetBuildPackageNames()
|
||||||
@@ -145,18 +155,16 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
private void PipelineMenuAction(DropdownMenuAction action)
|
private void PipelineMenuAction(DropdownMenuAction action)
|
||||||
{
|
{
|
||||||
var pipelineType = (EBuildPipeline)action.userData;
|
if (_buildPipeline != action.name)
|
||||||
if (_buildPipeline != pipelineType)
|
|
||||||
{
|
{
|
||||||
_buildPipeline = pipelineType;
|
_buildPipeline = action.name;
|
||||||
AssetBundleBuilderSetting.SetPackageBuildPipeline(_buildPackage, pipelineType);
|
AssetBundleBuilderSetting.SetPackageBuildPipeline(_buildPackage, _buildPipeline);
|
||||||
RefreshBuildPipelineView();
|
RefreshBuildPipelineView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private DropdownMenuAction.Status PipelineMenuFun(DropdownMenuAction action)
|
private DropdownMenuAction.Status PipelineMenuFun(DropdownMenuAction action)
|
||||||
{
|
{
|
||||||
var pipelineType = (EBuildPipeline)action.userData;
|
if (_buildPipeline == action.name)
|
||||||
if (_buildPipeline == pipelineType)
|
|
||||||
return DropdownMenuAction.Status.Checked;
|
return DropdownMenuAction.Status.Checked;
|
||||||
else
|
else
|
||||||
return DropdownMenuAction.Status.Normal;
|
return DropdownMenuAction.Status.Normal;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace YooAsset.Editor
|
|||||||
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
||||||
buildParameters.BuildinFileCopyOption = EBuildinFileCopyOption.None;
|
buildParameters.BuildinFileCopyOption = EBuildinFileCopyOption.None;
|
||||||
buildParameters.BuildinFileCopyParams = string.Empty;
|
buildParameters.BuildinFileCopyParams = string.Empty;
|
||||||
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
|
|
||||||
var pipeline = new EditorSimulateBuildPipeline();
|
var pipeline = new EditorSimulateBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件哈希值
|
/// 文件哈希值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PackageFileCRC { set; get; }
|
public uint PackageFileCRC { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件哈希值
|
/// 文件哈希值
|
||||||
@@ -56,13 +56,13 @@ namespace YooAsset.Editor
|
|||||||
public string EncryptedFilePath { set; get; }
|
public string EncryptedFilePath { set; get; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private readonly HashSet<string> _assetPaths = new HashSet<string>();
|
private readonly Dictionary<string, BuildAssetInfo> _packAssetDic = new Dictionary<string, BuildAssetInfo>(100);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 参与构建的资源列表
|
/// 参与构建的资源列表
|
||||||
/// 注意:不包含零依赖资源和冗余资源
|
/// 注意:不包含零依赖资源和冗余资源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly List<BuildAssetInfo> MainAssets = new List<BuildAssetInfo>();
|
public readonly List<BuildAssetInfo> AllPackAssets = new List<BuildAssetInfo>(100);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包名称
|
/// 资源包名称
|
||||||
@@ -86,63 +86,102 @@ namespace YooAsset.Editor
|
|||||||
public void PackAsset(BuildAssetInfo buildAsset)
|
public void PackAsset(BuildAssetInfo buildAsset)
|
||||||
{
|
{
|
||||||
string assetPath = buildAsset.AssetInfo.AssetPath;
|
string assetPath = buildAsset.AssetInfo.AssetPath;
|
||||||
if (_assetPaths.Contains(assetPath))
|
if (_packAssetDic.ContainsKey(assetPath))
|
||||||
throw new System.Exception($"Should never get here ! Asset is existed : {assetPath}");
|
throw new System.Exception($"Should never get here ! Asset is existed : {assetPath}");
|
||||||
|
|
||||||
_assetPaths.Add(assetPath);
|
_packAssetDic.Add(assetPath, buildAsset);
|
||||||
MainAssets.Add(buildAsset);
|
AllPackAssets.Add(buildAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否包含指定资源
|
/// 是否包含指定资源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsContainsAsset(string assetPath)
|
public bool IsContainsPackAsset(string assetPath)
|
||||||
{
|
{
|
||||||
return _assetPaths.Contains(assetPath);
|
return _packAssetDic.ContainsKey(assetPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取构建的资源路径列表
|
/// 获取构建的资源路径列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] GetAllMainAssetPaths()
|
public string[] GetAllPackAssetPaths()
|
||||||
{
|
{
|
||||||
return MainAssets.Select(t => t.AssetInfo.AssetPath).ToArray();
|
List<string> results = new List<string>(AllPackAssets.Count);
|
||||||
|
for (int i = 0; i < AllPackAssets.Count; i++)
|
||||||
|
{
|
||||||
|
var packAsset = AllPackAssets[i];
|
||||||
|
results.Add(packAsset.AssetInfo.AssetPath);
|
||||||
|
}
|
||||||
|
return results.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取该资源包内的所有资源(包括零依赖资源和冗余资源)
|
/// 获取构建的资源可寻址列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> GetAllBuiltinAssetPaths()
|
public string[] GetAllPackAssetAddress()
|
||||||
{
|
{
|
||||||
var packAssets = GetAllMainAssetPaths();
|
List<string> results = new List<string>(AllPackAssets.Count);
|
||||||
List<string> result = new List<string>(packAssets);
|
for (int i = 0; i < AllPackAssets.Count; i++)
|
||||||
foreach (var buildAsset in MainAssets)
|
|
||||||
{
|
{
|
||||||
if (buildAsset.AllDependAssetInfos == null)
|
var packAsset = AllPackAssets[i];
|
||||||
continue;
|
results.Add(packAsset.Address);
|
||||||
foreach (var dependAssetInfo in buildAsset.AllDependAssetInfos)
|
}
|
||||||
|
return results.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取构建的主资源信息
|
||||||
|
/// </summary>
|
||||||
|
public BuildAssetInfo GetPackAssetInfo(string assetPath)
|
||||||
|
{
|
||||||
|
if (_packAssetDic.TryGetValue(assetPath, out BuildAssetInfo value))
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception($"Can not found pack asset info {assetPath} in bundle : {BundleName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取资源包内部所有资产
|
||||||
|
/// </summary>
|
||||||
|
public List<AssetInfo> GetBundleContents()
|
||||||
|
{
|
||||||
|
Dictionary<string, AssetInfo> result = new Dictionary<string, AssetInfo>(AllPackAssets.Count);
|
||||||
|
foreach (var packAsset in AllPackAssets)
|
||||||
|
{
|
||||||
|
result.Add(packAsset.AssetInfo.AssetPath, packAsset.AssetInfo);
|
||||||
|
if (packAsset.AllDependAssetInfos != null)
|
||||||
{
|
{
|
||||||
// 注意:依赖资源里只添加零依赖资源和冗余资源
|
foreach (var dependAssetInfo in packAsset.AllDependAssetInfos)
|
||||||
if (dependAssetInfo.HasBundleName() == false)
|
|
||||||
{
|
{
|
||||||
if (result.Contains(dependAssetInfo.AssetInfo.AssetPath) == false)
|
// 注意:依赖资源里只添加零依赖资源和冗余资源
|
||||||
result.Add(dependAssetInfo.AssetInfo.AssetPath);
|
if (dependAssetInfo.HasBundleName() == false)
|
||||||
|
{
|
||||||
|
string dependAssetPath = dependAssetInfo.AssetInfo.AssetPath;
|
||||||
|
if (result.ContainsKey(dependAssetPath) == false)
|
||||||
|
result.Add(dependAssetPath, dependAssetInfo.AssetInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result.Values.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建AssetBundleBuild类
|
/// 创建AssetBundleBuild类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UnityEditor.AssetBundleBuild CreatePipelineBuild()
|
public UnityEditor.AssetBundleBuild CreatePipelineBuild(bool replaceAssetPathWithAddress)
|
||||||
{
|
{
|
||||||
// 注意:我们不再支持AssetBundle的变种机制
|
// 注意:我们不再支持AssetBundle的变种机制
|
||||||
AssetBundleBuild build = new AssetBundleBuild();
|
AssetBundleBuild build = new AssetBundleBuild();
|
||||||
build.assetBundleName = BundleName;
|
build.assetBundleName = BundleName;
|
||||||
build.assetBundleVariant = string.Empty;
|
build.assetBundleVariant = string.Empty;
|
||||||
build.assetNames = GetAllMainAssetPaths();
|
build.assetNames = GetAllPackAssetPaths();
|
||||||
|
if (replaceAssetPathWithAddress)
|
||||||
|
build.addressableNames = GetAllPackAssetAddress();
|
||||||
return build;
|
return build;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +190,7 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public BuildAssetInfo[] GetAllManifestAssetInfos()
|
public BuildAssetInfo[] GetAllManifestAssetInfos()
|
||||||
{
|
{
|
||||||
return MainAssets.Where(t => t.CollectorType == ECollectorType.MainAssetCollector).ToArray();
|
return AllPackAssets.Where(t => t.CollectorType == ECollectorType.MainAssetCollector).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly Dictionary<string, BuildBundleInfo> _bundleInfoDic = new Dictionary<string, BuildBundleInfo>(10000);
|
private readonly Dictionary<string, BuildBundleInfo> _bundleInfoDic = new Dictionary<string, BuildBundleInfo>(10000);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图集资源集合
|
||||||
|
/// </summary>
|
||||||
|
public readonly List<BuildAssetInfo> SpriteAtlasAssetList = new List<BuildAssetInfo>(10000);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 未被依赖的资源列表
|
/// 未被依赖的资源列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -60,6 +65,12 @@ namespace YooAsset.Editor
|
|||||||
newBundleInfo.PackAsset(assetInfo);
|
newBundleInfo.PackAsset(assetInfo);
|
||||||
_bundleInfoDic.Add(bundleName, newBundleInfo);
|
_bundleInfoDic.Add(bundleName, newBundleInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 统计所有的精灵图集
|
||||||
|
if (assetInfo.AssetInfo.IsSpriteAtlas())
|
||||||
|
{
|
||||||
|
SpriteAtlasAssetList.Add(assetInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,12 +96,12 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取构建管线里需要的数据
|
/// 获取构建管线里需要的数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UnityEditor.AssetBundleBuild[] GetPipelineBuilds()
|
public UnityEditor.AssetBundleBuild[] GetPipelineBuilds(bool replaceAssetPathWithAddres)
|
||||||
{
|
{
|
||||||
List<UnityEditor.AssetBundleBuild> builds = new List<UnityEditor.AssetBundleBuild>(_bundleInfoDic.Count);
|
List<UnityEditor.AssetBundleBuild> builds = new List<UnityEditor.AssetBundleBuild>(_bundleInfoDic.Count);
|
||||||
foreach (var bundleInfo in _bundleInfoDic.Values)
|
foreach (var bundleInfo in _bundleInfoDic.Values)
|
||||||
{
|
{
|
||||||
builds.Add(bundleInfo.CreatePipelineBuild());
|
builds.Add(bundleInfo.CreatePipelineBuild(replaceAssetPathWithAddres));
|
||||||
}
|
}
|
||||||
return builds.ToArray();
|
return builds.ToArray();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,15 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public IEncryptionServices EncryptionServices;
|
public IEncryptionServices EncryptionServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 资源清单加密服务类
|
||||||
|
/// </summary>
|
||||||
|
public IManifestProcessServices ManifestProcessServices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 资源清单解密服务类
|
||||||
|
/// </summary>
|
||||||
|
public IManifestRestoreServices ManifestRestoreServices;
|
||||||
|
|
||||||
private string _pipelineOutputDirectory = string.Empty;
|
private string _pipelineOutputDirectory = string.Empty;
|
||||||
private string _packageOutputDirectory = string.Empty;
|
private string _packageOutputDirectory = string.Empty;
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class TaskCreateCatalog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 生成内置资源记录文件
|
||||||
|
/// </summary>
|
||||||
|
internal void CreateCatalogFile(BuildParametersContext buildParametersContext)
|
||||||
|
{
|
||||||
|
string buildinRootDirectory = buildParametersContext.GetBuildinRootDirectory();
|
||||||
|
string buildPackageName = buildParametersContext.Parameters.PackageName;
|
||||||
|
var manifestServices = buildParametersContext.Parameters.ManifestRestoreServices;
|
||||||
|
CatalogTools.CreateCatalogFile(manifestServices, buildPackageName, buildinRootDirectory);
|
||||||
|
|
||||||
|
// 刷新目录
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 56ea224b45d314e4a86b558404e9b6c8
|
guid: 2d2c835e5e40ca34d93480587c8125df
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
@@ -18,7 +19,7 @@ namespace YooAsset.Editor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建补丁清单文件到输出目录
|
/// 创建补丁清单文件到输出目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void CreateManifestFile(bool processBundleDepends, bool processBundleTags, BuildContext context)
|
protected void CreateManifestFile(bool processBundleDepends, bool processBundleTags, bool replaceAssetPathWithAddress, BuildContext context)
|
||||||
{
|
{
|
||||||
var buildMapContext = context.GetContextObject<BuildMapContext>();
|
var buildMapContext = context.GetContextObject<BuildMapContext>();
|
||||||
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
@@ -30,10 +31,12 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 创建新补丁清单
|
// 创建新补丁清单
|
||||||
PackageManifest manifest = new PackageManifest();
|
PackageManifest manifest = new PackageManifest();
|
||||||
manifest.FileVersion = YooAssetSettings.ManifestFileVersion;
|
manifest.FileVersion = ManifestDefine.FileVersion;
|
||||||
manifest.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
manifest.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
||||||
|
manifest.SupportExtensionless = buildMapContext.Command.SupportExtensionless;
|
||||||
manifest.LocationToLower = buildMapContext.Command.LocationToLower;
|
manifest.LocationToLower = buildMapContext.Command.LocationToLower;
|
||||||
manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
||||||
|
manifest.ReplaceAssetPathWithAddress = replaceAssetPathWithAddress;
|
||||||
manifest.OutputNameStyle = (int)buildParameters.FileNameStyle;
|
manifest.OutputNameStyle = (int)buildParameters.FileNameStyle;
|
||||||
manifest.BuildBundleType = buildParameters.BuildBundleType;
|
manifest.BuildBundleType = buildParameters.BuildBundleType;
|
||||||
manifest.BuildPipeline = buildParameters.BuildPipeline;
|
manifest.BuildPipeline = buildParameters.BuildPipeline;
|
||||||
@@ -43,18 +46,28 @@ namespace YooAsset.Editor
|
|||||||
manifest.AssetList = CreatePackageAssetList(buildMapContext);
|
manifest.AssetList = CreatePackageAssetList(buildMapContext);
|
||||||
manifest.BundleList = CreatePackageBundleList(buildMapContext);
|
manifest.BundleList = CreatePackageBundleList(buildMapContext);
|
||||||
|
|
||||||
// 处理资源清单的ID数据
|
// 1. 处理资源清单的资源对象
|
||||||
ProcessPacakgeIDs(manifest);
|
ProcessPacakgeAsset(manifest);
|
||||||
|
|
||||||
// 处理资源包的依赖列表
|
// 2. 处理资源包的依赖列表
|
||||||
if (processBundleDepends)
|
if (processBundleDepends)
|
||||||
ProcessBundleDepends(context, manifest);
|
ProcessBundleDepends(context, manifest);
|
||||||
|
|
||||||
// 处理资源包的标签集合
|
// 3. 处理资源包的标签集合
|
||||||
if (processBundleTags)
|
if (processBundleTags)
|
||||||
ProcessBundleTags(manifest);
|
ProcessBundleTags(manifest);
|
||||||
|
|
||||||
// 创建补丁清单文本文件
|
// 4. 处理内置资源包
|
||||||
|
if (processBundleDepends)
|
||||||
|
{
|
||||||
|
// 注意:初始化资源清单建立引用关系
|
||||||
|
manifest.Initialize();
|
||||||
|
|
||||||
|
ProcessBuiltinBundleDependency(context, manifest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 创建资源清单文本文件
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetManifestJsonFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
string fileName = YooAssetSettingsData.GetManifestJsonFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
string filePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
@@ -62,22 +75,18 @@ namespace YooAsset.Editor
|
|||||||
BuildLogger.Log($"Create package manifest file: {filePath}");
|
BuildLogger.Log($"Create package manifest file: {filePath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建补丁清单二进制文件
|
// 创建资源清单二进制文件
|
||||||
string packageHash;
|
string packageHash;
|
||||||
|
string packagePath;
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
packagePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
ManifestTools.SerializeToBinary(filePath, manifest);
|
ManifestTools.SerializeToBinary(packagePath, manifest, buildParameters.ManifestProcessServices);
|
||||||
packageHash = HashUtility.FileCRC32(filePath);
|
packageHash = HashUtility.FileCRC32(packagePath);
|
||||||
BuildLogger.Log($"Create package manifest file: {filePath}");
|
BuildLogger.Log($"Create package manifest file: {packagePath}");
|
||||||
|
|
||||||
ManifestContext manifestContext = new ManifestContext();
|
|
||||||
byte[] bytesData = FileUtility.ReadAllBytes(filePath);
|
|
||||||
manifestContext.Manifest = ManifestTools.DeserializeFromBinary(bytesData);
|
|
||||||
context.SetContextObject(manifestContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建补丁清单哈希文件
|
// 创建资源清单哈希文件
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
string fileName = YooAssetSettingsData.GetPackageHashFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
string filePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
@@ -85,13 +94,21 @@ namespace YooAsset.Editor
|
|||||||
BuildLogger.Log($"Create package manifest hash file: {filePath}");
|
BuildLogger.Log($"Create package manifest hash file: {filePath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建补丁清单版本文件
|
// 创建资源清单版本文件
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(buildParameters.PackageName);
|
string fileName = YooAssetSettingsData.GetPackageVersionFileName(buildParameters.PackageName);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
string filePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
FileUtility.WriteAllText(filePath, buildParameters.PackageVersion);
|
FileUtility.WriteAllText(filePath, buildParameters.PackageVersion);
|
||||||
BuildLogger.Log($"Create package manifest version file: {filePath}");
|
BuildLogger.Log($"Create package manifest version file: {filePath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填充上下文
|
||||||
|
{
|
||||||
|
ManifestContext manifestContext = new ManifestContext();
|
||||||
|
byte[] bytesData = FileUtility.ReadAllBytes(packagePath);
|
||||||
|
manifestContext.Manifest = ManifestTools.DeserializeFromBinary(bytesData, buildParameters.ManifestRestoreServices);
|
||||||
|
context.SetContextObject(manifestContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -137,7 +154,7 @@ namespace YooAsset.Editor
|
|||||||
packageAsset.AssetPath = assetInfo.AssetInfo.AssetPath;
|
packageAsset.AssetPath = assetInfo.AssetInfo.AssetPath;
|
||||||
packageAsset.AssetGUID = buildMapContext.Command.IncludeAssetGUID ? assetInfo.AssetInfo.AssetGUID : string.Empty;
|
packageAsset.AssetGUID = buildMapContext.Command.IncludeAssetGUID ? assetInfo.AssetInfo.AssetGUID : string.Empty;
|
||||||
packageAsset.AssetTags = assetInfo.AssetTags.ToArray();
|
packageAsset.AssetTags = assetInfo.AssetTags.ToArray();
|
||||||
packageAsset.BundleNameInEditor = assetInfo.BundleName;
|
packageAsset.TempDataInEditor = assetInfo;
|
||||||
result.Add(packageAsset);
|
result.Add(packageAsset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,9 +182,9 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 处理资源清单的ID数据
|
/// 处理资源清单的资源对象列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ProcessPacakgeIDs(PackageManifest manifest)
|
private void ProcessPacakgeAsset(PackageManifest manifest)
|
||||||
{
|
{
|
||||||
// 注意:优先缓存资源包索引
|
// 注意:优先缓存资源包索引
|
||||||
for (int index = 0; index < manifest.BundleList.Count; index++)
|
for (int index = 0; index < manifest.BundleList.Count; index++)
|
||||||
@@ -176,10 +193,19 @@ namespace YooAsset.Editor
|
|||||||
_cachedBundleIndexIDs.Add(bundleName, index);
|
_cachedBundleIndexIDs.Add(bundleName, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录资源对象所属的资源包ID
|
||||||
foreach (var packageAsset in manifest.AssetList)
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
{
|
{
|
||||||
string bundleName = packageAsset.BundleNameInEditor;
|
var assetInfo = packageAsset.TempDataInEditor as BuildAssetInfo;
|
||||||
packageAsset.BundleID = GetCachedBundleIndexID(bundleName);
|
packageAsset.BundleID = GetCachedBundleIndexID(assetInfo.BundleName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录资源对象依赖的资源包ID集合
|
||||||
|
// 注意:依赖关系非引擎构建结果里查询!
|
||||||
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
|
{
|
||||||
|
var mainAssetInfo = packageAsset.TempDataInEditor as BuildAssetInfo;
|
||||||
|
packageAsset.DependBundleIDs = GetAssetDependBundleIDs(mainAssetInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,15 +218,18 @@ namespace YooAsset.Editor
|
|||||||
foreach (var packageBundle in manifest.BundleList)
|
foreach (var packageBundle in manifest.BundleList)
|
||||||
{
|
{
|
||||||
int mainBundleID = GetCachedBundleIndexID(packageBundle.BundleName);
|
int mainBundleID = GetCachedBundleIndexID(packageBundle.BundleName);
|
||||||
var depends = GetBundleDepends(context, packageBundle.BundleName);
|
string[] dependNames = GetBundleDepends(context, packageBundle.BundleName);
|
||||||
List<int> dependIDs = new List<int>(depends.Length);
|
List<int> dependIDs = new List<int>(dependNames.Length);
|
||||||
foreach (var dependBundleName in depends)
|
foreach (var dependName in dependNames)
|
||||||
{
|
{
|
||||||
int bundleID = GetCachedBundleIndexID(dependBundleName);
|
int dependBundleID = GetCachedBundleIndexID(dependName);
|
||||||
if (bundleID != mainBundleID)
|
if (dependBundleID != mainBundleID)
|
||||||
dependIDs.Add(bundleID);
|
dependIDs.Add(dependBundleID);
|
||||||
}
|
}
|
||||||
packageBundle.DependIDs = dependIDs.ToArray();
|
|
||||||
|
// 排序并填充数据
|
||||||
|
dependIDs.Sort();
|
||||||
|
packageBundle.DependBundleIDs = dependIDs.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,23 +238,27 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ProcessBundleTags(PackageManifest manifest)
|
private void ProcessBundleTags(PackageManifest manifest)
|
||||||
{
|
{
|
||||||
|
foreach (var packageBundle in manifest.BundleList)
|
||||||
|
{
|
||||||
|
packageBundle.Tags = Array.Empty<string>();
|
||||||
|
}
|
||||||
|
|
||||||
// 将主资源的标签信息传染给其依赖的资源包集合
|
// 将主资源的标签信息传染给其依赖的资源包集合
|
||||||
foreach (var packageAsset in manifest.AssetList)
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
{
|
{
|
||||||
var assetTags = packageAsset.AssetTags;
|
var assetTags = packageAsset.AssetTags;
|
||||||
int bundleID = packageAsset.BundleID;
|
int bundleID = packageAsset.BundleID;
|
||||||
CacheBundleTags(bundleID, assetTags);
|
CacheBundleTags(bundleID, assetTags);
|
||||||
|
if (packageAsset.DependBundleIDs != null)
|
||||||
var packageBundle = manifest.BundleList[bundleID];
|
|
||||||
if (packageBundle.DependIDs != null)
|
|
||||||
{
|
{
|
||||||
foreach (var dependBundleID in packageBundle.DependIDs)
|
foreach (var dependBundleID in packageAsset.DependBundleIDs)
|
||||||
{
|
{
|
||||||
CacheBundleTags(dependBundleID, assetTags);
|
CacheBundleTags(dependBundleID, assetTags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将缓存的资源标签赋值给资源包
|
||||||
for (int index = 0; index < manifest.BundleList.Count; index++)
|
for (int index = 0; index < manifest.BundleList.Count; index++)
|
||||||
{
|
{
|
||||||
var packageBundle = manifest.BundleList[index];
|
var packageBundle = manifest.BundleList[index];
|
||||||
@@ -264,5 +297,113 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否包含该资源包的索引ID
|
||||||
|
/// </summary>
|
||||||
|
private bool ContainsCachedBundleIndexID(string bundleName)
|
||||||
|
{
|
||||||
|
return _cachedBundleIndexIDs.ContainsKey(bundleName);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region YOOASSET_LEGACY_DEPENDENCY
|
||||||
|
private void ProcessBuiltinBundleDependency(BuildContext context, PackageManifest manifest)
|
||||||
|
{
|
||||||
|
// 注意:如果是可编程构建管线,需要补充内置资源包
|
||||||
|
// 注意:该步骤依赖前面的操作!
|
||||||
|
var buildResultContext = context.TryGetContextObject<TaskBuilding_SBP.BuildResultContext>();
|
||||||
|
|
||||||
|
if (buildResultContext != null)
|
||||||
|
{
|
||||||
|
ProcessBuiltinBundleReference(manifest, buildResultContext.BuiltinShadersBundleName);
|
||||||
|
ProcessBuiltinBundleReference(manifest, buildResultContext.MonoScriptsBundleName);
|
||||||
|
|
||||||
|
var buildParametersContext = context.TryGetContextObject<BuildParametersContext>();
|
||||||
|
var buildParameters = buildParametersContext.Parameters;
|
||||||
|
if (buildParameters is ScriptableBuildParameters scriptableBuildParameters)
|
||||||
|
{
|
||||||
|
if (scriptableBuildParameters.TrackSpriteAtlasDependencies)
|
||||||
|
{
|
||||||
|
// 注意:检测是否开启图集模式
|
||||||
|
// 说明:需要记录主资源对象对图集的依赖关系!
|
||||||
|
if (EditorSettings.spritePackerMode != SpritePackerMode.Disabled)
|
||||||
|
{
|
||||||
|
var buildMapContext = context.GetContextObject<BuildMapContext>();
|
||||||
|
foreach (var spriteAtlasAsset in buildMapContext.SpriteAtlasAssetList)
|
||||||
|
{
|
||||||
|
string spriteAtlasBundleName = spriteAtlasAsset.BundleName;
|
||||||
|
ProcessBuiltinBundleReference(manifest, spriteAtlasBundleName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ProcessBuiltinBundleReference(PackageManifest manifest, string builtinBundleName)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(builtinBundleName))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 查询内置资源包是否存在
|
||||||
|
if (ContainsCachedBundleIndexID(builtinBundleName) == false)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 获取内置资源包
|
||||||
|
int builtinBundleID = GetCachedBundleIndexID(builtinBundleName);
|
||||||
|
var builtinPackageBundle = manifest.BundleList[builtinBundleID];
|
||||||
|
|
||||||
|
// 更新依赖资源包ID集合
|
||||||
|
HashSet<int> cacheBundleIDs = new HashSet<int>(builtinPackageBundle.ReferenceBundleIDs);
|
||||||
|
HashSet<string> tempTags = new HashSet<string>();
|
||||||
|
foreach (var packageAsset in manifest.AssetList)
|
||||||
|
{
|
||||||
|
if (cacheBundleIDs.Contains(packageAsset.BundleID))
|
||||||
|
{
|
||||||
|
if (packageAsset.DependBundleIDs.Contains(builtinBundleID) == false)
|
||||||
|
{
|
||||||
|
var tempBundleIDs = new List<int>(packageAsset.DependBundleIDs);
|
||||||
|
tempBundleIDs.Add(builtinBundleID);
|
||||||
|
packageAsset.DependBundleIDs = tempBundleIDs.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var tag in packageAsset.AssetTags)
|
||||||
|
{
|
||||||
|
if (tempTags.Contains(tag) == false)
|
||||||
|
tempTags.Add(tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新内置资源包的标签集合
|
||||||
|
foreach (var tag in builtinPackageBundle.Tags)
|
||||||
|
{
|
||||||
|
if (tempTags.Contains(tag) == false)
|
||||||
|
tempTags.Add(tag);
|
||||||
|
}
|
||||||
|
builtinPackageBundle.Tags = tempTags.ToArray();
|
||||||
|
}
|
||||||
|
private int[] GetAssetDependBundleIDs(BuildAssetInfo mainAssetInfo)
|
||||||
|
{
|
||||||
|
HashSet<int> result = new HashSet<int>();
|
||||||
|
int mainBundleID = GetCachedBundleIndexID(mainAssetInfo.BundleName);
|
||||||
|
foreach (var dependAssetInfo in mainAssetInfo.AllDependAssetInfos)
|
||||||
|
{
|
||||||
|
if (dependAssetInfo.HasBundleName())
|
||||||
|
{
|
||||||
|
int bundleID = GetCachedBundleIndexID(dependAssetInfo.BundleName);
|
||||||
|
if (mainBundleID != bundleID)
|
||||||
|
{
|
||||||
|
if (result.Contains(bundleID) == false)
|
||||||
|
result.Add(bundleID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序并返回数据
|
||||||
|
List<int> listResult = new List<int>(result);
|
||||||
|
listResult.Sort();
|
||||||
|
return listResult.ToArray();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,11 +18,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 概述信息
|
// 概述信息
|
||||||
{
|
{
|
||||||
#if UNITY_2019_4_OR_NEWER
|
buildReport.Summary.YooVersion = EditorTools.GetPackageManagerYooVersion();
|
||||||
UnityEditor.PackageManager.PackageInfo packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(BuildReport).Assembly);
|
|
||||||
if (packageInfo != null)
|
|
||||||
buildReport.Summary.YooVersion = packageInfo.version;
|
|
||||||
#endif
|
|
||||||
buildReport.Summary.UnityVersion = UnityEngine.Application.unityVersion;
|
buildReport.Summary.UnityVersion = UnityEngine.Application.unityVersion;
|
||||||
buildReport.Summary.BuildDate = DateTime.Now.ToString();
|
buildReport.Summary.BuildDate = DateTime.Now.ToString();
|
||||||
buildReport.Summary.BuildSeconds = BuildRunner.TotalSeconds;
|
buildReport.Summary.BuildSeconds = BuildRunner.TotalSeconds;
|
||||||
@@ -36,38 +32,42 @@ namespace YooAsset.Editor
|
|||||||
// 收集器配置
|
// 收集器配置
|
||||||
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
|
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
|
||||||
buildReport.Summary.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
buildReport.Summary.EnableAddressable = buildMapContext.Command.EnableAddressable;
|
||||||
|
buildReport.Summary.SupportExtensionless = buildMapContext.Command.SupportExtensionless;
|
||||||
buildReport.Summary.LocationToLower = buildMapContext.Command.LocationToLower;
|
buildReport.Summary.LocationToLower = buildMapContext.Command.LocationToLower;
|
||||||
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
|
||||||
buildReport.Summary.IgnoreRuleName = buildMapContext.Command.IgnoreRule.GetType().FullName;
|
|
||||||
buildReport.Summary.AutoCollectShaders = buildMapContext.Command.AutoCollectShaders;
|
buildReport.Summary.AutoCollectShaders = buildMapContext.Command.AutoCollectShaders;
|
||||||
|
buildReport.Summary.IgnoreRuleName = buildMapContext.Command.IgnoreRule.GetType().FullName;
|
||||||
|
|
||||||
// 构建参数
|
// 构建参数
|
||||||
buildReport.Summary.ClearBuildCacheFiles = buildParameters.ClearBuildCacheFiles;
|
buildReport.Summary.ClearBuildCacheFiles = buildParameters.ClearBuildCacheFiles;
|
||||||
buildReport.Summary.UseAssetDependencyDB = buildParameters.UseAssetDependencyDB;
|
buildReport.Summary.UseAssetDependencyDB = buildParameters.UseAssetDependencyDB;
|
||||||
buildReport.Summary.EnableSharePackRule = buildParameters.EnableSharePackRule;
|
buildReport.Summary.EnableSharePackRule = buildParameters.EnableSharePackRule;
|
||||||
buildReport.Summary.EncryptionClassName = buildParameters.EncryptionServices == null ? "null" : buildParameters.EncryptionServices.GetType().FullName;
|
buildReport.Summary.SingleReferencedPackAlone = buildParameters.SingleReferencedPackAlone;
|
||||||
if (buildParameters.BuildPipeline == nameof(BuiltinBuildPipeline))
|
buildReport.Summary.FileNameStyle = buildParameters.FileNameStyle;
|
||||||
|
buildReport.Summary.EncryptionServicesClassName = buildParameters.EncryptionServices == null ? "null" : buildParameters.EncryptionServices.GetType().FullName;
|
||||||
|
buildReport.Summary.ManifestProcessServicesClassName = buildParameters.ManifestProcessServices == null ? "null" : buildParameters.ManifestProcessServices.GetType().FullName;
|
||||||
|
buildReport.Summary.ManifestRestoreServicesClassName = buildParameters.ManifestRestoreServices == null ? "null" : buildParameters.ManifestRestoreServices.GetType().FullName;
|
||||||
|
|
||||||
|
if (buildParameters is BuiltinBuildParameters)
|
||||||
{
|
{
|
||||||
var builtinBuildParameters = buildParameters as BuiltinBuildParameters;
|
var builtinBuildParameters = buildParameters as BuiltinBuildParameters;
|
||||||
buildReport.Summary.FileNameStyle = buildParameters.FileNameStyle;
|
|
||||||
buildReport.Summary.CompressOption = builtinBuildParameters.CompressOption;
|
buildReport.Summary.CompressOption = builtinBuildParameters.CompressOption;
|
||||||
buildReport.Summary.DisableWriteTypeTree = builtinBuildParameters.DisableWriteTypeTree;
|
buildReport.Summary.DisableWriteTypeTree = builtinBuildParameters.DisableWriteTypeTree;
|
||||||
buildReport.Summary.IgnoreTypeTreeChanges = builtinBuildParameters.IgnoreTypeTreeChanges;
|
buildReport.Summary.IgnoreTypeTreeChanges = builtinBuildParameters.IgnoreTypeTreeChanges;
|
||||||
|
buildReport.Summary.ReplaceAssetPathWithAddress = builtinBuildParameters.ReplaceAssetPathWithAddress;
|
||||||
}
|
}
|
||||||
else if (buildParameters.BuildPipeline == nameof(ScriptableBuildPipeline))
|
else if (buildParameters is ScriptableBuildParameters)
|
||||||
{
|
{
|
||||||
var scriptableBuildParameters = buildParameters as ScriptableBuildParameters;
|
var scriptableBuildParameters = buildParameters as ScriptableBuildParameters;
|
||||||
buildReport.Summary.FileNameStyle = buildParameters.FileNameStyle;
|
|
||||||
buildReport.Summary.CompressOption = scriptableBuildParameters.CompressOption;
|
buildReport.Summary.CompressOption = scriptableBuildParameters.CompressOption;
|
||||||
buildReport.Summary.DisableWriteTypeTree = scriptableBuildParameters.DisableWriteTypeTree;
|
buildReport.Summary.DisableWriteTypeTree = scriptableBuildParameters.DisableWriteTypeTree;
|
||||||
buildReport.Summary.IgnoreTypeTreeChanges = scriptableBuildParameters.IgnoreTypeTreeChanges;
|
buildReport.Summary.IgnoreTypeTreeChanges = scriptableBuildParameters.IgnoreTypeTreeChanges;
|
||||||
}
|
buildReport.Summary.ReplaceAssetPathWithAddress = scriptableBuildParameters.ReplaceAssetPathWithAddress;
|
||||||
else
|
buildReport.Summary.WriteLinkXML = scriptableBuildParameters.WriteLinkXML;
|
||||||
{
|
buildReport.Summary.CacheServerHost = scriptableBuildParameters.CacheServerHost;
|
||||||
buildReport.Summary.FileNameStyle = buildParameters.FileNameStyle;
|
buildReport.Summary.CacheServerPort = scriptableBuildParameters.CacheServerPort;
|
||||||
buildReport.Summary.CompressOption = ECompressOption.Uncompressed;
|
buildReport.Summary.BuiltinShadersBundleName = scriptableBuildParameters.BuiltinShadersBundleName;
|
||||||
buildReport.Summary.DisableWriteTypeTree = false;
|
buildReport.Summary.MonoScriptsBundleName = scriptableBuildParameters.MonoScriptsBundleName;
|
||||||
buildReport.Summary.IgnoreTypeTreeChanges = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建结果
|
// 构建结果
|
||||||
@@ -91,7 +91,8 @@ namespace YooAsset.Editor
|
|||||||
reportAssetInfo.AssetGUID = AssetDatabase.AssetPathToGUID(packageAsset.AssetPath);
|
reportAssetInfo.AssetGUID = AssetDatabase.AssetPathToGUID(packageAsset.AssetPath);
|
||||||
reportAssetInfo.MainBundleName = mainBundle.BundleName;
|
reportAssetInfo.MainBundleName = mainBundle.BundleName;
|
||||||
reportAssetInfo.MainBundleSize = mainBundle.FileSize;
|
reportAssetInfo.MainBundleSize = mainBundle.FileSize;
|
||||||
reportAssetInfo.DependAssets = GetDependAssets(buildMapContext, mainBundle.BundleName, packageAsset.AssetPath);
|
reportAssetInfo.DependAssets = GetAssetDependAssets(buildMapContext, mainBundle.BundleName, packageAsset.AssetPath);
|
||||||
|
reportAssetInfo.DependBundles = GetAssetDependBundles(manifest, packageAsset);
|
||||||
buildReport.AssetInfos.Add(reportAssetInfo);
|
buildReport.AssetInfos.Add(reportAssetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +108,9 @@ namespace YooAsset.Editor
|
|||||||
reportBundleInfo.FileSize = packageBundle.FileSize;
|
reportBundleInfo.FileSize = packageBundle.FileSize;
|
||||||
reportBundleInfo.Encrypted = packageBundle.Encrypted;
|
reportBundleInfo.Encrypted = packageBundle.Encrypted;
|
||||||
reportBundleInfo.Tags = packageBundle.Tags;
|
reportBundleInfo.Tags = packageBundle.Tags;
|
||||||
reportBundleInfo.DependBundles = GetDependBundles(manifest, packageBundle);
|
reportBundleInfo.DependBundles = GetBundleDependBundles(manifest, packageBundle);
|
||||||
reportBundleInfo.AllBuiltinAssets = GetAllBuiltinAssets(buildMapContext, packageBundle.BundleName);
|
reportBundleInfo.ReferenceBundles = GetBundleReferenceBundles(manifest, packageBundle);
|
||||||
|
reportBundleInfo.BundleContents = GetBundleContents(buildMapContext, packageBundle.BundleName);
|
||||||
buildReport.BundleInfos.Add(reportBundleInfo);
|
buildReport.BundleInfos.Add(reportBundleInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,12 +125,28 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取资源对象依赖的所有资源包
|
/// 获取资源对象依赖的其它所有资源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private List<string> GetDependBundles(PackageManifest manifest, PackageBundle packageBundle)
|
private List<AssetInfo> GetAssetDependAssets(BuildMapContext buildMapContext, string bundleName, string assetPath)
|
||||||
{
|
{
|
||||||
List<string> dependBundles = new List<string>(packageBundle.DependIDs.Length);
|
List<AssetInfo> result = new List<AssetInfo>();
|
||||||
foreach (int index in packageBundle.DependIDs)
|
var bundleInfo = buildMapContext.GetBundleInfo(bundleName);
|
||||||
|
var assetInfo = bundleInfo.GetPackAssetInfo(assetPath);
|
||||||
|
foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos)
|
||||||
|
{
|
||||||
|
result.Add(dependAssetInfo.AssetInfo);
|
||||||
|
}
|
||||||
|
result.Sort();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取资源对象依赖的资源包集合
|
||||||
|
/// </summary>
|
||||||
|
private List<string> GetAssetDependBundles(PackageManifest manifest, PackageAsset packageAsset)
|
||||||
|
{
|
||||||
|
List<string> dependBundles = new List<string>(packageAsset.DependBundleIDs.Length);
|
||||||
|
foreach (int index in packageAsset.DependBundleIDs)
|
||||||
{
|
{
|
||||||
string dependBundleName = manifest.BundleList[index].BundleName;
|
string dependBundleName = manifest.BundleList[index].BundleName;
|
||||||
dependBundles.Add(dependBundleName);
|
dependBundles.Add(dependBundleName);
|
||||||
@@ -138,42 +156,42 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取资源对象依赖的其它所有资源
|
/// 获取资源包依赖的资源包集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private List<string> GetDependAssets(BuildMapContext buildMapContext, string bundleName, string assetPath)
|
private List<string> GetBundleDependBundles(PackageManifest manifest, PackageBundle packageBundle)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> dependBundles = new List<string>(packageBundle.DependBundleIDs.Length);
|
||||||
var bundleInfo = buildMapContext.GetBundleInfo(bundleName);
|
foreach (int index in packageBundle.DependBundleIDs)
|
||||||
{
|
{
|
||||||
BuildAssetInfo findAssetInfo = null;
|
string dependBundleName = manifest.BundleList[index].BundleName;
|
||||||
foreach (var buildAsset in bundleInfo.MainAssets)
|
dependBundles.Add(dependBundleName);
|
||||||
{
|
|
||||||
if (buildAsset.AssetInfo.AssetPath == assetPath)
|
|
||||||
{
|
|
||||||
findAssetInfo = buildAsset;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (findAssetInfo == null)
|
|
||||||
{
|
|
||||||
throw new Exception($"Should never get here ! Not found asset {assetPath} in bunlde {bundleName}");
|
|
||||||
}
|
|
||||||
foreach (var dependAssetInfo in findAssetInfo.AllDependAssetInfos)
|
|
||||||
{
|
|
||||||
result.Add(dependAssetInfo.AssetInfo.AssetPath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result.Sort();
|
dependBundles.Sort();
|
||||||
return result;
|
return dependBundles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取该资源包内的所有资源
|
/// 获取引用该资源包的资源包集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private List<string> GetAllBuiltinAssets(BuildMapContext buildMapContext, string bundleName)
|
private List<string> GetBundleReferenceBundles(PackageManifest manifest, PackageBundle packageBundle)
|
||||||
|
{
|
||||||
|
List<string> referenceBundles = new List<string>(packageBundle.ReferenceBundleIDs.Count);
|
||||||
|
foreach (int index in packageBundle.ReferenceBundleIDs)
|
||||||
|
{
|
||||||
|
string dependBundleName = manifest.BundleList[index].BundleName;
|
||||||
|
referenceBundles.Add(dependBundleName);
|
||||||
|
}
|
||||||
|
referenceBundles.Sort();
|
||||||
|
return referenceBundles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取资源包内部所有资产
|
||||||
|
/// </summary>
|
||||||
|
private List<AssetInfo> GetBundleContents(BuildMapContext buildMapContext, string bundleName)
|
||||||
{
|
{
|
||||||
var bundleInfo = buildMapContext.GetBundleInfo(bundleName);
|
var bundleInfo = buildMapContext.GetBundleInfo(bundleName);
|
||||||
List<string> result = bundleInfo.GetAllBuiltinAssetPaths();
|
List<AssetInfo> result = bundleInfo.GetBundleContents();
|
||||||
result.Sort();
|
result.Sort();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace YooAsset.Editor
|
|||||||
protected abstract string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context);
|
protected abstract string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context);
|
protected abstract uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
||||||
protected abstract string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
||||||
protected abstract long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,8 @@ namespace YooAsset.Editor
|
|||||||
// 开始构建
|
// 开始构建
|
||||||
string pipelineOutputDirectory = buildParametersContext.GetPipelineOutputDirectory();
|
string pipelineOutputDirectory = buildParametersContext.GetPipelineOutputDirectory();
|
||||||
BuildAssetBundleOptions buildOptions = builtinBuildParameters.GetBundleBuildOptions();
|
BuildAssetBundleOptions buildOptions = builtinBuildParameters.GetBundleBuildOptions();
|
||||||
AssetBundleManifest unityManifest = BuildPipeline.BuildAssetBundles(pipelineOutputDirectory, buildMapContext.GetPipelineBuilds(), buildOptions, buildParametersContext.Parameters.BuildTarget);
|
var bundleBuilds = buildMapContext.GetPipelineBuilds(builtinBuildParameters.ReplaceAssetPathWithAddress);
|
||||||
|
AssetBundleManifest unityManifest = BuildPipeline.BuildAssetBundles(pipelineOutputDirectory, bundleBuilds, buildOptions, buildParametersContext.Parameters.BuildTarget);
|
||||||
if (unityManifest == null)
|
if (unityManifest == null)
|
||||||
{
|
{
|
||||||
string message = BuildLogger.GetErrorMessage(ErrorCode.UnityEngineBuildFailed, "UnityEngine build failed !");
|
string message = BuildLogger.GetErrorMessage(ErrorCode.UnityEngineBuildFailed, "UnityEngine build failed !");
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class TaskCreateCatalog_BBP : TaskCreateCatalog, IBuildTask
|
||||||
|
{
|
||||||
|
void IBuildTask.Run(BuildContext context)
|
||||||
|
{
|
||||||
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
|
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
|
||||||
|
{
|
||||||
|
CreateCatalogFile(buildParametersContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 69f62f6b4185d06498f96aa272e9b926
|
guid: 8fe3d00b03dc9c64a96b7acfdf99b54c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -11,7 +11,10 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
{
|
{
|
||||||
CreateManifestFile(true, true, context);
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
|
var builtinBuildParameters = buildParametersContext.Parameters as BuiltinBuildParameters;
|
||||||
|
bool replaceAssetPathWithAddress = builtinBuildParameters.ReplaceAssetPathWithAddress;
|
||||||
|
CreateManifestFile(true, true, replaceAssetPathWithAddress, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ namespace YooAsset.Editor
|
|||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileMD5(filePath);
|
return HashUtility.FileMD5(filePath);
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ECompressOption CompressOption = ECompressOption.Uncompressed;
|
public ECompressOption CompressOption = ECompressOption.Uncompressed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从文件头里剥离Unity版本信息
|
||||||
|
/// </summary>
|
||||||
|
public bool StripUnityVersion = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 禁止写入类型树结构(可以降低包体和内存并提高加载效率)
|
/// 禁止写入类型树结构(可以降低包体和内存并提高加载效率)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -22,6 +27,12 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IgnoreTypeTreeChanges = true;
|
public bool IgnoreTypeTreeChanges = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 使用可寻址地址代替资源路径
|
||||||
|
/// 说明:开启此项可以节省运行时清单占用的内存!
|
||||||
|
/// </summary>
|
||||||
|
public bool ReplaceAssetPathWithAddress = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取内置构建管线的构建选项
|
/// 获取内置构建管线的构建选项
|
||||||
@@ -41,6 +52,8 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
if (ClearBuildCacheFiles)
|
if (ClearBuildCacheFiles)
|
||||||
opt |= BuildAssetBundleOptions.ForceRebuildAssetBundle; //Force rebuild the asset bundles
|
opt |= BuildAssetBundleOptions.ForceRebuildAssetBundle; //Force rebuild the asset bundles
|
||||||
|
if (StripUnityVersion)
|
||||||
|
opt |= BuildAssetBundleOptions.AssetBundleStripUnityVersion; //Removes the Unity Version number in the Archive File & Serialized File headers
|
||||||
if (DisableWriteTypeTree)
|
if (DisableWriteTypeTree)
|
||||||
opt |= BuildAssetBundleOptions.DisableWriteTypeTree; //Do not include type information within the asset bundle (don't write type tree).
|
opt |= BuildAssetBundleOptions.DisableWriteTypeTree; //Do not include type information within the asset bundle (don't write type tree).
|
||||||
if (IgnoreTypeTreeChanges)
|
if (IgnoreTypeTreeChanges)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace YooAsset.Editor
|
|||||||
new TaskCreateReport_BBP(),
|
new TaskCreateReport_BBP(),
|
||||||
new TaskCreatePackage_BBP(),
|
new TaskCreatePackage_BBP(),
|
||||||
new TaskCopyBuildinFiles_BBP(),
|
new TaskCopyBuildinFiles_BBP(),
|
||||||
|
new TaskCreateCatalog_BBP()
|
||||||
};
|
};
|
||||||
return pipeline;
|
return pipeline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
{
|
{
|
||||||
CreateManifestFile(false, false, context);
|
CreateManifestFile(false, true, false, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ namespace YooAsset.Editor
|
|||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return GetFilePathTempHash(filePath);
|
return GetFilePathTempHash(filePath);
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
return "00000000"; //8位
|
return 0;
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
long tempSize = 0;
|
long tempSize = 0;
|
||||||
|
|
||||||
var assetPaths = bundleInfo.GetAllMainAssetPaths();
|
var assetPaths = bundleInfo.GetAllPackAssetPaths();
|
||||||
foreach (var assetPath in assetPaths)
|
foreach (var assetPath in assetPaths)
|
||||||
{
|
{
|
||||||
long size = FileUtility.GetFileSize(assetPath);
|
long size = FileUtility.GetFileSize(assetPath);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace YooAsset.Editor
|
|||||||
foreach (var bundleInfo in buildMapContext.Collection)
|
foreach (var bundleInfo in buildMapContext.Collection)
|
||||||
{
|
{
|
||||||
string dest = $"{pipelineOutputDirectory}/{bundleInfo.BundleName}";
|
string dest = $"{pipelineOutputDirectory}/{bundleInfo.BundleName}";
|
||||||
foreach (var buildAsset in bundleInfo.MainAssets)
|
foreach (var buildAsset in bundleInfo.AllPackAssets)
|
||||||
{
|
{
|
||||||
EditorTools.CopyFile(buildAsset.AssetInfo.AssetPath, dest, true);
|
EditorTools.CopyFile(buildAsset.AssetInfo.AssetPath, dest, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class TaskCreateCatalog_RFBP : TaskCreateCatalog, IBuildTask
|
||||||
|
{
|
||||||
|
void IBuildTask.Run(BuildContext context)
|
||||||
|
{
|
||||||
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
|
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
|
||||||
|
{
|
||||||
|
CreateCatalogFile(buildParametersContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 94254ab8e4496214884c11a891c131c6
|
guid: 563771ecaff17ee498b5fda7c1132e62
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -9,7 +9,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
{
|
{
|
||||||
CreateManifestFile(false, true, context);
|
CreateManifestFile(false, true, false, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace YooAsset.Editor
|
|||||||
// 注意:原生文件资源包只能包含一个原生文件
|
// 注意:原生文件资源包只能包含一个原生文件
|
||||||
foreach (var bundleInfo in buildMapContext.Collection)
|
foreach (var bundleInfo in buildMapContext.Collection)
|
||||||
{
|
{
|
||||||
if (bundleInfo.MainAssets.Count != 1)
|
if (bundleInfo.AllPackAssets.Count != 1)
|
||||||
{
|
{
|
||||||
string message = BuildLogger.GetErrorMessage(ErrorCode.NotSupportMultipleRawAsset, $"The bundle does not support multiple raw asset : {bundleInfo.BundleName}");
|
string message = BuildLogger.GetErrorMessage(ErrorCode.NotSupportMultipleRawAsset, $"The bundle does not support multiple raw asset : {bundleInfo.BundleName}");
|
||||||
throw new Exception(message);
|
throw new Exception(message);
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ namespace YooAsset.Editor
|
|||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileMD5(filePath);
|
return HashUtility.FileMD5(filePath);
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace YooAsset.Editor
|
|||||||
new TaskCreateReport_RFBP(),
|
new TaskCreateReport_RFBP(),
|
||||||
new TaskCreatePackage_RFBP(),
|
new TaskCreatePackage_RFBP(),
|
||||||
new TaskCopyBuildinFiles_RFBP(),
|
new TaskCopyBuildinFiles_RFBP(),
|
||||||
|
new TaskCreateCatalog_RFBP()
|
||||||
};
|
};
|
||||||
return pipeline;
|
return pipeline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ namespace YooAsset.Editor
|
|||||||
public class BuildResultContext : IContextObject
|
public class BuildResultContext : IContextObject
|
||||||
{
|
{
|
||||||
public IBundleBuildResults Results;
|
public IBundleBuildResults Results;
|
||||||
|
public string BuiltinShadersBundleName;
|
||||||
|
public string MonoScriptsBundleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
@@ -22,7 +24,8 @@ namespace YooAsset.Editor
|
|||||||
var scriptableBuildParameters = buildParametersContext.Parameters as ScriptableBuildParameters;
|
var scriptableBuildParameters = buildParametersContext.Parameters as ScriptableBuildParameters;
|
||||||
|
|
||||||
// 构建内容
|
// 构建内容
|
||||||
var buildContent = new BundleBuildContent(buildMapContext.GetPipelineBuilds());
|
var bundleBuilds = buildMapContext.GetPipelineBuilds(scriptableBuildParameters.ReplaceAssetPathWithAddress);
|
||||||
|
var buildContent = new BundleBuildContent(bundleBuilds);
|
||||||
|
|
||||||
// 开始构建
|
// 开始构建
|
||||||
IBundleBuildResults buildResults;
|
IBundleBuildResults buildResults;
|
||||||
@@ -53,6 +56,8 @@ namespace YooAsset.Editor
|
|||||||
BuildLogger.Log("UnityEngine build success!");
|
BuildLogger.Log("UnityEngine build success!");
|
||||||
BuildResultContext buildResultContext = new BuildResultContext();
|
BuildResultContext buildResultContext = new BuildResultContext();
|
||||||
buildResultContext.Results = buildResults;
|
buildResultContext.Results = buildResults;
|
||||||
|
buildResultContext.BuiltinShadersBundleName = builtinShadersBundleName;
|
||||||
|
buildResultContext.MonoScriptsBundleName = monoScriptsBundleName;
|
||||||
context.SetContextObject(buildResultContext);
|
context.SetContextObject(buildResultContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class TaskCreateCatalog_SBP : TaskCreateCatalog, IBuildTask
|
||||||
|
{
|
||||||
|
void IBuildTask.Run(BuildContext context)
|
||||||
|
{
|
||||||
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
|
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
|
||||||
|
{
|
||||||
|
CreateCatalogFile(buildParametersContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d8241b1eb8e22874b84d279dae9bbd1b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -13,7 +13,10 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
{
|
{
|
||||||
CreateManifestFile(true, true, context);
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
|
var scriptableBuildParameters = buildParametersContext.Parameters as ScriptableBuildParameters;
|
||||||
|
bool replaceAssetPathWithAddress = scriptableBuildParameters.ReplaceAssetPathWithAddress;
|
||||||
|
CreateManifestFile(true, true, replaceAssetPathWithAddress, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace YooAsset.Editor
|
|||||||
void IBuildTask.Run(BuildContext context)
|
void IBuildTask.Run(BuildContext context)
|
||||||
{
|
{
|
||||||
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
var buildParameters = buildParametersContext.Parameters;
|
var buildParameters = buildParametersContext.Parameters as ScriptableBuildParameters;
|
||||||
|
|
||||||
// 检测基础构建参数
|
// 检测基础构建参数
|
||||||
buildParametersContext.CheckBuildParameters();
|
buildParametersContext.CheckBuildParameters();
|
||||||
@@ -50,6 +50,13 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
BuildLogger.Log($"Create pipeline output directory: {pipelineOutputDirectory}");
|
BuildLogger.Log($"Create pipeline output directory: {pipelineOutputDirectory}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测内置着色器资源包名称
|
||||||
|
if (string.IsNullOrEmpty(buildParameters.BuiltinShadersBundleName))
|
||||||
|
{
|
||||||
|
string warning = BuildLogger.GetErrorMessage(ErrorCode.BuiltinShadersBundleNameIsNull, $"Builtin shaders bundle name is null. It will cause resource redundancy !");
|
||||||
|
BuildLogger.Warning(warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,10 +45,10 @@ namespace YooAsset.Editor
|
|||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileMD5(filePath);
|
return HashUtility.FileMD5(filePath);
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,16 +14,32 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ECompressOption CompressOption = ECompressOption.Uncompressed;
|
public ECompressOption CompressOption = ECompressOption.Uncompressed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从文件头里剥离Unity版本信息
|
||||||
|
/// </summary>
|
||||||
|
public bool StripUnityVersion = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 禁止写入类型树结构(可以降低包体和内存并提高加载效率)
|
/// 禁止写入类型树结构(可以降低包体和内存并提高加载效率)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DisableWriteTypeTree = false;
|
public bool DisableWriteTypeTree = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 忽略类型树变化
|
/// 忽略类型树变化(无效参数)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IgnoreTypeTreeChanges = true;
|
public bool IgnoreTypeTreeChanges = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 使用可寻址地址代替资源路径
|
||||||
|
/// 说明:开启此项可以节省运行时清单占用的内存!
|
||||||
|
/// </summary>
|
||||||
|
public bool ReplaceAssetPathWithAddress = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动建立资源对象对图集的依赖关系
|
||||||
|
/// </summary>
|
||||||
|
public bool TrackSpriteAtlasDependencies = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成代码防裁剪配置
|
/// 生成代码防裁剪配置
|
||||||
@@ -70,8 +86,10 @@ namespace YooAsset.Editor
|
|||||||
else
|
else
|
||||||
throw new System.NotImplementedException(CompressOption.ToString());
|
throw new System.NotImplementedException(CompressOption.ToString());
|
||||||
|
|
||||||
|
if (StripUnityVersion)
|
||||||
|
buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.StripUnityVersion; // Build Flag to indicate the Unity Version should not be written to the serialized file.
|
||||||
if (DisableWriteTypeTree)
|
if (DisableWriteTypeTree)
|
||||||
buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.DisableWriteTypeTree;
|
buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.DisableWriteTypeTree; //Do not include type information within the built content.
|
||||||
|
|
||||||
buildParams.UseCache = true;
|
buildParams.UseCache = true;
|
||||||
buildParams.CacheServerHost = CacheServerHost;
|
buildParams.CacheServerHost = CacheServerHost;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace YooAsset.Editor
|
|||||||
new TaskCreateReport_SBP(),
|
new TaskCreateReport_SBP(),
|
||||||
new TaskCreatePackage_SBP(),
|
new TaskCreatePackage_SBP(),
|
||||||
new TaskCopyBuildinFiles_SBP(),
|
new TaskCopyBuildinFiles_SBP(),
|
||||||
|
new TaskCreateCatalog_SBP()
|
||||||
};
|
};
|
||||||
return pipeline;
|
return pipeline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace YooAsset.Editor
|
|||||||
private readonly Dictionary<System.Type, IContextObject> _contextObjects = new Dictionary<System.Type, IContextObject>();
|
private readonly Dictionary<System.Type, IContextObject> _contextObjects = new Dictionary<System.Type, IContextObject>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 清空所有情景对象
|
/// 清空所有上下文对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearAllContext()
|
public void ClearAllContext()
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置情景对象
|
/// 设置上下文对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetContextObject(IContextObject contextObject)
|
public void SetContextObject(IContextObject contextObject)
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取情景对象
|
/// 获取上下文对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public T GetContextObject<T>() where T : IContextObject
|
public T GetContextObject<T>() where T : IContextObject
|
||||||
{
|
{
|
||||||
@@ -46,5 +46,21 @@ namespace YooAsset.Editor
|
|||||||
throw new Exception($"Not found context object : {type}");
|
throw new Exception($"Not found context object : {type}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取上下文对象
|
||||||
|
/// </summary>
|
||||||
|
public T TryGetContextObject<T>() where T : IContextObject
|
||||||
|
{
|
||||||
|
var type = typeof(T);
|
||||||
|
if (_contextObjects.TryGetValue(type, out IContextObject contextObject))
|
||||||
|
{
|
||||||
|
return (T)contextObject;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,37 +2,100 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
internal static class BuildLogger
|
internal static class BuildLogger
|
||||||
{
|
{
|
||||||
private static bool _enableLog = true;
|
private const int MAX_LOG_BUFFER_SIZE = 1024 * 1024 * 2; //2MB
|
||||||
|
|
||||||
public static void InitLogger(bool enableLog)
|
private static bool _enableLog = true;
|
||||||
|
private static string _logFilePath;
|
||||||
|
|
||||||
|
private static readonly object _lockObj = new object();
|
||||||
|
private static readonly StringBuilder _logBuilder = new StringBuilder(MAX_LOG_BUFFER_SIZE);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化日志系统
|
||||||
|
/// </summary>
|
||||||
|
public static void InitLogger(bool enableLog, string logFilePath)
|
||||||
{
|
{
|
||||||
_enableLog = enableLog;
|
_enableLog = enableLog;
|
||||||
|
_logFilePath = logFilePath;
|
||||||
|
_logBuilder.Clear();
|
||||||
|
|
||||||
|
if (_enableLog)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_logFilePath))
|
||||||
|
throw new Exception("Log file path is null or empty !");
|
||||||
|
|
||||||
|
Debug.Log($"Logger initialized at {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关闭日志系统
|
||||||
|
/// </summary>
|
||||||
|
public static void Shuntdown()
|
||||||
|
{
|
||||||
|
if (_enableLog)
|
||||||
|
{
|
||||||
|
lock (_lockObj)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists(_logFilePath))
|
||||||
|
File.Delete(_logFilePath);
|
||||||
|
|
||||||
|
FileUtility.CreateFileDirectory(_logFilePath);
|
||||||
|
File.WriteAllText(_logFilePath, _logBuilder.ToString(), Encoding.UTF8);
|
||||||
|
_logBuilder.Clear();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Failed to write log file: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Log(string message)
|
public static void Log(string message)
|
||||||
{
|
{
|
||||||
if (_enableLog)
|
if (_enableLog)
|
||||||
{
|
{
|
||||||
|
WriteLog("INFO", message);
|
||||||
Debug.Log(message);
|
Debug.Log(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void Warning(string message)
|
public static void Warning(string message)
|
||||||
{
|
{
|
||||||
Debug.LogWarning(message);
|
if (_enableLog)
|
||||||
|
{
|
||||||
|
WriteLog("WARN", message);
|
||||||
|
Debug.LogWarning(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static void Error(string message)
|
public static void Error(string message)
|
||||||
{
|
{
|
||||||
Debug.LogError(message);
|
if (_enableLog)
|
||||||
|
{
|
||||||
|
WriteLog("ERROR", message);
|
||||||
|
Debug.LogError(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetErrorMessage(ErrorCode code, string message)
|
public static string GetErrorMessage(ErrorCode code, string message)
|
||||||
{
|
{
|
||||||
return $"[ErrorCode{(int)code}] {message}";
|
return $"[ErrorCode{(int)code}] {message}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void WriteLog(string level, string message)
|
||||||
|
{
|
||||||
|
lock (_lockObj)
|
||||||
|
{
|
||||||
|
string logEntry = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} [{level}] {message}";
|
||||||
|
_logBuilder.AppendLine(logEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,11 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ErrorInfo;
|
public string ErrorInfo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构建失败的堆栈
|
||||||
|
/// </summary>
|
||||||
|
public string ErrorStack;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 输出的补丁包目录
|
/// 输出的补丁包目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ namespace YooAsset.Editor
|
|||||||
EditorTools.ClearProgressBar();
|
EditorTools.ClearProgressBar();
|
||||||
buildResult.FailedTask = task.GetType().Name;
|
buildResult.FailedTask = task.GetType().Name;
|
||||||
buildResult.ErrorInfo = e.ToString();
|
buildResult.ErrorInfo = e.ToString();
|
||||||
|
buildResult.ErrorStack = e.StackTrace;
|
||||||
buildResult.Success = false;
|
buildResult.Success = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace YooAsset.Editor
|
|||||||
BuildPipelineIsNullOrEmpty = 116,
|
BuildPipelineIsNullOrEmpty = 116,
|
||||||
BuildBundleTypeIsUnknown = 117,
|
BuildBundleTypeIsUnknown = 117,
|
||||||
RecommendScriptBuildPipeline = 130,
|
RecommendScriptBuildPipeline = 130,
|
||||||
|
BuiltinShadersBundleNameIsNull = 131,
|
||||||
|
|
||||||
// TaskGetBuildMap
|
// TaskGetBuildMap
|
||||||
RemoveInvalidTags = 200,
|
RemoveInvalidTags = 200,
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class ManifestProcessNone : IManifestProcessServices
|
||||||
|
{
|
||||||
|
byte[] IManifestProcessServices.ProcessManifest(byte[] fileData)
|
||||||
|
{
|
||||||
|
return fileData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ManifestRestoreNone : IManifestRestoreServices
|
||||||
|
{
|
||||||
|
byte[] IManifestRestoreServices.RestoreManifest(byte[] fileData)
|
||||||
|
{
|
||||||
|
return fileData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 446513b0ea9f5d445ade0cfb09c5073b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
public interface IBuildPipeline
|
public interface IBuildPipeline
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 运行构建任务
|
||||||
|
/// </summary>
|
||||||
BuildResult Run(BuildParameters buildParameters, bool enableLog);
|
BuildResult Run(BuildParameters buildParameters, bool enableLog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class BuildPipelineAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string PipelineName;
|
||||||
|
|
||||||
|
public BuildPipelineAttribute(string name)
|
||||||
|
{
|
||||||
|
this.PipelineName = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 90d865a5cede7ae43a5fdabdc20af0fd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -12,211 +12,269 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
internal abstract class BuildPipelineViewerBase
|
internal abstract class BuildPipelineViewerBase
|
||||||
{
|
{
|
||||||
private const int StyleWidth = 400;
|
protected const int StyleWidth = 400;
|
||||||
private const int LabelMinWidth = 180;
|
protected const int LabelMinWidth = 190;
|
||||||
|
|
||||||
protected readonly string PackageName;
|
protected string PackageName { private set; get; }
|
||||||
protected readonly BuildTarget BuildTarget;
|
protected string PipelineName { private set; get; }
|
||||||
protected readonly EBuildPipeline BuildPipeline;
|
protected BuildTarget BuildTarget { private set; get; }
|
||||||
protected TemplateContainer Root;
|
|
||||||
|
|
||||||
private TextField _buildOutputField;
|
/// <summary>
|
||||||
private TextField _buildVersionField;
|
/// 初始化视图
|
||||||
private PopupField<Enum> _buildModeField;
|
/// </summary>
|
||||||
private PopupField<Type> _encryptionField;
|
public void InitView(string packageName, string pipelineName, BuildTarget buildTarget)
|
||||||
private EnumField _compressionField;
|
|
||||||
private EnumField _outputNameStyleField;
|
|
||||||
private EnumField _copyBuildinFileOptionField;
|
|
||||||
private TextField _copyBuildinFileTagsField;
|
|
||||||
private Toggle _clearBuildCacheToggle;
|
|
||||||
private Toggle _useAssetDependencyDBToggle;
|
|
||||||
|
|
||||||
public BuildPipelineViewerBase(string packageName, EBuildPipeline buildPipeline, BuildTarget buildTarget, VisualElement parent)
|
|
||||||
{
|
{
|
||||||
PackageName = packageName;
|
PackageName = packageName;
|
||||||
|
PipelineName = pipelineName;
|
||||||
BuildTarget = buildTarget;
|
BuildTarget = buildTarget;
|
||||||
BuildPipeline = buildPipeline;
|
|
||||||
|
|
||||||
CreateView(parent);
|
|
||||||
RefreshView();
|
|
||||||
}
|
|
||||||
private void CreateView(VisualElement parent)
|
|
||||||
{
|
|
||||||
// 加载布局文件
|
|
||||||
var visualAsset = UxmlLoader.LoadWindowUXML<BuildPipelineViewerBase>();
|
|
||||||
if (visualAsset == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Root = visualAsset.CloneTree();
|
|
||||||
Root.style.flexGrow = 1f;
|
|
||||||
parent.Add(Root);
|
|
||||||
|
|
||||||
// 输出目录
|
|
||||||
string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
_buildOutputField = Root.Q<TextField>("BuildOutput");
|
|
||||||
_buildOutputField.SetValueWithoutNotify(defaultOutputRoot);
|
|
||||||
_buildOutputField.SetEnabled(false);
|
|
||||||
|
|
||||||
// 构建版本
|
|
||||||
_buildVersionField = Root.Q<TextField>("BuildVersion");
|
|
||||||
_buildVersionField.style.width = StyleWidth;
|
|
||||||
_buildVersionField.SetValueWithoutNotify(GetDefaultPackageVersion());
|
|
||||||
|
|
||||||
// 加密方法
|
|
||||||
{
|
|
||||||
var encryptionContainer = Root.Q("EncryptionContainer");
|
|
||||||
var encryptionClassTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));
|
|
||||||
if (encryptionClassTypes.Count > 0)
|
|
||||||
{
|
|
||||||
var encyptionClassName = AssetBundleBuilderSetting.GetPackageEncyptionClassName(PackageName, BuildPipeline);
|
|
||||||
int defaultIndex = encryptionClassTypes.FindIndex(x => x.FullName.Equals(encyptionClassName));
|
|
||||||
if (defaultIndex < 0)
|
|
||||||
defaultIndex = 0;
|
|
||||||
_encryptionField = new PopupField<Type>(encryptionClassTypes, defaultIndex);
|
|
||||||
_encryptionField.label = "Encryption";
|
|
||||||
_encryptionField.style.width = StyleWidth;
|
|
||||||
_encryptionField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageEncyptionClassName(PackageName, BuildPipeline, _encryptionField.value.FullName);
|
|
||||||
});
|
|
||||||
encryptionContainer.Add(_encryptionField);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_encryptionField = new PopupField<Type>();
|
|
||||||
_encryptionField.label = "Encryption";
|
|
||||||
_encryptionField.style.width = StyleWidth;
|
|
||||||
encryptionContainer.Add(_encryptionField);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 压缩方式选项
|
|
||||||
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, BuildPipeline);
|
|
||||||
_compressionField = Root.Q<EnumField>("Compression");
|
|
||||||
_compressionField.Init(compressOption);
|
|
||||||
_compressionField.SetValueWithoutNotify(compressOption);
|
|
||||||
_compressionField.style.width = StyleWidth;
|
|
||||||
_compressionField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageCompressOption(PackageName, BuildPipeline, (ECompressOption)_compressionField.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 输出文件名称样式
|
|
||||||
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, BuildPipeline);
|
|
||||||
_outputNameStyleField = Root.Q<EnumField>("FileNameStyle");
|
|
||||||
_outputNameStyleField.Init(fileNameStyle);
|
|
||||||
_outputNameStyleField.SetValueWithoutNotify(fileNameStyle);
|
|
||||||
_outputNameStyleField.style.width = StyleWidth;
|
|
||||||
_outputNameStyleField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageFileNameStyle(PackageName, BuildPipeline, (EFileNameStyle)_outputNameStyleField.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 首包文件拷贝选项
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
_copyBuildinFileOptionField = Root.Q<EnumField>("CopyBuildinFileOption");
|
|
||||||
_copyBuildinFileOptionField.Init(buildinFileCopyOption);
|
|
||||||
_copyBuildinFileOptionField.SetValueWithoutNotify(buildinFileCopyOption);
|
|
||||||
_copyBuildinFileOptionField.style.width = StyleWidth;
|
|
||||||
_copyBuildinFileOptionField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageBuildinFileCopyOption(PackageName, BuildPipeline, (EBuildinFileCopyOption)_copyBuildinFileOptionField.value);
|
|
||||||
RefreshView();
|
|
||||||
});
|
|
||||||
|
|
||||||
// 首包文件拷贝参数
|
|
||||||
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline);
|
|
||||||
_copyBuildinFileTagsField = Root.Q<TextField>("CopyBuildinFileParam");
|
|
||||||
_copyBuildinFileTagsField.SetValueWithoutNotify(buildinFileCopyParams);
|
|
||||||
_copyBuildinFileTagsField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageBuildinFileCopyParams(PackageName, BuildPipeline, _copyBuildinFileTagsField.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 清理构建缓存
|
|
||||||
bool clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, BuildPipeline);
|
|
||||||
_clearBuildCacheToggle = Root.Q<Toggle>("ClearBuildCache");
|
|
||||||
_clearBuildCacheToggle.SetValueWithoutNotify(clearBuildCache);
|
|
||||||
_clearBuildCacheToggle.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageClearBuildCache(PackageName, BuildPipeline, _clearBuildCacheToggle.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 使用资源依赖数据库
|
|
||||||
bool useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, BuildPipeline);
|
|
||||||
_useAssetDependencyDBToggle = Root.Q<Toggle>("UseAssetDependency");
|
|
||||||
_useAssetDependencyDBToggle.SetValueWithoutNotify(useAssetDependencyDB);
|
|
||||||
_useAssetDependencyDBToggle.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
|
||||||
AssetBundleBuilderSetting.SetPackageUseAssetDependencyDB(PackageName, BuildPipeline, _useAssetDependencyDBToggle.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 对齐文本间距
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_buildOutputField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_buildVersionField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_compressionField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_encryptionField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_outputNameStyleField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_copyBuildinFileOptionField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_copyBuildinFileTagsField, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_clearBuildCacheToggle, LabelMinWidth);
|
|
||||||
UIElementsTools.SetElementLabelMinWidth(_useAssetDependencyDBToggle, LabelMinWidth);
|
|
||||||
|
|
||||||
// 构建按钮
|
|
||||||
var buildButton = Root.Q<Button>("Build");
|
|
||||||
buildButton.clicked += BuildButton_clicked;
|
|
||||||
}
|
|
||||||
private void RefreshView()
|
|
||||||
{
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
bool tagsFiledVisible = buildinFileCopyOption == EBuildinFileCopyOption.ClearAndCopyByTags || buildinFileCopyOption == EBuildinFileCopyOption.OnlyCopyByTags;
|
|
||||||
_copyBuildinFileTagsField.visible = tagsFiledVisible;
|
|
||||||
}
|
|
||||||
private void BuildButton_clicked()
|
|
||||||
{
|
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
|
||||||
{
|
|
||||||
EditorTools.ClearUnityConsole();
|
|
||||||
EditorApplication.delayCall += ExecuteBuild;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogWarning("[Build] 打包已经取消");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行构建任务
|
/// 创建视图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected abstract void ExecuteBuild();
|
public abstract void CreateView(VisualElement parent);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取构建版本
|
/// 获取默认版本
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected string GetPackageVersion()
|
protected virtual string GetDefaultPackageVersion()
|
||||||
{
|
{
|
||||||
return _buildVersionField.value;
|
int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute;
|
||||||
|
return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建加密类实例
|
/// 创建资源包加密服务类实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected IEncryptionServices CreateEncryptionInstance()
|
protected IEncryptionServices CreateEncryptionServicesInstance()
|
||||||
{
|
{
|
||||||
var encyptionClassName = AssetBundleBuilderSetting.GetPackageEncyptionClassName(PackageName, BuildPipeline);
|
var className = AssetBundleBuilderSetting.GetPackageEncyptionServicesClassName(PackageName, PipelineName);
|
||||||
var encryptionClassTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));
|
||||||
var classType = encryptionClassTypes.Find(x => x.FullName.Equals(encyptionClassName));
|
var classType = classTypes.Find(x => x.FullName.Equals(className));
|
||||||
if (classType != null)
|
if (classType != null)
|
||||||
return (IEncryptionServices)Activator.CreateInstance(classType);
|
return (IEncryptionServices)Activator.CreateInstance(classType);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetDefaultPackageVersion()
|
/// <summary>
|
||||||
|
/// 创建资源清单加密服务类实例
|
||||||
|
/// </summary>
|
||||||
|
protected IManifestProcessServices CreateManifestProcessServicesInstance()
|
||||||
{
|
{
|
||||||
int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute;
|
var className = AssetBundleBuilderSetting.GetPackageManifestProcessServicesClassName(PackageName, PipelineName);
|
||||||
return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes;
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IManifestProcessServices));
|
||||||
|
var classType = classTypes.Find(x => x.FullName.Equals(className));
|
||||||
|
if (classType != null)
|
||||||
|
return (IManifestProcessServices)Activator.CreateInstance(classType);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建资源清单解密服务类实例
|
||||||
|
/// </summary>
|
||||||
|
protected IManifestRestoreServices CreateManifestRestoreServicesInstance()
|
||||||
|
{
|
||||||
|
var className = AssetBundleBuilderSetting.GetPackageManifestRestoreServicesClassName(PackageName, PipelineName);
|
||||||
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IManifestRestoreServices));
|
||||||
|
var classType = classTypes.Find(x => x.FullName.Equals(className));
|
||||||
|
if (classType != null)
|
||||||
|
return (IManifestRestoreServices)Activator.CreateInstance(classType);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region UI元素通用处理方法
|
||||||
|
protected void SetBuildOutputField(TextField textField)
|
||||||
|
{
|
||||||
|
// 输出目录
|
||||||
|
string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
||||||
|
textField.SetValueWithoutNotify(defaultOutputRoot);
|
||||||
|
textField.SetEnabled(false);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(textField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetBuildVersionField(TextField textField)
|
||||||
|
{
|
||||||
|
// 构建版本
|
||||||
|
textField.style.width = StyleWidth;
|
||||||
|
textField.SetValueWithoutNotify(GetDefaultPackageVersion());
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(textField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetCompressionField(EnumField enumField)
|
||||||
|
{
|
||||||
|
// 压缩方式选项
|
||||||
|
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, PipelineName);
|
||||||
|
enumField.Init(compressOption);
|
||||||
|
enumField.SetValueWithoutNotify(compressOption);
|
||||||
|
enumField.style.width = StyleWidth;
|
||||||
|
enumField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageCompressOption(PackageName, PipelineName, (ECompressOption)enumField.value);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(enumField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetOutputNameStyleField(EnumField enumField)
|
||||||
|
{
|
||||||
|
// 输出文件名称样式
|
||||||
|
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, PipelineName);
|
||||||
|
enumField.Init(fileNameStyle);
|
||||||
|
enumField.SetValueWithoutNotify(fileNameStyle);
|
||||||
|
enumField.style.width = StyleWidth;
|
||||||
|
enumField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageFileNameStyle(PackageName, PipelineName, (EFileNameStyle)enumField.value);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(enumField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetCopyBuildinFileOptionField(EnumField enumField, TextField tagField)
|
||||||
|
{
|
||||||
|
// 首包文件拷贝选项
|
||||||
|
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
enumField.Init(buildinFileCopyOption);
|
||||||
|
enumField.SetValueWithoutNotify(buildinFileCopyOption);
|
||||||
|
enumField.style.width = StyleWidth;
|
||||||
|
enumField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageBuildinFileCopyOption(PackageName, PipelineName, (EBuildinFileCopyOption)enumField.value);
|
||||||
|
|
||||||
|
// 设置内置资源标签显隐
|
||||||
|
SetCopyBuildinFileTagsVisible(tagField);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(enumField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetCopyBuildinFileTagsVisible(TextField tagField)
|
||||||
|
{
|
||||||
|
var option = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
tagField.visible = option == EBuildinFileCopyOption.ClearAndCopyByTags || option == EBuildinFileCopyOption.OnlyCopyByTags;
|
||||||
|
}
|
||||||
|
protected void SetCopyBuildinFileTagsField(TextField textField)
|
||||||
|
{
|
||||||
|
// 首包文件拷贝参数
|
||||||
|
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, PipelineName);
|
||||||
|
textField.SetValueWithoutNotify(buildinFileCopyParams);
|
||||||
|
textField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageBuildinFileCopyParams(PackageName, PipelineName, textField.value);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(textField, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetClearBuildCacheToggle(Toggle toggle)
|
||||||
|
{
|
||||||
|
// 清理构建缓存
|
||||||
|
bool clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, PipelineName);
|
||||||
|
toggle.SetValueWithoutNotify(clearBuildCache);
|
||||||
|
toggle.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageClearBuildCache(PackageName, PipelineName, toggle.value);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(toggle, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected void SetUseAssetDependencyDBToggle(Toggle toggle)
|
||||||
|
{
|
||||||
|
// 使用资源依赖数据库
|
||||||
|
bool useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, PipelineName);
|
||||||
|
toggle.SetValueWithoutNotify(useAssetDependencyDB);
|
||||||
|
toggle.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageUseAssetDependencyDB(PackageName, PipelineName, toggle.value);
|
||||||
|
});
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(toggle, LabelMinWidth);
|
||||||
|
}
|
||||||
|
protected PopupField<Type> CreateEncryptionServicesField(VisualElement container)
|
||||||
|
{
|
||||||
|
// 资源包加密服务类
|
||||||
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices));
|
||||||
|
if (classTypes.Count > 0)
|
||||||
|
{
|
||||||
|
var className = AssetBundleBuilderSetting.GetPackageEncyptionServicesClassName(PackageName, PipelineName);
|
||||||
|
int defaultIndex = classTypes.FindIndex(x => x.FullName.Equals(className));
|
||||||
|
if (defaultIndex < 0)
|
||||||
|
defaultIndex = 0;
|
||||||
|
var popupField = new PopupField<Type>(classTypes, defaultIndex);
|
||||||
|
popupField.label = "Encryption Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
popupField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageEncyptionServicesClassName(PackageName, PipelineName, popupField.value.FullName);
|
||||||
|
});
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var popupField = new PopupField<Type>();
|
||||||
|
popupField.label = "Encryption Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected PopupField<Type> CreateManifestProcessServicesField(VisualElement container)
|
||||||
|
{
|
||||||
|
// 资源清单加密服务类
|
||||||
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IManifestProcessServices));
|
||||||
|
if (classTypes.Count > 0)
|
||||||
|
{
|
||||||
|
var className = AssetBundleBuilderSetting.GetPackageManifestProcessServicesClassName(PackageName, PipelineName);
|
||||||
|
int defaultIndex = classTypes.FindIndex(x => x.FullName.Equals(className));
|
||||||
|
if (defaultIndex < 0)
|
||||||
|
defaultIndex = 0;
|
||||||
|
var popupField = new PopupField<Type>(classTypes, defaultIndex);
|
||||||
|
popupField.label = "Manifest Process Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
popupField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageManifestProcessServicesClassName(PackageName, PipelineName, popupField.value.FullName);
|
||||||
|
});
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var popupField = new PopupField<Type>();
|
||||||
|
popupField.label = "Manifest Process Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected PopupField<Type> CreateManifestRestoreServicesField(VisualElement container)
|
||||||
|
{
|
||||||
|
// 资源清单加密服务类
|
||||||
|
var classTypes = EditorTools.GetAssignableTypes(typeof(IManifestRestoreServices));
|
||||||
|
if (classTypes.Count > 0)
|
||||||
|
{
|
||||||
|
var className = AssetBundleBuilderSetting.GetPackageManifestRestoreServicesClassName(PackageName, PipelineName);
|
||||||
|
int defaultIndex = classTypes.FindIndex(x => x.FullName.Equals(className));
|
||||||
|
if (defaultIndex < 0)
|
||||||
|
defaultIndex = 0;
|
||||||
|
var popupField = new PopupField<Type>(classTypes, defaultIndex);
|
||||||
|
popupField.label = "Manifest Restore Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
popupField.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
AssetBundleBuilderSetting.SetPackageManifestRestoreServicesClassName(PackageName, PipelineName, popupField.value.FullName);
|
||||||
|
});
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var popupField = new PopupField<Type>();
|
||||||
|
popupField.label = "Manifest Restore Services";
|
||||||
|
popupField.style.width = StyleWidth;
|
||||||
|
container.Add(popupField);
|
||||||
|
UIElementsTools.SetElementLabelMinWidth(popupField, LabelMinWidth);
|
||||||
|
return popupField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5280dfac6a481ee429c769ba5688c9d2
|
guid: e2e1fae9b05cc554e9ebfee01f2b9333
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
#if UNITY_2019_4_OR_NEWER
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[BuildPipelineAttribute(nameof(EBuildPipeline.BuiltinBuildPipeline))]
|
||||||
|
internal class BuiltinBuildPipelineViewer : BuildPipelineViewerBase
|
||||||
|
{
|
||||||
|
protected TemplateContainer Root;
|
||||||
|
protected TextField _buildOutputField;
|
||||||
|
protected TextField _buildVersionField;
|
||||||
|
protected PopupField<Type> _encryptionServicesField;
|
||||||
|
protected PopupField<Type> _manifestProcessServicesField;
|
||||||
|
protected PopupField<Type> _manifestRestoreServicesField;
|
||||||
|
protected EnumField _compressionField;
|
||||||
|
protected EnumField _outputNameStyleField;
|
||||||
|
protected EnumField _copyBuildinFileOptionField;
|
||||||
|
protected TextField _copyBuildinFileTagsField;
|
||||||
|
protected Toggle _clearBuildCacheToggle;
|
||||||
|
protected Toggle _useAssetDependencyDBToggle;
|
||||||
|
|
||||||
|
public override void CreateView(VisualElement parent)
|
||||||
|
{
|
||||||
|
// 加载布局文件
|
||||||
|
var visualAsset = UxmlLoader.LoadWindowUXML<BuiltinBuildPipelineViewer>();
|
||||||
|
if (visualAsset == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Root = visualAsset.CloneTree();
|
||||||
|
Root.style.flexGrow = 1f;
|
||||||
|
parent.Add(Root);
|
||||||
|
|
||||||
|
// 输出目录
|
||||||
|
_buildOutputField = Root.Q<TextField>("BuildOutput");
|
||||||
|
SetBuildOutputField(_buildOutputField);
|
||||||
|
|
||||||
|
// 构建版本
|
||||||
|
_buildVersionField = Root.Q<TextField>("BuildVersion");
|
||||||
|
SetBuildVersionField(_buildVersionField);
|
||||||
|
|
||||||
|
// 服务类
|
||||||
|
var popupContainer = Root.Q("PopupContainer");
|
||||||
|
_encryptionServicesField = CreateEncryptionServicesField(popupContainer);
|
||||||
|
_manifestProcessServicesField = CreateManifestProcessServicesField(popupContainer);
|
||||||
|
_manifestRestoreServicesField = CreateManifestRestoreServicesField(popupContainer);
|
||||||
|
|
||||||
|
// 压缩方式选项
|
||||||
|
_compressionField = Root.Q<EnumField>("Compression");
|
||||||
|
SetCompressionField(_compressionField);
|
||||||
|
|
||||||
|
// 输出文件名称样式
|
||||||
|
_outputNameStyleField = Root.Q<EnumField>("FileNameStyle");
|
||||||
|
SetOutputNameStyleField(_outputNameStyleField);
|
||||||
|
|
||||||
|
// 首包文件拷贝参数
|
||||||
|
_copyBuildinFileTagsField = Root.Q<TextField>("CopyBuildinFileParam");
|
||||||
|
SetCopyBuildinFileTagsField(_copyBuildinFileTagsField);
|
||||||
|
SetCopyBuildinFileTagsVisible(_copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 首包文件拷贝选项
|
||||||
|
_copyBuildinFileOptionField = Root.Q<EnumField>("CopyBuildinFileOption");
|
||||||
|
SetCopyBuildinFileOptionField(_copyBuildinFileOptionField, _copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 清理构建缓存
|
||||||
|
_clearBuildCacheToggle = Root.Q<Toggle>("ClearBuildCache");
|
||||||
|
SetClearBuildCacheToggle(_clearBuildCacheToggle);
|
||||||
|
|
||||||
|
// 使用资源依赖数据库
|
||||||
|
_useAssetDependencyDBToggle = Root.Q<Toggle>("UseAssetDependency");
|
||||||
|
SetUseAssetDependencyDBToggle(_useAssetDependencyDBToggle);
|
||||||
|
|
||||||
|
// 构建按钮
|
||||||
|
var buildButton = Root.Q<Button>("Build");
|
||||||
|
buildButton.clicked += BuildButton_clicked;
|
||||||
|
}
|
||||||
|
private void BuildButton_clicked()
|
||||||
|
{
|
||||||
|
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
||||||
|
{
|
||||||
|
EditorTools.ClearUnityConsole();
|
||||||
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("[Build] 打包已经取消");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行构建
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void ExecuteBuild()
|
||||||
|
{
|
||||||
|
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, PipelineName);
|
||||||
|
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, PipelineName);
|
||||||
|
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, PipelineName);
|
||||||
|
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, PipelineName);
|
||||||
|
|
||||||
|
BuiltinBuildParameters buildParameters = new BuiltinBuildParameters();
|
||||||
|
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
||||||
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
|
buildParameters.BuildPipeline = PipelineName.ToString();
|
||||||
|
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
||||||
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
|
buildParameters.PackageName = PackageName;
|
||||||
|
buildParameters.PackageVersion = _buildVersionField.value;
|
||||||
|
buildParameters.EnableSharePackRule = true;
|
||||||
|
buildParameters.VerifyBuildingResult = true;
|
||||||
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
||||||
|
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
||||||
|
buildParameters.CompressOption = compressOption;
|
||||||
|
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
||||||
|
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
||||||
|
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
||||||
|
buildParameters.ManifestProcessServices = CreateManifestProcessServicesInstance();
|
||||||
|
buildParameters.ManifestRestoreServices = CreateManifestRestoreServicesInstance();
|
||||||
|
|
||||||
|
BuiltinBuildPipeline pipeline = new BuiltinBuildPipeline();
|
||||||
|
var buildResult = pipeline.Run(buildParameters, true);
|
||||||
|
if (buildResult.Success)
|
||||||
|
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" />
|
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" />
|
||||||
<ui:Toggle label="Clear Build Cache" name="ClearBuildCache" />
|
<ui:Toggle label="Clear Build Cache" name="ClearBuildCache" />
|
||||||
<ui:Toggle label="Use Asset Depend DB" name="UseAssetDependency" />
|
<ui:Toggle label="Use Asset Depend DB" name="UseAssetDependency" />
|
||||||
<ui:VisualElement name="EncryptionContainer" style="height: 24px;" />
|
<ui:VisualElement name="PopupContainer" style="flex-grow: 1;" />
|
||||||
<uie:EnumField label="Compression" value="Center" name="Compression" />
|
<uie:EnumField label="Compression" value="Center" name="Compression" />
|
||||||
<uie:EnumField label="File Name Style" value="Center" name="FileNameStyle" />
|
<uie:EnumField label="File Name Style" value="Center" name="FileNameStyle" />
|
||||||
<uie:EnumField label="Copy Buildin File Option" value="Center" name="CopyBuildinFileOption" />
|
<uie:EnumField label="Copy Buildin File Option" value="Center" name="CopyBuildinFileOption" />
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 86d0df373d425b449a3bbc42b4b2e5bb
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#if UNITY_2019_4_OR_NEWER
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor.UIElements;
|
|
||||||
using UnityEngine.UIElements;
|
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
|
||||||
{
|
|
||||||
internal class BuiltinBuildPipelineViewer : BuildPipelineViewerBase
|
|
||||||
{
|
|
||||||
public BuiltinBuildPipelineViewer(string packageName, BuildTarget buildTarget, VisualElement parent)
|
|
||||||
: base(packageName, EBuildPipeline.BuiltinBuildPipeline, buildTarget, parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行构建
|
|
||||||
/// </summary>
|
|
||||||
protected override void ExecuteBuild()
|
|
||||||
{
|
|
||||||
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline);
|
|
||||||
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, BuildPipeline);
|
|
||||||
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, BuildPipeline);
|
|
||||||
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, BuildPipeline);
|
|
||||||
|
|
||||||
BuiltinBuildParameters buildParameters = new BuiltinBuildParameters();
|
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
|
||||||
buildParameters.BuildPipeline = BuildPipeline.ToString();
|
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
|
||||||
buildParameters.BuildTarget = BuildTarget;
|
|
||||||
buildParameters.PackageName = PackageName;
|
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
|
||||||
buildParameters.EnableSharePackRule = true;
|
|
||||||
buildParameters.VerifyBuildingResult = true;
|
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
|
||||||
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
|
||||||
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
|
||||||
buildParameters.CompressOption = compressOption;
|
|
||||||
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
|
||||||
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
|
||||||
buildParameters.EncryptionServices = CreateEncryptionInstance();
|
|
||||||
|
|
||||||
BuiltinBuildPipeline pipeline = new BuiltinBuildPipeline();
|
|
||||||
var buildResult = pipeline.Run(buildParameters, true);
|
|
||||||
if (buildResult.Success)
|
|
||||||
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 275b87293edc6634f9d72387851dbbdf
|
guid: 33b6cb215b1d7bb4888cb3455b500399
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
#if UNITY_2019_4_OR_NEWER
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[BuildPipelineAttribute(nameof(EBuildPipeline.EditorSimulateBuildPipeline))]
|
||||||
|
internal class EditorSimulateBuildPipelineViewer : BuildPipelineViewerBase
|
||||||
|
{
|
||||||
|
protected TemplateContainer Root;
|
||||||
|
protected TextField _buildOutputField;
|
||||||
|
protected TextField _buildVersionField;
|
||||||
|
|
||||||
|
public override void CreateView(VisualElement parent)
|
||||||
|
{
|
||||||
|
// 加载布局文件
|
||||||
|
var visualAsset = UxmlLoader.LoadWindowUXML<EditorSimulateBuildPipelineViewer>();
|
||||||
|
if (visualAsset == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Root = visualAsset.CloneTree();
|
||||||
|
Root.style.flexGrow = 1f;
|
||||||
|
parent.Add(Root);
|
||||||
|
|
||||||
|
// 输出目录
|
||||||
|
_buildOutputField = Root.Q<TextField>("BuildOutput");
|
||||||
|
SetBuildOutputField(_buildOutputField);
|
||||||
|
|
||||||
|
// 构建版本
|
||||||
|
_buildVersionField = Root.Q<TextField>("BuildVersion");
|
||||||
|
SetBuildVersionField(_buildVersionField);
|
||||||
|
|
||||||
|
// 构建按钮
|
||||||
|
var buildButton = Root.Q<Button>("Build");
|
||||||
|
buildButton.clicked += BuildButton_clicked;
|
||||||
|
}
|
||||||
|
private void BuildButton_clicked()
|
||||||
|
{
|
||||||
|
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
||||||
|
{
|
||||||
|
EditorTools.ClearUnityConsole();
|
||||||
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("[Build] 打包已经取消");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行构建
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void ExecuteBuild()
|
||||||
|
{
|
||||||
|
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, PipelineName);
|
||||||
|
|
||||||
|
EditorSimulateBuildParameters buildParameters = new EditorSimulateBuildParameters();
|
||||||
|
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
||||||
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
|
buildParameters.BuildPipeline = PipelineName.ToString();
|
||||||
|
buildParameters.BuildBundleType = (int)EBuildBundleType.VirtualBundle;
|
||||||
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
|
buildParameters.PackageName = PackageName;
|
||||||
|
buildParameters.PackageVersion = _buildVersionField.value;
|
||||||
|
buildParameters.VerifyBuildingResult = true;
|
||||||
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
||||||
|
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
||||||
|
|
||||||
|
EditorSimulateBuildPipeline pipeline = new EditorSimulateBuildPipeline();
|
||||||
|
var buildResult = pipeline.Run(buildParameters, true);
|
||||||
|
if (buildResult.Success)
|
||||||
|
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||||
|
<ui:VisualElement name="BuildContainer">
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Output" name="BuildOutput" />
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" />
|
||||||
|
<ui:VisualElement name="ExtensionContainer" />
|
||||||
|
<ui:Button text="Click Build" display-tooltip-when-elided="true" name="Build" style="height: 50px; background-color: rgb(40, 106, 42); margin-top: 10px;" />
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:UXML>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 90cc4546b2b8afe4e8c864c132a999a9
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
#if UNITY_2019_4_OR_NEWER
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor.UIElements;
|
|
||||||
using UnityEngine.UIElements;
|
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
|
||||||
{
|
|
||||||
internal class EditorSimulateBuildPipelineViewer : BuildPipelineViewerBase
|
|
||||||
{
|
|
||||||
public EditorSimulateBuildPipelineViewer(string packageName, BuildTarget buildTarget, VisualElement parent)
|
|
||||||
: base(packageName, EBuildPipeline.RawFileBuildPipeline, buildTarget, parent)
|
|
||||||
{
|
|
||||||
var compressionField = Root.Q<EnumField>("Compression");
|
|
||||||
UIElementsTools.SetElementVisible(compressionField, false);
|
|
||||||
|
|
||||||
var encryptionContainer = Root.Q<VisualElement>("EncryptionContainer");
|
|
||||||
UIElementsTools.SetElementVisible(encryptionContainer, false);
|
|
||||||
|
|
||||||
var fileNameStyleField = Root.Q<EnumField>("FileNameStyle");
|
|
||||||
UIElementsTools.SetElementVisible(fileNameStyleField, false);
|
|
||||||
|
|
||||||
var copyBuildinFileOptionField = Root.Q<EnumField>("CopyBuildinFileOption");
|
|
||||||
UIElementsTools.SetElementVisible(copyBuildinFileOptionField, false);
|
|
||||||
|
|
||||||
var copyBuildinFileParamField = Root.Q<TextField>("CopyBuildinFileParam");
|
|
||||||
UIElementsTools.SetElementVisible(copyBuildinFileParamField, false);
|
|
||||||
|
|
||||||
var clearBuildCacheToggle = Root.Q<Toggle>("ClearBuildCache");
|
|
||||||
UIElementsTools.SetElementVisible(clearBuildCacheToggle, false);
|
|
||||||
|
|
||||||
var useAssetDependencyToggle = Root.Q<Toggle>("UseAssetDependency");
|
|
||||||
UIElementsTools.SetElementVisible(useAssetDependencyToggle, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行构建
|
|
||||||
/// </summary>
|
|
||||||
protected override void ExecuteBuild()
|
|
||||||
{
|
|
||||||
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline);
|
|
||||||
|
|
||||||
EditorSimulateBuildParameters buildParameters = new EditorSimulateBuildParameters();
|
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
|
||||||
buildParameters.BuildPipeline = BuildPipeline.ToString();
|
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.VirtualBundle;
|
|
||||||
buildParameters.BuildTarget = BuildTarget;
|
|
||||||
buildParameters.PackageName = PackageName;
|
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
|
||||||
buildParameters.VerifyBuildingResult = true;
|
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
|
||||||
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
|
||||||
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
|
||||||
buildParameters.EncryptionServices = CreateEncryptionInstance();
|
|
||||||
|
|
||||||
EditorSimulateBuildPipeline pipeline = new EditorSimulateBuildPipeline();
|
|
||||||
var buildResult = pipeline.Run(buildParameters, true);
|
|
||||||
if (buildResult.Success)
|
|
||||||
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 56adb3acd233fe5468af213a4c41de6a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
#if UNITY_2019_4_OR_NEWER
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[BuildPipelineAttribute(nameof(EBuildPipeline.RawFileBuildPipeline))]
|
||||||
|
internal class RawfileBuildpipelineViewer : BuildPipelineViewerBase
|
||||||
|
{
|
||||||
|
protected TemplateContainer Root;
|
||||||
|
protected TextField _buildOutputField;
|
||||||
|
protected TextField _buildVersionField;
|
||||||
|
protected PopupField<Type> _encryptionServicesField;
|
||||||
|
protected PopupField<Type> _manifestProcessServicesField;
|
||||||
|
protected PopupField<Type> _manifestRestoreServicesField;
|
||||||
|
protected EnumField _outputNameStyleField;
|
||||||
|
protected EnumField _copyBuildinFileOptionField;
|
||||||
|
protected TextField _copyBuildinFileTagsField;
|
||||||
|
protected Toggle _clearBuildCacheToggle;
|
||||||
|
protected Toggle _useAssetDependencyDBToggle;
|
||||||
|
|
||||||
|
public override void CreateView(VisualElement parent)
|
||||||
|
{
|
||||||
|
// 加载布局文件
|
||||||
|
var visualAsset = UxmlLoader.LoadWindowUXML<RawfileBuildpipelineViewer>();
|
||||||
|
if (visualAsset == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Root = visualAsset.CloneTree();
|
||||||
|
Root.style.flexGrow = 1f;
|
||||||
|
parent.Add(Root);
|
||||||
|
|
||||||
|
// 输出目录
|
||||||
|
_buildOutputField = Root.Q<TextField>("BuildOutput");
|
||||||
|
SetBuildOutputField(_buildOutputField);
|
||||||
|
|
||||||
|
// 构建版本
|
||||||
|
_buildVersionField = Root.Q<TextField>("BuildVersion");
|
||||||
|
SetBuildVersionField(_buildVersionField);
|
||||||
|
|
||||||
|
// 加密方法
|
||||||
|
var popupContainer = Root.Q("PopupContainer");
|
||||||
|
_encryptionServicesField = CreateEncryptionServicesField(popupContainer);
|
||||||
|
_manifestProcessServicesField = CreateManifestProcessServicesField(popupContainer);
|
||||||
|
_manifestRestoreServicesField = CreateManifestRestoreServicesField(popupContainer);
|
||||||
|
|
||||||
|
// 输出文件名称样式
|
||||||
|
_outputNameStyleField = Root.Q<EnumField>("FileNameStyle");
|
||||||
|
SetOutputNameStyleField(_outputNameStyleField);
|
||||||
|
|
||||||
|
// 首包文件拷贝参数
|
||||||
|
_copyBuildinFileTagsField = Root.Q<TextField>("CopyBuildinFileParam");
|
||||||
|
SetCopyBuildinFileTagsField(_copyBuildinFileTagsField);
|
||||||
|
SetCopyBuildinFileTagsVisible(_copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 首包文件拷贝选项
|
||||||
|
_copyBuildinFileOptionField = Root.Q<EnumField>("CopyBuildinFileOption");
|
||||||
|
SetCopyBuildinFileOptionField(_copyBuildinFileOptionField, _copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 清理构建缓存
|
||||||
|
_clearBuildCacheToggle = Root.Q<Toggle>("ClearBuildCache");
|
||||||
|
SetClearBuildCacheToggle(_clearBuildCacheToggle);
|
||||||
|
|
||||||
|
// 使用资源依赖数据库
|
||||||
|
_useAssetDependencyDBToggle = Root.Q<Toggle>("UseAssetDependency");
|
||||||
|
SetUseAssetDependencyDBToggle(_useAssetDependencyDBToggle);
|
||||||
|
|
||||||
|
// 构建按钮
|
||||||
|
var buildButton = Root.Q<Button>("Build");
|
||||||
|
buildButton.clicked += BuildButton_clicked;
|
||||||
|
}
|
||||||
|
private void BuildButton_clicked()
|
||||||
|
{
|
||||||
|
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
||||||
|
{
|
||||||
|
EditorTools.ClearUnityConsole();
|
||||||
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("[Build] 打包已经取消");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行构建
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void ExecuteBuild()
|
||||||
|
{
|
||||||
|
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, PipelineName);
|
||||||
|
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, PipelineName);
|
||||||
|
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, PipelineName);
|
||||||
|
|
||||||
|
RawFileBuildParameters buildParameters = new RawFileBuildParameters();
|
||||||
|
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
||||||
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
|
buildParameters.BuildPipeline = PipelineName.ToString();
|
||||||
|
buildParameters.BuildBundleType = (int)EBuildBundleType.RawBundle;
|
||||||
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
|
buildParameters.PackageName = PackageName;
|
||||||
|
buildParameters.PackageVersion = _buildVersionField.value;
|
||||||
|
buildParameters.VerifyBuildingResult = true;
|
||||||
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
||||||
|
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
||||||
|
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
||||||
|
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
||||||
|
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
||||||
|
buildParameters.ManifestProcessServices = CreateManifestProcessServicesInstance();
|
||||||
|
buildParameters.ManifestRestoreServices = CreateManifestRestoreServicesInstance();
|
||||||
|
|
||||||
|
RawFileBuildPipeline pipeline = new RawFileBuildPipeline();
|
||||||
|
var buildResult = pipeline.Run(buildParameters, true);
|
||||||
|
if (buildResult.Success)
|
||||||
|
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||||
|
<ui:VisualElement name="BuildContainer">
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Output" name="BuildOutput" />
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" />
|
||||||
|
<ui:Toggle label="Clear Build Cache" name="ClearBuildCache" />
|
||||||
|
<ui:Toggle label="Use Asset Depend DB" name="UseAssetDependency" />
|
||||||
|
<ui:VisualElement name="PopupContainer" style="flex-grow: 1;" />
|
||||||
|
<uie:EnumField label="File Name Style" value="Center" name="FileNameStyle" />
|
||||||
|
<uie:EnumField label="Copy Buildin File Option" value="Center" name="CopyBuildinFileOption" />
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Copy Buildin File Param" name="CopyBuildinFileParam" />
|
||||||
|
<ui:VisualElement name="ExtensionContainer" />
|
||||||
|
<ui:Button text="Click Build" display-tooltip-when-elided="true" name="Build" style="height: 50px; background-color: rgb(40, 106, 42); margin-top: 10px;" />
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:UXML>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8ed3387ab250c814e9797164c9a4b89a
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#if UNITY_2019_4_OR_NEWER
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor.UIElements;
|
|
||||||
using UnityEngine.UIElements;
|
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
|
||||||
{
|
|
||||||
internal class RawfileBuildpipelineViewer : BuildPipelineViewerBase
|
|
||||||
{
|
|
||||||
public RawfileBuildpipelineViewer(string packageName, BuildTarget buildTarget, VisualElement parent)
|
|
||||||
: base(packageName, EBuildPipeline.RawFileBuildPipeline, buildTarget, parent)
|
|
||||||
{
|
|
||||||
var compressionField = Root.Q<EnumField>("Compression");
|
|
||||||
UIElementsTools.SetElementVisible(compressionField, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行构建
|
|
||||||
/// </summary>
|
|
||||||
protected override void ExecuteBuild()
|
|
||||||
{
|
|
||||||
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline);
|
|
||||||
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, BuildPipeline);
|
|
||||||
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, BuildPipeline);
|
|
||||||
|
|
||||||
RawFileBuildParameters buildParameters = new RawFileBuildParameters();
|
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
|
||||||
buildParameters.BuildPipeline = BuildPipeline.ToString();
|
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.RawBundle;
|
|
||||||
buildParameters.BuildTarget = BuildTarget;
|
|
||||||
buildParameters.PackageName = PackageName;
|
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
|
||||||
buildParameters.VerifyBuildingResult = true;
|
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
|
||||||
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
|
||||||
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
|
||||||
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
|
||||||
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
|
||||||
buildParameters.EncryptionServices = CreateEncryptionInstance();
|
|
||||||
|
|
||||||
RawFileBuildPipeline pipeline = new RawFileBuildPipeline();
|
|
||||||
var buildResult = pipeline.Run(buildParameters, true);
|
|
||||||
if (buildResult.Success)
|
|
||||||
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: be39d027dec0b2f41ab1dba7effb1a9c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
#if UNITY_2019_4_OR_NEWER
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
[BuildPipelineAttribute(nameof(EBuildPipeline.ScriptableBuildPipeline))]
|
||||||
|
internal class ScriptableBuildPipelineViewer : BuildPipelineViewerBase
|
||||||
|
{
|
||||||
|
protected TemplateContainer Root;
|
||||||
|
protected TextField _buildOutputField;
|
||||||
|
protected TextField _buildVersionField;
|
||||||
|
protected PopupField<Type> _encryptionServicesField;
|
||||||
|
protected PopupField<Type> _manifestProcessServicesField;
|
||||||
|
protected PopupField<Type> _manifestRestoreServicesField;
|
||||||
|
protected EnumField _compressionField;
|
||||||
|
protected EnumField _outputNameStyleField;
|
||||||
|
protected EnumField _copyBuildinFileOptionField;
|
||||||
|
protected TextField _copyBuildinFileTagsField;
|
||||||
|
protected Toggle _clearBuildCacheToggle;
|
||||||
|
protected Toggle _useAssetDependencyDBToggle;
|
||||||
|
|
||||||
|
public override void CreateView(VisualElement parent)
|
||||||
|
{
|
||||||
|
// 加载布局文件
|
||||||
|
var visualAsset = UxmlLoader.LoadWindowUXML<ScriptableBuildPipelineViewer>();
|
||||||
|
if (visualAsset == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Root = visualAsset.CloneTree();
|
||||||
|
Root.style.flexGrow = 1f;
|
||||||
|
parent.Add(Root);
|
||||||
|
|
||||||
|
// 输出目录
|
||||||
|
_buildOutputField = Root.Q<TextField>("BuildOutput");
|
||||||
|
SetBuildOutputField(_buildOutputField);
|
||||||
|
|
||||||
|
// 构建版本
|
||||||
|
_buildVersionField = Root.Q<TextField>("BuildVersion");
|
||||||
|
SetBuildVersionField(_buildVersionField);
|
||||||
|
|
||||||
|
// 加密方法
|
||||||
|
var popupContainer = Root.Q("PopupContainer");
|
||||||
|
_encryptionServicesField = CreateEncryptionServicesField(popupContainer);
|
||||||
|
_manifestProcessServicesField = CreateManifestProcessServicesField(popupContainer);
|
||||||
|
_manifestRestoreServicesField = CreateManifestRestoreServicesField(popupContainer);
|
||||||
|
|
||||||
|
// 压缩方式选项
|
||||||
|
_compressionField = Root.Q<EnumField>("Compression");
|
||||||
|
SetCompressionField(_compressionField);
|
||||||
|
|
||||||
|
// 输出文件名称样式
|
||||||
|
_outputNameStyleField = Root.Q<EnumField>("FileNameStyle");
|
||||||
|
SetOutputNameStyleField(_outputNameStyleField);
|
||||||
|
|
||||||
|
// 首包文件拷贝参数
|
||||||
|
_copyBuildinFileTagsField = Root.Q<TextField>("CopyBuildinFileParam");
|
||||||
|
SetCopyBuildinFileTagsField(_copyBuildinFileTagsField);
|
||||||
|
SetCopyBuildinFileTagsVisible(_copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 首包文件拷贝选项
|
||||||
|
_copyBuildinFileOptionField = Root.Q<EnumField>("CopyBuildinFileOption");
|
||||||
|
SetCopyBuildinFileOptionField(_copyBuildinFileOptionField, _copyBuildinFileTagsField);
|
||||||
|
|
||||||
|
// 清理构建缓存
|
||||||
|
_clearBuildCacheToggle = Root.Q<Toggle>("ClearBuildCache");
|
||||||
|
SetClearBuildCacheToggle(_clearBuildCacheToggle);
|
||||||
|
|
||||||
|
// 使用资源依赖数据库
|
||||||
|
_useAssetDependencyDBToggle = Root.Q<Toggle>("UseAssetDependency");
|
||||||
|
SetUseAssetDependencyDBToggle(_useAssetDependencyDBToggle);
|
||||||
|
|
||||||
|
// 构建按钮
|
||||||
|
var buildButton = Root.Q<Button>("Build");
|
||||||
|
buildButton.clicked += BuildButton_clicked;
|
||||||
|
}
|
||||||
|
private void BuildButton_clicked()
|
||||||
|
{
|
||||||
|
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
||||||
|
{
|
||||||
|
EditorTools.ClearUnityConsole();
|
||||||
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("[Build] 打包已经取消");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行构建
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void ExecuteBuild()
|
||||||
|
{
|
||||||
|
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, PipelineName);
|
||||||
|
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, PipelineName);
|
||||||
|
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, PipelineName);
|
||||||
|
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, PipelineName);
|
||||||
|
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, PipelineName);
|
||||||
|
|
||||||
|
ScriptableBuildParameters buildParameters = new ScriptableBuildParameters();
|
||||||
|
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
||||||
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
|
buildParameters.BuildPipeline = PipelineName.ToString();
|
||||||
|
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
||||||
|
buildParameters.BuildTarget = BuildTarget;
|
||||||
|
buildParameters.PackageName = PackageName;
|
||||||
|
buildParameters.PackageVersion = _buildVersionField.value;
|
||||||
|
buildParameters.EnableSharePackRule = true;
|
||||||
|
buildParameters.VerifyBuildingResult = true;
|
||||||
|
buildParameters.FileNameStyle = fileNameStyle;
|
||||||
|
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
||||||
|
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
||||||
|
buildParameters.CompressOption = compressOption;
|
||||||
|
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
||||||
|
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
||||||
|
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
|
||||||
|
buildParameters.ManifestProcessServices = CreateManifestProcessServicesInstance();
|
||||||
|
buildParameters.ManifestRestoreServices = CreateManifestRestoreServicesInstance();
|
||||||
|
buildParameters.BuiltinShadersBundleName = GetBuiltinShaderBundleName();
|
||||||
|
|
||||||
|
ScriptableBuildPipeline pipeline = new ScriptableBuildPipeline();
|
||||||
|
var buildResult = pipeline.Run(buildParameters, true);
|
||||||
|
if (buildResult.Success)
|
||||||
|
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 内置着色器资源包名称
|
||||||
|
/// 注意:和自动收集的着色器资源包名保持一致!
|
||||||
|
/// </summary>
|
||||||
|
protected string GetBuiltinShaderBundleName()
|
||||||
|
{
|
||||||
|
var uniqueBundleName = AssetBundleCollectorSettingData.Setting.UniqueBundleName;
|
||||||
|
var packRuleResult = DefaultPackRule.CreateShadersPackRuleResult();
|
||||||
|
return packRuleResult.GetBundleName(PackageName, uniqueBundleName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Mono脚本的资源包名称
|
||||||
|
/// </summary>
|
||||||
|
protected string GetMonoScriptsBundleName()
|
||||||
|
{
|
||||||
|
var uniqueBundleName = AssetBundleCollectorSettingData.Setting.UniqueBundleName;
|
||||||
|
var packRuleResult = DefaultPackRule.CreateMonosPackRuleResult();
|
||||||
|
return packRuleResult.GetBundleName(PackageName, uniqueBundleName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||||
|
<ui:VisualElement name="BuildContainer">
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Output" name="BuildOutput" />
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" />
|
||||||
|
<ui:Toggle label="Clear Build Cache" name="ClearBuildCache" />
|
||||||
|
<ui:Toggle label="Use Asset Depend DB" name="UseAssetDependency" />
|
||||||
|
<ui:VisualElement name="PopupContainer" style="flex-grow: 1;" />
|
||||||
|
<uie:EnumField label="Compression" value="Center" name="Compression" />
|
||||||
|
<uie:EnumField label="File Name Style" value="Center" name="FileNameStyle" />
|
||||||
|
<uie:EnumField label="Copy Buildin File Option" value="Center" name="CopyBuildinFileOption" />
|
||||||
|
<ui:TextField picking-mode="Ignore" label="Copy Buildin File Param" name="CopyBuildinFileParam" />
|
||||||
|
<ui:VisualElement name="ExtensionContainer" />
|
||||||
|
<ui:Button text="Click Build" display-tooltip-when-elided="true" name="Build" style="height: 50px; background-color: rgb(40, 106, 42); margin-top: 10px;" />
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:UXML>
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
#if UNITY_2019_4_OR_NEWER
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor.UIElements;
|
|
||||||
using UnityEngine.UIElements;
|
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
|
||||||
{
|
|
||||||
internal class ScriptableBuildPipelineViewer : BuildPipelineViewerBase
|
|
||||||
{
|
|
||||||
public ScriptableBuildPipelineViewer(string packageName, BuildTarget buildTarget, VisualElement parent)
|
|
||||||
: base(packageName, EBuildPipeline.ScriptableBuildPipeline, buildTarget, parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行构建
|
|
||||||
/// </summary>
|
|
||||||
protected override void ExecuteBuild()
|
|
||||||
{
|
|
||||||
var fileNameStyle = AssetBundleBuilderSetting.GetPackageFileNameStyle(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyOption = AssetBundleBuilderSetting.GetPackageBuildinFileCopyOption(PackageName, BuildPipeline);
|
|
||||||
var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline);
|
|
||||||
var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, BuildPipeline);
|
|
||||||
var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, BuildPipeline);
|
|
||||||
var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, BuildPipeline);
|
|
||||||
var builtinShaderBundleName = GetBuiltinShaderBundleName();
|
|
||||||
|
|
||||||
ScriptableBuildParameters buildParameters = new ScriptableBuildParameters();
|
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
|
||||||
buildParameters.BuildPipeline = BuildPipeline.ToString();
|
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
|
||||||
buildParameters.BuildTarget = BuildTarget;
|
|
||||||
buildParameters.PackageName = PackageName;
|
|
||||||
buildParameters.PackageVersion = GetPackageVersion();
|
|
||||||
buildParameters.EnableSharePackRule = true;
|
|
||||||
buildParameters.VerifyBuildingResult = true;
|
|
||||||
buildParameters.FileNameStyle = fileNameStyle;
|
|
||||||
buildParameters.BuildinFileCopyOption = buildinFileCopyOption;
|
|
||||||
buildParameters.BuildinFileCopyParams = buildinFileCopyParams;
|
|
||||||
buildParameters.CompressOption = compressOption;
|
|
||||||
buildParameters.ClearBuildCacheFiles = clearBuildCache;
|
|
||||||
buildParameters.UseAssetDependencyDB = useAssetDependencyDB;
|
|
||||||
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
|
|
||||||
buildParameters.EncryptionServices = CreateEncryptionInstance();
|
|
||||||
|
|
||||||
ScriptableBuildPipeline pipeline = new ScriptableBuildPipeline();
|
|
||||||
var buildResult = pipeline.Run(buildParameters, true);
|
|
||||||
if (buildResult.Success)
|
|
||||||
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内置着色器资源包名称
|
|
||||||
/// 注意:和自动收集的着色器资源包名保持一致!
|
|
||||||
/// </summary>
|
|
||||||
private string GetBuiltinShaderBundleName()
|
|
||||||
{
|
|
||||||
var uniqueBundleName = AssetBundleCollectorSettingData.Setting.UniqueBundleName;
|
|
||||||
var packRuleResult = DefaultPackRule.CreateShadersPackRuleResult();
|
|
||||||
return packRuleResult.GetBundleName(PackageName, uniqueBundleName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -139,10 +139,17 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<CollectAssetInfo> GetAllCollectAssets(CollectCommand command, AssetBundleCollectorGroup group)
|
public List<CollectAssetInfo> GetAllCollectAssets(CollectCommand command, AssetBundleCollectorGroup group)
|
||||||
{
|
{
|
||||||
// 注意:模拟构建模式下只收集主资源
|
bool ignoreStaticCollector = command.IsFlagSet(ECollectFlags.IgnoreStaticCollector);
|
||||||
if (command.SimulateBuild)
|
if (ignoreStaticCollector)
|
||||||
{
|
{
|
||||||
if (CollectorType != ECollectorType.MainAssetCollector)
|
if (CollectorType == ECollectorType.StaticAssetCollector)
|
||||||
|
return new List<CollectAssetInfo>();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ignoreDependCollector = command.IsFlagSet(ECollectFlags.IgnoreDependCollector);
|
||||||
|
if (ignoreDependCollector)
|
||||||
|
{
|
||||||
|
if (CollectorType == ECollectorType.DependAssetCollector)
|
||||||
return new List<CollectAssetInfo>();
|
return new List<CollectAssetInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,8 +159,10 @@ namespace YooAsset.Editor
|
|||||||
List<string> findAssets = new List<string>();
|
List<string> findAssets = new List<string>();
|
||||||
if (AssetDatabase.IsValidFolder(CollectPath))
|
if (AssetDatabase.IsValidFolder(CollectPath))
|
||||||
{
|
{
|
||||||
string collectDirectory = CollectPath;
|
IFilterRule filterRuleInstance = AssetBundleCollectorSettingData.GetFilterRuleInstance(FilterRuleName);
|
||||||
string[] findResult = EditorTools.FindAssets(EAssetSearchType.All, collectDirectory);
|
string findAssetType = filterRuleInstance.FindAssetType;
|
||||||
|
string searchFolder = CollectPath;
|
||||||
|
string[] findResult = EditorTools.FindAssets(findAssetType, searchFolder);
|
||||||
findAssets.AddRange(findResult);
|
findAssets.AddRange(findResult);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -259,15 +268,18 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private List<string> GetAssetTags(AssetBundleCollectorGroup group)
|
private List<string> GetAssetTags(AssetBundleCollectorGroup group)
|
||||||
{
|
{
|
||||||
List<string> tags = EditorTools.StringToStringList(group.AssetTags, ';');
|
List<string> result = EditorTools.StringToStringList(AssetTags, ';');
|
||||||
List<string> temper = EditorTools.StringToStringList(AssetTags, ';');
|
if (CollectorType == ECollectorType.MainAssetCollector)
|
||||||
tags.AddRange(temper);
|
{
|
||||||
return tags;
|
List<string> temps = EditorTools.StringToStringList(group.AssetTags, ';');
|
||||||
|
result.AddRange(temps);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
private List<AssetInfo> GetAllDependencies(CollectCommand command, string mainAssetPath)
|
private List<AssetInfo> GetAllDependencies(CollectCommand command, string mainAssetPath)
|
||||||
{
|
{
|
||||||
// 注意:模拟构建模式下不需要收集依赖资源
|
bool ignoreGetDependencies = command.IsFlagSet(ECollectFlags.IgnoreGetDependencies);
|
||||||
if (command.SimulateBuild)
|
if (ignoreGetDependencies)
|
||||||
return new List<AssetInfo>();
|
return new List<AssetInfo>();
|
||||||
|
|
||||||
string[] depends = command.AssetDependency.GetDependencies(mainAssetPath, true);
|
string[] depends = command.AssetDependency.GetDependencies(mainAssetPath, true);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
public class AssetBundleCollectorConfig
|
public class AssetBundleCollectorConfig
|
||||||
{
|
{
|
||||||
public const string ConfigVersion = "v2.1";
|
public const string ConfigVersion = "v2025.8.28";
|
||||||
|
|
||||||
public const string XmlVersion = "Version";
|
public const string XmlVersion = "Version";
|
||||||
public const string XmlCommon = "Common";
|
public const string XmlCommon = "Common";
|
||||||
@@ -23,6 +23,7 @@ namespace YooAsset.Editor
|
|||||||
public const string XmlPackageName = "PackageName";
|
public const string XmlPackageName = "PackageName";
|
||||||
public const string XmlPackageDesc = "PackageDesc";
|
public const string XmlPackageDesc = "PackageDesc";
|
||||||
public const string XmlEnableAddressable = "AutoAddressable";
|
public const string XmlEnableAddressable = "AutoAddressable";
|
||||||
|
public const string XmlSupportExtensionless = "SupportExtensionless";
|
||||||
public const string XmlLocationToLower = "LocationToLower";
|
public const string XmlLocationToLower = "LocationToLower";
|
||||||
public const string XmlIncludeAssetGUID = "IncludeAssetGUID";
|
public const string XmlIncludeAssetGUID = "IncludeAssetGUID";
|
||||||
public const string XmlIgnoreRuleName = "IgnoreRuleName";
|
public const string XmlIgnoreRuleName = "IgnoreRuleName";
|
||||||
@@ -99,6 +100,7 @@ namespace YooAsset.Editor
|
|||||||
package.PackageName = packageElement.GetAttribute(XmlPackageName);
|
package.PackageName = packageElement.GetAttribute(XmlPackageName);
|
||||||
package.PackageDesc = packageElement.GetAttribute(XmlPackageDesc);
|
package.PackageDesc = packageElement.GetAttribute(XmlPackageDesc);
|
||||||
package.EnableAddressable = packageElement.GetAttribute(XmlEnableAddressable) == "True" ? true : false;
|
package.EnableAddressable = packageElement.GetAttribute(XmlEnableAddressable) == "True" ? true : false;
|
||||||
|
package.SupportExtensionless = packageElement.GetAttribute(XmlSupportExtensionless) == "True" ? true : false;
|
||||||
package.LocationToLower = packageElement.GetAttribute(XmlLocationToLower) == "True" ? true : false;
|
package.LocationToLower = packageElement.GetAttribute(XmlLocationToLower) == "True" ? true : false;
|
||||||
package.IncludeAssetGUID = packageElement.GetAttribute(XmlIncludeAssetGUID) == "True" ? true : false;
|
package.IncludeAssetGUID = packageElement.GetAttribute(XmlIncludeAssetGUID) == "True" ? true : false;
|
||||||
package.IgnoreRuleName = packageElement.GetAttribute(XmlIgnoreRuleName);
|
package.IgnoreRuleName = packageElement.GetAttribute(XmlIgnoreRuleName);
|
||||||
@@ -211,6 +213,7 @@ namespace YooAsset.Editor
|
|||||||
packageElement.SetAttribute(XmlPackageName, package.PackageName);
|
packageElement.SetAttribute(XmlPackageName, package.PackageName);
|
||||||
packageElement.SetAttribute(XmlPackageDesc, package.PackageDesc);
|
packageElement.SetAttribute(XmlPackageDesc, package.PackageDesc);
|
||||||
packageElement.SetAttribute(XmlEnableAddressable, package.EnableAddressable.ToString());
|
packageElement.SetAttribute(XmlEnableAddressable, package.EnableAddressable.ToString());
|
||||||
|
packageElement.SetAttribute(XmlSupportExtensionless, package.SupportExtensionless.ToString());
|
||||||
packageElement.SetAttribute(XmlLocationToLower, package.LocationToLower.ToString());
|
packageElement.SetAttribute(XmlLocationToLower, package.LocationToLower.ToString());
|
||||||
packageElement.SetAttribute(XmlIncludeAssetGUID, package.IncludeAssetGUID.ToString());
|
packageElement.SetAttribute(XmlIncludeAssetGUID, package.IncludeAssetGUID.ToString());
|
||||||
packageElement.SetAttribute(XmlIgnoreRuleName, package.IgnoreRuleName);
|
packageElement.SetAttribute(XmlIgnoreRuleName, package.IgnoreRuleName);
|
||||||
@@ -275,6 +278,23 @@ namespace YooAsset.Editor
|
|||||||
return UpdateXmlConfig(xmlDoc);
|
return UpdateXmlConfig(xmlDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v2.1 -> v2025.8.28
|
||||||
|
if (configVersion == "v2.1")
|
||||||
|
{
|
||||||
|
// 读取包裹配置
|
||||||
|
var packageNodeList = root.GetElementsByTagName(XmlPackage);
|
||||||
|
foreach (var packageNode in packageNodeList)
|
||||||
|
{
|
||||||
|
XmlElement packageElement = packageNode as XmlElement;
|
||||||
|
if (packageElement.HasAttribute(XmlSupportExtensionless) == false)
|
||||||
|
packageElement.SetAttribute(XmlSupportExtensionless, "True");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新版本
|
||||||
|
root.SetAttribute(XmlVersion, "v2025.8.28");
|
||||||
|
return UpdateXmlConfig(xmlDoc);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ namespace YooAsset.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool EnableAddressable = false;
|
public bool EnableAddressable = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支持无后缀名的资源定位地址
|
||||||
|
/// </summary>
|
||||||
|
public bool SupportExtensionless = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源定位地址大小写不敏感
|
/// 资源定位地址大小写不敏感
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -98,9 +103,9 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始收集工作
|
/// 获取收集的资源列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CollectResult BeginCollect(CollectCommand command)
|
public List<CollectAssetInfo> GetCollectAssets(CollectCommand command)
|
||||||
{
|
{
|
||||||
Dictionary<string, CollectAssetInfo> result = new Dictionary<string, CollectAssetInfo>(10000);
|
Dictionary<string, CollectAssetInfo> result = new Dictionary<string, CollectAssetInfo>(10000);
|
||||||
|
|
||||||
@@ -139,9 +144,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 返回结果
|
// 返回结果
|
||||||
var collectAssets = result.Values.ToList();
|
return result.Values.ToList();
|
||||||
var collectResult = new CollectResult(command, collectAssets);
|
|
||||||
return collectResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -111,12 +111,14 @@ namespace YooAsset.Editor
|
|||||||
command.UniqueBundleName = UniqueBundleName;
|
command.UniqueBundleName = UniqueBundleName;
|
||||||
command.UseAssetDependencyDB = useAssetDependencyDB;
|
command.UseAssetDependencyDB = useAssetDependencyDB;
|
||||||
command.EnableAddressable = package.EnableAddressable;
|
command.EnableAddressable = package.EnableAddressable;
|
||||||
|
command.SupportExtensionless = package.SupportExtensionless;
|
||||||
command.LocationToLower = package.LocationToLower;
|
command.LocationToLower = package.LocationToLower;
|
||||||
command.IncludeAssetGUID = package.IncludeAssetGUID;
|
command.IncludeAssetGUID = package.IncludeAssetGUID;
|
||||||
command.AutoCollectShaders = package.AutoCollectShaders;
|
command.AutoCollectShaders = package.AutoCollectShaders;
|
||||||
|
|
||||||
// 开始收集工作
|
// 开始收集工作
|
||||||
CollectResult collectResult = package.BeginCollect(command);
|
var collectAssets = package.GetCollectAssets(command);
|
||||||
|
var collectResult = new CollectResult(command, collectAssets);
|
||||||
return collectResult;
|
return collectResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private static string GetRuleDisplayName(string name, Type type)
|
private static string GetRuleDisplayName(string name, Type type)
|
||||||
{
|
{
|
||||||
var attribute = DisplayNameAttributeHelper.GetAttribute<DisplayNameAttribute>(type);
|
var attribute = EditorTools.GetAttribute<DisplayNameAttribute>(type);
|
||||||
if (attribute != null && string.IsNullOrEmpty(attribute.DisplayName) == false)
|
if (attribute != null && string.IsNullOrEmpty(attribute.DisplayName) == false)
|
||||||
return attribute.DisplayName;
|
return attribute.DisplayName;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
private VisualElement _setting2Container;
|
private VisualElement _setting2Container;
|
||||||
private Toggle _enableAddressableToogle;
|
private Toggle _enableAddressableToogle;
|
||||||
|
private Toggle _supportExtensionlessToogle;
|
||||||
private Toggle _locationToLowerToogle;
|
private Toggle _locationToLowerToogle;
|
||||||
private Toggle _includeAssetGUIDToogle;
|
private Toggle _includeAssetGUIDToogle;
|
||||||
private Toggle _autoCollectShadersToogle;
|
private Toggle _autoCollectShadersToogle;
|
||||||
@@ -131,6 +132,17 @@ namespace YooAsset.Editor
|
|||||||
RefreshWindow();
|
RefreshWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
_supportExtensionlessToogle = root.Q<Toggle>("SupportExtensionless");
|
||||||
|
_supportExtensionlessToogle.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
|
if (selectPackage != null)
|
||||||
|
{
|
||||||
|
selectPackage.SupportExtensionless = evt.newValue;
|
||||||
|
AssetBundleCollectorSettingData.ModifyPackage(selectPackage);
|
||||||
|
RefreshWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
_locationToLowerToogle = root.Q<Toggle>("LocationToLower");
|
_locationToLowerToogle = root.Q<Toggle>("LocationToLower");
|
||||||
_locationToLowerToogle.RegisterValueChangedCallback(evt =>
|
_locationToLowerToogle.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
@@ -224,6 +236,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 包裹名称
|
// 包裹名称
|
||||||
_packageNameTxt = root.Q<TextField>("PackageName");
|
_packageNameTxt = root.Q<TextField>("PackageName");
|
||||||
|
_packageNameTxt.isDelayed = true;
|
||||||
_packageNameTxt.RegisterValueChangedCallback(evt =>
|
_packageNameTxt.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
@@ -237,6 +250,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 包裹备注
|
// 包裹备注
|
||||||
_packageDescTxt = root.Q<TextField>("PackageDesc");
|
_packageDescTxt = root.Q<TextField>("PackageDesc");
|
||||||
|
_packageDescTxt.isDelayed = true;
|
||||||
_packageDescTxt.RegisterValueChangedCallback(evt =>
|
_packageDescTxt.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
@@ -274,6 +288,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 分组名称
|
// 分组名称
|
||||||
_groupNameTxt = root.Q<TextField>("GroupName");
|
_groupNameTxt = root.Q<TextField>("GroupName");
|
||||||
|
_groupNameTxt.isDelayed = true;
|
||||||
_groupNameTxt.RegisterValueChangedCallback(evt =>
|
_groupNameTxt.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
@@ -288,6 +303,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 分组备注
|
// 分组备注
|
||||||
_groupDescTxt = root.Q<TextField>("GroupDesc");
|
_groupDescTxt = root.Q<TextField>("GroupDesc");
|
||||||
|
_groupDescTxt.isDelayed = true;
|
||||||
_groupDescTxt.RegisterValueChangedCallback(evt =>
|
_groupDescTxt.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
@@ -302,6 +318,7 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
// 分组的资源标签
|
// 分组的资源标签
|
||||||
_groupTagsTxt = root.Q<TextField>("GroupTags");
|
_groupTagsTxt = root.Q<TextField>("GroupTags");
|
||||||
|
_groupTagsTxt.isDelayed = true;
|
||||||
_groupTagsTxt.RegisterValueChangedCallback(evt =>
|
_groupTagsTxt.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
var selectPackage = _packageListView.selectedItem as AssetBundleCollectorPackage;
|
||||||
@@ -487,6 +504,7 @@ namespace YooAsset.Editor
|
|||||||
_packageSettingsButton.SetEnabled(true);
|
_packageSettingsButton.SetEnabled(true);
|
||||||
_packageSettingsButton.text = $"{packageSettingName} ({selectPackage.PackageName})";
|
_packageSettingsButton.text = $"{packageSettingName} ({selectPackage.PackageName})";
|
||||||
_enableAddressableToogle.SetValueWithoutNotify(selectPackage.EnableAddressable);
|
_enableAddressableToogle.SetValueWithoutNotify(selectPackage.EnableAddressable);
|
||||||
|
_supportExtensionlessToogle.SetValueWithoutNotify(selectPackage.SupportExtensionless);
|
||||||
_locationToLowerToogle.SetValueWithoutNotify(selectPackage.LocationToLower);
|
_locationToLowerToogle.SetValueWithoutNotify(selectPackage.LocationToLower);
|
||||||
_includeAssetGUIDToogle.SetValueWithoutNotify(selectPackage.IncludeAssetGUID);
|
_includeAssetGUIDToogle.SetValueWithoutNotify(selectPackage.IncludeAssetGUID);
|
||||||
_autoCollectShadersToogle.SetValueWithoutNotify(selectPackage.AutoCollectShaders);
|
_autoCollectShadersToogle.SetValueWithoutNotify(selectPackage.AutoCollectShaders);
|
||||||
@@ -762,6 +780,7 @@ namespace YooAsset.Editor
|
|||||||
elementTop.Add(objectField);
|
elementTop.Add(objectField);
|
||||||
var label = objectField.Q<Label>();
|
var label = objectField.Q<Label>();
|
||||||
label.style.minWidth = 63;
|
label.style.minWidth = 63;
|
||||||
|
UIElementsTools.SetObjectFieldShowPath(objectField);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bottom VisualElement
|
// Bottom VisualElement
|
||||||
@@ -803,6 +822,7 @@ namespace YooAsset.Editor
|
|||||||
var textField = new TextField();
|
var textField = new TextField();
|
||||||
textField.name = "TextField0";
|
textField.name = "TextField0";
|
||||||
textField.label = "User Data";
|
textField.label = "User Data";
|
||||||
|
textField.isDelayed = true;
|
||||||
textField.style.width = 200;
|
textField.style.width = 200;
|
||||||
elementBottom.Add(textField);
|
elementBottom.Add(textField);
|
||||||
var label = textField.Q<Label>();
|
var label = textField.Q<Label>();
|
||||||
@@ -812,6 +832,7 @@ namespace YooAsset.Editor
|
|||||||
var textField = new TextField();
|
var textField = new TextField();
|
||||||
textField.name = "TextField1";
|
textField.name = "TextField1";
|
||||||
textField.label = "Asset Tags";
|
textField.label = "Asset Tags";
|
||||||
|
textField.isDelayed = true;
|
||||||
textField.style.width = 100;
|
textField.style.width = 100;
|
||||||
textField.style.marginLeft = 20;
|
textField.style.marginLeft = 20;
|
||||||
textField.style.flexGrow = 1;
|
textField.style.flexGrow = 1;
|
||||||
@@ -830,7 +851,7 @@ namespace YooAsset.Editor
|
|||||||
var foldout = new Foldout();
|
var foldout = new Foldout();
|
||||||
foldout.name = "Foldout1";
|
foldout.name = "Foldout1";
|
||||||
foldout.value = false;
|
foldout.value = false;
|
||||||
foldout.text = "Main Assets";
|
foldout.text = "Assets";
|
||||||
elementFoldout.Add(foldout);
|
elementFoldout.Add(foldout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -851,8 +872,6 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
var collector = selectGroup.Collectors[index];
|
var collector = selectGroup.Collectors[index];
|
||||||
var collectObject = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(collector.CollectPath);
|
var collectObject = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(collector.CollectPath);
|
||||||
if (collectObject != null)
|
|
||||||
collectObject.name = collector.CollectPath;
|
|
||||||
|
|
||||||
// 注意:非主资源收集器的标签栏需要被冻结
|
// 注意:非主资源收集器的标签栏需要被冻结
|
||||||
var textTags = element.Q<TextField>("TextField1");
|
var textTags = element.Q<TextField>("TextField1");
|
||||||
@@ -865,11 +884,9 @@ namespace YooAsset.Editor
|
|||||||
var foldout = element.Q<Foldout>("Foldout1");
|
var foldout = element.Q<Foldout>("Foldout1");
|
||||||
foldout.RegisterValueChangedCallback(evt =>
|
foldout.RegisterValueChangedCallback(evt =>
|
||||||
{
|
{
|
||||||
if (evt.newValue)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
else
|
|
||||||
foldout.Clear();
|
|
||||||
});
|
});
|
||||||
|
RefreshFoldoutName(foldout, collector.CollectorType);
|
||||||
|
|
||||||
// Remove Button
|
// Remove Button
|
||||||
var removeBtn = element.Q<Button>("Button1");
|
var removeBtn = element.Q<Button>("Button1");
|
||||||
@@ -885,13 +902,10 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
collector.CollectPath = AssetDatabase.GetAssetPath(evt.newValue);
|
collector.CollectPath = AssetDatabase.GetAssetPath(evt.newValue);
|
||||||
collector.CollectorGUID = AssetDatabase.AssetPathToGUID(collector.CollectPath);
|
collector.CollectorGUID = AssetDatabase.AssetPathToGUID(collector.CollectPath);
|
||||||
objectField1.value.name = collector.CollectPath;
|
|
||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
if (foldout.value)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
{
|
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
UIElementsTools.RefreshObjectFieldShowPath(objectField1);
|
||||||
|
|
||||||
// Collector Type
|
// Collector Type
|
||||||
var popupField0 = element.Q<PopupField<string>>("PopupField0");
|
var popupField0 = element.Q<PopupField<string>>("PopupField0");
|
||||||
@@ -900,10 +914,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
collector.CollectorType = EditorTools.NameToEnum<ECollectorType>(evt.newValue);
|
collector.CollectorType = EditorTools.NameToEnum<ECollectorType>(evt.newValue);
|
||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
if (foldout.value)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
{
|
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (collector.CollectorType == ECollectorType.MainAssetCollector)
|
if (collector.CollectorType == ECollectorType.MainAssetCollector)
|
||||||
textTags.SetEnabled(true);
|
textTags.SetEnabled(true);
|
||||||
@@ -922,10 +933,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
collector.AddressRuleName = evt.newValue.ClassName;
|
collector.AddressRuleName = evt.newValue.ClassName;
|
||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
if (foldout.value)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
{
|
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -938,10 +946,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
collector.PackRuleName = evt.newValue.ClassName;
|
collector.PackRuleName = evt.newValue.ClassName;
|
||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
if (foldout.value)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
{
|
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Filter Rule
|
// Filter Rule
|
||||||
@@ -953,10 +958,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
collector.FilterRuleName = evt.newValue.ClassName;
|
collector.FilterRuleName = evt.newValue.ClassName;
|
||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
if (foldout.value)
|
RefreshFoldoutContent(foldout, selectGroup, collector);
|
||||||
{
|
|
||||||
RefreshFoldout(foldout, selectGroup, collector);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// UserData
|
// UserData
|
||||||
@@ -977,61 +979,101 @@ namespace YooAsset.Editor
|
|||||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private void RefreshFoldout(Foldout foldout, AssetBundleCollectorGroup group, AssetBundleCollector collector)
|
private void RefreshFoldoutName(Foldout foldout, ECollectorType collectorType, int elementNumber = -1)
|
||||||
{
|
{
|
||||||
|
if (collectorType == ECollectorType.MainAssetCollector)
|
||||||
|
{
|
||||||
|
if (elementNumber >= 0)
|
||||||
|
foldout.text = $"Main Assets ({elementNumber})";
|
||||||
|
else
|
||||||
|
foldout.text = $"Main Assets";
|
||||||
|
}
|
||||||
|
else if (collectorType == ECollectorType.StaticAssetCollector)
|
||||||
|
{
|
||||||
|
if (elementNumber >= 0)
|
||||||
|
foldout.text = $"Static Assets ({elementNumber})";
|
||||||
|
else
|
||||||
|
foldout.text = $"Static Assets";
|
||||||
|
}
|
||||||
|
else if (collectorType == ECollectorType.DependAssetCollector)
|
||||||
|
{
|
||||||
|
if (elementNumber >= 0)
|
||||||
|
foldout.text = $"Depend Assets ({elementNumber})";
|
||||||
|
else
|
||||||
|
foldout.text = $"Depend Assets";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException(collectorType.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void RefreshFoldoutContent(Foldout foldout, AssetBundleCollectorGroup group, AssetBundleCollector collector)
|
||||||
|
{
|
||||||
|
RefreshFoldoutName(foldout, collector.CollectorType);
|
||||||
|
|
||||||
|
// 折叠栏不可见
|
||||||
|
if (foldout.value == false)
|
||||||
|
{
|
||||||
|
foldout.Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 清空旧元素
|
// 清空旧元素
|
||||||
foldout.Clear();
|
foldout.Clear();
|
||||||
|
|
||||||
|
// 检测配置是否有效
|
||||||
if (collector.IsValid() == false)
|
if (collector.IsValid() == false)
|
||||||
{
|
{
|
||||||
collector.CheckConfigError();
|
collector.CheckConfigError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collector.CollectorType == ECollectorType.MainAssetCollector || collector.CollectorType == ECollectorType.StaticAssetCollector)
|
List<CollectAssetInfo> collectAssetInfos = null;
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
List<CollectAssetInfo> collectAssetInfos = null;
|
IIgnoreRule ignoreRule = AssetBundleCollectorSettingData.GetIgnoreRuleInstance(_ignoreRulePopupField.value.ClassName);
|
||||||
|
string packageName = _packageNameTxt.value;
|
||||||
|
var command = new CollectCommand(packageName, ignoreRule);
|
||||||
|
command.SetFlag(ECollectFlags.IgnoreGetDependencies, true);
|
||||||
|
command.UniqueBundleName = _uniqueBundleNameToogle.value;
|
||||||
|
command.EnableAddressable = _enableAddressableToogle.value;
|
||||||
|
command.SupportExtensionless = _supportExtensionlessToogle.value;
|
||||||
|
command.LocationToLower = _locationToLowerToogle.value;
|
||||||
|
command.IncludeAssetGUID = _includeAssetGUIDToogle.value;
|
||||||
|
command.AutoCollectShaders = _autoCollectShadersToogle.value;
|
||||||
|
|
||||||
try
|
collector.CheckConfigError();
|
||||||
|
collectAssetInfos = collector.GetAllCollectAssets(command, group);
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError(e.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (collectAssetInfos != null)
|
||||||
|
{
|
||||||
|
bool showAdress = false;
|
||||||
|
if (_enableAddressableToogle.value && collector.CollectorType == ECollectorType.MainAssetCollector)
|
||||||
|
showAdress = true;
|
||||||
|
|
||||||
|
RefreshFoldoutName(foldout, collector.CollectorType, collectAssetInfos.Count);
|
||||||
|
foreach (var collectAsset in collectAssetInfos)
|
||||||
{
|
{
|
||||||
IIgnoreRule ignoreRule = AssetBundleCollectorSettingData.GetIgnoreRuleInstance(_ignoreRulePopupField.value.ClassName);
|
VisualElement elementRow = new VisualElement();
|
||||||
string packageName = _packageNameTxt.value;
|
elementRow.style.flexDirection = FlexDirection.Row;
|
||||||
var command = new CollectCommand(packageName, ignoreRule);
|
foldout.Add(elementRow);
|
||||||
command.SimulateBuild = true;
|
|
||||||
command.UniqueBundleName = _uniqueBundleNameToogle.value;
|
|
||||||
command.UseAssetDependencyDB = true;
|
|
||||||
command.EnableAddressable = _enableAddressableToogle.value;
|
|
||||||
command.LocationToLower = _locationToLowerToogle.value;
|
|
||||||
command.IncludeAssetGUID = _includeAssetGUIDToogle.value;
|
|
||||||
command.AutoCollectShaders = _autoCollectShadersToogle.value;
|
|
||||||
|
|
||||||
collector.CheckConfigError();
|
string showInfo = collectAsset.AssetInfo.AssetPath;
|
||||||
collectAssetInfos = collector.GetAllCollectAssets(command, group);
|
if (showAdress)
|
||||||
}
|
showInfo = $"[{collectAsset.Address}] {collectAsset.AssetInfo.AssetPath}";
|
||||||
catch (System.Exception e)
|
|
||||||
{
|
|
||||||
Debug.LogError(e.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (collectAssetInfos != null)
|
var label = new Label();
|
||||||
{
|
label.text = showInfo;
|
||||||
foreach (var collectAsset in collectAssetInfos)
|
label.style.width = 300;
|
||||||
{
|
label.style.marginLeft = 0;
|
||||||
VisualElement elementRow = new VisualElement();
|
label.style.flexGrow = 1;
|
||||||
elementRow.style.flexDirection = FlexDirection.Row;
|
elementRow.Add(label);
|
||||||
foldout.Add(elementRow);
|
|
||||||
|
|
||||||
string showInfo = collectAsset.AssetInfo.AssetPath;
|
|
||||||
if (_enableAddressableToogle.value)
|
|
||||||
showInfo = $"[{collectAsset.Address}] {collectAsset.AssetInfo.AssetPath}";
|
|
||||||
|
|
||||||
var label = new Label();
|
|
||||||
label.text = showInfo;
|
|
||||||
label.style.width = 300;
|
|
||||||
label.style.marginLeft = 0;
|
|
||||||
label.style.flexGrow = 1;
|
|
||||||
elementRow.Add(label);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
<ui:Button text="Package Settings" display-tooltip-when-elided="true" name="PackageSettingsButton" />
|
<ui:Button text="Package Settings" display-tooltip-when-elided="true" name="PackageSettingsButton" />
|
||||||
<ui:VisualElement name="PublicContainer2">
|
<ui:VisualElement name="PublicContainer2">
|
||||||
<ui:Toggle label="Enable Addressable" name="EnableAddressable" style="width: 196px; -unity-text-align: middle-left;" />
|
<ui:Toggle label="Enable Addressable" name="EnableAddressable" style="width: 196px; -unity-text-align: middle-left;" />
|
||||||
|
<ui:Toggle label="Support Extensionless" name="SupportExtensionless" style="width: 196px; -unity-text-align: middle-left;" />
|
||||||
<ui:Toggle label="Location To Lower" name="LocationToLower" style="width: 196px; -unity-text-align: middle-left;" />
|
<ui:Toggle label="Location To Lower" name="LocationToLower" style="width: 196px; -unity-text-align: middle-left;" />
|
||||||
<ui:Toggle label="Include Asset GUID" name="IncludeAssetGUID" style="width: 196px; -unity-text-align: middle-left;" />
|
<ui:Toggle label="Include Asset GUID" name="IncludeAssetGUID" style="width: 196px; -unity-text-align: middle-left;" />
|
||||||
<ui:Toggle label="Auto Collect Shaders" name="AutoCollectShaders" value="true" style="width: 196px; -unity-text-align: middle-left;" />
|
<ui:Toggle label="Auto Collect Shaders" name="AutoCollectShaders" value="true" style="width: 196px; -unity-text-align: middle-left;" />
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
<ui:VisualElement name="ContentContainer" style="flex-grow: 1; flex-direction: row;">
|
<ui:VisualElement name="ContentContainer" style="flex-grow: 1; flex-direction: row;">
|
||||||
<ui:VisualElement name="PackageContainer" style="width: 200px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
<ui:VisualElement name="PackageContainer" style="width: 200px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
||||||
<ui:Label text="Packages" display-tooltip-when-elided="true" name="PackageTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
<ui:Label text="Packages" display-tooltip-when-elided="true" name="PackageTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
||||||
<ui:ListView focusable="true" name="PackageListView" item-height="20" virtualization-method="DynamicHeight" style="flex-grow: 1;" />
|
<ui:ListView focusable="true" name="PackageListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
||||||
<ui:VisualElement name="PackageAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
<ui:VisualElement name="PackageAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
||||||
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
||||||
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
<ui:Label text="Groups" display-tooltip-when-elided="true" name="GroupTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
<ui:Label text="Groups" display-tooltip-when-elided="true" name="GroupTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
||||||
<ui:TextField picking-mode="Ignore" label="Package Name" name="PackageName" style="flex-direction: column;" />
|
<ui:TextField picking-mode="Ignore" label="Package Name" name="PackageName" style="flex-direction: column;" />
|
||||||
<ui:TextField picking-mode="Ignore" label="Package Desc" name="PackageDesc" style="flex-direction: column;" />
|
<ui:TextField picking-mode="Ignore" label="Package Desc" name="PackageDesc" style="flex-direction: column;" />
|
||||||
<ui:ListView focusable="true" name="GroupListView" item-height="20" virtualization-method="DynamicHeight" style="flex-grow: 1;" />
|
<ui:ListView focusable="true" name="GroupListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
||||||
<ui:VisualElement name="GroupAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
<ui:VisualElement name="GroupAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
||||||
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
||||||
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user