Debug.LogFormat public static voidLogFormat(stringformat, params object[]args); public static voidLogFormat(Objectcontext, stringformat, params object[]args); public static voidLogFormat(LogTypelogType,LogOptionlogOptions,Objectcontext, stringformat, params object[]args); ...
Debug.Log(message, null); }//调用Logger.Log("Net error:",error,"msgId:",msgId); 4.格式化打印 格式化打印封装原本Debug.LogFormat方法; publicstaticvoidLogFormat(stringformat, params object[] args){if(!s_debugLogEnable)return; Debug.LogFormat(format, args); } 三、LoggerMgr类 继承MonoBehavior...
Debug.Log("regular log"); Debug.LogWarning("this is a warning!!! but we never care about it"); Debug.LogAssertion("this is an Assert,hmmm...it must be something wrong!"); Debug.LogError("this is an Error,You have to fix it!"); Debug.LogException(new System.Exception("How about...
publicvoidDebugColorLog(stringcontent,stringcolor="#FFFFFF"){Debug.LogFormat("<color={0}>{1}</color>",color,content);}//打印亮蓝色日志DebugColorLog("LogColorTest","#40EEFF"); 效果图 控制日志 //仅显示普通日志Debug.unityLogger.filterLogType=LogType.Log;//仅显示警告日志Debug.unityLogger.filte...
Debug.Log(string.Format("{0}","我是黄色字体")); 其中color=这部分的代码就是对应的十六进制颜色码,我们只需要修改这里的代码即可修改颜色! 示例代码如下: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 Debug.Log(""+"我是带颜色的字体"+"");Debug.Log(""+"我是带颜色的字体"+"");Debug.Log...
UnityEngine.Debug.Log(message); } } publicstaticvoidLogAssertion(objectmessage) { if(EnableLog) { UnityEngine.Debug.LogAssertion(message); } } publicstaticvoidLogAssertionFormat(stringformat,paramsobject[] args) { if(EnableLog) { UnityEngine.Debug.LogAssertionFormat(format, args); ...
之前说的Debug.Log();此函数是打印Unity控制台的。 好办,有高人已经重新把控制台给换了地方,打印到界面的控制台上。 就是类似控制台的一个界面。 先放结果图样: 1.问题来了,怎么实现的呢? 上代码: 我给改了名字叫TestConsole.cs了,因为之前名字为Console,这样想我这样都在一个工程中为大家测试,容易造成混乱...
{ LogType.Exception, Color.red }, { LogType.Log, Color.white }, { LogType.Warning, Color.yellow }, }; const string windowTitle = "Console"; const int margin = 20; static readonly GUIContent clearLabel = new GUIContent("Clear", "Clear the contents of the console."); ...
(); } // automatically called when the 'using()' block ends public void Dispose(){ _watch.Stop(); float ms =watch.ElapsedMilliseconds; UnityEngine.Debug.Log( string.Format("{ 0}finished:{1:0.00}"+ "milliseconds total,{2:0.000000}milliseconds per-test "+ "for {3}tests",_timerName,...