How to reference the right objects when loading persisted States
Hello together.
I have a bit of a problem with persisting the state of my NPCs. Maybe someone has an idea how I could tackle this.
Example: I have 10 NPCs that I placed on the map during Design-Time and when I hit save, a list of npc properties gets saved. When loading the saved data in a new session, how do I know, which existing NPC object, gets which saved property?
Right now, my only idea was to destroy all placed NPCs after a level was loaded and recreate "new" NPCs with the saved data. But that does not seem very efficent :D Is there a way to automatically give a gameobject an unique id during design-time?
Thanks in advance for any help!
Your answer
Follow this Question
Related Questions
If statement fails... 0 Answers
One JSON file, multiple objects, multiple scenes... 0 Answers
How to read specific line with Streamreader in c#? 1 Answer
Unity Crashes during package resolution? 1 Answer
Animation start delay 0 Answers