Move all calls from Debug to DebugHelper
This commit is contained in:
parent
ec3ca2dd9d
commit
0da7155279
3 changed files with 12 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using src.Helpers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace src.Base
|
||||
|
@ -25,7 +26,7 @@ namespace src.Base
|
|||
|
||||
public void onExplosion()
|
||||
{
|
||||
Debug.Log("Player hit by explosion");
|
||||
DebugHelper.LogInfo("Player hit by explosion");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using src.Base;
|
||||
using src.Helpers;
|
||||
using src.Wall;
|
||||
|
@ -73,13 +72,13 @@ namespace src.Managers
|
|||
{
|
||||
if (_destructibleWalls.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("No destructible walls left, cannot spawn upgrade.");
|
||||
DebugHelper.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<DestructibleWall>();
|
||||
Debug.Log($"Spawned upgrade at: x:{wall.XCoordinate} y:{wall.YCoordinate}");
|
||||
DebugHelper.LogInfo($"Spawned upgrade at: x:{wall.XCoordinate} y:{wall.YCoordinate}");
|
||||
wall.SpawnsUpgrade();
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +93,7 @@ namespace src.Managers
|
|||
|
||||
/* Get the destructible wall script and make it to spawn the exit */
|
||||
var wall = _destructibleWalls.PopRandom().GetComponent<DestructibleWall>();
|
||||
Debug.Log($"Spawned exit at: x:{wall.XCoordinate} y:{wall.YCoordinate}");
|
||||
DebugHelper.LogInfo($"Spawned exit at: x:{wall.XCoordinate} y:{wall.YCoordinate}");
|
||||
wall.SpawnsExit();
|
||||
}
|
||||
|
||||
|
@ -159,7 +158,7 @@ namespace src.Managers
|
|||
|
||||
private void PlaceDestructibleTile(Vector3 position)
|
||||
{
|
||||
Debug.Log($"PlaceDestructibleTile: x:{position.x} y:{position.y}");
|
||||
DebugHelper.LogInfo($"PlaceDestructibleTile: x:{position.x} y:{position.y}");
|
||||
var randomWall = destructibleWallPrefabs.ChoseRandom();
|
||||
var instance = Instantiate(randomWall, position, Quaternion.identity);
|
||||
_destructibleWalls.Add(instance);
|
||||
|
@ -168,7 +167,7 @@ namespace src.Managers
|
|||
|
||||
private bool PlaceIndestructibleTile(float x, float y)
|
||||
{
|
||||
Debug.Log($"PlaceIndestructibleTile: x:{x} y:{y}");
|
||||
DebugHelper.LogInfo($"PlaceIndestructibleTile: x:{x} y:{y}");
|
||||
var absX = Mathf.RoundToInt(x);
|
||||
var absY = Mathf.RoundToInt(y);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using UnityEngine;
|
||||
|
||||
using src.Base;
|
||||
using src.Helpers;
|
||||
|
||||
namespace src.Wall
|
||||
{
|
||||
|
@ -31,19 +32,19 @@ namespace src.Wall
|
|||
Instantiate(explosionPrefab, currentPosition, Quaternion.identity);
|
||||
if (_spawnExit)
|
||||
{
|
||||
Debug.Log($"Destructible spawned exit {transform.position}");
|
||||
DebugHelper.LogInfo($"Destructible spawned exit {transform.position}");
|
||||
Instantiate(exitDoorPrefab, currentPosition, Quaternion.identity);
|
||||
}
|
||||
else if (_spawnUpgrade)
|
||||
{
|
||||
Debug.Log($"Destructible spawned upgrade {transform.position}");
|
||||
DebugHelper.LogInfo($"Destructible spawned upgrade {transform.position}");
|
||||
// TODO: Get and instantiate upgrade from manager
|
||||
}
|
||||
}
|
||||
|
||||
public void onExplosion()
|
||||
{
|
||||
Debug.Log($"Destructible wall hit by explosion {transform.position}");
|
||||
DebugHelper.LogInfo($"Destructible wall hit by explosion {transform.position}");
|
||||
BeforeDestroy();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue