UnityTechnologies / open-project-1

Unity Open Project #1: Chop Chop
http://unity.com/open-projects
Apache License 2.0
5.73k stars 2.03k forks source link

Systems are not isolated from the rest of the project #182

Closed neon-age closed 3 years ago

neon-age commented 3 years ago

Every System needs to live in it's own assembly (like StateMachine does), as we don't want to accidentally create dependencies hell.

Currently Audio system depends on AudioCueEventSO that is located in Events folder. It also depends on Factory and Pool at the same time, but they're in two different folders (when they need to be in a single assembly).

Also, when I was writing custom editor with ReorderableList for AudioCue (#181), it took this random zombie script instead of UnityEditorInternal.ReorderableList. It would've never happend inside isolated assembly!

Also, please change namespace UOP1 to ChopChop, thanks 😊

ciro-unity commented 3 years ago

we don't want to accidentally create dependencies hell.

Dependencies happen whether or not .asmdef are there. So they are not a cure.

Factory and Pool don't need to be in the same assembly, as @davejrodriguez pointed out in his PR for documentation #189, they are two tools and the Factory could be used independently.

I have removed the stray ReorderableList script, but other than that I am not 100% sure filling the project with .asmdefs is the way to go. If you fancy reorganising things though, make a PR for it! But isn't it harder to handle scripts after that? Compilation times are not high, so I don't see much use for .asmdef-fing the whole project.

Also, we prefer to keep UOP1 as a prefix rather than ChopChop.

neon-age commented 3 years ago

It's easier to manage the Systems like that - think of them as a Packages. And it's not about compilation time benefit, it's for good project organisation and reusability.

Here's some current problems I've encountered:

I'll make a PR then, just worried it would conflict with others.

ciro-unity commented 3 years ago

Should I close this issue?

neon-age commented 3 years ago

Welp, it only got worse overtime.