private void OnEnable()
 {
     m_graphNode = target as BTEditorGraphNode;
     if (m_graphNode != null)
     {
         m_nodeInspector = BTNodeInspectorFactory.CreateInspectorForNode(m_graphNode);
     }
     else
     {
         m_nodeInspector = null;
     }
 }
        public static NodeInspector CreateInspectorForNode(BTEditorGraphNode graphNode)
        {
            if (graphNode != null && graphNode.Node != null)
            {
                Type inspectorType = GetInspectorTypeForNode(graphNode.Node.GetType());
                if (inspectorType != null)
                {
                    NodeInspector inspector = Activator.CreateInstance(inspectorType) as NodeInspector;
                    inspector.Target    = graphNode.Node;
                    inspector.GraphNode = graphNode;

                    return(inspector);
                }
            }

            return(null);
        }