Assemblies - Studio-Lovelies/GG-JointJustice-Unity GitHub Wiki
Knowledge requirements
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
Overview
This project contains various assembly definitions all serving different purposes.
EditModeTest
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.
PlayModeTest
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
Editor
This assembly only contains resources required to extend Editor functionality.
Game
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.
Demo
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.