首页 > 其他分享 >unity3d 清空控制台

unity3d 清空控制台

时间:2023-09-21 15:59:59浏览次数:60  
标签:unity3d Reflection System 清空 using 控制台

unity3d 清空控制台

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using UnityEngine.UI;
using AssemblyCSharp;


using System;

#if UNITY_EDITOR
using UnityEditor;
#endif

public class VCClearConsole : MonoBehaviour {

    // Use this for initialization
    void Start () {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Time.frameCount % 2000 == 0)
        {
            //ClearConsole();
            ClearConsole2();
        }
    }

    #region
    /// <summary>
    /// unity3d新版本,清空控制台
    /// </summary>
    public static void ClearConsole()
    {

        System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(SceneView));
        Type logEntries = assembly.GetType("UnityEditor.LogEntries");
        System.Reflection.MethodInfo clearConsoleMethod = logEntries.GetMethod("Clear");
        clearConsoleMethod.Invoke(new object(), null);
    }
    #endregion


    #region
    /// <summary>
    /// unity3d旧版本,清空控制台
    /// </summary>
    public static void ClearConsole2()
    {
        var logEntries = System.Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll");
        var clearMethod = logEntries.GetMethod("Clear", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
        clearMethod.Invoke(null, null);
    }
    #endregion
}

 

 

 

##########################

标签:unity3d,Reflection,System,清空,using,控制台
From: https://www.cnblogs.com/herd/p/17562618.html

相关文章

  • 3.基本语法和浏览器控制台的使用
    掌握浏览器控制台的使用方法:源码,控制台,断点调试,应用<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Title</title><script>//语法和Java差不多,更加简单//变量varvars......
  • HCIA-项目试验1:配置Console控制台认证
    <Huawei>system-view[Huawei][Huawei]user-interfaceconsole0[Huawei-ui-console0]disthis#user-interfacecon0user-interfacevty04#return[Huawei-ui-console0]auth[Huawei-ui-console0]authentication-modepassword[Huawei-ui-console0][Huawei-......
  • 控制台游戏1.0
    `includeincludeincludeusingnamespacestd;classGame{public:Game(){this->energy=this->energy2=0;this->HP=this->HP2=100;this->round=1;}voidstart(){cout<<"Welcometomagicfight!"<<endl;st......
  • Python 获取控制台输入的值
    获取控制台输入参数if__name__=='__main__':while1:question=input('用户:')answer="你的问题是:"+questionprint('VipQA',answer)......
  • 文件操作(判断状态、删除、新建、复制、清空文件内容、获取文件长度)
     判断状态#include<io.h>int_access(constchar*path,intmode);返回值:0表示允许访问,-1表示禁止访问CreateFileHANDLEhFile=CreateFile("c://123.bmp",GENERIC_WRITE|GENERIC_READ,OPEN_EXISTING,//OPEN_EXISTINGFILE_ATTRIBUTE_NORMAL,NULL);......
  • 【小沐学Unity3d】3ds Max 骨骼动画制作(蒙皮修改器skin)
    1、简介“蒙皮”修改器是一种骨骼变形工具,主要设计用于通过另一个对象对一个对象进行变形来创建角色动画。可使用骨骼、样条线和其他对象变形网格、面片和NURBS对象。如果将“蒙皮”修改器应用到网格,然后使用修改器指定骨骼,则每个骨骼都将收到一个胶囊形状的“封套”。这些封......
  • springboot+html使用sql语句能够在控制台输出相关数据信息list,但是输出的list=null(未
    问题描述具体来说,就是,连接上数据库之后,发现查询的sql语句能够正常在控制台输出数据,但是将sql语句的查询结果放到list里面,在控制台输出的list=[null];真的崩溃了!!!之前从来没有遇到过这种情况;尝试了网上的各种方法,也都解决不了,麻木ing~求解!......
  • AES解密控制台打印出乱码解决方法
    使用其它方法控制台一直打印出乱码,后来使用了这种方法,一下就解决乱码问题。代码如下:fromCrypto.CipherimportAESfrombinasciiimporta2b_hexdefungenerateAES(key,text):aes=AES.new(str.encode(key),AES.MODE_ECB)aes_text=aes.decrypt(a2b_hex(text)).decode(......
  • tomcat报错:java.io.IOException: 您的主机中的软件中止了一个已建立的连接。页面响应
    tomcat报错:java.io.IOException:您的主机中的软件中止了一个已建立的连接。tomcat报错:org.apache.catalina.connector.ClientAbortException:java.io.IOException:您的主机中的软件中止了一个已建立的连接。 出现原因:1、由于客户端在发送请求后,还没等服务器响应就断开了......
  • 【小沐学Unity3d】3ds Max 骨骼动画制作(Physique 修改器)
    1、简介官方网址:https://help.autodesk.com/view/3DSMAX/2018/CHS/?guid=GUID-22E831B0-8B6B-4759-B5FB-4B86B6276A00使用Physique修改器可将蒙皮附加到骨骼结构上,比如Biped。蒙皮是一个3dsMax对象:它可以是任何可变形的、基于顶点的对象,如网格、面片或图形。当以附加蒙皮......