mirror of https://github.com/tuyoogame/YooAsset
Compare commits
13 Commits
ddda9e29db
...
e6958d205e
Author | SHA1 | Date |
---|---|---|
|
e6958d205e | |
|
b03d9db2b0 | |
|
30853b6d62 | |
|
a7cafcb328 | |
|
d03bca5512 | |
|
af3fc50188 | |
|
b71eeeb855 | |
|
317c42521a | |
|
064d69269e | |
|
9e6401d3c0 | |
|
2aaba328ee | |
|
62fdc93a82 | |
|
408f0942ee |
|
@ -2,6 +2,18 @@
|
||||||
|
|
||||||
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.3-preview] - 2025-03-06
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- 新增了异步操作任务调试器,AssetBundleDebugger窗口-->OperationView视图模式
|
||||||
|
- 编辑器下模拟构建默认启用依赖关系数据库,可以大幅增加编辑器下开始游戏时间。
|
||||||
|
- 单元测试用例增加加密解密测试用例。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#492) 修复了发布的MAC平台应用,在启动的时候提示权限无法获取的问题。
|
||||||
|
|
||||||
## [2.3.2-preview] - 2025-02-27
|
## [2.3.2-preview] - 2025-02-27
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -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();
|
||||||
|
@ -441,6 +441,8 @@ 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 = () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -43,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>
|
||||||
|
@ -89,6 +99,16 @@ 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;
|
||||||
|
|
|
@ -167,14 +167,13 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
// 每间隔0.5秒绘制一次页面
|
// 每间隔1秒绘制一次页面
|
||||||
if (EditorApplication.timeSinceStartup - _lastRepaintTime > 0.5f)
|
if (EditorApplication.timeSinceStartup - _lastRepaintTime > 1f)
|
||||||
{
|
{
|
||||||
_lastRepaintTime = EditorApplication.timeSinceStartup;
|
_lastRepaintTime = EditorApplication.timeSinceStartup;
|
||||||
if (_nextRepaintIndex >= 0)
|
if (_nextRepaintIndex >= 0)
|
||||||
{
|
{
|
||||||
RepaintFrame(_nextRepaintIndex);
|
RepaintFrame(_nextRepaintIndex);
|
||||||
_lastRepaintIndex = _nextRepaintIndex;
|
|
||||||
_nextRepaintIndex = -1;
|
_nextRepaintIndex = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,22 +191,27 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
private void OnHandlePlayerMessage(MessageEventArgs args)
|
private void OnHandlePlayerMessage(MessageEventArgs args)
|
||||||
{
|
{
|
||||||
var debugReport = DebugReport.Deserialize(args.data);
|
|
||||||
int playerId = args.playerId;
|
int playerId = args.playerId;
|
||||||
|
var debugReport = DebugReport.Deserialize(args.data);
|
||||||
|
|
||||||
|
if (debugReport.DebuggerVersion != RemoteDebuggerDefine.DebuggerVersion)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Debugger versions are inconsistent : {debugReport.DebuggerVersion} != {RemoteDebuggerDefine.DebuggerVersion}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Debug.Log($"Handle player {playerId} debug report !");
|
//Debug.Log($"Handle player {playerId} debug report !");
|
||||||
_currentPlayerSession = GetOrCreatePlayerSession(playerId);
|
_currentPlayerSession = GetOrCreatePlayerSession(playerId);
|
||||||
_currentPlayerSession.AddDebugReport(debugReport);
|
_currentPlayerSession.AddDebugReport(debugReport);
|
||||||
_frameSlider.highValue = _currentPlayerSession.MaxRangeValue;
|
_nextRepaintIndex = _currentPlayerSession.MaxRangeValue;
|
||||||
_frameSlider.value = _currentPlayerSession.MaxRangeValue;
|
|
||||||
UpdateRepaintIndex(_currentPlayerSession.MaxRangeValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFrameSliderChange(int sliderValue)
|
private void OnFrameSliderChange(int sliderValue)
|
||||||
{
|
{
|
||||||
if (_currentPlayerSession != null)
|
if (_currentPlayerSession != null)
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(sliderValue); ;
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(sliderValue); ;
|
||||||
UpdateRepaintIndex(_rangeIndex);
|
RepaintFrame(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameLast_clicked()
|
private void OnFrameLast_clicked()
|
||||||
|
@ -216,7 +220,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateRepaintIndex(_rangeIndex);
|
RepaintFrame(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameNext_clicked()
|
private void OnFrameNext_clicked()
|
||||||
|
@ -225,21 +229,26 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateRepaintIndex(_rangeIndex);
|
RepaintFrame(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameClear_clicked()
|
private void OnFrameClear_clicked()
|
||||||
{
|
{
|
||||||
if (_currentPlayerSession != null)
|
_nextRepaintIndex = -1;
|
||||||
{
|
_lastRepaintIndex = 0;
|
||||||
|
_rangeIndex = 0;
|
||||||
|
|
||||||
_frameSlider.label = $"Frame:";
|
_frameSlider.label = $"Frame:";
|
||||||
_frameSlider.value = 0;
|
_frameSlider.value = 0;
|
||||||
_frameSlider.lowValue = 0;
|
_frameSlider.lowValue = 0;
|
||||||
_frameSlider.highValue = 0;
|
_frameSlider.highValue = 0;
|
||||||
_currentPlayerSession.ClearDebugReport();
|
|
||||||
_assetListViewer.ClearView();
|
_assetListViewer.ClearView();
|
||||||
_bundleListViewer.ClearView();
|
_bundleListViewer.ClearView();
|
||||||
_operationListViewer.ClearView();
|
_operationListViewer.ClearView();
|
||||||
|
|
||||||
|
if (_currentPlayerSession != null)
|
||||||
|
{
|
||||||
|
_currentPlayerSession.ClearDebugReport();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnRecordToggleValueChange(ChangeEvent<bool> evt)
|
private void OnRecordToggleValueChange(ChangeEvent<bool> evt)
|
||||||
|
@ -357,17 +366,24 @@ namespace YooAsset.Editor
|
||||||
return newSession;
|
return newSession;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void UpdateRepaintIndex(int rangeIndex)
|
|
||||||
{
|
|
||||||
_nextRepaintIndex = rangeIndex;
|
|
||||||
}
|
|
||||||
private void RepaintFrame(int repaintIndex)
|
private void RepaintFrame(int repaintIndex)
|
||||||
{
|
{
|
||||||
|
if (_currentPlayerSession == null)
|
||||||
|
{
|
||||||
|
_assetListViewer.ClearView();
|
||||||
|
_bundleListViewer.ClearView();
|
||||||
|
_operationListViewer.ClearView();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var debugReport = _currentPlayerSession.GetDebugReport(repaintIndex);
|
var debugReport = _currentPlayerSession.GetDebugReport(repaintIndex);
|
||||||
if (debugReport != null)
|
if (debugReport != null)
|
||||||
{
|
{
|
||||||
|
_lastRepaintIndex = repaintIndex;
|
||||||
_currentReport = debugReport;
|
_currentReport = debugReport;
|
||||||
_frameSlider.label = $"Frame: {debugReport.FrameCount}";
|
_frameSlider.label = $"Frame: {debugReport.FrameCount}";
|
||||||
|
_frameSlider.highValue = _currentPlayerSession.MaxRangeValue;
|
||||||
|
_frameSlider.value = repaintIndex;
|
||||||
|
|
||||||
if (_viewMode == EViewMode.AssetView)
|
if (_viewMode == EViewMode.AssetView)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace YooAsset.Editor
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _providerTableView;
|
private TableViewer _providerTableView;
|
||||||
private TableView _dependTableView;
|
private TableViewer _dependTableView;
|
||||||
|
|
||||||
private List<ITableData> _sourceDatas;
|
private List<ITableData> _sourceDatas;
|
||||||
|
|
||||||
|
@ -44,12 +44,12 @@ namespace YooAsset.Editor
|
||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 资源列表
|
// 资源列表
|
||||||
_providerTableView = _root.Q<TableView>("TopTableView");
|
_providerTableView = _root.Q<TableViewer>("TopTableView");
|
||||||
_providerTableView.SelectionChangedEvent = OnProviderTableViewSelectionChanged;
|
_providerTableView.SelectionChangedEvent = OnProviderTableViewSelectionChanged;
|
||||||
CreateAssetTableViewColumns();
|
CreateAssetTableViewColumns();
|
||||||
|
|
||||||
// 依赖列表
|
// 依赖列表
|
||||||
_dependTableView = _root.Q<TableView>("BottomTableView");
|
_dependTableView = _root.Q<TableViewer>("BottomTableView");
|
||||||
CreateDependTableViewColumns();
|
CreateDependTableViewColumns();
|
||||||
|
|
||||||
// 面板分屏
|
// 面板分屏
|
||||||
|
@ -148,10 +148,11 @@ namespace YooAsset.Editor
|
||||||
|
|
||||||
// LoadingTime
|
// LoadingTime
|
||||||
{
|
{
|
||||||
var columnStyle = new ColumnStyle(100);
|
var columnStyle = new ColumnStyle(130);
|
||||||
columnStyle.Stretchable = false;
|
columnStyle.Stretchable = false;
|
||||||
columnStyle.Searchable = false;
|
columnStyle.Searchable = false;
|
||||||
columnStyle.Sortable = true;
|
columnStyle.Sortable = true;
|
||||||
|
columnStyle.Units = "ms";
|
||||||
var column = new TableColumn("LoadingTime", "Loading Time", columnStyle);
|
var column = new TableColumn("LoadingTime", "Loading Time", columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<ui:VisualElement name="TopGroup" 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="TopGroup" 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:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
<ui:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
||||||
<YooAsset.Editor.TableView name="BottomTableView" />
|
<YooAsset.Editor.TableViewer name="BottomTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
|
@ -28,9 +28,9 @@ namespace YooAsset.Editor
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _bundleTableView;
|
private TableViewer _bundleTableView;
|
||||||
private TableView _usingTableView;
|
private TableViewer _usingTableView;
|
||||||
private TableView _referenceTableView;
|
private TableViewer _referenceTableView;
|
||||||
|
|
||||||
private List<ITableData> _sourceDatas;
|
private List<ITableData> _sourceDatas;
|
||||||
|
|
||||||
|
@ -48,16 +48,16 @@ namespace YooAsset.Editor
|
||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 资源包列表
|
// 资源包列表
|
||||||
_bundleTableView = _root.Q<TableView>("BundleTableView");
|
_bundleTableView = _root.Q<TableViewer>("BundleTableView");
|
||||||
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
||||||
CreateBundleTableViewColumns();
|
CreateBundleTableViewColumns();
|
||||||
|
|
||||||
// 使用列表
|
// 使用列表
|
||||||
_usingTableView = _root.Q<TableView>("UsingTableView");
|
_usingTableView = _root.Q<TableViewer>("UsingTableView");
|
||||||
CreateUsingTableViewColumns();
|
CreateUsingTableViewColumns();
|
||||||
|
|
||||||
// 引用列表
|
// 引用列表
|
||||||
_referenceTableView = _root.Q<TableView>("ReferenceTableView");
|
_referenceTableView = _root.Q<TableViewer>("ReferenceTableView");
|
||||||
CreateReferenceTableViewColumns();
|
CreateReferenceTableViewColumns();
|
||||||
|
|
||||||
// 面板分屏
|
// 面板分屏
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<ui:VisualElement name="TopGroup" 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="TopGroup" 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="BundleTableView" />
|
<YooAsset.Editor.TableViewer name="BundleTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
<ui:VisualElement name="BottomGroup" style="height: 400px; 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: 1px; margin-bottom: 1px; display: flex;">
|
<ui:VisualElement name="BottomGroup" style="height: 400px; 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: 1px; margin-bottom: 1px; display: flex;">
|
||||||
<YooAsset.Editor.TableView name="UsingTableView" />
|
<YooAsset.Editor.TableViewer name="UsingTableView" />
|
||||||
<YooAsset.Editor.TableView name="ReferenceTableView" />
|
<YooAsset.Editor.TableViewer name="ReferenceTableView" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace YooAsset.Editor
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _operationTableView;
|
private TableViewer _operationTableView;
|
||||||
private Toolbar _bottomToolbar;
|
private Toolbar _bottomToolbar;
|
||||||
private TreeViewer _childTreeView;
|
private TreeViewer _childTreeView;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace YooAsset.Editor
|
||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 任务列表
|
// 任务列表
|
||||||
_operationTableView = _root.Q<TableView>("TopTableView");
|
_operationTableView = _root.Q<TableViewer>("TopTableView");
|
||||||
_operationTableView.SelectionChangedEvent = OnOperationTableViewSelectionChanged;
|
_operationTableView.SelectionChangedEvent = OnOperationTableViewSelectionChanged;
|
||||||
CreateOperationTableViewColumns();
|
CreateOperationTableViewColumns();
|
||||||
|
|
||||||
|
@ -170,10 +170,11 @@ namespace YooAsset.Editor
|
||||||
|
|
||||||
// ProcessTime
|
// ProcessTime
|
||||||
{
|
{
|
||||||
var columnStyle = new ColumnStyle(100);
|
var columnStyle = new ColumnStyle(130);
|
||||||
columnStyle.Stretchable = false;
|
columnStyle.Stretchable = false;
|
||||||
columnStyle.Searchable = false;
|
columnStyle.Searchable = false;
|
||||||
columnStyle.Sortable = true;
|
columnStyle.Sortable = true;
|
||||||
|
columnStyle.Units = "ms";
|
||||||
var column = new TableColumn("ProcessTime", "Process Time", columnStyle);
|
var column = new TableColumn("ProcessTime", "Process Time", columnStyle);
|
||||||
column.MakeCell = () =>
|
column.MakeCell = () =>
|
||||||
{
|
{
|
||||||
|
@ -270,9 +271,9 @@ namespace YooAsset.Editor
|
||||||
// ProcessTime
|
// ProcessTime
|
||||||
{
|
{
|
||||||
ToolbarButton button = new ToolbarButton();
|
ToolbarButton button = new ToolbarButton();
|
||||||
button.text = "ProcessTime";
|
button.text = "ProcessTime (ms)";
|
||||||
button.style.flexGrow = 0;
|
button.style.flexGrow = 0;
|
||||||
button.style.width = 100;
|
button.style.width = 130;
|
||||||
_bottomToolbar.Add(button);
|
_bottomToolbar.Add(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +423,7 @@ namespace YooAsset.Editor
|
||||||
var label = new Label();
|
var label = new Label();
|
||||||
label.name = "ProcessTime";
|
label.name = "ProcessTime";
|
||||||
label.style.flexGrow = 0f;
|
label.style.flexGrow = 0f;
|
||||||
label.style.width = 100;
|
label.style.width = 130;
|
||||||
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||||
container.Add(label);
|
container.Add(label);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
|
||||||
<ui:VisualElement name="TopGroup" 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="TopGroup" 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:VisualElement name="BottomGroup" style="flex-grow: 1;">
|
<ui:VisualElement name="BottomGroup" style="flex-grow: 1;">
|
||||||
<uie:Toolbar name="BottomToolbar" />
|
<uie:Toolbar name="BottomToolbar" />
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace YooAsset.Editor
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _assetTableView;
|
private TableViewer _assetTableView;
|
||||||
private TableView _dependTableView;
|
private TableViewer _dependTableView;
|
||||||
|
|
||||||
private BuildReport _buildReport;
|
private BuildReport _buildReport;
|
||||||
private string _reportFilePath;
|
private string _reportFilePath;
|
||||||
|
@ -46,13 +46,13 @@ namespace YooAsset.Editor
|
||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 资源列表
|
// 资源列表
|
||||||
_assetTableView = _root.Q<TableView>("TopTableView");
|
_assetTableView = _root.Q<TableViewer>("TopTableView");
|
||||||
_assetTableView.SelectionChangedEvent = OnAssetTableViewSelectionChanged;
|
_assetTableView.SelectionChangedEvent = OnAssetTableViewSelectionChanged;
|
||||||
_assetTableView.ClickTableDataEvent = OnClickAssetTableView;
|
_assetTableView.ClickTableDataEvent = OnClickAssetTableView;
|
||||||
CreateAssetTableViewColumns();
|
CreateAssetTableViewColumns();
|
||||||
|
|
||||||
// 依赖列表
|
// 依赖列表
|
||||||
_dependTableView = _root.Q<TableView>("BottomTableView");
|
_dependTableView = _root.Q<TableViewer>("BottomTableView");
|
||||||
_dependTableView.ClickTableDataEvent = OnClickBundleTableView;
|
_dependTableView.ClickTableDataEvent = OnClickBundleTableView;
|
||||||
CreateDependTableViewColumns();
|
CreateDependTableViewColumns();
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<ui:VisualElement name="TopGroup" 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="TopGroup" 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" style="flex-grow: 1;" />
|
<YooAsset.Editor.TableViewer name="TopTableView" style="flex-grow: 1;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
<ui:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
<ui:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
||||||
<YooAsset.Editor.TableView name="BottomTableView" style="flex-grow: 1;" />
|
<YooAsset.Editor.TableViewer name="BottomTableView" style="flex-grow: 1;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace YooAsset.Editor
|
||||||
private VisualTreeAsset _visualAsset;
|
private VisualTreeAsset _visualAsset;
|
||||||
private TemplateContainer _root;
|
private TemplateContainer _root;
|
||||||
|
|
||||||
private TableView _bundleTableView;
|
private TableViewer _bundleTableView;
|
||||||
private TableView _includeTableView;
|
private TableViewer _includeTableView;
|
||||||
|
|
||||||
private BuildReport _buildReport;
|
private BuildReport _buildReport;
|
||||||
private string _reportFilePath;
|
private string _reportFilePath;
|
||||||
|
@ -46,13 +46,13 @@ namespace YooAsset.Editor
|
||||||
_root.style.flexGrow = 1f;
|
_root.style.flexGrow = 1f;
|
||||||
|
|
||||||
// 资源包列表
|
// 资源包列表
|
||||||
_bundleTableView = _root.Q<TableView>("TopTableView");
|
_bundleTableView = _root.Q<TableViewer>("TopTableView");
|
||||||
_bundleTableView.ClickTableDataEvent = OnClickBundleTableView;
|
_bundleTableView.ClickTableDataEvent = OnClickBundleTableView;
|
||||||
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
_bundleTableView.SelectionChangedEvent = OnBundleTableViewSelectionChanged;
|
||||||
CreateBundleTableViewColumns();
|
CreateBundleTableViewColumns();
|
||||||
|
|
||||||
// 包含列表
|
// 包含列表
|
||||||
_includeTableView = _root.Q<TableView>("BottomTableView");
|
_includeTableView = _root.Q<TableViewer>("BottomTableView");
|
||||||
_includeTableView.ClickTableDataEvent = OnClickIncludeTableView;
|
_includeTableView.ClickTableDataEvent = OnClickIncludeTableView;
|
||||||
CreateIncludeTableViewColumns();
|
CreateIncludeTableViewColumns();
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<ui:VisualElement name="TopGroup" 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="TopGroup" 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" style="flex-grow: 1;" />
|
<YooAsset.Editor.TableViewer name="TopTableView" style="flex-grow: 1;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
<ui:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
<ui:VisualElement name="BottomGroup" style="height: 200px; 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: 1px; margin-bottom: 1px; display: flex; flex-grow: 1;">
|
||||||
<YooAsset.Editor.TableView name="BottomTableView" style="flex-grow: 1;" />
|
<YooAsset.Editor.TableViewer name="BottomTableView" style="flex-grow: 1;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
|
@ -46,6 +46,11 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Counter = false;
|
public bool Counter = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 展示单位
|
||||||
|
/// </summary>
|
||||||
|
public string Units = string.Empty;
|
||||||
|
|
||||||
public ColumnStyle(Length width)
|
public ColumnStyle(Length width)
|
||||||
{
|
{
|
||||||
if (width.value > MaxValue)
|
if (width.value > MaxValue)
|
|
@ -13,9 +13,9 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unity2022版本以上推荐官方类:MultiColumnListView组件
|
/// Unity2022版本以上推荐官方类:MultiColumnListView组件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TableView : VisualElement
|
public class TableViewer : VisualElement
|
||||||
{
|
{
|
||||||
public new class UxmlFactory : UxmlFactory<TableView, UxmlTraits>
|
public new class UxmlFactory : UxmlFactory<TableViewer, UxmlTraits>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ namespace YooAsset.Editor
|
||||||
public Action<ITableData> SelectionChangedEvent;
|
public Action<ITableData> SelectionChangedEvent;
|
||||||
|
|
||||||
|
|
||||||
public TableView()
|
public TableViewer()
|
||||||
{
|
{
|
||||||
this.style.flexShrink = 1f;
|
this.style.flexShrink = 1f;
|
||||||
this.style.flexGrow = 1f;
|
this.style.flexGrow = 1f;
|
||||||
|
@ -214,6 +214,16 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置展示单位
|
||||||
|
foreach (var column in _columns)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(column.ColumnStyle.Units) == false)
|
||||||
|
{
|
||||||
|
var toobarButton = GetHeaderElement(column.ElementName) as ToolbarButton;
|
||||||
|
toobarButton.text = $"{toobarButton.text} ({column.ColumnStyle.Units})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 设置升降符号
|
// 设置升降符号
|
||||||
if (string.IsNullOrEmpty(_sortingHeader) == false)
|
if (string.IsNullOrEmpty(_sortingHeader) == false)
|
||||||
{
|
{
|
|
@ -12,6 +12,11 @@ namespace YooAsset
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugReport
|
internal class DebugReport
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 调试器版本
|
||||||
|
/// </summary>
|
||||||
|
public string DebuggerVersion = RemoteDebuggerDefine.DebuggerVersion;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏帧
|
/// 游戏帧
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal class RemoteDebuggerDefine
|
internal class RemoteDebuggerDefine
|
||||||
{
|
{
|
||||||
|
public const string DebuggerVersion = "2.3.3";
|
||||||
public static readonly Guid kMsgPlayerSendToEditor = new Guid("e34a5702dd353724aa315fb8011f08c3");
|
public static readonly Guid kMsgPlayerSendToEditor = new Guid("e34a5702dd353724aa315fb8011f08c3");
|
||||||
public static readonly Guid kMsgEditorSendToPlayer = new Guid("4d1926c9df5b052469a1c63448b7609a");
|
public static readonly Guid kMsgEditorSendToPlayer = new Guid("4d1926c9df5b052469a1c63448b7609a");
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,11 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BuildPipelineName;
|
public string BuildPipelineName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户数据
|
||||||
|
/// </summary>
|
||||||
|
public object BuildUserData;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构建类所属程序集名称
|
/// 构建类所属程序集名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -44,10 +44,10 @@ public class TextureSchema : ScannerSchema
|
||||||
string name = "扫描所有纹理资产";
|
string name = "扫描所有纹理资产";
|
||||||
string desc = GetUserGuide();
|
string desc = GetUserGuide();
|
||||||
var report = new ScanReport(name, desc);
|
var report = new ScanReport(name, desc);
|
||||||
report.AddHeader("资源路径", 600, 500, 1000).SetStretchable().SetSearchable().SetSortable().SetHeaderType(EHeaderType.AssetPath);
|
report.AddHeader("资源路径", 600, 500, 1000).SetStretchable().SetSearchable().SetSortable().SetCounter().SetHeaderType(EHeaderType.AssetPath);
|
||||||
report.AddHeader("图片宽度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue);
|
report.AddHeader("图片宽度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue);
|
||||||
report.AddHeader("图片高度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue);
|
report.AddHeader("图片高度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue);
|
||||||
report.AddHeader("内存大小", 100).SetSortable().SetHeaderType(EHeaderType.LongValue);
|
report.AddHeader("内存大小", 120).SetSortable().SetUnits("bytes").SetHeaderType(EHeaderType.LongValue);
|
||||||
report.AddHeader("苹果格式", 100);
|
report.AddHeader("苹果格式", 100);
|
||||||
report.AddHeader("安卓格式", 100);
|
report.AddHeader("安卓格式", 100);
|
||||||
report.AddHeader("错误信息", 500).SetStretchable();
|
report.AddHeader("错误信息", 500).SetStretchable();
|
||||||
|
|
|
@ -70,17 +70,19 @@ internal class FsmInitializePackage : IStateNode
|
||||||
// WebGL运行模式
|
// WebGL运行模式
|
||||||
if (playMode == EPlayMode.WebPlayMode)
|
if (playMode == EPlayMode.WebPlayMode)
|
||||||
{
|
{
|
||||||
var createParameters = new WebPlayModeParameters();
|
|
||||||
#if UNITY_WEBGL && WEIXINMINIGAME && !UNITY_EDITOR
|
#if UNITY_WEBGL && WEIXINMINIGAME && !UNITY_EDITOR
|
||||||
|
var createParameters = new WebPlayModeParameters();
|
||||||
string defaultHostServer = GetHostServerURL();
|
string defaultHostServer = GetHostServerURL();
|
||||||
string fallbackHostServer = GetHostServerURL();
|
string fallbackHostServer = GetHostServerURL();
|
||||||
string packageRoot = $"{WeChatWASM.WX.env.USER_DATA_PATH}/__GAME_FILE_CACHE"; //注意:如果有子目录,请修改此处!
|
string packageRoot = $"{WeChatWASM.WX.env.USER_DATA_PATH}/__GAME_FILE_CACHE"; //注意:如果有子目录,请修改此处!
|
||||||
IRemoteServices remoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
|
IRemoteServices remoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
|
||||||
createParameters.WebServerFileSystemParameters = WechatFileSystemCreater.CreateFileSystemParameters(packageRoot, remoteServices);
|
createParameters.WebServerFileSystemParameters = WechatFileSystemCreater.CreateFileSystemParameters(packageRoot, remoteServices);
|
||||||
#else
|
|
||||||
createParameters.WebServerFileSystemParameters = FileSystemParameters.CreateDefaultWebServerFileSystemParameters(new WebDecryption());
|
|
||||||
#endif
|
|
||||||
initializationOperation = package.InitializeAsync(createParameters);
|
initializationOperation = package.InitializeAsync(createParameters);
|
||||||
|
#else
|
||||||
|
var createParameters = new WebPlayModeParameters();
|
||||||
|
createParameters.WebServerFileSystemParameters = FileSystemParameters.CreateDefaultWebServerFileSystemParameters();
|
||||||
|
initializationOperation = package.InitializeAsync(createParameters);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return initializationOperation;
|
yield return initializationOperation;
|
||||||
|
@ -149,24 +151,4 @@ internal class FsmInitializePackage : IStateNode
|
||||||
return $"{_fallbackHostServer}/{fileName}";
|
return $"{_fallbackHostServer}/{fileName}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class WebDecryption : IWebDecryptionServices
|
|
||||||
{
|
|
||||||
public const byte KEY = 64;
|
|
||||||
|
|
||||||
public WebDecryptResult LoadAssetBundle(WebDecryptFileInfo fileInfo)
|
|
||||||
{
|
|
||||||
byte[] copyData = new byte[fileInfo.FileData.Length];
|
|
||||||
Buffer.BlockCopy(fileInfo.FileData, 0, copyData, 0, fileInfo.FileData.Length);
|
|
||||||
|
|
||||||
for (int i = 0; i < copyData.Length; i++)
|
|
||||||
{
|
|
||||||
copyData[i] ^= KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
WebDecryptResult decryptResult = new WebDecryptResult();
|
|
||||||
decryptResult.Result = AssetBundle.LoadFromMemory(copyData);
|
|
||||||
return decryptResult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -15,17 +15,22 @@ public static class TestPackageBuilder
|
||||||
|
|
||||||
if (buildPipelineName == EBuildPipeline.EditorSimulateBuildPipeline.ToString())
|
if (buildPipelineName == EBuildPipeline.EditorSimulateBuildPipeline.ToString())
|
||||||
{
|
{
|
||||||
|
string projectPath = EditorTools.GetProjectPath();
|
||||||
|
string outputRoot = $"{projectPath}/Bundles/Tester_ESBP";
|
||||||
|
|
||||||
var buildParameters = new EditorSimulateBuildParameters();
|
var buildParameters = new EditorSimulateBuildParameters();
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
buildParameters.BuildOutputRoot = outputRoot;
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
buildParameters.BuildPipeline = EBuildPipeline.EditorSimulateBuildPipeline.ToString();
|
buildParameters.BuildPipeline = EBuildPipeline.EditorSimulateBuildPipeline.ToString();
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.VirtualBundle;
|
buildParameters.BuildBundleType = (int)EBuildBundleType.VirtualBundle;
|
||||||
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
||||||
buildParameters.PackageName = packageName;
|
buildParameters.PackageName = packageName;
|
||||||
buildParameters.PackageVersion = "ESBP_Simulate";
|
buildParameters.PackageVersion = "TestVersion";
|
||||||
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.ClearBuildCacheFiles = true;
|
||||||
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
|
|
||||||
var pipeline = new EditorSimulateBuildPipeline();
|
var pipeline = new EditorSimulateBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
@ -43,16 +48,20 @@ public static class TestPackageBuilder
|
||||||
}
|
}
|
||||||
else if (buildPipelineName == EBuildPipeline.ScriptableBuildPipeline.ToString())
|
else if (buildPipelineName == EBuildPipeline.ScriptableBuildPipeline.ToString())
|
||||||
{
|
{
|
||||||
|
string projectPath = EditorTools.GetProjectPath();
|
||||||
|
string outputRoot = $"{projectPath}/Bundles/Tester_SBP";
|
||||||
|
|
||||||
// 内置着色器资源包名称
|
// 内置着色器资源包名称
|
||||||
var builtinShaderBundleName = GetBuiltinShaderBundleName(packageName);
|
var builtinShaderBundleName = GetBuiltinShaderBundleName(packageName);
|
||||||
var buildParameters = new ScriptableBuildParameters();
|
var buildParameters = new ScriptableBuildParameters();
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
|
||||||
|
buildParameters.BuildOutputRoot = outputRoot;
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
buildParameters.BuildPipeline = EBuildPipeline.ScriptableBuildPipeline.ToString();
|
buildParameters.BuildPipeline = EBuildPipeline.ScriptableBuildPipeline.ToString();
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
||||||
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
||||||
buildParameters.PackageName = packageName;
|
buildParameters.PackageName = packageName;
|
||||||
buildParameters.PackageVersion = "SBP_Simulate";
|
buildParameters.PackageVersion = "TestVersion";
|
||||||
buildParameters.EnableSharePackRule = true;
|
buildParameters.EnableSharePackRule = true;
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
||||||
|
@ -62,6 +71,7 @@ public static class TestPackageBuilder
|
||||||
buildParameters.ClearBuildCacheFiles = true;
|
buildParameters.ClearBuildCacheFiles = true;
|
||||||
buildParameters.UseAssetDependencyDB = true;
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
|
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
|
||||||
|
buildParameters.EncryptionServices = new FileStreamEncryption();
|
||||||
|
|
||||||
var pipeline = new ScriptableBuildPipeline();
|
var pipeline = new ScriptableBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
@ -79,14 +89,17 @@ public static class TestPackageBuilder
|
||||||
}
|
}
|
||||||
else if (buildPipelineName == EBuildPipeline.BuiltinBuildPipeline.ToString())
|
else if (buildPipelineName == EBuildPipeline.BuiltinBuildPipeline.ToString())
|
||||||
{
|
{
|
||||||
|
string projectPath = EditorTools.GetProjectPath();
|
||||||
|
string outputRoot = $"{projectPath}/Bundles/Tester_BBP";
|
||||||
|
|
||||||
var buildParameters = new BuiltinBuildParameters();
|
var buildParameters = new BuiltinBuildParameters();
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
buildParameters.BuildOutputRoot = outputRoot;
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
buildParameters.BuildPipeline = EBuildPipeline.ScriptableBuildPipeline.ToString();
|
buildParameters.BuildPipeline = EBuildPipeline.ScriptableBuildPipeline.ToString();
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle;
|
||||||
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
||||||
buildParameters.PackageName = packageName;
|
buildParameters.PackageName = packageName;
|
||||||
buildParameters.PackageVersion = "BBP_Simulate";
|
buildParameters.PackageVersion = "TestVersion";
|
||||||
buildParameters.EnableSharePackRule = true;
|
buildParameters.EnableSharePackRule = true;
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
||||||
|
@ -95,6 +108,7 @@ public static class TestPackageBuilder
|
||||||
buildParameters.CompressOption = ECompressOption.LZ4;
|
buildParameters.CompressOption = ECompressOption.LZ4;
|
||||||
buildParameters.ClearBuildCacheFiles = true;
|
buildParameters.ClearBuildCacheFiles = true;
|
||||||
buildParameters.UseAssetDependencyDB = true;
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
|
buildParameters.EncryptionServices = new FileStreamEncryption();
|
||||||
|
|
||||||
var pipeline = new BuiltinBuildPipeline();
|
var pipeline = new BuiltinBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
@ -112,14 +126,17 @@ public static class TestPackageBuilder
|
||||||
}
|
}
|
||||||
else if (buildPipelineName == EBuildPipeline.RawFileBuildPipeline.ToString())
|
else if (buildPipelineName == EBuildPipeline.RawFileBuildPipeline.ToString())
|
||||||
{
|
{
|
||||||
|
string projectPath = EditorTools.GetProjectPath();
|
||||||
|
string outputRoot = $"{projectPath}/Bundles/Tester_RFBP";
|
||||||
|
|
||||||
var buildParameters = new RawFileBuildParameters();
|
var buildParameters = new RawFileBuildParameters();
|
||||||
buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot();
|
buildParameters.BuildOutputRoot = outputRoot;
|
||||||
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot();
|
||||||
buildParameters.BuildPipeline = EBuildPipeline.RawFileBuildPipeline.ToString();
|
buildParameters.BuildPipeline = EBuildPipeline.RawFileBuildPipeline.ToString();
|
||||||
buildParameters.BuildBundleType = (int)EBuildBundleType.RawBundle;
|
buildParameters.BuildBundleType = (int)EBuildBundleType.RawBundle;
|
||||||
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
||||||
buildParameters.PackageName = packageName;
|
buildParameters.PackageName = packageName;
|
||||||
buildParameters.PackageVersion = "RFBP_Simulate";
|
buildParameters.PackageVersion = "TestVersion";
|
||||||
buildParameters.VerifyBuildingResult = true;
|
buildParameters.VerifyBuildingResult = true;
|
||||||
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
buildParameters.FileNameStyle = EFileNameStyle.HashName;
|
||||||
buildParameters.BuildinFileCopyOption = EBuildinFileCopyOption.None;
|
buildParameters.BuildinFileCopyOption = EBuildinFileCopyOption.None;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
public class AssetBundleCollectorDefine
|
|
||||||
{
|
|
||||||
public const string TestPackageName = "TestPackage";
|
|
||||||
public const string RawPackageName = "RawPackage";
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using System.Collections;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
using UnityEngine.U2D;
|
|
||||||
using UnityEngine.TestTools;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using YooAsset;
|
|
||||||
|
|
||||||
public class AssetBundleCollectorPreapre : IPrebuildSetup, IPostBuildCleanup
|
|
||||||
{
|
|
||||||
void IPrebuildSetup.Setup()
|
|
||||||
{
|
|
||||||
AssetBundleCollectorMaker.MakeCollectorSettingData();
|
|
||||||
}
|
|
||||||
void IPostBuildCleanup.Cleanup()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void InitializeYooAssets()
|
|
||||||
{
|
|
||||||
// 初始化YooAsset
|
|
||||||
YooAssets.Initialize();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1b6c0cef725372943a5938f3fa73743b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -3,19 +3,37 @@ using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.U2D;
|
||||||
using UnityEngine.TestTools;
|
using UnityEngine.TestTools;
|
||||||
|
using NUnit.Framework;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
public static class AssetBundleCollectorMaker
|
public class T0_InitYooAssets : IPrebuildSetup, IPostBuildCleanup
|
||||||
{
|
{
|
||||||
public static void MakeCollectorSettingData()
|
void IPrebuildSetup.Setup()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// 清空旧数据
|
// 清空旧数据
|
||||||
YooAsset.Editor.AssetBundleCollectorSettingData.ClearAll();
|
YooAsset.Editor.AssetBundleCollectorSettingData.ClearAll();
|
||||||
|
|
||||||
// 创建正常文件Package
|
// 创建包裹配置
|
||||||
var testPackage = YooAsset.Editor.AssetBundleCollectorSettingData.CreatePackage(AssetBundleCollectorDefine.TestPackageName);
|
CreateAssetBundlePackageCollector();
|
||||||
|
CreateRawBundlePackageCollector();
|
||||||
|
|
||||||
|
// 修正配置路径为空导致的错误
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.FixFile();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void IPostBuildCleanup.Cleanup()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private static void CreateAssetBundlePackageCollector()
|
||||||
|
{
|
||||||
|
// 创建AssetBundlePackage
|
||||||
|
var testPackage = YooAsset.Editor.AssetBundleCollectorSettingData.CreatePackage(TestDefine.AssetBundlePackageName);
|
||||||
testPackage.EnableAddressable = true;
|
testPackage.EnableAddressable = true;
|
||||||
testPackage.AutoCollectShaders = true;
|
testPackage.AutoCollectShaders = true;
|
||||||
testPackage.IgnoreRuleName = "NormalIgnoreRule";
|
testPackage.IgnoreRuleName = "NormalIgnoreRule";
|
||||||
|
@ -104,8 +122,67 @@ public static class AssetBundleCollectorMaker
|
||||||
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(scriptableObjectGroup, collector1);
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(scriptableObjectGroup, collector1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建原生文件Package
|
// 引用测试文件
|
||||||
var rawPackage = YooAsset.Editor.AssetBundleCollectorSettingData.CreatePackage(AssetBundleCollectorDefine.RawPackageName);
|
var referenceGroup = YooAsset.Editor.AssetBundleCollectorSettingData.CreateGroup(testPackage, "ReferenceGroup");
|
||||||
|
{
|
||||||
|
var collector1 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector1.CollectPath = "";
|
||||||
|
collector1.CollectorGUID = "26b9f7e0454f2bc4a84b44a018075d8f"; //TestRes2/PanelA目录
|
||||||
|
collector1.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
|
||||||
|
collector1.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector1);
|
||||||
|
|
||||||
|
var collector2 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector2.CollectPath = "";
|
||||||
|
collector2.CollectorGUID = "b5cace4be4d008e408c0738f157708a0"; //TestRes2/PanelB目录
|
||||||
|
collector2.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
|
||||||
|
collector2.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector2);
|
||||||
|
|
||||||
|
var collector3 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector3.CollectPath = "";
|
||||||
|
collector3.CollectorGUID = "aa7f70ef09d60844ba62f85ff2414a9c"; //TestRes2/PanelAImage目录
|
||||||
|
collector3.CollectorType = YooAsset.Editor.ECollectorType.DependAssetCollector;
|
||||||
|
collector3.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector3);
|
||||||
|
|
||||||
|
var collector4 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector4.CollectPath = "";
|
||||||
|
collector4.CollectorGUID = "96d800f068cc69c4dbd20ffdcec40920"; //TestRes2/PanelBImage目录
|
||||||
|
collector4.CollectorType = YooAsset.Editor.ECollectorType.DependAssetCollector;
|
||||||
|
collector4.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector4);
|
||||||
|
|
||||||
|
var collector5 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector5.CollectPath = "";
|
||||||
|
collector5.CollectorGUID = "4264f3aa222d7f548a028d6c3411b1b0"; //TestRes2/PanelMat目录
|
||||||
|
collector5.CollectorType = YooAsset.Editor.ECollectorType.DependAssetCollector;
|
||||||
|
collector5.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector5);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加密测试文件
|
||||||
|
var encryptGroup = YooAsset.Editor.AssetBundleCollectorSettingData.CreateGroup(testPackage, "EncryptGroup");
|
||||||
|
{
|
||||||
|
var collector1 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector1.CollectPath = "";
|
||||||
|
collector1.CollectorGUID = "e082d492b9da65e499cee3495be3645d"; //TestRes3/music目录
|
||||||
|
collector1.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
|
||||||
|
collector1.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector1);
|
||||||
|
|
||||||
|
var collector2 = new YooAsset.Editor.AssetBundleCollector();
|
||||||
|
collector2.CollectPath = "";
|
||||||
|
collector2.CollectorGUID = "8c5a1726d94498e4cbe30f5f510cc796"; //TestRes3/prefab目录
|
||||||
|
collector2.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
|
||||||
|
collector2.PackRuleName = nameof(YooAsset.Editor.PackDirectory);
|
||||||
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(referenceGroup, collector2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static void CreateRawBundlePackageCollector()
|
||||||
|
{
|
||||||
|
// 创建RawBundlePackage
|
||||||
|
var rawPackage = YooAsset.Editor.AssetBundleCollectorSettingData.CreatePackage(TestDefine.RawBundlePackageName);
|
||||||
rawPackage.EnableAddressable = true;
|
rawPackage.EnableAddressable = true;
|
||||||
rawPackage.AutoCollectShaders = true;
|
rawPackage.AutoCollectShaders = true;
|
||||||
rawPackage.IgnoreRuleName = "RawFileIgnoreRule";
|
rawPackage.IgnoreRuleName = "RawFileIgnoreRule";
|
||||||
|
@ -131,9 +208,13 @@ public static class AssetBundleCollectorMaker
|
||||||
collector1.PackRuleName = nameof(YooAsset.Editor.PackVideoFile);
|
collector1.PackRuleName = nameof(YooAsset.Editor.PackVideoFile);
|
||||||
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(videoFileGroup, collector1);
|
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(videoFileGroup, collector1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 修正配置路径为空导致的错误
|
|
||||||
YooAsset.Editor.AssetBundleCollectorSettingData.FixFile();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void InitializeYooAssets()
|
||||||
|
{
|
||||||
|
// 初始化YooAsset
|
||||||
|
YooAssets.Initialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 07f7c95e8e42fd04f81b9925b2dcf0d0
|
guid: e2d300bf1a8f8194f9748f4aaebf6e03
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d4496f16afadc9b418cbbb8128272c44
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -9,34 +9,34 @@ using UnityEngine.TestTools;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
public class EditorFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
public class T1_TestEditorFileSystem : IPrebuildSetup, IPostBuildCleanup
|
||||||
{
|
{
|
||||||
private const string EFS_TEST_PACKAGE_ROOT_KEY = "EFS_TEST_PACKAGE_ROOT_KEY";
|
private const string ASSET_BUNDLE_PACKAGE_ROOT_KEY = "T1_ASSET_BUNDLE_PACKAGE_ROOT_KEY";
|
||||||
private const string EFS_RAW_PACKAGE_ROOT_KEY = "EFS_RAW_PACKAGE_ROOT_KEY";
|
private const string RAW_BUNDLE_PACKAGE_ROOT_KEY = "T1_RAW_BUNDLE_PACKAGE_ROOT_KEY";
|
||||||
|
|
||||||
void IPrebuildSetup.Setup()
|
void IPrebuildSetup.Setup()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// 构建TestPackage
|
// 构建资源包
|
||||||
{
|
{
|
||||||
var simulateParams = new PackageInvokeBuildParam(AssetBundleCollectorDefine.TestPackageName);
|
var simulateParams = new PackageInvokeBuildParam(TestDefine.AssetBundlePackageName);
|
||||||
simulateParams.BuildPipelineName = "EditorSimulateBuildPipeline";
|
simulateParams.BuildPipelineName = "EditorSimulateBuildPipeline";
|
||||||
simulateParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
simulateParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
||||||
simulateParams.InvokeClassFullName = "TestPackageBuilder";
|
simulateParams.InvokeClassFullName = "TestPackageBuilder";
|
||||||
simulateParams.InvokeMethodName = "BuildPackage";
|
simulateParams.InvokeMethodName = "BuildPackage";
|
||||||
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(simulateParams);
|
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(simulateParams);
|
||||||
UnityEditor.EditorPrefs.SetString(EFS_TEST_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
UnityEditor.EditorPrefs.SetString(ASSET_BUNDLE_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建RawPackage
|
// 构建资源包
|
||||||
{
|
{
|
||||||
var simulateParams = new PackageInvokeBuildParam(AssetBundleCollectorDefine.RawPackageName);
|
var simulateParams = new PackageInvokeBuildParam(TestDefine.RawBundlePackageName);
|
||||||
simulateParams.BuildPipelineName = "EditorSimulateBuildPipeline";
|
simulateParams.BuildPipelineName = "EditorSimulateBuildPipeline";
|
||||||
simulateParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
simulateParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
||||||
simulateParams.InvokeClassFullName = "TestPackageBuilder";
|
simulateParams.InvokeClassFullName = "TestPackageBuilder";
|
||||||
simulateParams.InvokeMethodName = "BuildPackage";
|
simulateParams.InvokeMethodName = "BuildPackage";
|
||||||
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(simulateParams);
|
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(simulateParams);
|
||||||
UnityEditor.EditorPrefs.SetString(EFS_RAW_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
UnityEditor.EditorPrefs.SetString(RAW_BUNDLE_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -45,48 +45,18 @@ public class EditorFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator DestroyPackage()
|
public IEnumerator A_InitializePackage()
|
||||||
{
|
{
|
||||||
// 销毁旧资源包
|
// 初始化资源包
|
||||||
{
|
|
||||||
var package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
|
||||||
var destroyOp = package.DestroyAsync();
|
|
||||||
yield return destroyOp;
|
|
||||||
if (destroyOp.Status != EOperationStatus.Succeed)
|
|
||||||
Debug.LogError(destroyOp.Error);
|
|
||||||
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
|
||||||
|
|
||||||
bool result = YooAssets.RemovePackage(AssetBundleCollectorDefine.TestPackageName);
|
|
||||||
Assert.IsTrue(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 销毁旧资源包
|
|
||||||
{
|
|
||||||
var package = YooAssets.GetPackage(AssetBundleCollectorDefine.RawPackageName);
|
|
||||||
var destroyOp = package.DestroyAsync();
|
|
||||||
yield return destroyOp;
|
|
||||||
if (destroyOp.Status != EOperationStatus.Succeed)
|
|
||||||
Debug.LogError(destroyOp.Error);
|
|
||||||
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
|
||||||
|
|
||||||
bool result = YooAssets.RemovePackage(AssetBundleCollectorDefine.RawPackageName);
|
|
||||||
Assert.IsTrue(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator InitializePackage()
|
|
||||||
{
|
|
||||||
// 初始化TestPackage
|
|
||||||
{
|
{
|
||||||
string packageRoot = string.Empty;
|
string packageRoot = string.Empty;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
packageRoot = UnityEditor.EditorPrefs.GetString(EFS_TEST_PACKAGE_ROOT_KEY);
|
packageRoot = UnityEditor.EditorPrefs.GetString(ASSET_BUNDLE_PACKAGE_ROOT_KEY);
|
||||||
#endif
|
#endif
|
||||||
if (Directory.Exists(packageRoot) == false)
|
if (Directory.Exists(packageRoot) == false)
|
||||||
throw new Exception($"Not found package root : {packageRoot}");
|
throw new Exception($"Not found package root : {packageRoot}");
|
||||||
|
|
||||||
var package = YooAssets.CreatePackage(AssetBundleCollectorDefine.TestPackageName);
|
var package = YooAssets.CreatePackage(TestDefine.AssetBundlePackageName);
|
||||||
|
|
||||||
// 初始化资源包
|
// 初始化资源包
|
||||||
var initParams = new EditorSimulateModeParameters();
|
var initParams = new EditorSimulateModeParameters();
|
||||||
|
@ -112,16 +82,16 @@ public class EditorFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
|
Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化RawPackage
|
// 初始化资源包
|
||||||
{
|
{
|
||||||
string packageRoot = string.Empty;
|
string packageRoot = string.Empty;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
packageRoot = UnityEditor.EditorPrefs.GetString(EFS_RAW_PACKAGE_ROOT_KEY);
|
packageRoot = UnityEditor.EditorPrefs.GetString(RAW_BUNDLE_PACKAGE_ROOT_KEY);
|
||||||
#endif
|
#endif
|
||||||
if (Directory.Exists(packageRoot) == false)
|
if (Directory.Exists(packageRoot) == false)
|
||||||
throw new Exception($"Not found package root : {packageRoot}");
|
throw new Exception($"Not found package root : {packageRoot}");
|
||||||
|
|
||||||
var package = YooAssets.CreatePackage(AssetBundleCollectorDefine.RawPackageName);
|
var package = YooAssets.CreatePackage(TestDefine.RawBundlePackageName);
|
||||||
|
|
||||||
// 初始化资源包
|
// 初始化资源包
|
||||||
var initParams = new EditorSimulateModeParameters();
|
var initParams = new EditorSimulateModeParameters();
|
||||||
|
@ -149,65 +119,95 @@ public class EditorFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadAsyncTask()
|
public IEnumerator B1_TestLoadAsyncTask()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadPanel();
|
var tester = new TestLoadPanel();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadAudio()
|
public IEnumerator B2_TestLoadAudio()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadAudio();
|
var tester = new TestLoadAudio();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadImage()
|
public IEnumerator B3_TestLoadImage()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadImage();
|
var tester = new TestLoadImage();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadPrefab()
|
public IEnumerator B4_TestLoadPrefab()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadPrefab();
|
var tester = new TestLoadPrefab();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadScene()
|
public IEnumerator B5_TestLoadSpriteAtlas()
|
||||||
{
|
|
||||||
var tester = new TestLoadScene();
|
|
||||||
yield return tester.RuntimeTester();
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator TestLoadScriptableObject()
|
|
||||||
{
|
|
||||||
var tester = new TestLoadScriptableObject();
|
|
||||||
yield return tester.RuntimeTester();
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator TestLoadSpriteAtlas()
|
|
||||||
{
|
{
|
||||||
var tester = new TestLoadSpriteAtlas();
|
var tester = new TestLoadSpriteAtlas();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadRawFile()
|
public IEnumerator B6_TestLoadScriptableObject()
|
||||||
|
{
|
||||||
|
var tester = new TestLoadScriptableObject();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator B7_TestLoadScene()
|
||||||
|
{
|
||||||
|
var tester = new TestLoadScene();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator B8_TestLoadRawFile()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadRawFile();
|
var tester = new TestLoadRawFile();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadVideo()
|
public IEnumerator B9_TestLoadVideo()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadVideo();
|
var tester = new TestLoadVideo();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator C_DestroyPackage()
|
||||||
|
{
|
||||||
|
// 销毁旧资源包
|
||||||
|
{
|
||||||
|
var package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
|
var destroyOp = package.DestroyAsync();
|
||||||
|
yield return destroyOp;
|
||||||
|
if (destroyOp.Status != EOperationStatus.Succeed)
|
||||||
|
Debug.LogError(destroyOp.Error);
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
||||||
|
|
||||||
|
bool result = YooAssets.RemovePackage(TestDefine.AssetBundlePackageName);
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 销毁旧资源包
|
||||||
|
{
|
||||||
|
var package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
|
||||||
|
var destroyOp = package.DestroyAsync();
|
||||||
|
yield return destroyOp;
|
||||||
|
if (destroyOp.Status != EOperationStatus.Succeed)
|
||||||
|
Debug.LogError(destroyOp.Error);
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
||||||
|
|
||||||
|
bool result = YooAssets.RemovePackage(TestDefine.RawBundlePackageName);
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9c31d2ca48714ce4882e877397f638b0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -9,34 +9,34 @@ using UnityEngine.TestTools;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
public class BuildinFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
public class T2_TestBuldinFileSystem : IPrebuildSetup, IPostBuildCleanup
|
||||||
{
|
{
|
||||||
private const string BFS_TEST_PACKAGE_ROOT_KEY = "BFS_TEST_PACKAGE_ROOT_KEY";
|
private const string ASSET_BUNDLE_PACKAGE_ROOT_KEY = "T2_ASSET_BUNDLE_PACKAGE_ROOT_KEY";
|
||||||
private const string BFS_RAW_PACKAGE_ROOT_KEY = "BFS_RAW_PACKAGE_ROOT_KEY";
|
private const string RAW_BUNDLE_PACKAGE_ROOT_KEY = "T2_RAW_BUNDLE_PACKAGE_ROOT_KEY";
|
||||||
|
|
||||||
void IPrebuildSetup.Setup()
|
void IPrebuildSetup.Setup()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// 构建TestPackage
|
// 构建AssetBundlePackage
|
||||||
{
|
{
|
||||||
var buildParams = new PackageInvokeBuildParam(AssetBundleCollectorDefine.TestPackageName);
|
var buildParams = new PackageInvokeBuildParam(TestDefine.AssetBundlePackageName);
|
||||||
buildParams.BuildPipelineName = "ScriptableBuildPipeline";
|
buildParams.BuildPipelineName = "ScriptableBuildPipeline";
|
||||||
buildParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
buildParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
||||||
buildParams.InvokeClassFullName = "TestPackageBuilder";
|
buildParams.InvokeClassFullName = "TestPackageBuilder";
|
||||||
buildParams.InvokeMethodName = "BuildPackage";
|
buildParams.InvokeMethodName = "BuildPackage";
|
||||||
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(buildParams);
|
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(buildParams);
|
||||||
UnityEditor.EditorPrefs.SetString(BFS_TEST_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
UnityEditor.EditorPrefs.SetString(ASSET_BUNDLE_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建RawPackage
|
// 构建RawBundlePackage
|
||||||
{
|
{
|
||||||
var buildParams = new PackageInvokeBuildParam(AssetBundleCollectorDefine.RawPackageName);
|
var buildParams = new PackageInvokeBuildParam(TestDefine.RawBundlePackageName);
|
||||||
buildParams.BuildPipelineName = "RawFileBuildPipeline";
|
buildParams.BuildPipelineName = "RawFileBuildPipeline";
|
||||||
buildParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
buildParams.InvokeAssmeblyName = "YooAsset.Test.Editor";
|
||||||
buildParams.InvokeClassFullName = "TestPackageBuilder";
|
buildParams.InvokeClassFullName = "TestPackageBuilder";
|
||||||
buildParams.InvokeMethodName = "BuildPackage";
|
buildParams.InvokeMethodName = "BuildPackage";
|
||||||
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(buildParams);
|
var simulateResult = PakcageInvokeBuilder.InvokeBuilder(buildParams);
|
||||||
UnityEditor.EditorPrefs.SetString(BFS_RAW_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
UnityEditor.EditorPrefs.SetString(RAW_BUNDLE_PACKAGE_ROOT_KEY, simulateResult.PackageRootDirectory);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -45,22 +45,23 @@ public class BuildinFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator InitializePackage()
|
public IEnumerator A_InitializePackage()
|
||||||
{
|
{
|
||||||
// 初始化TestPackage
|
// 初始化资源包
|
||||||
{
|
{
|
||||||
string packageRoot = string.Empty;
|
string packageRoot = string.Empty;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
packageRoot = UnityEditor.EditorPrefs.GetString(BFS_TEST_PACKAGE_ROOT_KEY);
|
packageRoot = UnityEditor.EditorPrefs.GetString(ASSET_BUNDLE_PACKAGE_ROOT_KEY);
|
||||||
#endif
|
#endif
|
||||||
if (Directory.Exists(packageRoot) == false)
|
if (Directory.Exists(packageRoot) == false)
|
||||||
throw new Exception($"Not found package root : {packageRoot}");
|
throw new Exception($"Not found package root : {packageRoot}");
|
||||||
|
|
||||||
var package = YooAssets.CreatePackage(AssetBundleCollectorDefine.TestPackageName);
|
var package = YooAssets.CreatePackage(TestDefine.AssetBundlePackageName);
|
||||||
|
|
||||||
// 初始化资源包
|
// 初始化资源包
|
||||||
var initParams = new OfflinePlayModeParameters();
|
var initParams = new OfflinePlayModeParameters();
|
||||||
initParams.BuildinFileSystemParameters = FileSystemParameters.CreateDefaultBuildinFileSystemParameters(null, packageRoot);
|
var decryption = new FileStreamDecryption();
|
||||||
|
initParams.BuildinFileSystemParameters = FileSystemParameters.CreateDefaultBuildinFileSystemParameters(decryption, packageRoot);
|
||||||
var initializeOp = package.InitializeAsync(initParams);
|
var initializeOp = package.InitializeAsync(initParams);
|
||||||
yield return initializeOp;
|
yield return initializeOp;
|
||||||
if (initializeOp.Status != EOperationStatus.Succeed)
|
if (initializeOp.Status != EOperationStatus.Succeed)
|
||||||
|
@ -82,16 +83,16 @@ public class BuildinFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
|
Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化RawPackage
|
// 初始化资源包
|
||||||
{
|
{
|
||||||
string packageRoot = string.Empty;
|
string packageRoot = string.Empty;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
packageRoot = UnityEditor.EditorPrefs.GetString(BFS_RAW_PACKAGE_ROOT_KEY);
|
packageRoot = UnityEditor.EditorPrefs.GetString(RAW_BUNDLE_PACKAGE_ROOT_KEY);
|
||||||
#endif
|
#endif
|
||||||
if (Directory.Exists(packageRoot) == false)
|
if (Directory.Exists(packageRoot) == false)
|
||||||
throw new Exception($"Not found package root : {packageRoot}");
|
throw new Exception($"Not found package root : {packageRoot}");
|
||||||
|
|
||||||
var package = YooAssets.CreatePackage(AssetBundleCollectorDefine.RawPackageName);
|
var package = YooAssets.CreatePackage(TestDefine.RawBundlePackageName);
|
||||||
|
|
||||||
// 初始化资源包
|
// 初始化资源包
|
||||||
var initParams = new OfflinePlayModeParameters();
|
var initParams = new OfflinePlayModeParameters();
|
||||||
|
@ -120,65 +121,109 @@ public class BuildinFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadAsyncTask()
|
public IEnumerator B1_TestLoadAsyncTask()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadPanel();
|
var tester = new TestLoadPanel();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadAudio()
|
public IEnumerator B2_TestLoadAudio()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadAudio();
|
var tester = new TestLoadAudio();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadImage()
|
public IEnumerator B3_TestLoadImage()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadImage();
|
var tester = new TestLoadImage();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadPrefab()
|
public IEnumerator B4_TestLoadPrefab()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadPrefab();
|
var tester = new TestLoadPrefab();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadScene()
|
public IEnumerator B5_TestLoadSpriteAtlas()
|
||||||
{
|
|
||||||
var tester = new TestLoadScene();
|
|
||||||
yield return tester.RuntimeTester();
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator TestLoadScriptableObject()
|
|
||||||
{
|
|
||||||
var tester = new TestLoadScriptableObject();
|
|
||||||
yield return tester.RuntimeTester();
|
|
||||||
}
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator TestLoadSpriteAtlas()
|
|
||||||
{
|
{
|
||||||
var tester = new TestLoadSpriteAtlas();
|
var tester = new TestLoadSpriteAtlas();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadRawFile()
|
public IEnumerator B6_TestLoadScriptableObject()
|
||||||
|
{
|
||||||
|
var tester = new TestLoadScriptableObject();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator B7_TestLoadScene()
|
||||||
|
{
|
||||||
|
var tester = new TestLoadScene();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator B8_TestLoadRawFile()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadRawFile();
|
var tester = new TestLoadRawFile();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator TestLoadVideo()
|
public IEnumerator B9_TestLoadVideo()
|
||||||
{
|
{
|
||||||
var tester = new TestLoadVideo();
|
var tester = new TestLoadVideo();
|
||||||
yield return tester.RuntimeTester();
|
yield return tester.RuntimeTester();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator C1_TestBundleReference()
|
||||||
|
{
|
||||||
|
var tester = new TestBundleReference();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator C2_TestBundleEncryption()
|
||||||
|
{
|
||||||
|
var tester = new TestBundleEncryption();
|
||||||
|
yield return tester.RuntimeTester();
|
||||||
|
}
|
||||||
|
|
||||||
|
[UnityTest]
|
||||||
|
public IEnumerator D_DestroyPackage()
|
||||||
|
{
|
||||||
|
// 销毁旧资源包
|
||||||
|
{
|
||||||
|
var package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
|
var destroyOp = package.DestroyAsync();
|
||||||
|
yield return destroyOp;
|
||||||
|
if (destroyOp.Status != EOperationStatus.Succeed)
|
||||||
|
Debug.LogError(destroyOp.Error);
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
||||||
|
|
||||||
|
bool result = YooAssets.RemovePackage(TestDefine.AssetBundlePackageName);
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 销毁旧资源包
|
||||||
|
{
|
||||||
|
var package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
|
||||||
|
var destroyOp = package.DestroyAsync();
|
||||||
|
yield return destroyOp;
|
||||||
|
if (destroyOp.Status != EOperationStatus.Succeed)
|
||||||
|
Debug.LogError(destroyOp.Error);
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
|
||||||
|
|
||||||
|
bool result = YooAssets.RemovePackage(TestDefine.RawBundlePackageName);
|
||||||
|
Assert.IsTrue(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,10 +1,99 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.U2D;
|
||||||
|
using UnityEngine.TestTools;
|
||||||
|
using NUnit.Framework;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
#region 文件流
|
public class TestBundleEncryption
|
||||||
|
{
|
||||||
|
public IEnumerator RuntimeTester()
|
||||||
|
{
|
||||||
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
|
// 加载音乐播放预制体
|
||||||
|
{
|
||||||
|
var assetHandle = package.LoadAssetAsync<GameObject>("prefab_audio");
|
||||||
|
yield return assetHandle;
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, assetHandle.Status);
|
||||||
|
|
||||||
|
var go = assetHandle.InstantiateSync(Vector3.zero, Quaternion.identity);
|
||||||
|
Assert.IsNotNull(go);
|
||||||
|
|
||||||
|
var audioSource = go.GetComponent<AudioSource>();
|
||||||
|
Assert.IsNotNull(audioSource.clip);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 试听三秒钟
|
||||||
|
yield return new WaitForSeconds(3f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件流加密方式
|
||||||
|
/// </summary>
|
||||||
|
public class FileStreamEncryption : IEncryptionServices
|
||||||
|
{
|
||||||
|
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
||||||
|
{
|
||||||
|
// 说明:对TestRes3资源目录进行加密
|
||||||
|
if (fileInfo.BundleName.Contains("_testres3_"))
|
||||||
|
{
|
||||||
|
var fileData = File.ReadAllBytes(fileInfo.FileLoadPath);
|
||||||
|
for (int i = 0; i < fileData.Length; i++)
|
||||||
|
{
|
||||||
|
fileData[i] ^= BundleStream.KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
EncryptResult result = new EncryptResult();
|
||||||
|
result.Encrypted = true;
|
||||||
|
result.EncryptedData = fileData;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EncryptResult result = new EncryptResult();
|
||||||
|
result.Encrypted = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件偏移加密方式
|
||||||
|
/// </summary>
|
||||||
|
public class FileOffsetEncryption : IEncryptionServices
|
||||||
|
{
|
||||||
|
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
||||||
|
{
|
||||||
|
// 说明:对TestRes3资源目录进行加密
|
||||||
|
if (fileInfo.BundleName.Contains("_testres3_"))
|
||||||
|
{
|
||||||
|
int offset = 32;
|
||||||
|
byte[] fileData = File.ReadAllBytes(fileInfo.FileLoadPath);
|
||||||
|
var encryptedData = new byte[fileData.Length + offset];
|
||||||
|
Buffer.BlockCopy(fileData, 0, encryptedData, offset, fileData.Length);
|
||||||
|
|
||||||
|
EncryptResult result = new EncryptResult();
|
||||||
|
result.Encrypted = true;
|
||||||
|
result.EncryptedData = encryptedData;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EncryptResult result = new EncryptResult();
|
||||||
|
result.Encrypted = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源文件解密流
|
/// 资源文件解密流
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -31,36 +120,7 @@ public class BundleStream : FileStream
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件流加密方式
|
/// 资源文件流解密类
|
||||||
/// </summary>
|
|
||||||
public class FileStreamEncryption : IEncryptionServices
|
|
||||||
{
|
|
||||||
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
|
||||||
{
|
|
||||||
if (fileInfo.BundleName.Contains("_gameres_audio"))
|
|
||||||
{
|
|
||||||
var fileData = File.ReadAllBytes(fileInfo.FileLoadPath);
|
|
||||||
for (int i = 0; i < fileData.Length; i++)
|
|
||||||
{
|
|
||||||
fileData[i] ^= BundleStream.KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
EncryptResult result = new EncryptResult();
|
|
||||||
result.Encrypted = true;
|
|
||||||
result.EncryptedData = fileData;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EncryptResult result = new EncryptResult();
|
|
||||||
result.Encrypted = false;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 资源文件流加载解密类
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileStreamDecryption : IDecryptionServices
|
public class FileStreamDecryption : IDecryptionServices
|
||||||
{
|
{
|
||||||
|
@ -111,40 +171,9 @@ public class FileStreamDecryption : IDecryptionServices
|
||||||
return 1024;
|
return 1024;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 文件偏移
|
|
||||||
/// <summary>
|
|
||||||
/// 文件偏移加密方式
|
|
||||||
/// </summary>
|
|
||||||
public class FileOffsetEncryption : IEncryptionServices
|
|
||||||
{
|
|
||||||
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
|
||||||
{
|
|
||||||
// 注意:只对音频资源包加密
|
|
||||||
if (fileInfo.BundleName.Contains("_gameres_audio"))
|
|
||||||
{
|
|
||||||
int offset = 32;
|
|
||||||
byte[] fileData = File.ReadAllBytes(fileInfo.FileLoadPath);
|
|
||||||
var encryptedData = new byte[fileData.Length + offset];
|
|
||||||
Buffer.BlockCopy(fileData, 0, encryptedData, offset, fileData.Length);
|
|
||||||
|
|
||||||
EncryptResult result = new EncryptResult();
|
|
||||||
result.Encrypted = true;
|
|
||||||
result.EncryptedData = encryptedData;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EncryptResult result = new EncryptResult();
|
|
||||||
result.Encrypted = false;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源文件偏移加载解密类
|
/// 资源文件偏移解密类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileOffsetDecryption : IDecryptionServices
|
public class FileOffsetDecryption : IDecryptionServices
|
||||||
{
|
{
|
||||||
|
@ -193,4 +222,25 @@ public class FileOffsetDecryption : IDecryptionServices
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
/// <summary>
|
||||||
|
/// WebGL平台解密类
|
||||||
|
/// 注意:WebGL平台支持内存解密
|
||||||
|
/// </summary>
|
||||||
|
public class WebFileStreamDecryption : IWebDecryptionServices
|
||||||
|
{
|
||||||
|
public WebDecryptResult LoadAssetBundle(WebDecryptFileInfo fileInfo)
|
||||||
|
{
|
||||||
|
byte[] copyData = new byte[fileInfo.FileData.Length];
|
||||||
|
Buffer.BlockCopy(fileInfo.FileData, 0, copyData, 0, fileInfo.FileData.Length);
|
||||||
|
|
||||||
|
for (int i = 0; i < copyData.Length; i++)
|
||||||
|
{
|
||||||
|
copyData[i] ^= BundleStream.KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
WebDecryptResult decryptResult = new WebDecryptResult();
|
||||||
|
decryptResult.Result = AssetBundle.LoadFromMemory(copyData);
|
||||||
|
return decryptResult;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Collections;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.U2D;
|
||||||
|
using UnityEngine.TestTools;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using YooAsset;
|
||||||
|
|
||||||
|
public class TestBundleReference
|
||||||
|
{
|
||||||
|
public IEnumerator RuntimeTester()
|
||||||
|
{
|
||||||
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
|
// 加载HeroA
|
||||||
|
{
|
||||||
|
var assetHandle = package.LoadAssetAsync<GameObject>("hero_a");
|
||||||
|
yield return assetHandle;
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, assetHandle.Status);
|
||||||
|
|
||||||
|
var pos = new Vector3(-1, -1, 0);
|
||||||
|
var go = assetHandle.InstantiateSync(pos, Quaternion.identity);
|
||||||
|
Assert.IsNotNull(go);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载HeroB
|
||||||
|
AssetHandle heroHandle;
|
||||||
|
GameObject heroObject;
|
||||||
|
{
|
||||||
|
heroHandle = package.LoadAssetAsync<GameObject>("hero_b");
|
||||||
|
yield return heroHandle;
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, heroHandle.Status);
|
||||||
|
|
||||||
|
var pos = new Vector3(1, -1, 0);
|
||||||
|
heroObject = heroHandle.InstantiateSync(pos, Quaternion.identity);
|
||||||
|
Assert.IsNotNull(heroObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 卸载HeroB
|
||||||
|
{
|
||||||
|
heroHandle.Release();
|
||||||
|
GameObject.Destroy(heroObject);
|
||||||
|
yield return new WaitForEndOfFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理未使用资源
|
||||||
|
{
|
||||||
|
var operation = package.UnloadUnusedAssetsAsync();
|
||||||
|
yield return operation;
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, operation.Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 再次加载HeroB
|
||||||
|
{
|
||||||
|
heroHandle = package.LoadAssetAsync<GameObject>("hero_b");
|
||||||
|
yield return heroHandle;
|
||||||
|
Assert.AreEqual(EOperationStatus.Succeed, heroHandle.Status);
|
||||||
|
|
||||||
|
var pos = new Vector3(1, -1, 0);
|
||||||
|
heroObject = heroHandle.InstantiateSync(pos, Quaternion.identity);
|
||||||
|
Assert.IsNotNull(heroObject);
|
||||||
|
|
||||||
|
// 检测材质球关联的纹理是否为空
|
||||||
|
var mat = heroObject.GetComponent<MeshRenderer>().material;
|
||||||
|
Assert.IsNotNull(mat.mainTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 88e4ec854876f3f40bce38bc880c0f6a
|
guid: 31ab830e018f9934f8b95ca1a63b3a03
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 967f41aa15e95ec4ebf41cbac0f0aafb
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -6,7 +6,7 @@ using UnityEngine;
|
||||||
using UnityEngine.TestTools;
|
using UnityEngine.TestTools;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
public class CacheFileSystemTester : IPrebuildSetup, IPostBuildCleanup
|
public class T3_TestCacheFileSystem : IPrebuildSetup, IPostBuildCleanup
|
||||||
{
|
{
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
public class TestDefine
|
||||||
|
{
|
||||||
|
public const string AssetBundlePackageName = "AssetBundlePackage";
|
||||||
|
public const string RawBundlePackageName = "RawBundlePackage";
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0fcd7851bb8b7d34eb3684c8dbdd99f0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -13,7 +13,7 @@ public class TestLoadAudio
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 音乐异步加载
|
// 音乐异步加载
|
|
@ -13,7 +13,7 @@ public class TestLoadImage
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 异步加载子对象
|
// 异步加载子对象
|
|
@ -14,7 +14,7 @@ public class TestLoadPanel
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 异步加载面板
|
// 异步加载面板
|
|
@ -13,7 +13,7 @@ public class TestLoadPrefab
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 异步加载所有预制体
|
// 异步加载所有预制体
|
|
@ -13,7 +13,7 @@ public class TestLoadRawFile
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.RawPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 测试异步加载
|
// 测试异步加载
|
|
@ -14,7 +14,7 @@ public class TestLoadScene
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 异步加载主场景
|
// 异步加载主场景
|
|
@ -13,7 +13,7 @@ public class TestLoadScriptableObject
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
// 异步加载序列化对象
|
// 异步加载序列化对象
|
|
@ -13,7 +13,7 @@ public class TestLoadSpriteAtlas
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.TestPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
var assetHandle = package.LoadAssetAsync<SpriteAtlas>("atlas_icon");
|
var assetHandle = package.LoadAssetAsync<SpriteAtlas>("atlas_icon");
|
|
@ -14,7 +14,7 @@ public class TestLoadVideo
|
||||||
{
|
{
|
||||||
public IEnumerator RuntimeTester()
|
public IEnumerator RuntimeTester()
|
||||||
{
|
{
|
||||||
ResourcePackage package = YooAssets.GetPackage(AssetBundleCollectorDefine.RawPackageName);
|
ResourcePackage package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
|
||||||
Assert.IsNotNull(package);
|
Assert.IsNotNull(package);
|
||||||
|
|
||||||
var rawFileHandle = package.LoadRawFileAsync("video_logo");
|
var rawFileHandle = package.LoadRawFileAsync("video_logo");
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a4c74c63688b77743b853b255a5fb853
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26b9f7e0454f2bc4a84b44a018075d8f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue