编辑器清除控制台日志

编辑器清除控制台日志


1
2
3
4
5
6
public static void ClearConsole()
{
var logEntries = System.Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll");
var clearMethod = logEntries.GetMethod("Clear", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
clearMethod.Invoke(null, null);
}

参考资料