SCRIPTING API / Time, input and debug / Debug
Debug
Writes messages to the Console panel in the editor, to the player's log in a shipped game and to the server log on the dedicated server. Errors and warnings are coloured and counted in the editor's status bar.
Kindclass
NamespaceKroys.EngineScripting
Members3
Source
Debug.csEXAMPLE
In a script
A complete script that uses Debug; copy it into your scripts project.
Core.cs
public sealed class HealthCheck : EntityScript { protected override void OnStart() { if (!Health.Has(Entity)) { Debug.LogError($"{Entity.Name} needs a Health component"); return; } if (!RigidBody.Has(Entity)) Debug.LogWarning($"{Entity.Name} has no Rigid Body; it will not react to hits"); Debug.Log($"{Entity.Name} ready at {Transform.WorldPosition}"); } }
REFERENCE
Members
Methods
#public static void Log(string message)Writes an informational message.
#public static void LogWarning(string message)Writes a warning message.
#public static void LogError(string message)Writes an error message.
Signatures
public static void Log(string message) public static void LogWarning(string message) public static void LogError(string message)
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.