1
votes

Basically I'm trying to get the desktop rendering plugin to work ( http://docs.unity3d.com/Documentation/Manual/NativePluginInterface.html ).

Here is what I did:

  1. Downloaded the example project ( http://docs.unity3d.com/Documentation/Images/manual/RenderingPluginExample42.zip ). The bundle is already compiled and is located in the Assets/Plugins folder. This works fine when running Unity.
  2. Opened the XCode project in XCode 5.
  3. In the file "RenderingPlugin.cpp" change #include <OpenGL/OpenGL.h> to #include <OpenGL/gl.h>
  4. Update XCode project settings: enter image description here
  5. Build the new bundle in XCode and copy the new bundle to the Assets/Plugins (replace existing bundle).
  6. Restart Unity and try to run the demo again. Now Unity gives the following error: DllNotFoundException: /Users/mono/Downloads/RenderingPluginExample42-1/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin

Some observations: The new bundle file (17kb) is much smaller than the old bundle file (29kb).

1
Did you make sure your code is linked to OpenGL.framework ? I also have CoreGraphics.framework connected to my plugin. - The Lazy Coder

1 Answers

1
votes

I found the problem. Unity is i386, so you simply need to change the architecture to i386 (Universal does not work for some reason). I have described the process in full details here:

http://blog.nobel-joergensen.com/2013/10/21/creating-a-desktop-plugin-for-unity-4-using-xcode-5/