Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [MenuItem("Tools/ClearConsole")]
- private static void ClearConsole()
- {
- #if UNITY_5
- 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);
- #elif UNITY_2017
- var assembly = Assembly.GetAssembly(typeof(SceneView));
- var type = assembly.GetType("UnityEditor.LogEntries");
- var method = type.GetMethod("Clear");
- method.Invoke(new object(), null);
- #endif
- }
Add Comment
Please, Sign In to add comment