Print/Debug.Log在Unity Console上未显示输出 [英] Print/Debug.Log is not showing output on Unity Console
问题描述
我正在尝试在Unity Console上使用C#打印一个简单的语句,但是我不知道为什么它不打印.
I am trying to print a simple statement using C# on Unity Console but i don't know why it is not printing.
推荐答案
如果打印不有效,则Debug.Log
也将不有效,因此<强>不是问题.
If print does not work, Debug.Log
will not work either so that's not the problem.
以下是print
在控制台中未显示的可能原因:
These are the possible reasons why print
is not showing in the console:
1 .脚本未未附加到GameObject.
1.Script is not attached to a GameObject.
2 .脚本附加到的GameObject 不处于活动状态.从编辑器中激活它.
2.The GameObject the script is attached to is not Active. Activate it from the Editor.
3 .NumberWizard
脚本未启用.启用脚本.
3.The NumberWizard
script is not enabled. Enable the script.
4 .未选中 日志切换.
在您的屏幕截图中,调试,警告和错误消息均已启用,因此我们可以排除4中的内容.
From your screenshot, both Debug, Warning and Error messages are enabled, so we can exclude what's in 4.
这篇关于Print/Debug.Log在Unity Console上未显示输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!