I have a prefab Block. In my scene hierarchy, there is a lot of Blocks:
The prefab contains a code that contains an integer value called id.
I wrote a script (to run in edit mode) that sets random values to the id of all blocks and it works well, but when I hit play, all ids go back to 0. If I set the id manually in inspector, it stays correct during runtime.
What is this problem? Any ideas on how I can fix?
I tried to use things like PrefabUtility.RecordPrefabInstancePropertyModifications but it didn't work (or I don't know how to use it correctly).
