Page 2 of 2
Re: Alerts on loadFromSlot
Posted: Fri Jul 24, 2020 8:46 pm
by cesar101
I think i kinda understand how the BeforeSceneChange/LevelWillBeUnloaded works, and as i wrote in the code, im calling it right before the SceneManager.LoadSceneAsync(). Now, im using the MultiActiveSaver with GameObjects that have the IncrementOnDestroy component attached to them, which leads me to think that when the scene starts, the MultiActiveSaver restore the active state of the gameobjects, and therefore the IncrementOnDestroy component reacts to it, how could i avoid that? or the BeforeSceneChange/LevelWillBeUnloaded are supposed to prevent this behaviour?
Re: Alerts on loadFromSlot
Posted: Fri Jul 24, 2020 9:03 pm
by Tony Li
If you're loading the Ingame scene and then unloading the login scene, then the IncrementOnDestroy GameObjects in the Ingame scene shouldn't be getting destroyed at all. What's causing them to trigger?
Re: Alerts on loadFromSlot
Posted: Fri Jul 24, 2020 9:22 pm
by cesar101
Im not destroying the objects, they are just being set to inactive by the MultiActiveSaver. what i have is a GameObject which has a MultiActiveSaver which has reference as objects to watch, to his childs, which each one has an IncrementOnDestroy component. What i believe is happening is that as soon as the ingame scene loads, and i call the LoadFromSlot, the MultiActiveSaver restores the referenced objects to their active states(which would be false in my case), which causes the IncrementOnDestroy objects to trigger, therefore, the alerts pop up.
Re: Alerts on loadFromSlot
Posted: Fri Jul 24, 2020 9:39 pm
by Tony Li
Got it. That's an oversight on my part. This patch should address it:
PixelCrushers_ActiveSaverPatch_2020-07-24.unitypackage
Before the ActiveSaver/MultiActiveSaver component sets a GameObject inactive when restoring save data, it tells the GameObject's components to ignore the OnDisable message.
Re: Alerts on loadFromSlot
Posted: Fri Jul 24, 2020 10:41 pm
by cesar101
I imported the pacakge and sadly it didn't fix the issue, could it be that im missing something?
Re: Alerts on loadFromSlot
Posted: Sat Jul 25, 2020 7:58 am
by Tony Li
Darn it, I had a typo in MultiActiveSaver. ActiveSaver was fine, though. Here's an updated package:
PixelCrushers_ActiveSaverPatch_2020-07-25.unitypackage
Also, make sure to put the Dialogue Manager prefab in your login scene, and add a DialogueSystemSaver to it.
Re: Alerts on loadFromSlot
Posted: Sat Jul 25, 2020 6:36 pm
by cesar101
That did the trick, thanks a lot for your help.
Re: Alerts on loadFromSlot
Posted: Sat Jul 25, 2020 7:17 pm
by Tony Li
Happy to help!