- Home /
AssetDatabase.Refresh ()
Hi, i have a code like this :
if UNITY_EDITOR
UnityEditor.AssetDatabase.Refresh (); #endif
i use the code to refresh the json file when i write or rewrite and it work fine on Unity. Is that only work on the Unity Editor or can work on Android and iPhone?. If cann't, what should i use to refresh after write the data to the file?. thanks for the help, sorry for the bad english :)
Answer by AlucardJay · Mar 21, 2018 at 05:02 AM
This is just to refresh (reimport) assets that have been modified in the editor project window, usually so you can see the changes that have been made in the editor. Hence the Platform Dependant directive "if I'm running in the editor, refresh the project assets so I can see them in the editor"
https://docs.unity3d.com/ScriptReference/AssetDatabase.Refresh.html
https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
Answer by PEZO19 · Dec 02, 2019 at 03:09 PM
Use persistentDataPath:
https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html