Unity编辑器:清空控制台(Console)

 1 static MethodInfo clearMethod = null;
 2     /// <summary>
 3     /// 清空log信息
 4     /// </summary>
 5     private static void ClearConsole()
 6     {
 7         if (clearMethod == null)
 8         {
 9             Type log = typeof(EditorWindow).Assembly.GetType("UnityEditor.LogEntries");
10             clearMethod = log.GetMethod("Clear");
11         }
12         clearMethod.Invoke(null, null);
13     }

 

posted @ 2018-12-06 10:45  吃斤欢乐豆  阅读(1726)  评论(0编辑  收藏  举报