- Application.persistentDataPath
- Success!
- Submission failed
- Description
- Application.persistentDataPath
- Success!
- Submission failed
- Description
- Application.persistentDataPath
- Success!
- Submission failed
- Description
- Application.persistentDataPath
- Success!
- Submission failed
- Description
- Application.persistentDataPath
- Success!
- Submission failed
- Description
Application.persistentDataPath
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
(Read Only) Contains the path to a persistent data directory.
This value is a directory path where you can store data that you want to be kept between runs. When you publish on iOS and Android, persistentDataPath points to a public directory on the device. Files in this location are not erased by app updates. The files can still be erased by users directly.
When you build the Unity application, a GUID is generated that is based on the Bundle Identifier. This GUID is part of persistentDataPath. If you keep the same Bundle Identifier in future versions, the application keeps accessing the same location on every update.
Windows Store Apps: Application.persistentDataPath points to %userprofile%\AppData\Local\Packages\
Windows Editor and Standalone Player: Application.persistentDataPath usually points to %userprofile%\AppData\LocalLow\ \
. It is resolved by SHGetKnownFolderPath with FOLDERID_LocalAppDataLow, or SHGetFolderPathW with CSIDL_LOCAL_APPDATA if the former is not available.
WebGL: Application.persistentDataPath points to /idbfs/ where the data path is the URL stripped of everything including and after the last ‘/’ before any ‘?’ components.
Linux: Application.persistentDataPath points to $XDG_CONFIG_HOME/unity3d or $HOME/.config/unity3d .
iOS: Application.persistentDataPath points to /var/mobile/Containers/Data/Application/ /Documents .
tvOS: Application.persistentDataPath is not supported and returns an empty string.
Android: Application.persistentDataPath points to /storage/emulated/0/Android/data/
/files on most devices (some older phones might point to location on SD card if present), the path is resolved using android.content.Context.getExternalFilesDir.
Mac: Application.persistentDataPath points to the user Library folder. (This folder is often hidden.) In recent Unity releases user data is written into
/Library/Application Support/company name/product name . Older versions of Unity wrote into the
/Library/Caches folder, or
/Library/Application Support/unity.company name.product name . These folders are all searched for by Unity. The application finds and uses the oldest folder with the required data on your system.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright ©2021 Unity Technologies. Publication Date: 2021-11-26.
Источник
Application.persistentDataPath
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Contains the path to a persistent data directory (Read Only).
This value is a directory path where you can store data that you want to be kept between runs. When you publish on iOS and Android, persistentDataPath points to a public directory on the device. Files in this location are not erased by app updates. The files can still be erased by users directly.
When you build the Unity application, a GUID is generated that is based on the Bundle Identifier. This GUID is part of persistentDataPath. If you keep the same Bundle Identifier in future versions, the application keeps accessing the same location on every update.
Windows Store Apps: Application.persistentDataPath points to %userprofile%\AppData\Local\Packages\
iOS: Application.persistentDataPath points to /var/mobile/Containers/Data/Application/ /Documents.
Android: Application.persistentDataPath points to /storage/emulated/0/Android/data/
/files on most devices (some older phones might point to location on SD card if present), the path is resolved using android.content.Context.getExternalFilesDir.
Note: The persistentDataPath on a Mac is written into the user Library folder. (This folder is often hidden.) In recent Unity releases user data is written into
/Library/Application Support/company name/product name . Older versions of Unity wrote into the
/Library/Caches folder, or
/Library/Application Support/unity.company name.product name . These folders are all searched for by Unity. The application finds and uses the oldest folder with the required data on your system.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright © 2020 Unity Technologies. Publication Date: 2020-06-05.
Источник
Application.persistentDataPath
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Contains the path to a persistent data directory (Read Only).
This value is a directory path where you can store data that you want to be kept between runs. When you publish on iOS and Android, persistentDataPath points to a public directory on the device. Files in this location are not erased by app updates. The files can still be erased by users directly.
When you build the Unity application, a GUID is generated that is based on the Bundle Identifier. This GUID is part of persistentDataPath. If you keep the same Budle Identifier in future versions, the application keeps accessing the same location on every update.
Windows Store Apps: Application.persistentDataPath points to %userprofile%\AppData\Local\Packages\
iOS: Application.persistentDataPath points to /var/mobile/Containers/Data/Application/ /Documents.
Android: Application.persistentDataPath points to /storage/emulated/0/Android/data/
/files on most devices (some older phones might point to location on SD card if present), the path is resolved using android.content.Context.getExternalFilesDir.
Note: The persistentDataPath on a Mac is written into the user Library folder. (This folder is often hidden.) In recent Unity releases user data is written into
/Library/Application Support/company name/product name . Older versions of Unity wrote into the
/Library/Caches folder, or
/Library/Application Support/unity.company name.product name . These folders are all searched for by Unity. The application finds and uses the oldest folder with the required data on your system.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
You’ve told us this page needs code samples. If you’d like to help us further, you could provide a code sample, or tell us about what kind of code sample you’d like to see:
You’ve told us there are code samples on this page which don’t work. If you know how to fix it, or have something better we could use instead, please let us know:
You’ve told us there is information missing from this page. Please tell us more about what’s missing:
You’ve told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You’ve told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You’ve told us there is a spelling or grammar error on this page. Please tell us what’s wrong:
You’ve told us this page has a problem. Please tell us more about what’s wrong:
Thanks for helping to make the Unity documentation better!
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright © 2019 Unity Technologies. Publication: 2018.3-002V. Built: 2019-04-15.
Источник
Application.persistentDataPath
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Contains the path to a persistent data directory (Read Only).
The value is a directory path where data expected to be kept between runs can be stored. When publishing on iOS and Android, persistentDataPath will point to a public directory on the device. Files in this location won’t be erased with each update of the App. However, you should bear in mind that this is not foolproof against users’ actions. For example, removing the SD Card would make data stored on it inaccessible. Note that when you build the app, a GUID will be generated based on the Bundle Identifier, and this GUID will be part of persistentDataPath. If you keep the same Bundle Identifier in future versions then the app will continue accessing the same location on every update.
Windows Store Apps: Application.persistentDataPath points to %userprofile%\AppData\Local\Packages\
Note: The persistentDataPath on a Mac is written into the user Library folder. (This folder is often hidden.) In recent Unity releases user data is written into
/Library/Application Support/company name/product name . Older versions of Unity wrote into the
/Library/Caches folder, or
/Library/Application Support/unity.company name.product name . These folders are all searched for by Unity. The oldest folder that contains the required data is used for the application.
Did you find this page useful? Please give it a rating:
Источник
Application.persistentDataPath
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Contains the path to a persistent data directory (Read Only).
This value is a directory path where you can store data that you want to be kept between runs. When you publish on iOS and Android, persistentDataPath points to a public directory on the device. Files in this location are not erased by app updates. The files can still be erased by users directly.
When you build the Unity application, a GUID is generated that is based on the Bundle Identifier. This GUID is part of persistentDataPath. If you keep the same Bundle Identifier in future versions, the application keeps accessing the same location on every update.
Windows Store Apps: Application.persistentDataPath points to %userprofile%\AppData\Local\Packages\
iOS: Application.persistentDataPath points to /var/mobile/Containers/Data/Application/ /Documents.
Android: Application.persistentDataPath points to /storage/emulated/0/Android/data/
/files on most devices (some older phones might point to location on SD card if present), the path is resolved using android.content.Context.getExternalFilesDir.
Note: The persistentDataPath on a Mac is written into the user Library folder. (This folder is often hidden.) In recent Unity releases user data is written into
/Library/Application Support/company name/product name . Older versions of Unity wrote into the
/Library/Caches folder, or
/Library/Application Support/unity.company name.product name . These folders are all searched for by Unity. The application finds and uses the oldest folder with the required data on your system.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright ©2021 Unity Technologies. Publication Date: 2021-11-26.
Источник