Пример #1
0
 /// <summary>
 /// Returns an instance of the save utility for a given target graph view
 /// </summary>
 /// <param name="targetGraphView"></param>
 /// <returns></returns>
 public static GraphSaveUtility GetInstance(BTGraphView targetGraphView)
 {
     return(new GraphSaveUtility
     {
         _targetGraphView = targetGraphView
     });
 }
Пример #2
0
        /// <summary>
        /// Initializes search window for a given graph and editor window
        /// </summary>
        /// <param name="editorWindow"></param>
        /// <param name="graphView"></param>
        public void Init(BTEditorWindow editorWindow, BTGraphView graphView)
        {
            _editorWindow = editorWindow;
            _graphView    = graphView;

            // This is a hack to avoid wacky indentation because of wack unity stuff
            _indentationIcon = new Texture2D(1, 1);
            _indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0));
            _indentationIcon.Apply();
        }
Пример #3
0
 // Generate graph view to be displayed on top of window
 private void GenerateGraph()
 {
     _graphView = new BTGraphView(this)
     {
         name = "Behaviour Tree Editor"
     };
     fileLoadField = new ObjectField {
         objectType = typeof(BTDataContainer)
     };
     _graphView.StretchToParentSize();
     rootVisualElement.Add(_graphView);
 }