• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by soulburner · Jul 03, 2012 at 09:15 PM · javascriptdisablewarningpragma

Javascript: Disable warnings

How do I disable warnings in JavaScript ?

I've tried

 #pragma warning disable 0015

But I get error message:

 BCE0044: unexpected char: 'd'.
Comment
Gaidzin

People who like this

1 Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Piflik · Jul 03, 2012 at 09:20 PM 0
Share

I don't think #pragma warning disable xxxx exists in JavaScript.

avatar image Brian Stone · Jul 03, 2012 at 09:41 PM 1
Share

The unexpected character is probably the 'd' in 'disable'. I'm pretty sure this is not supported in JS/US. It is only supported by the C# compiler.

You should always heed warnings, and be sure to fix them for your final build. Ignoring the problems won't make them go away.

avatar image guavaman · Aug 22, 2012 at 06:29 PM 0
Share

Yeah it's good to correct your errors, but when working in UnityScript you get all kinds of bogus namespace warnings from MonoBehaviours if you don't use any elements from UnityEngine, UnityEditor, and System.Collections. Also, I'm constantly doing things like creating a debug function, then remming out the caller of it which then gives me an annoying "function is never used" warning. "Fix all your warnings" is not a good answer.

Its yet another of a long, long list of pitfalls with UnityScript that you can't silence the warnings like in C#. I wish they'd just get rid of UScript and force everyone to use C# in the first place instead of luring you in with the "easy of use" argument only to find you're stuck in a corner 2 years down the road when you've built too big a pyramid to start over.

Incidentally, if you're tired of the BCW0016 warnings EVERY SIGNLE script throws, I have an ugly but effective workaround posted at http://answers.unity3d.com/questions/278276/how-can-i-close-the-namespace-never-used-warning.html

avatar image DaveA · Aug 22, 2012 at 09:25 PM 0
Share

Quicker, easier, more seductive. If once you start down the dark path, forever will it dominate your destiny, consume you it will, as it did Obi-Wan's apprentice.

avatar image Draco18s · Feb 24, 2014 at 03:43 PM 0
Share

I found this thread wanting to suppress a warning about using bitwise logic instead of boolean.

Thing is, I WANT bitwise:

returnVal |= updateObject(objArr[i]); //function returns true if the object changed

Which is inside a loop that should continue to run until no object changes.

1 Reply

  • Sort: 
avatar image

Answer by Beyond-Ken · Dec 25, 2012 at 05:15 PM

Try adding this unused class to the bottom of your script:

private class ShushES {var q:Queue; var h:Help; var g:GUI;}

Comment
pedrevans

People who like this

1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do i check if all tagged objects are inactive? 2 Answers

Easiest Way to shake a object? 1 Answer

Examples of closures in UnityScript 0 Answers

Shader warning for URP 2 Answers

How do I create a simply disable script for enemy AI once it completes its waypoints? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges