Search code examples
unity-game-enginegame-enginedatastore

Save data to AppData and share it between other projects


Is there anyway to save some data and then share it between Unity3D projects?

I was thinking about Application.persistentDataPath but it always use Company Name and Product Name, and create a new folder for every application I run.

e.g.

AppData/CompanyName/Game1/...
AppData/CompanyName/Game2/...
AppData/CompanyName/Game3/...

and my goal is to store everything in one folder, like this:

AppData/CompanyName/...

Solution

  • I wrote my own method to make it.

    public static string GetSharedApplicationPersistentDataPath()
    {
        string appDataWithProductName = Application.persistentDataPath;
        string toReplace = Application.productName;
    
        return result = appDataWithProductName.Replace(toReplace, "");
    }