Here fix this…
using System.Reflection;
using UnityEditor;
public static void Misc_ClearLogConsole() {
Assembly assembly = Assembly.GetAssembly (typeof(SceneView));
Type logEntries = assembly.GetType ("UnityEditorInternal.LogEntries");
MethodInfo clearConsoleMethod = logEntries.GetMethod ("Clear");
clearConsoleMethod.Invoke (new object (), null);
}
and this…
public static void F_ClearLog()
{
//Debug.ClearDeveloperConsole();
//Assembly SampleAssembly = Assembly.GetAssembly(typeof(UnityEditorInternal.Macros));
Assembly SampleAssembly = Assembly.GetAssembly(typeof(UnityEditorInternal.ComponentUtility));
if (SampleAssembly == null)
{
Debug.LogError("!!! (SampleAssembly == null)");
}
else
{
Type type = SampleAssembly.GetType("UnityEditorInternal.LogEntries");
if (type == null)
{
Debug.LogError("!!! (type == null)");
}
else
{
MethodInfo method = type.GetMethod("Clear");
if (method == null)
{
Debug.LogError("!!! (method == null)");
}
else
{
method.Invoke(new object(), null);
}
}
}
}
and this…
using System;
using System.Reflection;
public static class DebugConsole
{
public static void Clear()
{
Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll")
.GetMethod("Clear", BindingFlags.Static | BindingFlags.Public)
.Invoke(null,null);
}
}