Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Please help, Can i use C## code compiled with Visual studio or MonoDev within Unity3D

Discussion in 'Scripting' started by frank.kyoshi.liu, Nov 9, 2012.

  1. frank.kyoshi.liu

    frank.kyoshi.liu

    Joined:
    Nov 9, 2012
    Posts:
    3
    I just started Dev on Unity platform. i have the following questions, please help me out. Thank a lot.

    1) Can i use the C# project developed using visual studio ?

    2) Must i just write and compile all C# using Mono Developer? Can i use Visual Studio compile my C# codebase?

    3) Can i use the whole .Net 2.0 Assemblies from MS framework? For example to show some message box?

    4) Can these compiled C# project be run on iOS?

    5) Can i use C++ codebase ? if YES, how can i compile my c++ code base ?

    :confused::confused:
     
  2. khanstruct

    khanstruct

    Joined:
    Feb 11, 2011
    Posts:
    2,870
    1: Yes. I use VS for all of my projects.
    2: No. See above.
    3: I believe so.
    4: If you have an iOS license for Unity.
    5: No.

    I am far from an expert, so if someone disagrees with me, you should probably listen to them.
     
  3. Hardynist

    Hardynist

    Joined:
    Sep 27, 2012
    Posts:
    16
  4. oleyb

    oleyb

    Joined:
    Nov 8, 2012
    Posts:
    15
    Unfortunately you can't use the whole .NET 2.0 framework, only the parts implemented in the Mono framework. For instance, you can't use any of the winform namespace within Unity.
     
  5. khanstruct

    khanstruct

    Joined:
    Feb 11, 2011
    Posts:
    2,870
    No, its straightforward and works incredibly well (in 2010). I haven't used 2012.
     
  6. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    I can confirm that Intellisense works perfectly in VS 2012 as well. If you're not working off the *.sln file that Unity makes, you just need to make sure to get UnityEngine.dll and UnityEditor.dll (if you're using it) referenced in your project. You also should have no problems using dll's you compiled in Visual Studio, as long as they don't use any part of the .NET framework that Mono, or more specifically, the Mono used in Unity, doesn't support.

    The one caveat is that as far as I know, there's no way to get Intellisense for JavaScript (UnityScript) files in Visual Studio; if you're using all C#, that won't be an issue of course.
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    With this you can,
    http://unityvs.com/
     
  8. frank.kyoshi.liu

    frank.kyoshi.liu

    Joined:
    Nov 9, 2012
    Posts:
    3
    Thanks a lot for all of these replies.

    i am really curious, what could be the complete list of all mono supported frameworks? Or where can i find them?