Unity Bug 修复系列
2015-08-26 10:56
501 查看
DllNotFoundException:
参考 http://stackoverflow.com/questions/10003028/dllnotfoundexception-in-unity3d-plugin-for-c-dll 最近转Windows开发,同事c++生成的dll需要引用到opencv的dll,先用dependency walker 找到依赖的库,然后把所有dll直接扔到Plugins会报DllNotFoundException,初步怀疑是加载dll的顺序不同导致的。有几种解决方案:
1、http://stackoverflow.com/questions/10003028/dllnotfoundexception-in-unity3d-plugin-for-c-dll
根据上面网站的解决方法,在Editor时把依赖的dll放到安装目录Unity\Editor文件夹下,在Build后放到与.exe同目录下。
2、http://forum.unity3d.com/threads/dllnotfoundexception-when-depend-on-another-dll.31083/
直接手动添加全局变量
public class MyPluginClass { static MyPluginClass() { String currentPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process); String dllPath = Environment.CurrentDirectory + Path.DirectorySeparatorChar + "Assets" + Path.DirectorySeparatorChar + "Plugins"; if(currentPath.Contains(dllPath) == false) { Environment.SetEnvironmentVariable("PATH", currentPath + Path.PathSeparator + dllPath, EnvironmentVariableTarget.Process); } } }
相关文章推荐
- Unity物体上下反复漂浮效果
- unity Kinect v2 with MS-SDK20绿屏抠像shader修改 透明背景
- 如果在 unity中滚动 3D 骰子
- Unity Game Programming AI(1)人工智能导论
- Unity3D圣典学习【2】之CharacterController
- Unity Notes调制粒子系统的颗粒的最大数目
- Unity 热更新之AssetBundle
- Unity3d动画脚本 Animation Scripting(深入了解游戏引擎中的动画处理原理)
- Unity3D官方案例--太空射击游戏总结
- Unity之弹床(蹦床效果)
- Unity3D中引用Spine2D动画研究学习(一)
- Unity使用Animator实现人物头部朝向鼠标
- Unity中英文字长度
- Unity3D——个人游戏Car的游戏中控制
- Unity Shader之Billboard算法
- Unity3D Terrain
- Unity3D EasyTouch 初步使用教程(详细)
- [Unity3D]unity3d 4.3.7更新之后的bug
- unity3d5.1物体椭圆旋转选择界面实现(一)
- unity3d Mecanim动画系统获取动画层、动画状态等方法