コード例 #1
0
        /// <summary>
        /// Отладочная информация поля
        /// </summary>
        private void DrawHelpers()
        {
            var cells = ReflectionTool.GetField <CellCollection>(Target, "_cells");

            if (cells == null)
            {
                return;
            }

            var currentCellPos = ReflectionTool.GetField <Vector2Int>(Target, "_currentCellPosition");

            var zoom = ReflectionTool.GetField <ZoomControl>(Target, "_zoom");

            var precision = zoom.GetZoomPrecision();

            for (int i = 0; i < cells._cells.Length; i++)
            {
                var cell = cells._cells[i];

                if (cell == null)
                {
                    continue;
                }

                var rect = cell.GetRect(precision);

                bool isVisible = cells.IsFullGeneratedCell(currentCellPos, cell.Pos);

                DrawRect(rect, isVisible ? Color.blue : Color.red, 1f, precision);
            }
        }