Skip to content

Instantly share code, notes, and snippets.

@wonkee-kim
Created February 19, 2020 23:39
Show Gist options
  • Save wonkee-kim/3cfc0f1ea9e3c9ba0ed8acdebed2c7df to your computer and use it in GitHub Desktop.
Save wonkee-kim/3cfc0f1ea9e3c9ba0ed8acdebed2c7df to your computer and use it in GitHub Desktop.
Display Unity's console screen
using UnityEngine;
using UnityEngine.UI;
public class DisplayConsole :MonoBehaviour {
[SerializeField] Text text;
void OnEnable() {
Application.logMessageReceived += LogMessage;
}
void OnDisable() {
Application.logMessageReceived -= LogMessage;
}
public void LogMessage(string message, string stackTrace, LogType type) {
text.text += message + "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment