ES3Settings Class

The ES3Settings object is used to override default settings (such as encryption settings), and can be used to specify file and directory paths.

[table th=”0″]ES3Settings Constructor,”Creates a new ES3Settings object.”[/table]
[table th=”0″]location,”The storage location where we wish to store data by default.”

path,”The path this ES3Settings object points to, if any.”

encryptionType,”The type of encryption to use when saving data, if any.”

encryptionPassword,”The password to use to encrypt the data if encryption is enabled.”

compressionType,”The type of compression to use when saving data, if any.”

directory,”The default directory in which to store files when using the File save location, and the location which relative paths should be relative to.”

bufferSize,”Any stream buffers will be set to this length in bytes.”

encoding,”What text encoding to use when writing and reading text from a file.”

[/table]

Save data using an ES3Settings object to specify settings.

// Create a new ES3Settings to enable encryption.
var settings = new ES3Settings(ES3.EncryptionType.AES, myPassword);
// Change the save location to Resources.
settings.location = ES3.Location.Resoucres;
  
// Use the ES3Settings object to encrypt data and save to PlayerPrefs.
ES3.Save<Transform>("myTransform", this.transform, settings);