Integrating with other storage APIs
Sometimes it’s necessary to integrate Easy Save’s API with another service’s storage API. For example, to support consoles, or to integrate with cloud storage plugins.
Saving as a string or byte array
This can be achieved by saving to cache, and retrieving the data as a byte array or string:
1 2 3 |
var cacheSettings = new ES3Settings(ES3.Location.Cache); ES3.Save("transform", this.transform, cacheSettings); byte[] bytes = ES3.LoadRawBytes(cacheSettings); |
You can then store this byte array or stringĀ usingĀ the storage API you are integrating with.
Loading from a string or byte array
The storage API should then allow you to retrieve this data as a string or byte array, which you can store in the cache and load from:
1 2 3 |
var cacheSettings = new ES3Settings(ES3.Location.Cache); ES3.SaveRaw(bytes, cacheSettings); ES3.LoadInto("transform", this.transform, cacheSettings); |