Now exits build mode after placing

This commit is contained in:
BOT Alex 2024-04-21 02:25:19 +02:00
parent 8dd3dcefab
commit 51d699a7d6
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,9 @@ public class TowerPlacementManager : MonoBehaviour
var spawnedTower = Instantiate(towerPrefab, CurrentSelectedSlot.transform); var spawnedTower = Instantiate(towerPrefab, CurrentSelectedSlot.transform);
Quaternion newRotation = Quaternion.AngleAxis(CurrentRotation * 90f, transform.up); Quaternion newRotation = Quaternion.AngleAxis(CurrentRotation * 90f, transform.up);
spawnedTower.transform.localRotation = newRotation; spawnedTower.transform.localRotation = newRotation;
Destroy(SilhouettedObject);
OnTowerPlaced?.Invoke(SelectedTowerInfo);
} }
public void OnSlotHovered(SlotManager slot, GridManager grid, int x, int y) public void OnSlotHovered(SlotManager slot, GridManager grid, int x, int y)