In my RPG, I have implemented dynamic system for item creation:
When I want to create a new item at runtime, I base its parameters(icon, name, ...) from a prefab that serves as item database and has such values for all items. I take those values and put them into an newly created class that serves as item in-game representation.
Then, when I want to save, I use JSON to save the data to harddrive. Now the problem comes:
JSON will save parameters like icon as InstanceID
. From research I did, it seems InstanceId
might change in between Unity runs.
So what is the propper way of saving resource references at runtime to disk and loading them in between Unity runs?