mirror of https://github.com/tuyoogame/YooAsset
Compare commits
No commits in common. "ddda9e29dbed5dbe8e929f1d99f5cd8770727794" and "ed9692574c18d18c37392247293adefca65df761" have entirely different histories.
ddda9e29db
...
ed9692574c
|
@ -59,10 +59,6 @@ namespace YooAsset.Editor
|
||||||
private string _searchKeyWord;
|
private string _searchKeyWord;
|
||||||
private DebugReport _currentReport;
|
private DebugReport _currentReport;
|
||||||
private RemotePlayerSession _currentPlayerSession;
|
private RemotePlayerSession _currentPlayerSession;
|
||||||
|
|
||||||
private double _lastRepaintTime = 0;
|
|
||||||
private int _nextRepaintIndex = -1;
|
|
||||||
private int _lastRepaintIndex = 0;
|
|
||||||
private int _rangeIndex = 0;
|
private int _rangeIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -165,20 +161,6 @@ namespace YooAsset.Editor
|
||||||
RemoteEditorConnection.Instance.Unregister(RemoteDebuggerDefine.kMsgPlayerSendToEditor);
|
RemoteEditorConnection.Instance.Unregister(RemoteDebuggerDefine.kMsgPlayerSendToEditor);
|
||||||
_playerSessions.Clear();
|
_playerSessions.Clear();
|
||||||
}
|
}
|
||||||
public void Update()
|
|
||||||
{
|
|
||||||
// 每间隔0.5秒绘制一次页面
|
|
||||||
if (EditorApplication.timeSinceStartup - _lastRepaintTime > 0.5f)
|
|
||||||
{
|
|
||||||
_lastRepaintTime = EditorApplication.timeSinceStartup;
|
|
||||||
if (_nextRepaintIndex >= 0)
|
|
||||||
{
|
|
||||||
RepaintFrame(_nextRepaintIndex);
|
|
||||||
_lastRepaintIndex = _nextRepaintIndex;
|
|
||||||
_nextRepaintIndex = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnHandleConnectionEvent(int playerId)
|
private void OnHandleConnectionEvent(int playerId)
|
||||||
{
|
{
|
||||||
|
@ -194,20 +176,19 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
var debugReport = DebugReport.Deserialize(args.data);
|
var debugReport = DebugReport.Deserialize(args.data);
|
||||||
int playerId = args.playerId;
|
int playerId = args.playerId;
|
||||||
|
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;
|
_frameSlider.highValue = _currentPlayerSession.MaxRangeValue;
|
||||||
_frameSlider.value = _currentPlayerSession.MaxRangeValue;
|
_frameSlider.value = _currentPlayerSession.MaxRangeValue;
|
||||||
UpdateRepaintIndex(_currentPlayerSession.MaxRangeValue);
|
UpdateFrameView(_currentPlayerSession);
|
||||||
}
|
}
|
||||||
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);
|
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameLast_clicked()
|
private void OnFrameLast_clicked()
|
||||||
|
@ -216,7 +197,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateRepaintIndex(_rangeIndex);
|
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameNext_clicked()
|
private void OnFrameNext_clicked()
|
||||||
|
@ -225,7 +206,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateRepaintIndex(_rangeIndex);
|
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameClear_clicked()
|
private void OnFrameClear_clicked()
|
||||||
|
@ -253,6 +234,42 @@ namespace YooAsset.Editor
|
||||||
RemoteEditorConnection.Instance.Send(RemoteDebuggerDefine.kMsgEditorSendToPlayer, data);
|
RemoteEditorConnection.Instance.Send(RemoteDebuggerDefine.kMsgEditorSendToPlayer, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private RemotePlayerSession GetOrCreatePlayerSession(int playerId)
|
||||||
|
{
|
||||||
|
if (_playerSessions.TryGetValue(playerId, out RemotePlayerSession session))
|
||||||
|
{
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RemotePlayerSession newSession = new RemotePlayerSession(playerId);
|
||||||
|
_playerSessions.Add(playerId, newSession);
|
||||||
|
return newSession;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateFrameView(RemotePlayerSession playerSession)
|
||||||
|
{
|
||||||
|
if (playerSession != null)
|
||||||
|
{
|
||||||
|
UpdateFrameView(playerSession, playerSession.MaxRangeValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateFrameView(RemotePlayerSession playerSession, int rangeIndex)
|
||||||
|
{
|
||||||
|
if (playerSession == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var debugReport = playerSession.GetDebugReport(rangeIndex);
|
||||||
|
if (debugReport != null)
|
||||||
|
{
|
||||||
|
_currentReport = debugReport;
|
||||||
|
_frameSlider.label = $"Frame: {debugReport.FrameCount}";
|
||||||
|
_assetListViewer.FillViewData(debugReport);
|
||||||
|
_bundleListViewer.FillViewData(debugReport);
|
||||||
|
_operationListViewer.FillViewData(debugReport);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void SampleBtn_onClick()
|
private void SampleBtn_onClick()
|
||||||
{
|
{
|
||||||
// 发送采集数据的命令
|
// 发送采集数据的命令
|
||||||
|
@ -330,9 +347,6 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
throw new NotImplementedException(viewMode.ToString());
|
throw new NotImplementedException(viewMode.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新绘制该帧数据
|
|
||||||
RepaintFrame(_lastRepaintIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private DropdownMenuAction.Status OnViewModeMenuStatusUpdate(DropdownMenuAction action)
|
private DropdownMenuAction.Status OnViewModeMenuStatusUpdate(DropdownMenuAction action)
|
||||||
|
@ -343,56 +357,6 @@ namespace YooAsset.Editor
|
||||||
else
|
else
|
||||||
return DropdownMenuAction.Status.Normal;
|
return DropdownMenuAction.Status.Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RemotePlayerSession GetOrCreatePlayerSession(int playerId)
|
|
||||||
{
|
|
||||||
if (_playerSessions.TryGetValue(playerId, out RemotePlayerSession session))
|
|
||||||
{
|
|
||||||
return session;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RemotePlayerSession newSession = new RemotePlayerSession(playerId);
|
|
||||||
_playerSessions.Add(playerId, newSession);
|
|
||||||
return newSession;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void UpdateRepaintIndex(int rangeIndex)
|
|
||||||
{
|
|
||||||
_nextRepaintIndex = rangeIndex;
|
|
||||||
}
|
|
||||||
private void RepaintFrame(int repaintIndex)
|
|
||||||
{
|
|
||||||
var debugReport = _currentPlayerSession.GetDebugReport(repaintIndex);
|
|
||||||
if (debugReport != null)
|
|
||||||
{
|
|
||||||
_currentReport = debugReport;
|
|
||||||
_frameSlider.label = $"Frame: {debugReport.FrameCount}";
|
|
||||||
|
|
||||||
if (_viewMode == EViewMode.AssetView)
|
|
||||||
{
|
|
||||||
_assetListViewer.FillViewData(debugReport);
|
|
||||||
_bundleListViewer.ClearView();
|
|
||||||
_operationListViewer.ClearView();
|
|
||||||
}
|
|
||||||
else if (_viewMode == EViewMode.BundleView)
|
|
||||||
{
|
|
||||||
_assetListViewer.ClearView();
|
|
||||||
_bundleListViewer.FillViewData(debugReport);
|
|
||||||
_operationListViewer.ClearView();
|
|
||||||
}
|
|
||||||
else if (_viewMode == EViewMode.OperationView)
|
|
||||||
{
|
|
||||||
_assetListViewer.ClearView();
|
|
||||||
_bundleListViewer.ClearView();
|
|
||||||
_operationListViewer.FillViewData(debugReport);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new System.NotImplementedException(_viewMode.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
|
@ -1,13 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace YooAsset.Editor
|
namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
internal class RemotePlayerSession
|
internal class RemotePlayerSession
|
||||||
{
|
{
|
||||||
private readonly Queue<DebugReport> _reports = new Queue<DebugReport>();
|
private readonly List<DebugReport> _reportList = new List<DebugReport>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户ID
|
/// 用户ID
|
||||||
|
@ -30,7 +29,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
int index = _reports.Count - 1;
|
int index = _reportList.Count - 1;
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0;
|
index = 0;
|
||||||
return index;
|
return index;
|
||||||
|
@ -38,7 +37,7 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public RemotePlayerSession(int playerId, int maxReportCount = 500)
|
public RemotePlayerSession(int playerId, int maxReportCount = 1000)
|
||||||
{
|
{
|
||||||
PlayerId = playerId;
|
PlayerId = playerId;
|
||||||
MaxReportCount = maxReportCount;
|
MaxReportCount = maxReportCount;
|
||||||
|
@ -49,7 +48,7 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearDebugReport()
|
public void ClearDebugReport()
|
||||||
{
|
{
|
||||||
_reports.Clear();
|
_reportList.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -60,9 +59,9 @@ namespace YooAsset.Editor
|
||||||
if (report == null)
|
if (report == null)
|
||||||
Debug.LogWarning("Invalid debug report data !");
|
Debug.LogWarning("Invalid debug report data !");
|
||||||
|
|
||||||
if (_reports.Count >= MaxReportCount)
|
if (_reportList.Count >= MaxReportCount)
|
||||||
_reports.Dequeue();
|
_reportList.RemoveAt(0);
|
||||||
_reports.Enqueue(report);
|
_reportList.Add(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -70,11 +69,11 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DebugReport GetDebugReport(int rangeIndex)
|
public DebugReport GetDebugReport(int rangeIndex)
|
||||||
{
|
{
|
||||||
if (_reports.Count == 0)
|
if (_reportList.Count == 0)
|
||||||
return null;
|
return null;
|
||||||
if (rangeIndex < 0 || rangeIndex >= _reports.Count)
|
if (rangeIndex < 0 || rangeIndex >= _reportList.Count)
|
||||||
return null;
|
return null;
|
||||||
return _reports.ElementAt(rangeIndex);
|
return _reportList[rangeIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -279,7 +279,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
StyleColor textColor;
|
StyleColor textColor;
|
||||||
var dependTableData = data as DependTableData;
|
var dependTableData = data as DependTableData;
|
||||||
if (dependTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
if (dependTableData.BundleInfo.Status == EOperationStatus.Failed)
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
|
@ -332,10 +332,8 @@ namespace YooAsset.Editor
|
||||||
public void ClearView()
|
public void ClearView()
|
||||||
{
|
{
|
||||||
_providerTableView.ClearAll(false, true);
|
_providerTableView.ClearAll(false, true);
|
||||||
_providerTableView.RebuildView();
|
|
||||||
|
|
||||||
_dependTableView.ClearAll(false, true);
|
_dependTableView.ClearAll(false, true);
|
||||||
_dependTableView.RebuildView();
|
RebuildView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -344,12 +342,10 @@ namespace YooAsset.Editor
|
||||||
public void RebuildView(string searchKeyWord)
|
public void RebuildView(string searchKeyWord)
|
||||||
{
|
{
|
||||||
// 搜索匹配
|
// 搜索匹配
|
||||||
if (_sourceDatas != null)
|
|
||||||
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
||||||
|
|
||||||
// 重建视图
|
// 重建视图
|
||||||
_providerTableView.RebuildView();
|
_providerTableView.RebuildView();
|
||||||
_dependTableView.RebuildView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -151,7 +151,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
StyleColor textColor;
|
StyleColor textColor;
|
||||||
var bundleTableData = data as BundleTableData;
|
var bundleTableData = data as BundleTableData;
|
||||||
if (bundleTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
if (bundleTableData.BundleInfo.Status == EOperationStatus.Failed)
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
|
@ -341,7 +341,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
StyleColor textColor;
|
StyleColor textColor;
|
||||||
var feferenceTableData = data as ReferenceTableData;
|
var feferenceTableData = data as ReferenceTableData;
|
||||||
if (feferenceTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
if (feferenceTableData.BundleInfo.Status == EOperationStatus.Failed)
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
|
@ -393,10 +393,8 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_bundleTableView.ClearAll(false, true);
|
_bundleTableView.ClearAll(false, true);
|
||||||
_bundleTableView.RebuildView();
|
_bundleTableView.RebuildView();
|
||||||
|
|
||||||
_usingTableView.ClearAll(false, true);
|
_usingTableView.ClearAll(false, true);
|
||||||
_usingTableView.RebuildView();
|
_usingTableView.RebuildView();
|
||||||
|
|
||||||
_referenceTableView.ClearAll(false, true);
|
_referenceTableView.ClearAll(false, true);
|
||||||
_referenceTableView.RebuildView();
|
_referenceTableView.RebuildView();
|
||||||
}
|
}
|
||||||
|
@ -407,13 +405,10 @@ namespace YooAsset.Editor
|
||||||
public void RebuildView(string searchKeyWord)
|
public void RebuildView(string searchKeyWord)
|
||||||
{
|
{
|
||||||
// 搜索匹配
|
// 搜索匹配
|
||||||
if(_sourceDatas != null)
|
|
||||||
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
||||||
|
|
||||||
// 重建视图
|
// 重建视图
|
||||||
_bundleTableView.RebuildView();
|
_bundleTableView.RebuildView();
|
||||||
_usingTableView.RebuildView();
|
|
||||||
_referenceTableView.RebuildView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -337,10 +337,8 @@ namespace YooAsset.Editor
|
||||||
public void ClearView()
|
public void ClearView()
|
||||||
{
|
{
|
||||||
_operationTableView.ClearAll(false, true);
|
_operationTableView.ClearAll(false, true);
|
||||||
_operationTableView.RebuildView();
|
|
||||||
|
|
||||||
_childTreeView.ClearAll();
|
_childTreeView.ClearAll();
|
||||||
_childTreeView.RebuildView();
|
RebuildView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -349,7 +347,6 @@ namespace YooAsset.Editor
|
||||||
public void RebuildView(string searchKeyWord)
|
public void RebuildView(string searchKeyWord)
|
||||||
{
|
{
|
||||||
// 搜索匹配
|
// 搜索匹配
|
||||||
if(_sourceDatas != null)
|
|
||||||
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
||||||
|
|
||||||
// 重建视图
|
// 重建视图
|
||||||
|
@ -449,7 +446,7 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
private void BindTreeViewItem(VisualElement container, object userData)
|
private void BindTreeViewItem(VisualElement container, object userData)
|
||||||
{
|
{
|
||||||
var operationInfo = (DebugOperationInfo)userData;
|
var operationInfo = userData as DebugOperationInfo;
|
||||||
|
|
||||||
// OperationName
|
// OperationName
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal struct DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
internal class DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包名称
|
/// 资源包名称
|
||||||
|
@ -20,7 +20,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载状态
|
/// 加载状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Status;
|
public EOperationStatus Status;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 谁引用了该资源包
|
/// 谁引用了该资源包
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal struct DebugOperationInfo : IComparer<DebugOperationInfo>, IComparable<DebugOperationInfo>
|
internal class DebugOperationInfo : IComparer<DebugOperationInfo>, IComparable<DebugOperationInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务名称
|
/// 任务名称
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace YooAsset
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnityEngine.Debug.LogError($"Can not found {nameof(DebugBundleInfo)} : {bundleName}");
|
UnityEngine.Debug.LogError($"Can not found {nameof(DebugBundleInfo)} : {bundleName}");
|
||||||
return default;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal struct DebugProviderInfo : IComparer<DebugProviderInfo>, IComparable<DebugProviderInfo>
|
internal class DebugProviderInfo : IComparer<DebugProviderInfo>, IComparable<DebugProviderInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 包裹名
|
/// 包裹名
|
||||||
|
|
|
@ -385,7 +385,7 @@ namespace YooAsset
|
||||||
var bundleInfo = new DebugBundleInfo();
|
var bundleInfo = new DebugBundleInfo();
|
||||||
bundleInfo.BundleName = packageBundle.BundleName;
|
bundleInfo.BundleName = packageBundle.BundleName;
|
||||||
bundleInfo.RefCount = bundleLoader.RefCount;
|
bundleInfo.RefCount = bundleLoader.RefCount;
|
||||||
bundleInfo.Status = bundleLoader.Status.ToString();
|
bundleInfo.Status = bundleLoader.Status;
|
||||||
bundleInfo.ReferenceBundles = FilterReferenceBundles(packageBundle);
|
bundleInfo.ReferenceBundles = FilterReferenceBundles(packageBundle);
|
||||||
result.Add(bundleInfo);
|
result.Add(bundleInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
public static class YooAssetSettingsData
|
internal static class YooAssetSettingsData
|
||||||
{
|
{
|
||||||
private static YooAssetSettings _setting = null;
|
private static YooAssetSettings _setting = null;
|
||||||
internal static YooAssetSettings Setting
|
public static YooAssetSettings Setting
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -33,15 +33,6 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取YooAsset文件夹名称
|
|
||||||
/// </summary>
|
|
||||||
public static string GetDefaultYooFolderName()
|
|
||||||
{
|
|
||||||
return Setting.DefaultYooFolderName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取构建报告文件名
|
/// 获取构建报告文件名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -101,7 +92,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的Resources目录的加载路径
|
/// 获取YOO的Resources目录的加载路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooResourcesLoadPath(string packageName, string fileName)
|
public static string GetYooResourcesLoadPath(string packageName, string fileName)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return PathUtility.Combine(packageName, fileName);
|
return PathUtility.Combine(packageName, fileName);
|
||||||
|
@ -112,7 +103,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的Resources目录的全路径
|
/// 获取YOO的Resources目录的全路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooResourcesFullPath()
|
public static string GetYooResourcesFullPath()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return $"Assets/Resources";
|
return $"Assets/Resources";
|
||||||
|
@ -123,7 +114,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的编辑器下缓存文件根目录
|
/// 获取YOO的编辑器下缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooEditorCacheRoot()
|
public static string GetYooEditorCacheRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
{
|
{
|
||||||
|
@ -141,9 +132,9 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的PC平台缓存文件根目录
|
/// 获取YOO的PC端缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooStandaloneWinCacheRoot()
|
public static string GetYooStandaloneCacheRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return Application.dataPath;
|
return Application.dataPath;
|
||||||
|
@ -152,31 +143,9 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的Linux平台缓存文件根目录
|
/// 获取YOO的移动端缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooStandaloneLinuxCacheRoot()
|
public static string GetYooMobileCacheRoot()
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
|
||||||
return Application.dataPath;
|
|
||||||
else
|
|
||||||
return PathUtility.Combine(Application.dataPath, Setting.DefaultYooFolderName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取YOO的Mac平台缓存文件根目录
|
|
||||||
/// </summary>
|
|
||||||
internal static string GetYooStandaloneMacCacheRoot()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
|
||||||
return Application.persistentDataPath;
|
|
||||||
else
|
|
||||||
return PathUtility.Combine(Application.persistentDataPath, Setting.DefaultYooFolderName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取YOO的移动平台缓存文件根目录
|
|
||||||
/// </summary>
|
|
||||||
internal static string GetYooMobileCacheRoot()
|
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return Application.persistentDataPath;
|
return Application.persistentDataPath;
|
||||||
|
@ -187,16 +156,12 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO默认的缓存文件根目录
|
/// 获取YOO默认的缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooDefaultCacheRoot()
|
public static string GetYooDefaultCacheRoot()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
return GetYooEditorCacheRoot();
|
return GetYooEditorCacheRoot();
|
||||||
#elif UNITY_STANDALONE_WIN
|
#elif UNITY_STANDALONE
|
||||||
return GetYooStandaloneWinCacheRoot();
|
return GetYooStandaloneCacheRoot();
|
||||||
#elif UNITY_STANDALONE_LINUX
|
|
||||||
return GetYooStandaloneLinuxCacheRoot();
|
|
||||||
#elif UNITY_STANDALONE_OSX
|
|
||||||
return GetYooStandaloneMacCacheRoot();
|
|
||||||
#else
|
#else
|
||||||
return GetYooMobileCacheRoot();
|
return GetYooMobileCacheRoot();
|
||||||
#endif
|
#endif
|
||||||
|
@ -205,7 +170,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO默认的内置文件根目录
|
/// 获取YOO默认的内置文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string GetYooDefaultBuildinRoot()
|
public static string GetYooDefaultBuildinRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return Application.streamingAssetsPath;
|
return Application.streamingAssetsPath;
|
||||||
|
|
Loading…
Reference in New Issue