From 9d544f7687d922a7f5bd769af6dd397b87f6c915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Tue, 11 Jun 2019 20:10:16 +0300 Subject: [PATCH] Implement DebugHelper class --- Assets/Scripts/src/Helpers/DebugHelper.cs | 59 +++++++++++++++++++ .../Scripts/src/Helpers/DebugHelper.cs.meta | 3 + 2 files changed, 62 insertions(+) create mode 100644 Assets/Scripts/src/Helpers/DebugHelper.cs create mode 100644 Assets/Scripts/src/Helpers/DebugHelper.cs.meta diff --git a/Assets/Scripts/src/Helpers/DebugHelper.cs b/Assets/Scripts/src/Helpers/DebugHelper.cs new file mode 100644 index 0000000..d23b438 --- /dev/null +++ b/Assets/Scripts/src/Helpers/DebugHelper.cs @@ -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); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/src/Helpers/DebugHelper.cs.meta b/Assets/Scripts/src/Helpers/DebugHelper.cs.meta new file mode 100644 index 0000000..653b2f7 --- /dev/null +++ b/Assets/Scripts/src/Helpers/DebugHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 36a93a2c984d44bd8d65a9a3ad28894e +timeCreated: 1560272684 \ No newline at end of file