[MenuItem("Edit/ClearConsole %#c", false, 37)]
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);
}
网友评论