Example #1
0
        public static void OpenWindow()
        {
            editor                = GetWindow <BehaviourEditorWindow>();
            editor.minSize        = new Vector2(600, 300);
            editor.titleContent   = new GUIContent("Behaviour Editor");
            editor._curWindowSize = editor.position.size;
            editor._menuRect      = editor.GetMenuRect();

            nodeCanvas    = new NodeCanvas(editor.GetCanvasRect());
            nodeInspector = new NodeInspector(editor.GetInspectorRect(), nodeCanvas);

            Selection.selectionChanged += TryLoadSelectedAsset;

            NodeFactory.FetchNodes();
            NodePanelFactory.FetchCustomPanels();
            CustomFieldDrawerManager.FetchCustomFieldDrawers();

            // tries to load the selected asset if it is a behaviour tree when the window is open
            // and also when the assembly is reloaded
            TryLoadSelectedAsset();
        }
Example #2
0
 public override NodePanel Create(Node node, CanvasState canvasState)
 {
     return(NodePanelFactory.CreateDefaultNodePanel(node, canvasState));
 }