简体   繁体   中英

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

I use a c++ dll in my unity3d project and if any input is incorrect, the library use exit(1), which makes unity3d crashes/closes. Is there any way to avoid this behavior without modifying the original c++ code ?

I don't know if this would work but try to call the C++ function in a try and catch clause . For example:

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

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM