1
This commit is contained in:
41
Packages/Editor/ReferencesTable.cs
Normal file
41
Packages/Editor/ReferencesTable.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Linq;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using BITKit;
|
||||
using BITKit.UX;
|
||||
namespace BITKit.Editors
|
||||
{
|
||||
public class ReferenceEditor : EditorWindow
|
||||
{
|
||||
VisualElement root;
|
||||
ListView listView;
|
||||
[MenuItem("Tools/References Editor")]
|
||||
static void Open()
|
||||
{
|
||||
var window = EditorWindow.GetWindow<ReferenceEditor>();
|
||||
//window.titleContent = new("Reference Editor");
|
||||
window.Show();
|
||||
Debug.Log("Show");
|
||||
}
|
||||
public void CreateGUI()
|
||||
{
|
||||
root = Addressables.LoadAssetAsync<VisualTreeAsset>(nameof(ReferenceEditor)).WaitForCompletion().CloneTree();
|
||||
rootVisualElement.Add(root);
|
||||
|
||||
listView = root.Q<ListView>(UXConstant.ContextListView);
|
||||
|
||||
var allList = AssetDatabase
|
||||
.FindAssets($"t:{nameof(ReferenceSO)}")
|
||||
.Select(x => AssetDatabase.GUIDToAssetPath(x))
|
||||
.Select(x => AssetDatabase.LoadAssetAtPath<ReferenceSO>(x))
|
||||
.ToList();
|
||||
|
||||
listView.itemsSource = allList;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user