KROYSDOCS
HomeWhat's newv0.1.0

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
SourceDebug.cs
EXAMPLE

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.
methodstatic
#public static void LogWarning(string message)
Writes a warning message.
methodstatic
#public static void LogError(string message)
Writes an error message.
methodstatic
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.