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...
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("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...
UnityEngine.Debug.Log(message); } } publicstaticvoidLogAssertion(objectmessage) { if(EnableLog) { UnityEngine.Debug.LogAssertion(message); } } publicstaticvoidLogAssertionFormat(stringformat,paramsobject[] args) { if(EnableLog) { UnityEngine.Debug.LogAssertionFormat(format, args); ...
UnityEngine.Debug.LogAssertion(message); } } public static void LogAssertionFormat(string format, params object[] args) { if (EnableLog == MSDKSetting.APKDebug) { UnityEngine.Debug.LogAssertionFormat(format, args); } } public static void LogError(object message, UnityEngine.Object context) ...
只需要在Debug.Log()方法中加入最常用的color标签即可 代码语言:javascript 复制 Debug.Log(""+"我是红色的字体"+""); 或者使用下面这种方法也可以,都是一样的原理! 代码语言:javascript 复制 Debug.Log(string.Format("{0}","我是黄色字体"));
3、启动游戏,查看crash日志,无用log先过滤一下,点击Tag,然后选择CRASH选项 image.png carsh日志 2023/07/2910:46:06.88330973121Error Unity3秒开始2023/07/2910:46:06.88330973121Error Unity UnityEngine.DebugLogHandler:LogFormat(LogType,Object,String,Object[])2023/07/2910:46:06.88330973121Error Unity UnityEngi...
Debug.LogFormat("SaveMonsterPrefab Path = {0}", prefabPath); Monster comp = instance.GetComponent(); if(null== comp) { stringmsg =string.Format("{0} 缺少Monster组件", prefabPath); EditorUtility.DisplayDialog("Apply a Monster prefab!", msg,"OK"); ...