Skip to content

Comments

Additive sceneloading sceneid fix#175

Merged
miwarnec merged 7 commits intomasterfrom
additive_sceneloading_sceneid_fix
Jan 14, 2019
Merged

Additive sceneloading sceneid fix#175
miwarnec merged 7 commits intomasterfrom
additive_sceneloading_sceneid_fix

Conversation

@paulpach
Copy link
Contributor

No description provided.

@miwarnec miwarnec added the work in progress Need more time to decide. Nothing to do here for now. label Jan 8, 2019
@miwarnec
Copy link
Collaborator

miwarnec commented Jan 8, 2019

this was the bug report: #72

@MrGadget1024
Copy link
Collaborator

I don't think it fixed the problem?

@paulpach
Copy link
Contributor Author

paulpach commented Jan 8, 2019

hang in there vis, I still want to take a look at this one

@paulpach paulpach requested a review from miwarnec January 14, 2019 02:56
@paulpach paulpach added enhancement New feature or request and removed work in progress Need more time to decide. Nothing to do here for now. labels Jan 14, 2019
@miwarnec
Copy link
Collaborator

so all that was left was making preparetospawn public? that's weird

@miwarnec
Copy link
Collaborator

also, I made this comment on the issue last time:

'I need to get some sleep for now. This might work if you try it @MrGadget1024 , but we can't merge it yet because OnPostProcessScene -> setactive(false) -> ondisable -> spawnableObjects.add would add sceneids from objects that are not in the starter scene, which means that there would be problems if someone tries to spawn them even though the extra scene isn't loaded. or perhaps not.'

will have to look into that again

@paulpach
Copy link
Contributor Author

paulpach commented Jan 14, 2019

@vis2k After a client loads/unloads a scene, he needs to call:

NetworkClient.PrepareToSpawnSceneObjects();

which is why this is public.

After a server loads/unloads a scene, we need to call

NetworkServer.SpawnObjects();

Those changes + this pull request = additive scene loading works

@MrGadget1024
Copy link
Collaborator

MrGadget1024 commented Jan 14, 2019

if NetworkClient.PrepareToSpawnSceneObjects(); and NetworkServer.SpawnObjects(); need to be called after unloading a child scene, perhaps these methods need better names? Not very intuitive as they are.

@miwarnec miwarnec merged commit 3c0ff33 into master Jan 14, 2019
@miwarnec
Copy link
Collaborator

@MrGadget1024 if you have an idea for better names then please open another issue/pr

@miwarnec miwarnec deleted the additive_sceneloading_sceneid_fix branch January 14, 2019 21:00
@miwarnec
Copy link
Collaborator

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot referenced this pull request in MirageNet/Mirage Jan 12, 2020
* Fix additive scene loading causing duplicate sceneIds by using an offset per scene.

* TEST: moved SpawnableObjects to NetworkIdentity. OnDisable adds it to the dict. SpawnObject removes it.

* Log if we don't find the spawn scene object

* Fix compilation issues

* Make PrepareToSpawnSceneObjects public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants