Plugins in Unity

Plugins in Unity

  Unity has extensive support for Plugins, which are libraries of native code written in C, C++, Objective-C, etc. Plugins allow your game code (written in Javascript, C# or Boo) to call functions from these libraries. This feature allows Unity to integrate with middleware libraries or existing C/C++ game code.

  Note: For security reasons, plugins are not usable with webplayers.

  In order to use a plugin you need to do two things:

  • Write functions in a C-based language and compile them into a library.
  • Create a C# script which calls functions in the library.

  The plugin should provide a simple C interface which the C# script then exposes to other user scripts. It is also possible for Unity to call functions exported by the plugin when certain low-level rendering events happen (for example, when a graphics device is created).

 参考:http://docs.unity3d.com/Manual/Plugins.html

你可能感兴趣的:(plugins)