mirror of https://github.com/tuyoogame/YooAsset
Compare commits
3 Commits
ed9692574c
...
ddda9e29db
Author | SHA1 | Date |
---|---|---|
|
ddda9e29db | |
|
c2b33f5ec4 | |
|
e58999e484 |
|
@ -59,6 +59,10 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,6 +165,20 @@ 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)
|
||||||
{
|
{
|
||||||
|
@ -176,19 +194,20 @@ 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;
|
||||||
UpdateFrameView(_currentPlayerSession);
|
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); ;
|
||||||
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
UpdateRepaintIndex(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameLast_clicked()
|
private void OnFrameLast_clicked()
|
||||||
|
@ -197,7 +216,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex - 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
UpdateRepaintIndex(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameNext_clicked()
|
private void OnFrameNext_clicked()
|
||||||
|
@ -206,7 +225,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
_rangeIndex = _currentPlayerSession.ClampRangeIndex(_rangeIndex + 1);
|
||||||
_frameSlider.value = _rangeIndex;
|
_frameSlider.value = _rangeIndex;
|
||||||
UpdateFrameView(_currentPlayerSession, _rangeIndex);
|
UpdateRepaintIndex(_rangeIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OnFrameClear_clicked()
|
private void OnFrameClear_clicked()
|
||||||
|
@ -234,42 +253,6 @@ 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()
|
||||||
{
|
{
|
||||||
// 发送采集数据的命令
|
// 发送采集数据的命令
|
||||||
|
@ -347,6 +330,9 @@ 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)
|
||||||
|
@ -357,6 +343,56 @@ 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,12 +1,13 @@
|
||||||
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 List<DebugReport> _reportList = new List<DebugReport>();
|
private readonly Queue<DebugReport> _reports = new Queue<DebugReport>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户ID
|
/// 用户ID
|
||||||
|
@ -29,7 +30,7 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
int index = _reportList.Count - 1;
|
int index = _reports.Count - 1;
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0;
|
index = 0;
|
||||||
return index;
|
return index;
|
||||||
|
@ -37,7 +38,7 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public RemotePlayerSession(int playerId, int maxReportCount = 1000)
|
public RemotePlayerSession(int playerId, int maxReportCount = 500)
|
||||||
{
|
{
|
||||||
PlayerId = playerId;
|
PlayerId = playerId;
|
||||||
MaxReportCount = maxReportCount;
|
MaxReportCount = maxReportCount;
|
||||||
|
@ -48,7 +49,7 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearDebugReport()
|
public void ClearDebugReport()
|
||||||
{
|
{
|
||||||
_reportList.Clear();
|
_reports.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -59,9 +60,9 @@ namespace YooAsset.Editor
|
||||||
if (report == null)
|
if (report == null)
|
||||||
Debug.LogWarning("Invalid debug report data !");
|
Debug.LogWarning("Invalid debug report data !");
|
||||||
|
|
||||||
if (_reportList.Count >= MaxReportCount)
|
if (_reports.Count >= MaxReportCount)
|
||||||
_reportList.RemoveAt(0);
|
_reports.Dequeue();
|
||||||
_reportList.Add(report);
|
_reports.Enqueue(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -69,11 +70,11 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DebugReport GetDebugReport(int rangeIndex)
|
public DebugReport GetDebugReport(int rangeIndex)
|
||||||
{
|
{
|
||||||
if (_reportList.Count == 0)
|
if (_reports.Count == 0)
|
||||||
return null;
|
return null;
|
||||||
if (rangeIndex < 0 || rangeIndex >= _reportList.Count)
|
if (rangeIndex < 0 || rangeIndex >= _reports.Count)
|
||||||
return null;
|
return null;
|
||||||
return _reportList[rangeIndex];
|
return _reports.ElementAt(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)
|
if (dependTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
|
@ -332,8 +332,10 @@ 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);
|
||||||
RebuildView(null);
|
_dependTableView.RebuildView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -342,10 +344,12 @@ 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)
|
if (bundleTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
||||||
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)
|
if (feferenceTableData.BundleInfo.Status == EOperationStatus.Failed.ToString())
|
||||||
textColor = new StyleColor(Color.yellow);
|
textColor = new StyleColor(Color.yellow);
|
||||||
else
|
else
|
||||||
textColor = new StyleColor(Color.white);
|
textColor = new StyleColor(Color.white);
|
||||||
|
@ -393,8 +393,10 @@ 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();
|
||||||
}
|
}
|
||||||
|
@ -405,10 +407,13 @@ 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,8 +337,10 @@ namespace YooAsset.Editor
|
||||||
public void ClearView()
|
public void ClearView()
|
||||||
{
|
{
|
||||||
_operationTableView.ClearAll(false, true);
|
_operationTableView.ClearAll(false, true);
|
||||||
|
_operationTableView.RebuildView();
|
||||||
|
|
||||||
_childTreeView.ClearAll();
|
_childTreeView.ClearAll();
|
||||||
RebuildView(null);
|
_childTreeView.RebuildView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -347,6 +349,7 @@ namespace YooAsset.Editor
|
||||||
public void RebuildView(string searchKeyWord)
|
public void RebuildView(string searchKeyWord)
|
||||||
{
|
{
|
||||||
// 搜索匹配
|
// 搜索匹配
|
||||||
|
if(_sourceDatas != null)
|
||||||
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
DefaultSearchSystem.Search(_sourceDatas, searchKeyWord);
|
||||||
|
|
||||||
// 重建视图
|
// 重建视图
|
||||||
|
@ -446,7 +449,7 @@ namespace YooAsset.Editor
|
||||||
}
|
}
|
||||||
private void BindTreeViewItem(VisualElement container, object userData)
|
private void BindTreeViewItem(VisualElement container, object userData)
|
||||||
{
|
{
|
||||||
var operationInfo = userData as DebugOperationInfo;
|
var operationInfo = (DebugOperationInfo)userData;
|
||||||
|
|
||||||
// OperationName
|
// OperationName
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
internal struct DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包名称
|
/// 资源包名称
|
||||||
|
@ -20,7 +20,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载状态
|
/// 加载状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EOperationStatus Status;
|
public string Status;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 谁引用了该资源包
|
/// 谁引用了该资源包
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugOperationInfo : IComparer<DebugOperationInfo>, IComparable<DebugOperationInfo>
|
internal struct 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 null;
|
return default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugProviderInfo : IComparer<DebugProviderInfo>, IComparable<DebugProviderInfo>
|
internal struct 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;
|
bundleInfo.Status = bundleLoader.Status.ToString();
|
||||||
bundleInfo.ReferenceBundles = FilterReferenceBundles(packageBundle);
|
bundleInfo.ReferenceBundles = FilterReferenceBundles(packageBundle);
|
||||||
result.Add(bundleInfo);
|
result.Add(bundleInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal static class YooAssetSettingsData
|
public static class YooAssetSettingsData
|
||||||
{
|
{
|
||||||
private static YooAssetSettings _setting = null;
|
private static YooAssetSettings _setting = null;
|
||||||
public static YooAssetSettings Setting
|
internal static YooAssetSettings Setting
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,15 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取YooAsset文件夹名称
|
||||||
|
/// </summary>
|
||||||
|
public static string GetDefaultYooFolderName()
|
||||||
|
{
|
||||||
|
return Setting.DefaultYooFolderName;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取构建报告文件名
|
/// 获取构建报告文件名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -92,7 +101,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的Resources目录的加载路径
|
/// 获取YOO的Resources目录的加载路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooResourcesLoadPath(string packageName, string fileName)
|
internal 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);
|
||||||
|
@ -103,7 +112,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的Resources目录的全路径
|
/// 获取YOO的Resources目录的全路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooResourcesFullPath()
|
internal static string GetYooResourcesFullPath()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return $"Assets/Resources";
|
return $"Assets/Resources";
|
||||||
|
@ -114,7 +123,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的编辑器下缓存文件根目录
|
/// 获取YOO的编辑器下缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooEditorCacheRoot()
|
internal static string GetYooEditorCacheRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
{
|
{
|
||||||
|
@ -132,9 +141,9 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的PC端缓存文件根目录
|
/// 获取YOO的PC平台缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooStandaloneCacheRoot()
|
internal static string GetYooStandaloneWinCacheRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return Application.dataPath;
|
return Application.dataPath;
|
||||||
|
@ -143,9 +152,31 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO的移动端缓存文件根目录
|
/// 获取YOO的Linux平台缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooMobileCacheRoot()
|
internal static string GetYooStandaloneLinuxCacheRoot()
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
@ -156,12 +187,16 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO默认的缓存文件根目录
|
/// 获取YOO默认的缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooDefaultCacheRoot()
|
internal static string GetYooDefaultCacheRoot()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
return GetYooEditorCacheRoot();
|
return GetYooEditorCacheRoot();
|
||||||
#elif UNITY_STANDALONE
|
#elif UNITY_STANDALONE_WIN
|
||||||
return GetYooStandaloneCacheRoot();
|
return GetYooStandaloneWinCacheRoot();
|
||||||
|
#elif UNITY_STANDALONE_LINUX
|
||||||
|
return GetYooStandaloneLinuxCacheRoot();
|
||||||
|
#elif UNITY_STANDALONE_OSX
|
||||||
|
return GetYooStandaloneMacCacheRoot();
|
||||||
#else
|
#else
|
||||||
return GetYooMobileCacheRoot();
|
return GetYooMobileCacheRoot();
|
||||||
#endif
|
#endif
|
||||||
|
@ -170,7 +205,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取YOO默认的内置文件根目录
|
/// 获取YOO默认的内置文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetYooDefaultBuildinRoot()
|
internal static string GetYooDefaultBuildinRoot()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||||
return Application.streamingAssetsPath;
|
return Application.streamingAssetsPath;
|
||||||
|
|
Loading…
Reference in New Issue