xak的专栏

Sometimes when I look at the world, I can see a line behind it.

Hide Warn Global In Unity

Sometime, The warn info are turn into error msg in unity's console, Although we can find the error msg in the end of msg's detail,But when we have a lot of warn, It can't be showed until you fixed most of the warn.So we need to hide the warn infos simplely.

There are some way to do that,

1、you can disable them via a pragma at the top of your script file  

#pragma warning disable 0168 // variable declared but not used.
#pragma warning disable 0219 // variable assigned but not used.
#pragma warning disable 0414 // private field assigned but not used.

(when you need to restore,you can do it like this: #pragma warning restore 0168 )

2、Global Hide

create a file n name it smcs.rsp(gmcs.rsp ,us.rsp). Save this file under your "assets/" folder,just type "-nowarn:168" 


mark:

1.The problem is often caused by some code trigged InternalErrorException.

2.168 is the numeric part of the warning identifier(CS0168).


Reference Url

https://msdn.microsoft.com/zh-cn/library/7f28x9z3.aspx

http://docs.unity3d.com/Manual/PlatformDependentCompilation.html

http://manpages.ubuntu.com/manpages/jaunty/man1/gmcs.1.html

http://answers.unity3d.com/questions/49540/pragma-warning-disable-on-a-global-scale-from-with.html

http://answers.unity3d.com/questions/21796/disable-warning-messages.html

http://answers.unity3d.com/questions/428915/many-warning-as-internal-error.html

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cubesky/article/details/48526279
个人分类: Unity开发
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Hide Warn Global In Unity

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭