Page 1 of 1

I suppose there's a typo in the documentation (improving performance)

Posted: Mon Sep 12, 2022 9:20 am
by lomantic
Since I'm new to EasySave3, I've been following the documentation and got stuck with the code below

https://docs.moodkie.com/easy-save-3/es ... rformance/

Code: Select all

// Cache a local file and load from it.
ES3.CacheFile("MyFile.es3");
 
// Create an ES3Settings to load from cache.
var settings = new ES3Settings(ES3.Location.Cache);
 
// Load from the cached file.
var myInt = ES3.Load("myInt", 0, settings);
ES3.LoadInto("myTransform", this.transform, settings);
I suppose <ES3.Location.Cache> should be "MyFile.es3"
I'm not very sure but I've tested the code and it seems to work properly

Re: I suppose there's a typo in the documentation (improving performance)

Posted: Mon Sep 12, 2022 9:38 am
by Joel
Hi there,

Thanks for the information. There is an error but to resolve it you need to add the filename and ES3.Location.Cache when creating the ES3Settings. I.e.

Code: Select all

// Cache a local file and load from it.
ES3.CacheFile("MyFile.es3");
 
// Create an ES3Settings to load from cache.
var settings = new ES3Settings("MyFile.es3", ES3.Location.Cache);
 
// Load from the cached file.
var myInt = ES3.Load("myInt", 0, settings);
ES3.LoadInto("myTransform", this.transform, settings);
Alternatively we could simply omit the filename from the ES3.CacheFile call and it will load from the default file. I.e. However, we'll update the example in the docs to the former example as we feel it is clearer.

All the best,
Joel