Share via


SimpleConsole Class

Definition

A simple runtime console to help in debugging on device.

public class SimpleConsole : UnityEngine.MonoBehaviour
type SimpleConsole = class
    inherit MonoBehaviour
Public Class SimpleConsole
Inherits MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
SimpleConsole

Remarks

The system accepts a verbosity level along with each line of text. If the system is enabled, If the verbosity level is >= the logVerbosity the line is written to the Unity log file via Debug.Log(). If the verbosity level is >= the screenVerbosity the line will be displayed on screen. If the system is NOT enabled If the verbosity level is >= 5 the line is written to the Unity log file. To enable the system: 1) Add a SimpleConsole component to any game object in the scene. 2) Fill in the SimpleConsole's TextMesh console field with a valid TextMesh. Ideally, place the console TextMesh where it can be seen. If enabled, then every frame the last lineCount lines added are displayed on the console TextMesh, where lineCount is an inspector accessible property below. Use is thread safe, and from threads besides the main thread.

Constructors

SimpleConsole()

Fields

console
logVerbosity
screenVerbosity

Properties

Active

Whether the onscreen component is active.

LineCount

The maximum number of lines to display.

LogFile

Methods

AddLine(Int32, String)

Static helper for adding a line of text for output.

Applies to