当前位置:网站首页>[总结]Unity Console面板的问题汇总
[总结]Unity Console面板的问题汇总
2022-08-08 06:26:00 【GREAT1217】
[总结] Unity Console面板的问题汇总
1.Console面板双击无法定位问题
点击Console面板右上角设置,选择Stack Trace Logging(堆栈追踪日志),选择无法定位的输出日志类型或者All,设置ScriptOnly,如下图,即可解决。其他的设置可以自行了解。
2.关闭Debug输出日志信息
程序发布的时候不需要输出日志信息,可以选择关闭。
- 5.3及以上版本的Unity提供了运行时关闭Debug的API:Debug.unityLogger.logEnabled = false;
- 旧版本的解决方法可以参考雨松老师的博客(链接)。
3.Debug颜色调试
- 默认颜色
Debug.Log("<color=red>红色</color>");
Debug.Log("<color=orange>橙色</color>");
Debug.Log("<color=yellow>黄色</color>");
Debug.Log("<color=green>绿色</color>");
Debug.Log("<color=blue>蓝色</color>");
Debug.Log("<color=purple>紫色</color>");
Debug.Log("<color=black>黑色</color>");
Debug.Log("<color=white>白色</color>");
Debug.Log("<color=grey>灰色</color>");
- 自定义颜色
HTML颜色编码工具:菜鸟教程(链接)
Debug.Log("<color=#FFC0CB>Pink</color>");
Debug.Log("<color=#FF69B4>HotPink</color>");
Debug.Log("<color=#FF1493>DeepPink</color>");
4.Debug占位符
int account = 1217;
string name = "great";
Debug.Log($"account: {account}, name: {name}");
Debug.Log(string.Format("account: {0}, name: {1}", account, name));
边栏推荐
猜你喜欢
随机推荐
Error日志 ERROR: Failed building wheel for jsonnet
神经网络预测值几乎一样,神经网络为什么能预测
Gym 101492E Teamwork 伪dp解法
leetcode daily question 8.6 (continuously updated)
Research analysis and development prospect forecast of electric shaver market status
Unity学习笔记 01 —— 常用API
NVIDIA CUDA 高度并行处理器编程(八):并行模式:直方图计算
【图形学】16 光照模型(一、理论与公式)
Unity 物体颜色渐变效果(判断逻辑实现)
rhcsa——第三天
Google Colab 快速上手
基于深度学习的关系抽取
Unity HDRP下VRTK传送、穿墙 时画面淡入淡出、视觉遮挡无法正确显示问题解决
【图形学】17 光照模型(二、漫反射的Shader实现)
在ENSP中配置DHCP服务器
[Unity] 状态机事件流程框架 (一)(C#事件系统,Trigger与Action)
ACM latex
深度神经网络主要模型,深度神经网络预测模型
Industry Research: Analysis of the Status and Prospects of the Pension Insurance Market in 2022
[总结] Unity Lightmap使用总结