Search Unity

Is it possible to suppress warning in a specific script?

Discussion in 'Scripting' started by tedzhu, Sep 14, 2012.

  1. tedzhu

    tedzhu

    Joined:
    Sep 9, 2012
    Posts:
    1
    I've imported some packages and the script keeps warning me.
    Is there a way to suppress all warnings in one script?
     
  2. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Use this as first line of your script:
    Code (csharp):
    1. #pragma warning disable 0000
    Replace "0000" with the warning code Unity gives you on the console panel. I,e:
    The number after "CS" is your warning code:
    Code (csharp):
    1. #pragma warning disable 0414
    And thats it. :)
     
    Last edited: Sep 14, 2012
    INeatFreak and Anisoropos like this.