mirror of https://github.com/tuyoogame/YooAsset
parent
d03bca5512
commit
a7cafcb328
|
@ -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 = () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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 = () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue