Unity在编辑器状态下清空控制台信息

public static void ClearConsole()
{
    var assembly = System.Reflection.Assembly.GetAssembly(typeof(UnityEditor.ActiveEditorTracker));
    var type = assembly.GetType("UnityEditorInternal.LogEntries");
    var method = type.GetMethod("Clear");
    method.Invoke(new object(), null);
}

 

出处:http://answers.unity3d.com/questions/578393/clear-console-through-code-in-development-build.html

 

Debug.ClearDeveloperConsole()也可以用,但稍麻烦些。

转载于:https://www.cnblogs.com/hont/p/5184791.html

你可能感兴趣的:(Unity在编辑器状态下清空控制台信息)