Exemple #1
0
        protected override void InitCanvas()
        {
            titleContent = new GUIContent("AI Designer");
            base.InitCanvas();
            GraphCanvas.LocalRect = new Rect(-50000, -50000, 100000, 100000);

            mWires = new BTWireGUI(this);
            GraphCanvas.AddElement(mWires);

            AIGraph           = new EditorGUICanvas();
            AIGraph.LocalRect = new Rect(-50000, -50000, 100000, 100000);
            GraphCanvas.AddElement(AIGraph);

            RootNode = new BTRootNodeGUI(this);
            AIGraph.AddElement(RootNode);

            BlackboardMonitor           = new BlackboardMonitorGUI(this);
            BlackboardMonitor.LocalRect = new Rect(0, 0, 200, 180);
            RootCanvas.AddElement(BlackboardMonitor);

            HelpBox           = new BehaviourHelpGUI();
            HelpBox.SortOrder = -10;
            RootCanvas.AddElement(HelpBox);

            mSelectionRect         = new EditorSelection();
            mSelectionRect.Visible = false;
            GraphCanvas.AddElement(mSelectionRect);

            Tip = new TipBox();
            RootCanvas.AddElement(Tip);

            RootCanvas.Resort(true);
        }
Exemple #2
0
        public void Show(EditorGUICanvas canvas, Vector2 localPos)
        {
            if (Parent != null || canvas == null)
            {
                return;
            }
            Installizer.contentStyle.fontSize = 12;
            Vector2 size = Installizer.SizeOfContent(mText ?? "") + new Vector2(10, 10);
            Rect    r    = new Rect();

            r.size     = size;
            r.position = localPos - r.size * 0.5f;
            LocalRect  = r;
            mTick      = JDateTime.NowMillies;
            canvas.AddElement(this);
        }
        protected virtual void InitCanvas()
        {
            RootCanvas       = new EditorGUICanvas();
            RootCanvas.Pivot = new Vector2(0, 0);

            ScaledCanvas           = new EditorGUICanvas();
            ScaledCanvas.SortOrder = -1;
            RootCanvas.AddElement(ScaledCanvas);

            GraphCanvas = new EditorGUICanvas();
            ScaledCanvas.AddElement(GraphCanvas);

            GraphCanvas.GridLineColor = new Color(0.2f, 0.2f, 0.2f, 1f);
            GraphCanvas.ShowGridLine  = true;
            GraphCanvas.GridSize      = 100;
            GraphCanvas.LocalRect     = new Rect(-10000, -10000, 20000, 20000);
        }