public static void Open <T>(PWGraph graph) where T : PWGraphEditor { PWGraphEditor editor = EditorWindow.GetWindow <T>(); editor.LoadGraph(graph); editor.Show(); }
public static bool OnOpenAssetAttribute(int instanceId, int line) { object instance = EditorUtility.InstanceIDToObject(instanceId); //if selected object is not a graph if (!editorTypeTable.ContainsKey(instance.GetType())) { return(false); } //open Graph window: PWGraphEditor window = (PWGraphEditor)EditorWindow.GetWindow(editorTypeTable[instance.GetType()]); window.Show(); window.LoadGraph(instance as PWGraph); return(false); }