P
P
Pavel2018-03-14 21:24:10
Unity
Pavel, 2018-03-14 21:24:10

Is it possible to store information in a ScriptableObject?

Is it possible to store user settings not in PlayerPrefs, but in a ScriptableObject file stored in resources? Are these files saved after the platform build? If it is possible, then why is it bad/good?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Basmanov, 2018-03-14
@youkerni

You can, but the changes will not be saved in the assembly, only in the editor. If you want to be saved, then you need to serialize the ScriptableObject and write somewhere to disk. When I last looked, changes to resource files only existed during the lifetime of the application. Except for the need for serialization, storing settings in a ScriptableObject is very convenient, especially if you need to look at or correct something in the editor.

F
freeExec, 2018-03-14
@freeExec

These assets are readonly, they can store some game characteristics, but not user settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question