From c71750a059d19b5e5490cd6abd6af7e355779e56 Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:35:35 +0200 Subject: [PATCH] Grid spawner gap now x and y independendt --- Assets/Scripts/PlacementSystem/GridManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/PlacementSystem/GridManager.cs b/Assets/Scripts/PlacementSystem/GridManager.cs index 329022f..cbd870e 100644 --- a/Assets/Scripts/PlacementSystem/GridManager.cs +++ b/Assets/Scripts/PlacementSystem/GridManager.cs @@ -6,7 +6,7 @@ using UnityEngine; public class GridManager : MonoBehaviour { [SerializeField] private Vector2Int GridSize; - [SerializeField] private float Gap = 0.1f; + [SerializeField] private Vector2 Gap; [SerializeField] private GridType gridType = GridType.Primary; [Space(10)] [SerializeField] private GameObject TowerSlotPrefab; @@ -37,7 +37,7 @@ public class GridManager : MonoBehaviour for (int y = 0; y < GridSize.y; y++) { // Spawn slot - Vector3 spawnPosition = new(x * (Gap + 1) + 0.5f, 0, y * (Gap + 1) + 0.5f); + Vector3 spawnPosition = new(x * (Gap.x + 1) + 0.5f, 0, y * (Gap.y + 1) + 0.5f); var spawned = Instantiate(TowerSlotPrefab, transform); spawned.transform.localPosition = spawnPosition;