Page 1 of 1

how to change default file path at runtime?

Posted: Sat Dec 15, 2018 4:48 pm
by wethecom
how to change default file path at runtime?
anyone have a clue?
i need to change it from defualt.dat to someusername.dat
anyone have a clue how this is done




var settings = new ES3Settings();
// Change the save location to PlayerPrefs.
settings.path = "UserName.dat";


im confused because of the use of the words ,path ,directory and the word file.. i want to change this at runtime the "default file Path" the name of the file to be stored.. i may have to rewrite all the code to use a varable for file paths but its just seems like you should be able to change this easily

Re: how to change default file path at runtime?

Posted: Sun Dec 16, 2018 10:33 am
by Joel
Hi there,

Defaults are initialised when the scene loads, so it's not possible to change them at runtime.

However, you can create your own static variable containing an ES3Settings object and use this as your default settings. Then you just need to provide this ES3Settings object as the settings parameter whenever you call an Easy Save method.

All the best,
Joel

Re: how to change default file path at runtime?

Posted: Sun Dec 16, 2018 7:56 pm
by wethecom
thank you that seem to work well.. i didnt understand the power of those settings..