Search Unity

getting intellisense while writing C# unity scripts

Discussion in 'Editor & General Support' started by firas darwiche, Jan 23, 2007.

  1. firas darwiche

    firas darwiche

    Joined:
    Oct 4, 2006
    Posts:
    130
    hello all,

    any idea on how to get intellisense and syntax checking while writing C# unity scripts, most probably in an external editor such as Mono Develop or Visual Studio.Net if not possible inside unity.

    thanx.
     
  2. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    Some people are using X-develop for this.

    http://www.omnicore.com:80/en/xdevelop.htm

    It runs on OS X and you can supposedly point it to the Unity engine .dll (found inside the /Applications/Unity/Unity.app/Contents/build/UnityEngine.dll, possible others for completeness) and your project .dll's (found inside your PROJECT FOLDER/Library/ScriptAssemblies/*.dll).
     
  3. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    I am 99% sure you can set it up in VS.net too using the .dll that David mentions, but I can't help you find out how.

    -Jeremy
     
  4. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    I use Visual Studio for Unity C# coding with full auto-complete/intellisense (.NET classes, Unity classes, and my own classes). It's super-handy.

    Create a new C# project and do Project->Add Reference, then Browse tab and point it to a copy of the UnityEngine.dll file. That's pretty much it.

    There are some fancy things you can do with symlinks to avoid having all of the .csproj/.sln/.suo files ending up in your Unity assets folder, but it isn't a requirement of the setup. I also created some Visual Studio templates for my own boiler-plate class, a singleton/manager class, and others. The great thing about the VS templates is it sets the class name/filename and everything for you too.

    I would actually code in JavaScript if there was an editor available with autocomplete for built-in/custom classes. I'd rather use a more verbose language with the crutch than a simpler language without. If only Unity had an editor comparable to http://www.flashdevelop.org/ for Actionscript (a great open-source standalone editor with full class completion)...
     
  5. firas darwiche

    firas darwiche

    Joined:
    Oct 4, 2006
    Posts:
    130
    thanx a lot guys for the very useful and time saving info.

    are you alternating between windows and os x as you develop under VS and Unity constantly transferring files.
     
  6. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
  7. firas darwiche

    firas darwiche

    Joined:
    Oct 4, 2006
    Posts:
    130
    interesting, really interesting. but where are your project files residing, on which machine, the windows or the os x machine?
     
  8. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    The project files are all on the Mac (I use Windows sharing on the Mac, and mount my home directory as a drive letter on the Windows box).
     
  9. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    I use xdevelop (on the mac of course). Works great. Offers better code completion than any other IDE (or text editor) that I've tried.... and I've tried them all.

    Although if I could use Visual Studio on my mac I would. ....theres another reason to get a new MacBook!
     
  10. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122

    ...I set a project reference to UnityEngine.DLL, but I don't set references to the script assemblies. Instead I just have the xdevelop project saved in my Unity's "workingassets" folder and have all my C# script files in the xdevelop project.. and then I simply use xdevelop as a text editor (I don't use it to compile anything).
     
  11. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
  12. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    so is X-develop worth it's 499 USD asking price? Just curious.

    cheers.
     
  13. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    Yeah, I do the same. I edit code with VS, and network save the files on my mac. All you have to do is hit command r on the mac to reload. Works really well.

    Thanks for the how-to on adding the reference.

    -Jeremy
     
  14. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    Is it that expensive? I bought version 1.2 about a year ago for something like $150 (they had some special going). I find the intellisense feature to be almost invaluable... however $500 is probably too much considering that most of its features aren't going to be used when only using it for Unity.


    Omnicore should come out with a stripped down "lite" version made specifically for Unity.