-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDEBUG.cs
More file actions
34 lines (30 loc) · 1.09 KB
/
Copy pathDEBUG.cs
File metadata and controls
34 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace UnityCustomDebugger
{
using UnityEngine;
public class DEBUG : MonoBehaviour
{
public static void Log(string message, LogType logType = LogType.Log, StackTraceLogType stackTraceLogType = StackTraceLogType.ScriptOnly)
{
#if UNITY_EDITOR || UNITY
Application.SetStackTraceLogType(logType,stackTraceLogType);
Debug.Log(message);
#endif
}
public static void Warning(string message, LogType logType = LogType.Log, StackTraceLogType stackTraceLogType = StackTraceLogType.ScriptOnly)
{
#if UNITY_EDITOR || UNITY
Application.SetStackTraceLogType(logType,stackTraceLogType);
Debug.LogWarning(message);
#endif
}
public static void Error(string message, bool forceQuit = false, LogType logType = LogType.Log, StackTraceLogType stackTraceLogType = StackTraceLogType.ScriptOnly)
{
#if UNITY_EDITOR || UNITY
Application.SetStackTraceLogType(logType,stackTraceLogType);
Debug.LogError(message);
if (forceQuit)
UnityEditor.EditorApplication.isPlaying = false;
#endif
}
}
}