Implement DebugHelper class

This commit is contained in:
Denis-Cosmin Nutiu 2019-06-11 20:10:16 +03:00
parent 263c53245e
commit 9d544f7687
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,59 @@
using System;
using UnityEngine;
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMember.Local
// ReSharper disable ArrangeTypeMemberModifiers
namespace src.Helpers
{
public static class DebugHelper
{
public static void LogInfo(string message)
{
if (Debug.isDebugBuild)
{
Debug.Log(message);
}
}
public static void LogWarning(string message)
{
if (Debug.isDebugBuild)
{
Debug.LogWarning(message);
}
}
public static void LogError(string message)
{
if (Debug.isDebugBuild)
{
Debug.LogError(message);
}
}
public static void LogException(Exception ex)
{
if (Debug.isDebugBuild)
{
Debug.LogException(ex);
}
}
public static void DrawRay(Vector3 position, Vector3 direction, Color color)
{
if (Debug.isDebugBuild)
{
Debug.DrawRay(position, direction, color);
}
}
public static void DrawLine(Vector3 position, Vector3 direction, Color color)
{
if (Debug.isDebugBuild)
{
Debug.DrawLine(position, direction, color);
}
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 36a93a2c984d44bd8d65a9a3ad28894e
timeCreated: 1560272684