Last active
August 29, 2015 14:05
-
-
Save tsubaki/0fdc6327203a6e54fa80 to your computer and use it in GitHub Desktop.
UnityのC#からNativePluginsを使わずObjective-C++を呼び出すテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Runtime.InteropServices; | |
using System; | |
public class ObjCMessage | |
{ | |
[DllImport("__Internal")] | |
static extern IntPtr objc_getClass (string name); | |
[DllImport("__Internal")] | |
static extern IntPtr sel_registerName (string name); | |
[DllImport("__Internal")] | |
static extern IntPtr objc_msgSend (IntPtr self, IntPtr op); | |
public static IntPtr GetClass(string name ) | |
{ | |
return objc_getClass(name); | |
} | |
public static IntPtr Selector(string name) | |
{ | |
return sel_registerName(name); | |
} | |
public static IntPtr MsgSend(IntPtr self, IntPtr op) | |
{ | |
return objc_msgSend(self, op); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment