Plugin not found

Hey guys,

I’m currently trying to create a plugin for unity and I’m experiencing issues with it being found. Here are some details:

  • Bundle created using a Max OS X Bundle, named Test.bundle
  • Added in a C++ header and implementation file

Test.h:

#pragma once

extern “C” { int getNumber(); }

Test.cpp:

#include “Test.h”

int getNumber() { return 1; }

  • Built and copied the .bundle to the assets/plugins folder for the unity project

  • Created a simple C# file inside the plugins folder:

using System.Collections;
using System.Runtime.InteropServices;

public class Test {
public int GetExternalNuber() { return getNumber(); }

[DllImport(“Test”)]
private static extern int getNumber();
}

  • When I create an instance of the class and call getExternalNumber() (inside OnGUI) I get a DllNotFoundException

Is there something I missed here? Maybe the wrong type of bundle, or some setting perhaps? Any help is greatly appreciated.

Thanks!

Did you put the bundle inside Assets\Plugins directory?

Hey tct,

Thanks for the reply and yes I placed it inside the assets/plugins folder.