Example #1
0
        public View(BTEditorWindow owner)
        {
            this.owner = owner;
            mCanvas    = new Rect(0, 0, owner.position.width, owner.position.height);

            BTEditorManager.onPaste += OnPaste;
        }
Example #2
0
        public override void OnInspectorGUI()
        {
            if (BTEditorManager.SelectTree != null)
            {
                if (BTEditorManager.SelectTree.nodeDic.Count > 2)
                {
                    EditorGUILayout.LabelField(string.Format("{0} nodes",
                                                             BTEditorManager.SelectTree.nodeDic.Count - 1), TitleStyle);
                }
                else if (BTEditorManager.SelectTree.nodeDic.Count == 2)
                {
                    EditorGUILayout.LabelField("Empty", TitleStyle);
                }
                else
                {
                    EditorGUILayout.LabelField("1 node", TitleStyle);
                }
            }

            EditorGUILayout.Space();

            if (GUILayout.Button("Show Behavior Tree editor"))
            {
                BTEditorWindow.ShowWindow();
            }

            if (GUI.changed)
            {
                BTEditorManager.Dirty();
            }
        }
Example #3
0
        public static void ShowWindow()
        {
            BTEditorWindow window = EditorWindow.GetWindow <BTEditorWindow>("BehaviorDesigner");

            window.Show();
        }