From 66a91cb6188c27b8835d14b2f3660bfe3a043efb Mon Sep 17 00:00:00 2001 From: Denis NUTIU Date: Sat, 13 Jul 2019 18:35:29 +0300 Subject: [PATCH] Implement LogVerbose & update level manager's logging --- Assets/Scripts/src/Helpers/DebugHelper.cs | 10 ++++++++++ Assets/Scripts/src/Managers/LevelManager.cs | 7 +++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/src/Helpers/DebugHelper.cs b/Assets/Scripts/src/Helpers/DebugHelper.cs index d23b438..d252efc 100644 --- a/Assets/Scripts/src/Helpers/DebugHelper.cs +++ b/Assets/Scripts/src/Helpers/DebugHelper.cs @@ -8,6 +8,16 @@ namespace src.Helpers { 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) { if (Debug.isDebugBuild) diff --git a/Assets/Scripts/src/Managers/LevelManager.cs b/Assets/Scripts/src/Managers/LevelManager.cs index ee08e68..ac35ea2 100644 --- a/Assets/Scripts/src/Managers/LevelManager.cs +++ b/Assets/Scripts/src/Managers/LevelManager.cs @@ -164,8 +164,7 @@ namespace src.Managers private void PlaceDestructibleTile(Vector3 position) { - // TODO ADD ENUMS AND DEFINES TO THE LOGGING SYSTEM -// DebugHelper.LogInfo($"PlaceDestructibleTile: x:{position.x} y:{position.y}"); + DebugHelper.LogVerbose($"PlaceDestructibleTile: x:{position.x} y:{position.y}"); var randomWall = destructibleWallPrefabs.ChoseRandom(); var instance = Instantiate(randomWall, position, Quaternion.identity); _destructibleWalls.Add(instance); @@ -174,7 +173,7 @@ namespace src.Managers 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 absY = Mathf.RoundToInt(y); @@ -208,7 +207,7 @@ namespace src.Managers 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 instance = Instantiate(randomEnemy, position, Quaternion.identity); _enemies.Add(instance);