Skip to content

Instantly share code, notes, and snippets.

@Refsa
Created October 11, 2019 02:19
Show Gist options
  • Save Refsa/9d2530529bcc1216ceba163c14812bd8 to your computer and use it in GitHub Desktop.
Save Refsa/9d2530529bcc1216ceba163c14812bd8 to your computer and use it in GitHub Desktop.
Clear the content of the debug console window
using UnityEngine;
public static class DebugExtensions
{
public static void ClearConsole ()
{
var logentries = System.Type.GetType ("UnityEditor.LogEntries, UnityEditor.dll");
var clearmethod = logentries.GetMethod ("Clear", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
clearmethod.Invoke (null, null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment