Scripting API

Debug

static class in UnityEngine · UnityEngine.CoreModule

14 of 25 of Unity's membersUnity's documentation
In Tassix

Logging to the engine console; messages also reach Application.logMessageReceived.

Properties 1

static bool isDebugBuild { get; }

Methods 13

static void Assert(bool condition)
static void Assert(bool condition, object message)
static void Assert(bool condition, string message)

Logs an assertion failure when the condition is false (Unity: in development builds).

static void Break()
static void ClearDeveloperConsole()
static void DrawLine(Vector3 start, Vector3 end)
static void DrawLine(Vector3 start, Vector3 end, Color color, float duration = 0f, bool depthTest = true)
static void DrawLine(Vector3 start, Vector3 end, Color color, float duration)
static void DrawLine(Vector3 start, Vector3 end, Color color)

Scene-view lines arrive with gizmos; until then these draw nothing.

static void DrawRay(Vector3 start, Vector3 dir)
static void DrawRay(Vector3 start, Vector3 dir, Color color, float duration = 0f, bool depthTest = true)
static void DrawRay(Vector3 start, Vector3 dir, Color color, float duration)
static void DrawRay(Vector3 start, Vector3 dir, Color color)
static void Log(object message)
static void Log(object message, Object? context)
static void LogAssertion(object message)
static void LogError(object message)
static void LogError(object message, Object? context)
static void LogErrorFormat(string format, params object[] args)
static void LogException(Exception exception)
static void LogException(Exception exception, Object? context)

As Unity's console shows one: "Type: message" as the line, its stack (and its inner exceptions') kept apart.

static void LogFormat(string format, params object[] args)
static void LogWarning(object message)
static void LogWarning(object message, Object? context)
static void LogWarningFormat(string format, params object[] args)

Not in Tassix yet 11

(constructor) AssertFormat CheckIntegrity DebugBreak ExtractStackTraceNoAlloc IsValidationLevelEnabled LogAssertionFormat RetrieveStartupLogs developerConsoleEnabled developerConsoleVisible unityLogger