I am making a mobile game.
I need to get data from a file. But, I don’t know How I will found file’s location in phone. For example, İf I want to get data from file in PC, I write file’s location(like “/games/game1/files/file1”) in the code to get data from file. But I don’t know How I will found file’s location in phone.
Can someone help me with this?
PlayerPrefs are very useful to save and load data.
You can use SetFloat(), SetInt() and SetString() to set data, and GetFloat(), GetInt(), and GetString() to load it. You can also save more complex stuff such as arrays, but that’s more complicated.
There are lots of useful tutorials for this on Youtube.
You can see the documentation for PlayerPrefs here: Unity - Scripting API: PlayerPrefs
I understand but I cant use playerPrefs to do this, because data is a words data. there are A LOT OF words in data. I need to put the words in arrays to can use playerPrefs. If I do this, Game optimization gets very bad. So, I can’t do this.
In order to access directories beyond the application’s standard file system access, you will need read/write permissions.
If you are creating the files and maintaining them yourselves, I’d recommend using Unity - Scripting API: Application.persistentDataPath
But, if you still want to access other files, ensure that your app has read/write permissions.
Try this if it is for Android, https://discussions.unity.com/t/how-can-i-browse-files-on-android-outside-of-the-unity-app-folder/178021
Here is a no-brainer approach, if you need some sort of a file picker. UnityNativeFilePicker: A native Unity plugin to import/export files from/to various document providers on Android & iOS
I know this folder, but I don’t know How I will use this folder. what’s connection between phone and this folder? How I wlll use this folder?