LogicalError / realtime-CSG-for-unity

Realtime-CSG, CSG level editor for Unity
https://realtimecsg.com
MIT License
735 stars 77 forks source link

Fix SceneView UI layout issues with 2021.2+ #330

Closed nukeandbeans closed 2 years ago

nukeandbeans commented 2 years ago

This PR should resolve #327, and should self-adjust to any docked overlay toolbars automatically. It also fixes the scene info overlay in the same way, as it also relied on SceneView.postion to get the width/height of the scene view. The new method should use SceneView.rootVisualElement.contentRect instead, which accounts for any docked overlays, etc.. This PR does NOT fix the issue of overlays blocking the RCSG windows/toolbar, nor does it fix #318

nukeandbeans commented 2 years ago

In the future, it may be worthwhile to re-visit this and provide an actual proper fix (actually use overlays), so that there are no overlapping windows or other problems going forward. It should theoretically be possible to just call the IMGUI code inside of an overlay, instead of rewriting the entire thing. Just some thoughts.

HeadClot commented 2 years ago

Hey, I am running into an issue with this PR. I cannot draw out any form of CSG Shapes in the viewport. Is anyone else running into this issue?

I am on Unity 2021.2.7f1 and I am getting no errors.

Edit: I just tried it with the Master branch and I am not having any issues with drawing out CSG shapes. It is very much an issue with this PR.

andreiagmu commented 2 years ago

@Kerfuffles @LogicalError I'm having the same issue with this PR that @HeadClot commented above. I'm testing in Unity 2021.2.6f1, and I can't draw any CSG Shape in the viewport. In the Master branch, the shapes drawing works correctly.

andreiagmu commented 2 years ago

I fixed the issue, line 520 from EditModeManager.cs should be var sceneSize = sceneView.position.size; like in the master branch.

Now RCSG is working properly on Unity 2021.2 here :)

nukeandbeans commented 2 years ago

I fixed the issue, line 520 from EditModeManager.cs should be var sceneSize = sceneView.position.size; like in the master branch.

Now RCSG is working properly on Unity 2021.2 here :)

This did indeed fix the issue! Thanks for that! In addition to those changes, I changed the sliders in the sphere and cylinder generators, to buttons, which is a change I had done in my own personal project as a workaround to the buggy input with sliders in the scene view.

HeadClot commented 2 years ago

Cannot wait to see this merged :)

LogicalError commented 2 years ago

Actually, I'm not sure if it's a good idea to commit all the ProjectSettings assets + ProjectVersion.txt since that will cause problems with older versions of unity

LogicalError commented 2 years ago

Sorry, there was another commit to fix another issue & it touched some of the things you touched..

nukeandbeans commented 2 years ago

Actually, I'm not sure if it's a good idea to commit all the ProjectSettings assets + ProjectVersion.txt since that will cause problems with older versions of unity

I would like to change the repo to a package, or to just the Plugins/ folder. There seems to be a common confusion issue from others due to the entire repo being a project.

LogicalError commented 2 years ago

Actually, I'm not sure if it's a good idea to commit all the ProjectSettings assets + ProjectVersion.txt since that will cause problems with older versions of unity

I would like to change the repo to a package, or to just the Plugins/ folder. There seems to be a common confusion issue from others due to the entire repo being a project.

Fair enough, but addressing those issues would make more sense as a separate PR since we'd need to figure out how to best do this

nukeandbeans commented 2 years ago

Actually, I'm not sure if it's a good idea to commit all the ProjectSettings assets + ProjectVersion.txt since that will cause problems with older versions of unity

I would like to change the repo to a package, or to just the Plugins/ folder. There seems to be a common confusion issue from others due to the entire repo being a project.

Fair enough, but addressing those issues would make more sense as a separate PR since we'd need to figure out how to best do this

Right. That was the plan. I may look into doing that at a later time, though.

nukeandbeans commented 2 years ago

I am basically done changing anything with this PR, if nothing else needs fixing/revision.