纳金网

标题: Unity3D 调用DLL类库 [打印本页]

作者: 狂风大尉    时间: 2014-7-29 00:39
标题: Unity3D 调用DLL类库
1。将CanmeraDll.dll文件放入根目录

2。编写如下声明代码
    [DllImport("CanmeraDll")]
    public static extern int Net_Cam_Init(ref int CamID, ref int w, ref int h, ref int BFormat);
    [DllImport("CanmeraDll")]
    public static extern IntPtr Net_Cam_GetFrameBuff(ref int Cam, ref int Size);
    [DllImport("CanmeraDll")]
    public static extern int Net_Cam_UnInit();

3。调用代码
void Start () {      
  if(NetCamWrapper.Net_Cam_Init(ref Cam_Id, ref wid, ref hig, ref BFormat) == 1){
   NetCamStatus = true;
   Debug.Log("NetCamera Have Init!");      
  }else
   Debug.Log("NetCamera Don't Init!");      
}


作者: hyui    时间: 2014-7-29 01:22
Nice share !
作者: shotdead    时间: 2014-7-29 09:10
非常感謝你分享這個
作者: Kira    时间: 2014-7-29 11:29
zhegehao     
作者: adoraj    时间: 2014-7-29 11:48
学习了。。。。。在IOS上也是如此
作者: HIDEOKOJIMA    时间: 2014-7-29 11:57
THanks for sharing !
作者: 我不再年轻    时间: 2014-7-29 16:02
这是调用C++ DLL吧




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5