adammyhre / Unity-Utils

Extension Methods and Utils for Unity Game Dev
The Unlicense
392 stars 34 forks source link

Adpot Unity's package strucutre convention #9

Open cN3rd opened 3 months ago

cN3rd commented 3 months ago

Hi, and thanks for all your interesting videos!

Traditionally, unity packages follow a specific layout convention detailed in this link. Notably, these directories:

Currently, Unity-Utils does not follow this convention. Instead, it contains UnityUtils/UnityUtils.asmdef and UnityUtils/Scripts/Hotkeys/Editor/UnityUtils.Hotkeys.asmdef. In my opinion, following Unity's convention would improve maintainability in the long term, as e.g. editor-specific functions would expand beyond providing hotkeys, and allow you to include extra functionality such as samples that can be installable from unity's own package manager.

I don't mind PRing the changes myself, however following your comment from #4:

I'm going to start enforcing some standards - starting with no more PRs without an approved Issue.

I'm opening this issue to get the required approval.

Thanks for your time!

Ddemon26 commented 2 months ago

I understand your suggestion to follow Unity's traditional package layout, which typically organizes assets into directories like Runtime, Editor, and Tests. This structure is useful in many cases, especially for packages targeting specific functionality or systems within Unity. However, in the case of Unity-Utils, this package is designed to serve multiple purposes and not just a single, focused system.

One of the benefits of assembly definitions (asmdefs) is that they help the compiler by dividing code into different assemblies. This can make compilation more efficient in larger projects, as only relevant code gets recompiled. Since Unity-Utils is a more generalized utility package and not strictly focused on runtime or editor-specific content, organizing it by asmdefs allows us to manage various aspects of the package separately, improving modularity and compilation times as the project grows.

That said, I don't think the standard Unity layout is necessary here. It might be better suited to packages that focus on one specific system or functionality. For Unity-Utils, grouping folders by their respective asmdefs makes more sense and keeps the package flexible as it expands in different areas.