美文网首页
Unity 编辑器清理控制台

Unity 编辑器清理控制台

作者: 泱千澈 | 来源:发表于2019-10-15 18:15 被阅读0次
  [MenuItem("Assets/清理控制台")]
  public static void ConsoleClear()
  {
       Assembly assembly = Assembly.GetAssembly(typeof(SceneView));
       Type logEntries = assembly.GetType("UnityEditor.LogEntries");
       MethodInfo clearConsoleMethod = logEntries.GetMethod("Clear");
       clearConsoleMethod.Invoke(new object(), null);
  }

相关文章

网友评论

      本文标题:Unity 编辑器清理控制台

      本文链接:https://www.haomeiwen.com/subject/jgzsmctx.html