Unity Client - Project Structure
Back to ezysmashers1. Folder structure
- ezysmashers-unity/Assets
- StreamingAssets: contains game configuration file
config.json
, which is not converted to binany file and can be editted after built. - WebGLTemplates: contains a template designed specifically for ezyplatform-based web game
- youngmonkeys/ezysmashers:
- _Project
- _Resources: contains game resources like animators, images, textures, etc
- Actions: contains actions for the new Unity's input system
- Prefabs: contains reusable game prefabs
- Scenes: contains game scenes including PreLoaderScene, LoginScene, LobbyScene, GameLoungeScene, etc
- ScriptableObjects: contains scriptable objects representing UI events
- Scripts: contains C# scripts, whose structure is detailed in section 3
- Extensions: contains the ezyfox-server-csharp-sdk to communicate with ezyfox socket server
- JsonDotNet: a library offering flexible and efficient JSON serialization and deserialization capabilities
- TextMesh Pro: offers better game UI components than built-in Unity UIs
- _Project
- StreamingAssets: contains game configuration file
2. Scene structure
- PreLoaderScene: loads game configurations, initialises some common singletons being used across all scenes
- LoginScene: includes user login UIs/functionalities
- ForgotPasswordScene: includes UIs/functionalities to reset password
- LobbyScene: displays a common lobby room where users can find/join game rooms from here
- GameLoungeScene: displays a waiting area before a game room starts
- Game2DScene: displays a game room
3. Code structure
- config: contains data structures to represent what is in
StreamingAssets/config.json
- constant: contains constant values or enumerations used throughout this project
- controller: communicates with HTTP server or socket server
- converter: converts between different object types (request, model, response, etc)
- event: contains scriptable object-based game event classes
- http: contains a singleton class to handle HTTP requests/responses
- manager: contains singletons to manage different data/states of the game
- model: contains data transfer objects used throughout the project, which are generally managed by data managers
- presenter: handles game logics, data interactions, control how components are displayed
- request: contains objects representing HTTP requests sent to the HTTP server
- response: contains objects representing HTTP/Socket responses from server
- util: contains utility classes used throughout the game
- view: contains unity MonoBehaviour components displaying different items/UIs/players in the game