Search Unity

Reference UnityEditor in external DLL successfully.

Discussion in 'Scripting' started by llMarty, Dec 20, 2014.

  1. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Hello. So I'm trying to put my scripts and custom inspector editor scripts in two external DLLs and I'm facing a problem on my Editor DLL.
    First of, I'm using UnityVS with Visual Studio 2013 Ultimate.

    I added a reference to "C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.dll" and it successfully shows me IntelliSense. But when I try to compile the build, it will complain not finding the assembly UnityEditor. Even referencing the same DLL like the UnityProject (inside the Library folder) results in that problem, as it's just a copy of installed UnityEditor.dll.



    I even tried to open this project in a separate Visual Studio and build it, got the same result.

    I've heard, placing the resulting DLL in the Editor folder will make the custom inspectors available, so I really wish this would compile.
     
  2. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    Make sure you enabled the ref in the References. Right Click -> Add Reference -> Recent (I think I'm on my Mac right now its the last option with the drop down) ensure it is ticked to be looked at.
     
  3. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    Ofc I did, otherwise Visual Studio would not give me IntelliSense. Also everything is fine and I can access the namespace with all it's classes and members until I compile.
     
  4. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    33
    My bad, I forgot to reference the right target framework in my Editor DLL.