I’m at a bit of a loss here. I’m trying to get unity to check out a file before writing to it, all of which actually works fine. Except that it throws an error:
chmod: D:\Projects\ProjectName\english.json: The system cannot find the file specified.
Here’s my attempt at getting it to work properly:
UnityEditor.VersionControl.Asset asset = UnityEditor.VersionControl.Provider.GetAssetByPath(path);
UnityEditor.VersionControl.Task status = UnityEditor.VersionControl.Provider.Status(asset);
status.Wait();
if (UnityEditor.VersionControl.Provider.CheckoutIsValid(status.assetList[0]))
{
UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(status.assetList[0], UnityEditor.VersionControl.CheckoutMode.Asset);
task.Wait();
}
The error is thrown at task.Wait().
The file it’s pointing to exists and in the lines after this it actually writes the correct text to the file.
Anyone got any idea what causes this?