ClientSim icon indicating copy to clipboard operation
ClientSim copied to clipboard

Fix broken Remove EditorOnly

Open mfmfuyu opened this issue 2 years ago • 4 comments

Remove "Editor Only" is not working correctly currently. GetRootGameObjects seems to return an empty result before the scene is loaded. By doing this, Removing GameObject processing is not working correctly.

CyanEmu is using AfterSceneLoad, but ClientSim is using BeforeSceneLoad. So, I did use AfterSceneLoad like as CyanEmu. The code is a copy from here and here.

I tested these changes in my own 2 projects. It seems working correctly with Remove EditorOnly and other functions. But I think need more tests, If dependent it's BeforeSceneLoad.

mfmfuyu avatar Jan 17 '23 04:01 mfmfuyu

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Jan 17 '23 04:01 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

mfmfuyu avatar Jan 17 '23 04:01 mfmfuyu

Sorry for my lack of research. I could'nt find this related issue when I created this PR. This issue is already created on #33

mfmfuyu avatar Jan 19 '23 01:01 mfmfuyu

I've tried this and it appears to break the functionality of enter and exit station events in ClientSim. It may also break some other things but that was the first thing I noticed. (Edit: it also breaks pickups)

Changing it by moving just the DeleteEditorOnly code to after scene load doesn't appear to cause any issues so that's what I am going with for now on my end and I'll contribute a PR after I fix the integration tests. (Changing my editor settings to enable Enter Playmode Settings is not a workaround as this causes ClientSim to crash in all my projects, which is issue #20)

mahuvrc avatar Apr 04 '23 03:04 mahuvrc