Hide Warn Global In Unity

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cubesky/article/details/48526279

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

阅读更多
想对作者说点什么?

博主推荐

换一批

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