如何保留我的unity3d程序(c#v3.5),即使c ++ dll /本机插件中有exit(1)

How to keep my unity3d program (c# v3.5) even if there is an exit(1) in a c++ dll / native plugin?

本文关键字:本机 dll 插件 exit 我的 保留 何保留 unity3d 程序 c#v3 即使      更新时间:2023-10-16

我在unity3d项目中使用c ++ dll,如果任何输入不正确,库使用exit(1),这会使unity3d崩溃/关闭。有没有办法在不修改原始 c++ 代码的情况下避免这种行为?

我不知道

这是否有效,但请尝试在 trycatch子句调用C++函数。例如:

try{
//Call you C++ function from C# here
}catch(Exception e){
}