SerializedObject GetBehaviourTreeObject()
 {
     if (_BehaviourTreeObject == null)
     {
         SubBehaviourTree subBehaviourTree = target as SubBehaviourTree;
         BehaviourTree    subBT            = subBehaviourTree.subBT;
         if (subBT != null)
         {
             _BehaviourTreeObject = new SerializedObject(subBT);
         }
     }
     return(_BehaviourTreeObject);
 }
        static void SaveToPrefab(MenuCommand command)
        {
            SubBehaviourTree behaviour = command.context as SubBehaviourTree;
            NodeGraph        nodeGraph = behaviour.subBT;

            string path = EditorUtility.SaveFilePanelInProject(Localization.GetWord("Save To Prefab"), nodeGraph.graphName, "prefab", "");

            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            Clipboard.SaveToPrefab(path, nodeGraph);
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            SubBehaviourTree subBehaviourTree = target as SubBehaviourTree;
            NodeGraph        nodeGraph        = subBehaviourTree.subBT;

            if (GUILayout.Button("Open " + nodeGraph.displayGraphName, ArborEditor.Styles.largeButton))
            {
                if (graphEditor != null)
                {
                    graphEditor.hostWindow.ChangeCurrentNodeGraph(nodeGraph);
                }
            }

            argumentListEditor.DoLayoutList();

            serializedObject.ApplyModifiedProperties();

            OnBehaviourTreeGUI();
        }