Skip to content

Instantly share code, notes, and snippets.

@shinriyo
Created December 29, 2012 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinriyo/4405518 to your computer and use it in GitHub Desktop.
Save shinriyo/4405518 to your computer and use it in GitHub Desktop.
#if !UNITY_EDITOR
#define DEBUG_LOG_OVERWRAP
#endif
using UnityEngine;
#if DEBUG_LOG_OVERWRAP
public static class Debug
{
static public void Break ()
{
if (IsEnable ())
{
UnityEngine.Debug.Break ();
}
}
static public void Log (object message)
{
if (IsEnable ()) {
UnityEngine.Debug.Log (message);
}
}
static public void Log (object message, Object context)
{
if (IsEnable ()) {
UnityEngine.Debug.Log (message, context);
}
}
static public void LogWarning (object message)
{
if (IsEnable ()) {
UnityEngine.Debug.LogWarning (message);
}
}
static public void LogWarning (object message, Object context)
{
if (IsEnable ()) {
UnityEngine.Debug.LogWarning (message, context);
}
}
static public void LogError (object message)
{
if (IsEnable ()) {
UnityEngine.Debug.LogError (message);
}
}
static public void LogError (object message, Object context)
{
if (IsEnable ()) {
UnityEngine.Debug.LogError (message, context);
}
}
static public void DrawLine (Vector3 start, Vector3 end, Color color, float duration = 0.0F, bool depthTest = true)
{
UnityEngine.Debug.DrawLine(start, end, color, duration, depthTest);
}
static bool IsEnable ()
{
return UnityEngine.Debug.isDebugBuild;
}
}
#endif
@shinriyo
Copy link
Author

UnityのDebug用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment