Edit: Solved. I was mistakenly updating the .js files instead of the .cs files
The MSDN says you can put the following in the beginning of a file to disable all warnings:
#pragma warning disable
Learn the different C# preprocessor directives that control conditional compilation, warnings, nullable analysis, and more
However, this causes unity to generate the following warning:
Assets/Scripts/AnimationDisabler.cs(1,25): warning CS1692: Invalid number
Is there another way to do this without specifying the specific warning numbers?
Thanks.
#pragma warning disable
expects a warning number . It is not a catch-all disable. As far as I know, that feature doesn’t exist. For instance, if you wanted to disable the warning CS1692, you would do:
#pragma warning disable 1692
No, it does work for C#. The problem was I was including it in JavaScript files, which apparently was causing the problems. I’m not sure exactly what went wrong, but it now seems to work for the C# files.