Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MonoDevelop showing Java Script Class names Red from C#

Discussion in 'Scripting' started by swb123, Jul 26, 2014.

  1. swb123

    swb123

    Joined:
    Jul 7, 2014
    Posts:
    1
    I have installed the latest Unity software on my Mac as well as PC and see this issue on both.

    When I create a script, declaring a class variable in my C# class, where my declared variable is a java script class, this will result in the class name showing up as red in the editor, and when I hover over it, it says the name does not exist in the current context. I can build the project fine, the build resolves it (I did the step to make sure the referenced js class is in an area that is compiled early, I put in Standard Assets, and builds work after that). But even though it builds right, the MonoDevelop editor still shows the class with the color red and cannot do autocomplete etc.

    From experimenting it seems MonoDevelop does this when I reference any js class from my C# file. Referencing C# classes shows blue and has autocomplete etc.

    So as an example if I have a class like:

    Test1.cs

    then in my C# class (in same folder) I declare

    public Test1 t1;

    Everything is fine, editor shows Test1 blue, resolved

    But if I declare a js class like:

    Test2.js

    then in my C# class (in same folder) I declare

    public Test2 t2;

    Test2 shows red, and has that error I mentioned when I hover over it, even though it builds fine

    So is there some steps I need to do to get monodevelop editor to recognize js classes from my C# class? As I said I know about putting js files in standard assets folder so its compiled early and it does build, its just the editor that does not seem to think it is resolved.