diff --git a/Assets/_Project/Scripts/Gameplay/TowerPlacementController.cs b/Assets/_Project/Scripts/Gameplay/TowerPlacementController.cs index 3b71743..9b1db7c 100644 --- a/Assets/_Project/Scripts/Gameplay/TowerPlacementController.cs +++ b/Assets/_Project/Scripts/Gameplay/TowerPlacementController.cs @@ -55,7 +55,7 @@ namespace TD.Gameplay // ----- Active-placement state ------------------------------------- // Null when placement mode is inactive. - private TowerDefinition activeDef; + private TowerDefinition activeTowerDefinition; private int activeTowerTypeId; // Set true by a single-shot placement submit; processed at the top of the next @@ -112,7 +112,7 @@ namespace TD.Gameplay return; } - if (activeDef == null) return; // idle — nothing to do + if (activeTowerDefinition == null) return; // idle — nothing to do var mouse = Mouse.current; if (mouse == null) return; // no mouse device connected @@ -137,10 +137,10 @@ namespace TD.Gameplay SetGhostVisible(true); // Compute the footprint anchor from the hit point. - Vector2Int anchor = ComputeAnchor(hitPoint, activeDef.FootprintSize); + Vector2Int anchor = ComputeAnchor(hitPoint, activeTowerDefinition.FootprintSize); // Position the cursor ghost at the footprint center. - Vector3 ghostPos = GridCoordinates.GetFootprintCenterWorld(anchor, activeDef.FootprintSize); + Vector3 ghostPos = GridCoordinates.GetFootprintCenterWorld(anchor, activeTowerDefinition.FootprintSize); ghostPos.y = 0.5f; // lift off the plane so the cube base sits flush ghostGO.transform.position = ghostPos; @@ -150,7 +150,7 @@ namespace TD.Gameplay { lastAnchor = anchor; lastAnchorValid = true; - lastPlacementValid = EvaluateLocalValidity(anchor, activeDef); + lastPlacementValid = EvaluateLocalValidity(anchor, activeTowerDefinition); } // Update ghost color. @@ -182,7 +182,7 @@ namespace TD.Gameplay // Cancel any existing placement before starting a new one. ExitPlacementMode(); - activeDef = def; + activeTowerDefinition = def; activeTowerTypeId = towerTypeId; CreateGhost(def); @@ -193,7 +193,7 @@ namespace TD.Gameplay /// void ExitPlacementMode() { - activeDef = null; + activeTowerDefinition = null; activeTowerTypeId = 0; lastAnchorValid = false; @@ -203,7 +203,7 @@ namespace TD.Gameplay /// /// True when placement mode is currently active. /// - public bool IsPlacing => activeDef != null; + public bool IsPlacing => activeTowerDefinition != null; // ----- Modifier helpers -------------------------------------------