Search Unity

Importing dll doesn't work

Discussion in 'Editor & General Support' started by Tef, Jun 21, 2016.

  1. Tef

    Tef

    Joined:
    Apr 6, 2013
    Posts:
    18
    Hi there,

    I have tried to import an external native dll but I fail todo so. Even the example project that Unity documentation use as en example doesn't work.

    Unity example can be downloaded here: http://docs.unity3d.com/540/Documentation/uploads/Examples/SimplestPluginExample-4.0.zip

    I have also tried to follow these tutorials:
    http://www.alanzucconi.com/2015/10/11/how-to-write-native-plugins-for-unity/


    In all of these examples Unity can't find the dll or its the wrong architecture. I have tried x86, x64 and placing them in Assets/Plugins (where they should be in Unity 5), root folder, editor folder hack, everything... I don't get it, how hard should it be to import a dll?

    I'm developing on a mac OS X and use Unity version 5.3.4f.
     
  2. Tef

    Tef

    Joined:
    Apr 6, 2013
    Posts:
    18
    Okay, I found the solution and what confused me. All dll's and bundles should be in Assets/Plugins

    Editor:
    I thought a .dll would work in the editor if I was targeting windows. But it doesn't, however, it worked perfectly with a .bundle file from xcode.

    Windows:
    I need to build the correct x86 or x86_64 architecture here.

    OSX:
    Same as Editor, I need to have a .bundle file but also make sure I match the architecture, in my case it was Universal.

    Cheers.