Do you recognise in one of the following Unity developer situation?
– You are working a your brand new amazing Unity project and you don’t know how to start?
– Does your controllers become massive and hard to understand or to add new features?
– You feel like what you are planning to do will result in spaghetti code after a few modifications?
– You spend a considerable amount of time fixing edge cases bugs?
– Adding a new feature means regression and massive refactoring?
– Your app result in a bunch of closely coupled modules?
– You don’t know why your Player class is now tightly coupled with that Enemy other class?
– You feel like the effort vs benefit tradeoff with TDD isn’t worth it?
But it doesn’t have to be that way. You don’t have to stick with MVC and massive MonoBehaviour classes. You are looking for something better.
The Controller-Manager Issue
You know that MVC is not sufficient for large Unity projects. As your app grows you end up with plenty large classes and your view is tied to your models. You have no reusability, you don’t even know how to test it as there is so much coupling.
So you’ve tried to look at some relevant Unity projects, sample code and so on but the process is too slow and you are only gathering some small tips and not general Unity application architecture guidelines.
Imagine if you could know quickly and exactly where things are, fix bugs easily and add new features without breaking any existing code. Imagine if you could add a new feature and tell very precisely which amount of time it will take to implement.
Imagine if you could make clients say yes to Test Driven Development, and show them solid proof how their investment pays off.
A good application architecture facilitates testing.
Read the Clean Unity Architecture post to get details about how to implement this architecture for your Unity projects.
This post demonstrates the concepts using the example of a generic Objectives system which allow the player to validate general game objectives and level objectives, and keep track of its objectives completion status.
It also walks you through how to use the Clean Unity C# templates to generate the Clean Unity components.
This is a brief description of the full product which details how to implement a generic Objectives system which will be reusable in all your games, and easy to extend !
You will learn how to:
- Apply Clean Unity and the VIP cycle to design Unity reusable modules
- Separate concerns in view controller, interactor, worker and presenter modules
- Write fast and maintainable tests with confidence to make changes
- Write unit tests to ensure your application will be open to changes
- Deep dive into each Clean Unity component
- How does Clean Unity perform in a large project
- Extract complex interactor logic into workers