protected override void OnSceneGUI(NavMeshPainter targetPainter)
        {
            NavMeshEditorUtils.ClearBrush();
            var t = target as NavMeshBoxTool;

            if (t == null)
            {
                return;
            }
            if (m_IsDragging)
            {
                NavMeshEditorUtils.DrawBounds(t.bounds, Color.blue);
            }
            else
            {
                NavMeshEditorUtils.DrawWireCube(t.beginPos, new Vector3(1, t.bottomHeight + t.topHeight, 1), Color.blue);
            }
            if (Event.current.type == EventType.MouseUp)
            {
                if (m_IsDragging)
                {
                    m_IsDragging = false;
                    ApplyPaint();
                }
            }
        }
Esempio n. 2
0
        protected override void OnSceneGUI(NavMeshPainter targetPainter)
        {
            var t = this.target as NavMeshBrushTool;

            if (t != null)
            {
                NavMeshEditorUtils.DrawBounds(t.bounds, Color.blue);
                NavMeshEditorUtils.DrawBrush(targetPainter.renderMeshs, Matrix4x4.identity, t.position, t.length, t.width, t.height,
                                             t.brushType);
            }
        }