I'm using i2 localization with the google sheets sync and want to make it part of our nightly build process. The idea is to run the import from sheets->unity from a command line (and then check in the resulting changes) so it's always up to date. Yes, I know about the auto sync option but for various reasons that's not ideal.
However I can't see a way to do this from just a script. Is there an API call I can make to do a sheets->unity sync (with 'replace' preferably, but 'merge' would also be ok).
The administrator has disabled public write access.
Automating a google sheets import
2 weeks 4 days ago #2588
The code that runs when you click the Import button is in:
function Import_Google at line 423
You could select the source and call that function, or alternatively, run the internal query by using:
LocalizationManager.UpdateSources(); // ensures the source is loaded
var source = LocalizationManager.Sources;
var www = source.Import_Google_CreateWWWcall(true);
yield return www;
// call from your code using this:
Please, notice, that if you are executing that call from the Editor (not play mode), a normal coroutine will not work. But I2.Loc.CoroutineManager has code to simulate a coroutine by using the EditorApplication.update event.
That way, that code will work in both the editor and in-game.
Hope that helps,
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!