/// <summary> /// Create a node and its behaviour from the type. /// </summary> /// <param name="nodeTypename"></param> internal BonsaiNode CreateNode(Type behaviourType, Core.BehaviourTree bt) { var behaviour = BonsaiSaveManager.CreateBehaviourNode(behaviourType, bt); var node = CreateNode(behaviour); return(node); }
void OnEnable() { GUIScaleUtility.CheckInit(); editor = new BonsaiEditor(); editor.window = this; BonsaiEditor.FetchBehaviourNodes(); inputHandler = new BonsaiInputHandler(this); saveManager = new BonsaiSaveManager(this); buildCanvas(); // Always start in edit mode. // // The only way it can be in view mode is if the window is // already opened and the user selects a game object with a // behaviour tree component. _mode = Mode.Edit; }