34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.FrameAnimation.Editor
|
|
{
|
|
[CustomEditor(typeof(FrameAnimationGraph))]
|
|
public sealed class FrameAnimationGraphEditor : UnityEditor.Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
var graph = (FrameAnimationGraph)target;
|
|
EditorGUILayout.LabelField("FrameAnimationGraph", EditorStyles.boldLabel);
|
|
using (new EditorGUI.DisabledScope(true))
|
|
{
|
|
EditorGUILayout.TextField("ID", graph.Id);
|
|
EditorGUILayout.TextField("Display Name", graph.DisplayName);
|
|
EditorGUILayout.IntField("Clips", graph.Clips.Count);
|
|
EditorGUILayout.IntField("Nodes", graph.Nodes.Count);
|
|
EditorGUILayout.IntField("Edges", graph.Edges.Count);
|
|
EditorGUILayout.IntField("Flows", graph.Flows.Count);
|
|
EditorGUILayout.IntField("Import Sources", graph.ImportSources.Count);
|
|
EditorGUILayout.TextField("Default Playable", graph.Settings?.DefaultPlayableId ?? string.Empty);
|
|
}
|
|
EditorGUILayout.HelpBox(
|
|
"Graph 的资源、来源、重命名和删除操作只能在主工作台中执行。",
|
|
MessageType.Info);
|
|
if (GUILayout.Button("Open Frame Animation Graph Editor"))
|
|
{
|
|
FrameAnimationGraphEditorWindow.Open(graph);
|
|
}
|
|
}
|
|
}
|
|
}
|