Skip to content

Instantly share code, notes, and snippets.

@keijiro
Created September 26, 2011 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keijiro/1241999 to your computer and use it in GitHub Desktop.
Save keijiro/1241999 to your computer and use it in GitHub Desktop.
(Unity for iOS) Native plugin import in JavaScript
import System.Runtime.InteropServices;
#if UNITY_IPHONE && !UNITY_EDITOR
@DllImportAttribute("__Internal") static private function _PluginFoo(arg : int) {}
#else
static private function _PluginFoo(arg : int) {
// iOS以外での代替処理。
}
#endif
static function Foo(arg : int) {
_PluginFoo(arg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment