Created
February 19, 2020 23:39
-
-
Save wonkee-kim/3cfc0f1ea9e3c9ba0ed8acdebed2c7df to your computer and use it in GitHub Desktop.
Display Unity's console screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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