Copying orbbec.ini file [Orbbec 2.0.15 + Unity3D + Windows sample]


I got the following error after running the first time the test scenes:
IOException: /../Plugins/orbbec.ini already exists

The problem it’s in here:

This happens when srcDate & dstData (typo also) have the same timestamp. A quick fix:
if (srcDate *>=* dstData)

If this piece of code to to warn the user that you can’t edit Plugins/orbbec.ini maybe throw; a better error ?
If not why can’t you just do:
try { File.Copy(srcName, dstName, true); //always override } catch { }

Okay after trying my fix from my side I notice with my change this can be a problem to git repositories since the file will always be created/edited.

Maybe if same timestamp don’t copy the .ini

Is this new peace of code actually doing something ? Shouldn’t be copied to /plugins/[x86/x86_64]/orbbec.ini instead of /plugins/orbbec.ini ?

if file of dstName existed, you use File.Copy() function, it will throw IOException. So the first time you run this script, it’s ok , because the file does not exist, and it creats the file, but when you run it again, you will get IOException, my solution is to put the File.Copy() function behind File.Delete() function.