Implement DebugHelper class
This commit is contained in:
parent
263c53245e
commit
9d544f7687
2 changed files with 62 additions and 0 deletions
59
Assets/Scripts/src/Helpers/DebugHelper.cs
Normal file
59
Assets/Scripts/src/Helpers/DebugHelper.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/src/Helpers/DebugHelper.cs.meta
Normal file
3
Assets/Scripts/src/Helpers/DebugHelper.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 36a93a2c984d44bd8d65a9a3ad28894e
|
||||
timeCreated: 1560272684
|
Loading…
Reference in a new issue