Using this component for collectables.
1. Is it better for performance to disable objects? Should I set both the Mode and DestroyMode to disable?
2. If you have an existing save file with destroyed objects, and I go and change the mode and destroy mode collectable's prefab will this affect save files, or will everything that was collected be remembered anyway?
3. Why does ActiveSaver exist if DestructibleSaver can do the same thing? Or is there a difference between them?
DestructibleSaver performance
DestructibleSaver performance
- Attachments
-
- 1.png (12.99 KiB) Viewed 149 times
Re: DestructibleSaver performance
Hi,
Good questions!
Good questions!
Disable may be marginally better, but it might not be noticeable.
Collectables that have already been marked as destroyed in the save file will be destroyed when you load the save file, even if you change the Mode. However, they will be "destroyed" using the Destroy Mode, which may be different from when the save file was made.
They're similar but slightly different. ActiveSaver saves whether a target GameObject is active or inactive, but will not save anything if you destroy the target GameObject. DestructibleSaver does nothing if the GameObject is not disabled or destroyed (depending on Mode). If the GameObject is disabled or destroyed, it records that the GameObject was destroyed.