LogicalError / realtime-CSG-for-unity

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

Convert project to Plugins/ folder only #333

Closed nukeandbeans closed 2 years ago

nukeandbeans commented 2 years ago

This PR: closes #300 closes #332

It also removes some clutter from the texture browser.

Biggest changes are that the entire repo is no longer a unity project, but just the RealtimeCSG folder. Referencing #332, this should make onboarding a bit smoother, and possibly make updating easier for others who don't make any local changes to RCSG.

Additionally, icons are now embedded in a script (I added a zip with the original icons, and a script generator to update embedded content). This does not change how RealtimeCSG handles icons, but only migrates it to the embedded system. In order to use the script generator, one would simply drop the icons into Resources/RealtimeCSG/Icons/ anywhere in the project, press "Find Icons", and then press "Convert". A new version of EmbeddedAssets will be generated in RealtimeCSG/Plugins/Editor/Scripts/Data/Generated/Icons/. This path will always point to the RealtimeCSG folder so that it is always generated in the correct location.

CaseyHofland commented 2 years ago

The inclusion of the package.json is interesting to me. Are you planning on converting Realtime CSG to a package at a later stage?

nukeandbeans commented 2 years ago

The inclusion of the package.json is interesting to me. Are you planning on converting Realtime CSG to a package at a later stage?

This PR does exactly that

CaseyHofland commented 2 years ago

This PR does exactly that

I see, my bad, usually packages don't have a Plugins folder. This one, for example, would normally directly put the API, Editor and Runtime folder at the root.

By chance I also happened to notice that the project now also contains an .asmdef, which is a welcome inclusion. However, note that a second .asmdef needs to be created in the Editor folder, as they ignore conventional folder naming rules. Without an Editor .asmdef, it becomes impossible to build, so I urge that this is looked at quickly.

This also goes for the folders under API > Foundation and API > Legacy.

Refer to Assembly definition and packages for Unity's guidelines.

nukeandbeans commented 2 years ago

By chance I also happened to notice that the project now also contains an .asmdef, which is a welcome inclusion. However, note that a second .asmdef needs to be created in the Editor folder, as they ignore conventional folder naming rules. Without an Editor .asmdef, it becomes impossible to build, so I urge that this is looked at quickly.

The repo is intended to also be used by older versions of unity (back to 5.4), not only newer versions that support package manager, so Plugins/ is necessary, and the format of the repo is intentional. The fix for not being able to build is very simple, and something I had missed when checking everything over. Just change the platform of the .asmdef to editor only. RCSG only generates a mesh, which is the only thing that ends up in the build, so no scripts are built when the player is built.

nukeandbeans commented 2 years ago

See #334. The mentioned issue has been fixed, as far as I can tell. Please add any additional comments there, thanks.