On Steam our game has 2 versions: a payed full one and a free demo one.
When the player buys the full version it copies the progress from the demo and continues from where the player stopped in the demo. It is implemented pretty simple. To store the progress we use ‘<Application.persistentDataPath>/Demo’ for the demo version and ‘<Application.persistentDataPath>/Full’ for the full version. So it’s quite easy to copy required files from one folder into another one.
However, it appeared that this feature neither works on Mac OSX after we updated the project to one of the latest versions of Unity (2019.4.21).
The thing is that for the demo version Application.persistentDataPath is ‘Library/Application Support//’, but for the full version it is ‘Library/Application Support/’. Obviously, it’s kinda impossible to rely on these paths anymore.
Any clues why Unity chooses different paths?
PS. Both versions are implemented as a single project. We just update product name and some preprocessor directives during the build.
Looks like this is a backwards compat thing. At some point in the past (before Unity 5.2), macOS persistent data path was stored in ‘Library/Application Support//’. However, in Unity 5.2 we changed it to be stored at ‘Library/Application Support/’ because that became a requirement for Mac App Store submission. However, to preserve backwards compatibility for older projects that were upgraded to 5.2, we first check if ‘Library/Application Support//’ folder exists, and if it does, we use that (so that games could still find their old data). If it doesn’t exist, we will use ‘Library/Application Support/’ instead.
It looks like the documentation is incorrect (it’s swapped). Unity uses “~/Library/Application Support/unity.company name.product name” on macOS Standalone player. It was changed to that from “~/Library/Application Support/company name/product name” in 2011 (10 years ago!).