您的位置:首页 > 移动开发 > Unity3D

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

2016-02-07 19:06 323 查看
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()也可以用,但稍微麻烦点。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: