Implement LogVerbose & update level manager's logging

This commit is contained in:
Denis-Cosmin Nutiu 2019-07-13 18:35:29 +03:00
parent ffa46c2426
commit 66a91cb618
2 changed files with 13 additions and 4 deletions

View file

@ -8,6 +8,16 @@ namespace src.Helpers
{ {
public static class DebugHelper public static class DebugHelper
{ {
public static void LogVerbose(string message)
{
#if LOG_VERBOSE
if (Debug.isDebugBuild)
{
Debug.Log(message);
}
#endif
}
public static void LogInfo(string message) public static void LogInfo(string message)
{ {
if (Debug.isDebugBuild) if (Debug.isDebugBuild)

View file

@ -164,8 +164,7 @@ namespace src.Managers
private void PlaceDestructibleTile(Vector3 position) private void PlaceDestructibleTile(Vector3 position)
{ {
// TODO ADD ENUMS AND DEFINES TO THE LOGGING SYSTEM DebugHelper.LogVerbose($"PlaceDestructibleTile: x:{position.x} y:{position.y}");
// DebugHelper.LogInfo($"PlaceDestructibleTile: x:{position.x} y:{position.y}");
var randomWall = destructibleWallPrefabs.ChoseRandom(); var randomWall = destructibleWallPrefabs.ChoseRandom();
var instance = Instantiate(randomWall, position, Quaternion.identity); var instance = Instantiate(randomWall, position, Quaternion.identity);
_destructibleWalls.Add(instance); _destructibleWalls.Add(instance);
@ -174,7 +173,7 @@ namespace src.Managers
private bool PlaceIndestructibleTile(float x, float y) private bool PlaceIndestructibleTile(float x, float y)
{ {
// DebugHelper.LogInfo($"PlaceIndestructibleTile: x:{x} y:{y}"); DebugHelper.LogVerbose($"PlaceIndestructibleTile: x:{x} y:{y}");
var absX = Mathf.RoundToInt(x); var absX = Mathf.RoundToInt(x);
var absY = Mathf.RoundToInt(y); var absY = Mathf.RoundToInt(y);
@ -208,7 +207,7 @@ namespace src.Managers
private bool PlaceEnemy(Vector3 position) private bool PlaceEnemy(Vector3 position)
{ {
// DebugHelper.LogInfo($"PlaceEnemy: x:{position.x} y:{position.y}"); DebugHelper.LogVerbose($"PlaceEnemy: x:{position.x} y:{position.y}");
var randomEnemy = enemiesPrefab.ChoseRandom(); var randomEnemy = enemiesPrefab.ChoseRandom();
var instance = Instantiate(randomEnemy, position, Quaternion.identity); var instance = Instantiate(randomEnemy, position, Quaternion.identity);
_enemies.Add(instance); _enemies.Add(instance);