Unity graph tool solution based on different implementation now focused on Unity.Experimental.Graphview
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using TNode.Editor;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEditor.Callbacks;
|
|
|
|
|
using UnityEditor.Experimental.GraphView;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UIElements;
|
|
|
|
|
|
|
|
|
|
public class $EditorClassName$ : GraphEditor<$GraphClassName$>{
|
|
|
|
|
[OnOpenAsset]
|
|
|
|
|
public static bool OnOpenAsset(int instanceID, int line){
|
|
|
|
|
var graph = EditorUtility.InstanceIDToObject(instanceID) as $GraphClassName$;
|
|
|
|
|
if (graph != null)
|
|
|
|
|
{
|
|
|
|
|
$GraphClassName$ wnd = GetWindow<$EditorClassName$>();
|
|
|
|
|
wnd.titleContent = new GUIContent("$GraphClassName$ Editor");
|
|
|
|
|
wnd.CreateGUI();
|
|
|
|
|
wnd._graphView.Data = graph;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|