public void Initialize(string guid) { try { _selectedGuid = guid; var asset = AssetDatabase.LoadAssetAtPath <Object>(AssetDatabase.GUIDToAssetPath(guid)); var path = AssetDatabase.GetAssetPath(asset); var textGraph = File.ReadAllText(path, Encoding.UTF8); _logicGraphEditorObject = CreateInstance <LogicGraphEditorObject>(); LogicGraphData logicGraphData = JsonUtility.FromJson <LogicGraphData>(textGraph); _logicGraphEditorObject.Initialize(logicGraphData); LogicGraphEditorView = new LogicGraphEditorView(this, _logicGraphEditorObject); LogicGraphEditorView.RegisterCallback <GeometryChangedEvent>(OnPostLayout); titleContent = new GUIContent(_logicGraphEditorObject.name); Repaint(); } catch (Exception) { _graphEditorView = null; _logicGraphEditorObject = null; throw; } }
public void Initialize(LogicGraphEditorWindow editorWindow, LogicGraphEditorView logicGraphEditorView, LogicGraphView graphView) { _editorWindow = editorWindow; _logicGraphEditorView = logicGraphEditorView; _graphView = graphView; // Transparent icon to trick search window into indenting items m_Icon = new Texture2D(1, 1); m_Icon.SetPixel(0, 0, new Color(0, 0, 0, 0)); m_Icon.Apply(); }
public EdgeConnectorListener(LogicGraphEditorView logicGraphEditorView, SearchWindowProvider searchWindowProvider) { _logicGraphEditorView = logicGraphEditorView; _searchWindowProvider = searchWindowProvider; }
void Update() { LogicGraphEditorView.HandleGraphChanges(); }
void OnPostLayout(GeometryChangedEvent evt) { LogicGraphEditorView.UnregisterCallback <GeometryChangedEvent>(OnPostLayout); LogicGraphEditorView.LogicGraphView.FrameAll(); }