Move all calls from Debug to DebugHelper

This commit is contained in:
Denis-Cosmin Nutiu 2019-06-12 23:27:32 +03:00
parent ec3ca2dd9d
commit 0da7155279
3 changed files with 12 additions and 11 deletions

View file

@ -1,4 +1,5 @@
using System; using System;
using src.Helpers;
using UnityEngine; using UnityEngine;
namespace src.Base namespace src.Base
@ -25,7 +26,7 @@ namespace src.Base
public void onExplosion() public void onExplosion()
{ {
Debug.Log("Player hit by explosion"); DebugHelper.LogInfo("Player hit by explosion");
} }
} }
} }

View file

@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using src.Base; using src.Base;
using src.Helpers; using src.Helpers;
using src.Wall; using src.Wall;
@ -73,13 +72,13 @@ namespace src.Managers
{ {
if (_destructibleWalls.Count == 0) if (_destructibleWalls.Count == 0)
{ {
Debug.LogWarning("No destructible walls left, cannot spawn upgrade."); DebugHelper.LogWarning("No destructible walls left, cannot spawn upgrade.");
continue; continue;
} }
/* Get the destructible wall script and make it to spawn the upgrade */ /* Get the destructible wall script and make it to spawn the upgrade */
var wall = _destructibleWalls.PopRandom().GetComponent<DestructibleWall>(); 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(); wall.SpawnsUpgrade();
} }
} }
@ -94,7 +93,7 @@ namespace src.Managers
/* Get the destructible wall script and make it to spawn the exit */ /* Get the destructible wall script and make it to spawn the exit */
var wall = _destructibleWalls.PopRandom().GetComponent<DestructibleWall>(); 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(); wall.SpawnsExit();
} }
@ -159,7 +158,7 @@ namespace src.Managers
private void PlaceDestructibleTile(Vector3 position) 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 randomWall = destructibleWallPrefabs.ChoseRandom();
var instance = Instantiate(randomWall, position, Quaternion.identity); var instance = Instantiate(randomWall, position, Quaternion.identity);
_destructibleWalls.Add(instance); _destructibleWalls.Add(instance);
@ -168,7 +167,7 @@ namespace src.Managers
private bool PlaceIndestructibleTile(float x, float y) 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 absX = Mathf.RoundToInt(x);
var absY = Mathf.RoundToInt(y); var absY = Mathf.RoundToInt(y);

View file

@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using src.Base; using src.Base;
using src.Helpers;
namespace src.Wall namespace src.Wall
{ {
@ -31,19 +32,19 @@ namespace src.Wall
Instantiate(explosionPrefab, currentPosition, Quaternion.identity); Instantiate(explosionPrefab, currentPosition, Quaternion.identity);
if (_spawnExit) if (_spawnExit)
{ {
Debug.Log($"Destructible spawned exit {transform.position}"); DebugHelper.LogInfo($"Destructible spawned exit {transform.position}");
Instantiate(exitDoorPrefab, currentPosition, Quaternion.identity); Instantiate(exitDoorPrefab, currentPosition, Quaternion.identity);
} }
else if (_spawnUpgrade) else if (_spawnUpgrade)
{ {
Debug.Log($"Destructible spawned upgrade {transform.position}"); DebugHelper.LogInfo($"Destructible spawned upgrade {transform.position}");
// TODO: Get and instantiate upgrade from manager // TODO: Get and instantiate upgrade from manager
} }
} }
public void onExplosion() public void onExplosion()
{ {
Debug.Log($"Destructible wall hit by explosion {transform.position}"); DebugHelper.LogInfo($"Destructible wall hit by explosion {transform.position}");
BeforeDestroy(); BeforeDestroy();
Destroy(gameObject); Destroy(gameObject);
} }