Skip to content

Folder Structure

Andreas Stange edited this page Jun 10, 2022 · 2 revisions

Prefer PascalCase when naming folders and files. Prefer plural forms when naming folders (e.g. Images instead of Image).

The current assets folder hierarchy is structured by scene and combines assets that implement a common idea. The goal is to have assets nearby that are closely related to each other, such that a task at hand can be done with little search in the folder hierarchy.

As a result, assets that are used in only one scene are placed in the folder of this scene. Similarly, assets that implement a common idea (e.g. a DragonImage.png, DragonControl.cs, DragonSound.ogg) could go to a common folder Dragon.

Common Code in Unity Package

The UltraStar Play repo holds multiple Unity projects: one for the main game and one for the Companion App. Common code of these projects is placed in a Unity package /UltraStar Play/Packages/playshared. The playshared package is then referenced in the Packages/manifest.json file of other Unity projects.

Folder Structure

Top level structure:

Where What
/ Main repo folder. Try to not add any new files here, but instead place them in a fitting subfolder.
/tools/ Any build scripts, templates, helper stuff for devs, code checking stuff, lint templates.
/UltraStar Play/ Unity project of the main game
/UltraStar Play Companion/ Unity project of the Companion App
/UltraStar Play/Packages/playshared Unity package with common code of main game and Companion App

Inside a Unity project (or inside the package for common code):

Where What
./Assets/Editor/ Special folder for code that extends the Unity Editor. Also, our unit tests and integration tests go here
./Assets/Plugins/ Third party libraries
./Assets/Scenes/ Unity scene files with their related assets
./Assets/Common/ Assets that are used only in this Unity project in multiple scenes or are not related to any scene
./Assets/Common/Audio/ Common sound files and code related to audio processing and pitch detection
./Assets/Common/Graphics/ Common visual assets, e.g. icons, background images
./Assets/Common/Input/ InputAction configuration and code for input handling
./Assets/Common/Model/ Code related to the data model and related (single instance) manager classes
./Assets/Common/Network/ Code related to network communication (e.g. with Companion App)
./Assets/Common/Network/Dto "Data transfer objects", i.e., classes that are (de)serialized to JSON to exchange messages
./Assets/Common/R/ Generated classes that hold constants to reference resources
./Assets/Common/Util/ Rather generic utility code that is not specific to this karaoke game
Clone this wiki locally