Save System: How do savers on spawned objects work ?
Posted: Sat Nov 27, 2021 2:18 am
I don't understand how savers on spawned objects (managed throught SpawnedObjectManager and SpawnedObject) are supposed to work.
The SpawnedObjectManager records this data: prefabName, position, rotation
The SpawnedObject itself records no data, it only registers/unregisters with the SpawnedObjectManager
I don't see how savers on the spawned object get their save data. I can't assign a key to the saver in the prefab, obviously, as it would be the same across all instances. I likewise can't leave it empty so it uses the gameObject name because again there's no guarantee that that's unique. The SpawnedObjectManager doesn't save any keys from any savers - so how?
Additionally, I have a number of spawned objects that start existing in the level, but can be destroyed by the player. This part appears to work (i.e. when I load a game, they correctly don't exist).
The SpawnedObjectManager records this data: prefabName, position, rotation
The SpawnedObject itself records no data, it only registers/unregisters with the SpawnedObjectManager
I don't see how savers on the spawned object get their save data. I can't assign a key to the saver in the prefab, obviously, as it would be the same across all instances. I likewise can't leave it empty so it uses the gameObject name because again there's no guarantee that that's unique. The SpawnedObjectManager doesn't save any keys from any savers - so how?
Additionally, I have a number of spawned objects that start existing in the level, but can be destroyed by the player. This part appears to work (i.e. when I load a game, they correctly don't exist).