Ejemplo n.º 1
0
        private void DoNodes()
        {
            DoTransitions();
            DoChildIndex();

            if (Agent.Nodes.Count > 0)
            {
                for (int i = 0; i < Agent.Nodes.Count; i++)
                {
                    NodeDesigner node = Agent.Nodes[i];
                    DoNode(node, false);
                }
            }

            ZoomableArea.End();
            NodeContextMenu();
        }
Ejemplo n.º 2
0
        protected override void OnGUI()
        {
            GetCanvasSize();

            mainToolbar.OnGUI();

            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginHorizontal(GUILayout.Width(propertyRect.width));
                {
                    GUILayout.BeginVertical();
                    GUILayout.EndVertical();
                }
                GUILayout.EndHorizontal();

                GUILayout.FlexibleSpace();

                GUILayout.BeginHorizontal();
                {
                    ZoomableArea.Begin(new Rect(propertyRect.width, 0f, scaledCanvasSize.width, scaledCanvasSize.height + 21), scale, IsDocked);
                    Begin();

                    if (Agent != null)
                    {
                        DoNodes();
                    }
                    else
                    {
                        ZoomableArea.End();
                    }
                    End();

                    preferencesRect.x -= propertyRect.width;
                    if (centerView)
                    {
                        CenterView();
                        centerView = false;
                    }

                    //GUI.Label(new Rect(5, 20, 300, 200), "Right click to create a node.", BehaviorTreeEditorStyles.instructionLabel);
                    Event ev = Event.current;
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndHorizontal();
        }