Пример #1
0
    protected override void OnSceneGUI()
    {
        Map map = target;

        Cell[,] cells = map.m_cells;

        if (cells == null)
        {
            return;
        }

        float x = map.transform.position.x - 0.5f * Constants.CELL_WIDTH;
        float y = map.transform.position.y - 0.5f * Constants.CELL_HEIGHT;

        for (int i = 0; i < map.rows; ++i)
        {
            for (int j = 0; j < map.cols; ++j)
            {
                Cell cell = cells [i, j];
                if (cell != null)
                {
                    DebugEx.DrawRect(x + cell.x, y + cell.y, Constants.CELL_WIDTH, Constants.CELL_HEIGHT);
                }
            }
        }
    }