mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
添加引用分析
This commit is contained in:
34
UnityProject/Assets/Editor/ReferenceFinder/ClickColumn.cs
Normal file
34
UnityProject/Assets/Editor/ReferenceFinder/ClickColumn.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEditor.IMGUI.Controls;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
internal sealed class ClickColumn : MultiColumnHeader
|
||||
{
|
||||
public delegate void SortInColumn();
|
||||
|
||||
public static Dictionary<int, SortInColumn> SortWithIndex = new Dictionary<int, SortInColumn>
|
||||
{
|
||||
{ 0, SortByName },
|
||||
{ 1, SortByPath }
|
||||
};
|
||||
|
||||
public ClickColumn(MultiColumnHeaderState state) : base(state) => canSort = true;
|
||||
|
||||
protected override void ColumnHeaderClicked(MultiColumnHeaderState.Column column, int columnIndex)
|
||||
{
|
||||
base.ColumnHeaderClicked(column, columnIndex);
|
||||
if (SortWithIndex.ContainsKey(columnIndex))
|
||||
{
|
||||
SortWithIndex[columnIndex].Invoke();
|
||||
ResourceReferenceInfo curWindow = EditorWindow.GetWindow<ResourceReferenceInfo>();
|
||||
curWindow.mAssetTreeView.SortExpandItem();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SortByName() => SortHelper.SortByName();
|
||||
|
||||
public static void SortByPath() => SortHelper.SortByPath();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user