-
Notifications
You must be signed in to change notification settings - Fork 8
Assemblies
This document is best read with a basic understanding of...
- C# and Assemblies
- Unity-specific concepts like Assembly definitions and Edit Mode vs. Play Mode tests
This project contains various assembly definitions all serving different purposes.
This assembly contains all tests that test...
- functionality only available inside the Editor
- classes that don't derive from MonoBehavior
- classes that don't require an active Unity scene
When creating unit tests for new functionality, it is generally encouraged to place them here, as they're quicker to run than PlayMode tests.
It also encourages code to be written in a way that only interact with Unity-internal components if absolutely necessary.
This assembly contains all tests that test...
- classes that derive from MonoBehavior on their own
- interaction between multiple classes that derive from MonoBehavior
- classes that require Unity-internal components like
AudioSource
,Rigidbody
,InputAction
-
scenes, rather than individual classes; examples include:
- verifying a specific narrative script is playable from start to finish
- verifying player inputs update UI elements or progress the game accordingly
- save data is persisted when scenes are reloaded
Creating play mode tests should ideally be limited to test which... - help assert that the entire game loop is playable via user inputs (this is highly encouraged!) - cover components that cannot be covered during EditMode
This assembly only contains resources required to extend Editor functionality.
This assembly only contains resources that are required for the final game.
Assets (like placeholder sprites, scripts that serve as developer guidance) that are not required by the final game, should be placed inside the Demo
assembly instead.
This assembly contains all resources that don't fit inside any of the previous assemblies.
Its main purpose is to contain scenes or scripts that may be used to show of functionality that has been built but not yet integrated into the game (this could be because of missing assets like sprites, audio or narrative scripts).
Similarly, it should also house placeholder resources, so that building the game fails, if they are referenced by anything inside the Game
assembly.