Exemplo n.º 1
0
        public void OnDisable()
        {
            SaveSplitterPosition();

            m_ExpressionGraph.nodeChanged      -= OnNodePropertiesChanged;
            m_ExpressionGraph.graphChanged     -= OnGraphChanged;
            m_ExpressionGraph.selectionChanged -= OnSelectionChanged;
            m_ExpressionGraph.Dispose();
            m_ExpressionGraph = null;

            m_NodeEditor.propertiesChanged -= OnNodePropertiesChanged;
            m_NodeEditor.variableAdded     -= OnNodeVariableAdded;
            m_NodeEditor.variableRemoved   -= OnNodeVariableRemoved;
            m_NodeEditor.variableRenamed   -= OnNodeVariableRenamed;
            m_NodeEditor.Dispose();
            m_NodeEditor = null;

            m_Expression.Dispose();
            m_Expression = null;
        }
Exemplo n.º 2
0
        public void OnEnable()
        {
            m_Expression      = new SearchExpression(SearchSettings.GetContextOptions());
            m_ExpressionGraph = new ExpressionGraph(m_Expression);

            titleContent = new GUIContent("Expression Builder", Icons.quicksearch);

            #if UNITY_2020_2_OR_NEWER
            wantsLessLayoutEvents = true;
            #endif

            BuildUI();
            Reload();

            m_ExpressionGraph.nodeChanged      += OnNodePropertiesChanged;
            m_ExpressionGraph.graphChanged     += OnGraphChanged;
            m_ExpressionGraph.selectionChanged += OnSelectionChanged;
            m_NodeEditor.propertiesChanged     += OnNodePropertiesChanged;
            m_NodeEditor.variableAdded         += OnNodeVariableAdded;
            m_NodeEditor.variableRemoved       += OnNodeVariableRemoved;
            m_NodeEditor.variableRenamed       += OnNodeVariableRenamed;
        }