Exemple #1
0
        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();
        }
Exemple #3
0
 public EdgeConnectorListener(LogicGraphEditorView logicGraphEditorView, SearchWindowProvider searchWindowProvider)
 {
     _logicGraphEditorView = logicGraphEditorView;
     _searchWindowProvider = searchWindowProvider;
 }
Exemple #4
0
 void Update()
 {
     LogicGraphEditorView.HandleGraphChanges();
 }
Exemple #5
0
 void OnPostLayout(GeometryChangedEvent evt)
 {
     LogicGraphEditorView.UnregisterCallback <GeometryChangedEvent>(OnPostLayout);
     LogicGraphEditorView.LogicGraphView.FrameAll();
 }