DestructibleSaver performance

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

DestructibleSaver performance

Post by SealDev »

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?
Attachments
1.png
1.png (12.99 KiB) Viewed 149 times
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: DestructibleSaver performance

Post by Tony Li »

Hi,
Good questions!
SealDev wrote: Sat Aug 06, 2022 1:49 pm1. Is it better for performance to disable objects? Should I set both the Mode and DestroyMode to disable?
Disable may be marginally better, but it might not be noticeable.
SealDev wrote: Sat Aug 06, 2022 1:49 pm2. 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?
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.
SealDev wrote: Sat Aug 06, 2022 1:49 pm3. Why does ActiveSaver exist if DestructibleSaver can do the same thing? Or is there a difference between them?
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.
Post Reply