Guest User

Untitled

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. [MenuItem("Tools/ClearConsole")]
  2. private static void ClearConsole()
  3. {
  4. #if UNITY_5
  5. var logEntries = System.Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll");
  6. var clearMethod = logEntries.GetMethod("Clear", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
  7. clearMethod.Invoke(null,null);
  8. #elif UNITY_2017
  9. var assembly = Assembly.GetAssembly(typeof(SceneView));
  10. var type = assembly.GetType("UnityEditor.LogEntries");
  11. var method = type.GetMethod("Clear");
  12. method.Invoke(new object(), null);
  13. #endif
  14. }
Add Comment
Please, Sign In to add comment