Forum rules - please read before posting.

[Bug] Adding a scene does not load data

edited August 2018 in Engine development
Creating an additive scene and adding it, does not load objects into proper states. It seems that removing a scene serializes its data as intended, but adding a scene fails to load the data. It seems that its because: LevelStorage.cs -> SendDataToScene() loop has a check:

if (saveObject != null && UnityVersionHandler.ObjectIsInActiveScene (saveObject.gameObject))

The culprit is the second condition. Since all additive scene objects are not in active scene, they get skipped. I feel like the behavior should be consistent. Either removing scene saves nothing and adding scene loads nothing or removing saves and adding loads. Or, you check/uncheck a checkbox for desired behavior in both scene add and scene remove.

Version: 1.64.1

Edit:
Replacing the second conditional with:

saveObject.gameObject.scene.buildIndex == levelData.sceneNumber)

should fix the issue and still avoid undesired overwrites in wrong subscenes

Comments

  • edited August 2018
    Sub-scene data should be serialized and de-serialized when closed and opened.  I'll look into this, thanks for the report.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.