Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
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
Add comment · 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 $$anonymous$$onoBehaviours 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 rem$$anonymous$$g 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 ins$$anonymous$$d 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 do$$anonymous$$ate 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 ins$$anonymous$$d 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

· Add your reply
  • Sort: 
avatar image
1

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
Add comment · 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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

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

UNITY3D: TEXTFILE I/O : Don't write same things 0 Answers

How to make a List Constructor? 1 Answer

Assets/Standard Assets (Mobile)/Example/ExampleScript.js/(13,104): BCE0044: expecting :, found ';'. 0 Answers

Can I convert unityscript to boo? 0 Answers

Can't use script name as variable type? 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