3D: версия на экране, отладочная сетка, сборка APK одной кнопкой и починка сборки Android

This commit is contained in:
2026-11-05 15:12:19 +03:00
parent 88f460a4a6
commit e26eeaffaf
11 changed files with 324 additions and 4 deletions
+14 -2
View File
@@ -99,6 +99,17 @@ public class City3DController : MonoBehaviour, City3DSave.ILive
if (UIPanelManager.Instance != null) UIPanelManager.Instance.CloseAll();
}
// Отладочная сетка (05.11, просьба Миши): видна всегда, ярче, каждая 5-я линия жёлтая -- примерять референсы.
// Включается кнопкой "Сетка" в панели DEV.
public static bool DebugGrid { get; private set; }
public static void SetDebugGrid(bool on)
{
DebugGrid = on;
var city = FindAnyObjectByType<City3DController>();
if (city != null && city.map != null) city.RefreshGround();
}
bool stateApplied; // сохранённый город уже поставлен (в первом кадре, после загрузки сохранения в Start)
void OnEnable()
@@ -324,7 +335,7 @@ public class City3DController : MonoBehaviour, City3DSave.ILive
void RefreshGround()
{
int n = City3DLayout.Size, px = PixelsPerCell;
bool grid = mode != Mode.View;
bool grid = mode != Mode.View || DebugGrid;
var pixels = new Color32[n * px * n * px];
for (int y = 0; y < n; y++)
for (int x = 0; x < n; x++)
@@ -349,7 +360,8 @@ public class City3DController : MonoBehaviour, City3DSave.ILive
for (int ix = 0; ix < px; ix++)
{
Color p = c;
if (grid && (ix == 0 || iy == 0)) p *= 0.85f; // линии клеток
if (grid && (ix == 0 || iy == 0)) p *= DebugGrid ? 0.55f : 0.85f; // линии клеток
if (DebugGrid && ((ix == 0 && x % 5 == 0) || (iy == 0 && y % 5 == 0))) p = new Color(1f, 0.85f, 0.2f); // каждая 5-я
// граница открытой зоны -- светлая линия
if (grid && open && (ix == 0 && !map.IsOpen(x - 1, y, townHallLevel) || ix == px - 1 && !map.IsOpen(x + 1, y, townHallLevel)
|| iy == 0 && !map.IsOpen(x, y - 1, townHallLevel) || iy == px - 1 && !map.IsOpen(x, y + 1, townHallLevel)))