public static bool OnOpenAsset(int instanceID, int line) { MoronGraph graph; String path; path = AssetDatabase.GetAssetPath(instanceID); graph = AssetDatabase.LoadAssetAtPath <MoronGraph>(path); if (graph == null) { return(false); } MoronEditorWindow.graph = graph; EditorWindow.GetWindow <MoronEditorWindow>().Show(); return(true); }
public void OnSelectionChange() { MoronThinker thinker; if (!Application.isPlaying) { return; } if (Selection.activeGameObject == null) { return; } thinker = Selection.activeGameObject.GetComponent <MoronThinker>(); if (thinker == null) { return; } graph = thinker.logic; buildGuidMap(thinker); Repaint(); }