예제 #1
0
        public static void Open <T>(PWGraph graph) where T : PWGraphEditor
        {
            PWGraphEditor editor = EditorWindow.GetWindow <T>();

            editor.LoadGraph(graph);
            editor.Show();
        }
예제 #2
0
        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);
        }