diff --git a/Assets/Scripts/src/Managers/LevelManager.cs b/Assets/Scripts/src/Managers/LevelManager.cs index 082d64d..211d64b 100644 --- a/Assets/Scripts/src/Managers/LevelManager.cs +++ b/Assets/Scripts/src/Managers/LevelManager.cs @@ -76,9 +76,10 @@ namespace src.Managers Debug.LogWarning("No destructible walls left, cannot spawn upgrade."); continue; } - + /* Get the destructible wall script and make it to spawn the upgrade */ var wall = _destructibleWalls.PopRandom().GetComponent(); + Debug.Log($"Spawned upgrade at: x:{wall.XCoordinate} y:{wall.YCoordinate}"); wall.SpawnsUpgrade(); } } @@ -90,8 +91,10 @@ namespace src.Managers Debug.LogWarning("No destructible walls found, cannot spawn exit!"); return; } + /* Get the destructible wall script and make it to spawn the exit */ var wall = _destructibleWalls.PopRandom().GetComponent(); + Debug.Log($"Spawned exit at: x:{wall.XCoordinate} y:{wall.YCoordinate}"); wall.SpawnsExit(); } @@ -156,6 +159,7 @@ namespace src.Managers private void PlaceDestructibleTile(Vector3 position) { + Debug.Log($"PlaceDestructibleTile: x:{position.x} y:{position.y}"); var instance = Instantiate(destructibleWallPrefab, position, Quaternion.identity); _destructibleWalls.Add(instance); instance.transform.SetParent(boardHolder); diff --git a/Assets/Scripts/src/Wall/DestructibleWall.cs b/Assets/Scripts/src/Wall/DestructibleWall.cs index 33bc1c4..733801e 100644 --- a/Assets/Scripts/src/Wall/DestructibleWall.cs +++ b/Assets/Scripts/src/Wall/DestructibleWall.cs @@ -16,13 +16,17 @@ namespace src.Wall { _spawnUpgrade = true; } - + + public float XCoordinate => transform.position.x; + public float YCoordinate => transform.position.y; + public void OnDestroy() { if (_spawnExit) { // TODO Spawn an exit - } else if (_spawnUpgrade) + } + else if (_spawnUpgrade) { // TODO Spawn an upgrade, use composition to UpgradeManager // to get random / desired upgrade