News for hackers. Stuff that matters.
Re:Basic Concepts in Unity for Software Engineers by jayd16 on Monday October 12, 2020 @02:32AM (#24751950)
The Unity example code is laughably bad.

But don't use dependency injection. Unity's Scene/Prefab load/instantiation is already a form of DI. Using another causes issues with juggling multiple lifecycles.

You also lose the ability for Unity to prefetch assets because Unity can't inspect the dependency graph if it's not done through the asset system. Instead you hit situations where you're loading several objects and running DI code over several frames when unity could have loaded everything at once.

Re:Basic Concepts in Unity for Software Engineers by andypants on Monday October 12, 2020 @09:36AM (#24754189)
You can use unity-aware dependency injection with extenject: https://github.com/svermeulen/Extenject