Is it possible to append the save/load path at runtime.

Discussion and help for Easy Save 3
Post Reply
kytestar
Posts: 2
Joined: Wed Jun 24, 2020 1:58 am

Is it possible to append the save/load path at runtime.

Post by kytestar »

Hello

Not using Playmaker, doing this via code.

Initially I wanted to use the streamingAssets path, but that does not seem to be an option. I am now using the persistantDataPath but want to add folders to this path with different save files in. I am building a quiz system and the user will be able to add images and music files to each different quiz they create (ideally I would still prefer to use streamingAssets in case my end user is using an SSD for their system drive).

So, what I am ideally looking for is a way to do something like this: Path = Application.streamingAssets + "/" + UserSaveDirectory(x); // Where x is the different quizzes that the user creates.

I just cannot work out how to change the path of ES3 to work with that method.

Would really love a bit of assistance.

many thanks, Steve
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Is it possible to append the save/load path at runtime.

Post by Joel »

Hi Steve,

You can set the save path by providing the filePath parameter. I.e.

Code: Select all

ES3.Save(key, data, Application.streamingAssetsPath + "/myDirectory/file.es3");
For more information see the Settings, Paths and Locations guide.

Note that you cannot write to the streaming assets path in a built player, and Android and WebGL do not support it at all. See Unity's Streaming Assets docs for more information: https://docs.unity3d.com/ScriptReferenc ... sPath.html

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
kytestar
Posts: 2
Joined: Wed Jun 24, 2020 1:58 am

Re: Is it possible to append the save/load path at runtime.

Post by kytestar »

Brilliant. Thank you so much for the quick and detailed reply :)

Steve
Post Reply