Unity TextAsset - Is it safe to put game parameter in TextAsset?

Hi All

We have a game with many parameters to configure.
To make it flexible, we put all those parameters in TextAsset.

Is it not safe and easy to be modified by Android user?

Thanks
M40

Any android user can see any text file with the proper app as well as edit it. Large text files have a problem as far as I remember though.

So to answer: “Is it safe?”: no.

“Is it easy to be modified?”: yes

Could you elaborate on this? How large exactly - like are we talking 100 KB or multiple MB when problems happen? What problem? We use fairly large config files in our project and haven’t had any problems,

I believe that the android system may not be capable of loading large text files into memory. All of the editors I have seen choked with 10k or more. You could edit them, but it was incredibly slow.

This may have been a limitation of the app, or the architecture. That would be a little hard to nail it down. I was working on a web file on vacation for work. :frowning:

If the limitation for memory exists, using a large text file editor where you only load a portion of the file into memory may solve it.

This being said, is your goal for someone to edit, or someone not to edit the files? If it is the later NEVER write them as a text file, it doesn’t matter the environment. Write them as binary compressed files. Use zlib or some other compression software to store your data.

Well, the biggest of our config files I’m aware of offhand is 50KB (being read in via MiniJSON as a TextAsset) and it has no problems. We edit it using whatever text editor is handy (usually either MonoDevelop or Visual Studio), and it reads just fine on all devices/platforms we build to (including WebGL, Android, iOS, among others). So… can’t really say what your problems with large TextAssets were, but they don’t seem to be at all universal.