i bought ios pro, when build iphone apps.
error occur
Warning message : Namespace ‘System.Collections’ is never used (BCW0016);
Warning message : Namespace ‘UnityEditor’ is never used (BCW0016);
Language : javascript
thx for help
i bought ios pro, when build iphone apps.
error occur
Warning message : Namespace ‘System.Collections’ is never used (BCW0016);
Warning message : Namespace ‘UnityEditor’ is never used (BCW0016);
Language : javascript
thx for help
would you please post the script ? you probably don’t have any Start, Update, etc functions in your code.
thx, solved it
how did u solve it? I have the same problem.
Here’s my code:
var speed = 3.0;
var cratePrefab:Transform;
function Update ()
{
if(Input.GetButtonDown(“Fire”))
{
var crate = Instantiate(cratePrefab, transform.position, Quaternion.identity);
crate.rigidbody.Addforce(transform.forward * 2000);
}
bump.
:.?
Same problem here. How did you solve it?
This is appearing at the top of every js script in my project, even brand new ones that just have the empty Update function.
Ya same problem here, it appear at the top of every js script in my project too
Mind to share how you solve it?
This question keeps going unanswered. From what I’ve found, there is no proper way to disable this warning. The Monobehaviour class (the default class used for all .js files) has imports predefined for UnityEngine, UnityEditor, System.Collections, and others. If your script doesn’t make any calls to these namespaces, you’ll get a warning. A possible but ugly workaround would be to use each namespace that’s giving you a warning by adding some code that does nothing but uses each namespace just to silence the warning. Add this function to each of the offending scripts at the top (after your pragmas and such).
Version for non-editor scripts:
/* Silence MonoBehaviour Warnings*/ private function SilenceWarnings() : void { var al : ArrayList; if(al == null); var ae : AccelerationEvent; if(ae == 10) SilenceWarnings(); }
Version for editor scripts:
/* Silence MonoBehaviour Warnings*/ private function SilenceWarnings() : void { var al : ArrayList; if(al == null); var ae : AccelerationEvent; if(ae == 0); var dcm : DrawCameraMode; if(dcm == 10) SilenceWarnings(); }
There’s no equvalent to C#'s #pragma warning disable #### that I can find. (Plus even if there were, there doesn’t seem to be a number code to disable this particular warning.)
It’s ugly, but that’s the only way around it that I’ve found.
I found another possibility that showed promise, but I couldn’t get it to work. If you open your .unityproj files in the root of your unity project, there’s a line 0169, which is supposed to suppress warnings with a specific code. These are normally available in GUI by going to the compiler via the project options in C#, but on UnityScript no such option appears. They do appear in the .unityproj file however. Unfortunately, changing it to 0169 0016 has no effect. I tried changing it in both Debug and Release for all the unityproj files, but the warnings persisted. Perhaps someone else knows something I don’t and maybe there’s a way to get this working. Seems a whole lot better than my hack posted above.
Actually, you were on the right track, this does work. However, you need to change the syntax.
Change it to this:
<NoWarn>0169</NoWarn>
<NoWarn>0016</NoWarn>
and it will do the trick.
This is working for you? I tried the modified syntax attempting to suppress 4 warnings. I added it to every .unityproj file in both Debug and Release sections, restarted MD, and nothing happened. Then I added it to all the .csproj files, restarted MD, and again nothing happened.
<NoWarn>0169</NoWarn>
<NoWarn>0016</NoWarn>
<NoWarn>0014</NoWarn>
<NoWarn>0003</NoWarn>
I got the original space separated syntax I tried from a C# project. It lets you specify ignored warnings in the MD GUI separated by spaces. The warnings are saved to the .csproj file in the same way 0169 ### ### ### ETC.
Also, be aware that when compiling in Unity, you don’t get the 0016 warnings. You only see those when compiling directly in MonoDevelop. I guess it has those warnings suppressed internally. Can you verify yours is suppressing the 0016 warnings in MD?
Try adding this unused class to the bottom of your script:
private class ShushES {var q:Queue; var h:Help; var g:GUI;}
I remove the ‘*’ and warnings go away. Monodevelop Ver, 2.8.2
Okay just found out how to get around this by a fluke. Didnt even really mean to do it but it works and the errors will stop coming up.
Go to run
Click exceptions
Type in the system.collections or whatever script error is coming up
Bottom right corner of the exceptions window click ok
The specific error you typed in is now an exception and will not be shown again
Worked for me hope it works for you guys.
So, is there a reason to get rid of the warning? by just leaving them there and understand why they are happening will it cause any conflicts or problems later? I got the same warning and searched it just cause I wasn’t sure if it was something i needed to worry about.
It’s just annoying and clutters up your warning list so it makes it harder to see the other more meaningful warnings.
Go to run??? Where is run?
…Oh in monodevelop
I tried it, didn’t work.
Don’t know… but even using private (If I’m not wrong) and using it on multiple .js files from monodevelop, will cause a “previously defined” error.
So I do the same, but with vars on the offending .js files
At end of each offending .js.
private var RemoveUnusedNameSpaceWarningsq:Queue;
private var RemoveUnusedNameSpaceWarningsh:Help;
private var RemoveUnusedNameSpaceWarningsg:GUI;
Just wanted to say I’m using this solution to remove the errors and it’s working fine, however I recommend wrapping the whole block in #if UNITY_EDITOR directives, otherwise Unity complains if you try to publish a web build, for example.
#if UNITY_EDITOR
private var RemoveUnusedNameSpaceWarningsq:Queue;
private var RemoveUnusedNameSpaceWarningsh:Help;
private var RemoveUnusedNameSpaceWarningsg:GUI;
#endif