Unity + Visual Studio ã§ãNative Plugin ããããã°ãã (Windows)
ã¤ã¥ã
ååã Visual Studio ã使ã£ã¦ Managed(C#)ãªPluginãä½ã£ã¦UnityVSã使ã£ã¦ãããã°ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ããã
ä»åã¯ãã®ç¶ãã§ãNative(C++) 㪠Plugin ãã¤ãã£ã¦ãããã°ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ããããããOpenCVã使ãããã¦ãã©ã°ã¤ã³åããã¦ããã®ã§ãä»åãæ¬å½ã§ãã
ç°å¢
- Windows 8.1 pro 64bit
- Unity 4.6.0f3 pro
- Visual Studio 2013 Community
GitHubã«ããã¾ãã
è¨äºã¯managed/nativeã§2åã«åãã¾ããããããã¸ã§ã¯ãã¯ä¸ã¤ã«ã¾ã¨ãã¦ããã¾ãã
Native Plugin ã®å ´å
UnityVS/MS å ¬å¼ã«ããã°ã UnityVSã¨ãã¦ã¯ãµãã¼ããã¦ããªããã¨ã«ãªã£ã¦ãã¾ãã
- UnityVS の使用 - Visual Studio Tools for Unity | MSDN ã®ãDLL ã®ãããã°ãã®é ã
ä»å Unity åãã«èª¿ã¹ãã¾ã§ã¯ç¥ããªãã£ãã®ã§ããããã¨ãã¨Visual Studioã«ã¯ãWindowsä¸ã§å®è¡ä¸ã®ããã»ã¹ã«ã¢ã¿ãããã¦ãããã°ãè¡ãæ©è½ãããã¾ãã
ãã£ã¦ã¿ã¾ãã
å®è¡ä¸ã®ããã»ã¹ã«ã¢ã¿ãã
ãããã°ããã Native Plugin ã®ããã¸ã§ã¯ããé¸æããç¶æ ã§ã
DEBUG > Attach to Process...
ã¨é¸ã³ãéããã¦ã£ã³ãã¦ã§ã Unity.exe ãé¸æãã¾ã
ãã®ç¶æ ã§ãã¬ã¤ã¯ãããç®æã«ãã¤ã³ããå¼µã£ã¦ã Unity Editor ãã Play ããã°ããã¬ã¤ã¯ãã¦ããã¾ãã
ã³ã¼ã«ã¹ã¿ãã¯ãè¦ãã¨ã Unity.exe!MonoBehaviour::Update()
ããDLLã® GetRandom()
é¢æ°ãå¼ã³åºããã¦ãããã¨ãããã£ã¦ãããããã§ãã
ãã¬ã¤ã¯ãããªãã¨ãããã£ã
ç§ã®ãªãã¸ããªããCloneãããã®ã§ãæ£ãããã¬ã¤ã¯ã«å¼ã£ããã£ããããªãã£ãå ´åã¯ãä¸åº¦Unityãéãã¦ãããVisual Studio ã®æ¹ã§ Plugin ããã«ããç´ããUnityã® Assets/Plugins ã®dllãä¸æ¸ããã¦ããå度å®è¡ããã¨ãå¼ã£ãããããã«ãªãã¾ãã
æå¾ã«
ãã㧠Native Plugin ããããã°ãã§ããããã«ãªãã¾ãããåã åã®è¨äºã§ OpenCV ã Native Plugin åãã¾ãããããã¡ãã®å ´åã§ãã¡ããã¨ãã¬ã¤ã¯ã§ãããã¨ã確èªãã¦ãã¾ãã