Overview
This lecture series explains how to create a complete, cleanly coded game project in Unity using C#, covering everything from project setup to adding polish, UI, sound, and essential gameplay features. The course emphasizes best practices in code structure, clean architecture, and Unity tool usage for both beginners and intermediate users.
Initial Setup & Project Organization
- Begin by selecting a Unity LTS version and starting a new 3D URP (Universal Render Pipeline) project.
- Organize the project folders for scripts, assets, prefabs, and scenes.
- Set up your Unity layout and Visual Studio environment for coding, including adding useful extensions.
- Follow strict naming conventions: PascalCase for functions/properties, camelCase for variables/fields, and SCREAMING_SNAKE_CASE for constants.
Coding Practices & Clean Code
- Always separate logic from visuals—keep logic on parent objects, visuals on children.
- Never use public fields for editor exposure; use
[SerializeField] private fields instead.
- Normalize input vectors to ensure consistent movement speed in all directions.
- Refactor code regularly to maintain clean architecture (e.g., separating input handling from movement logic).
Basic Core Systems
- Implement a character controller with frame-rate independent movement and smooth rotation using
Transform.forward and Vector3.Slerp.
- Use ScriptableObjects to define game data (e.g., kitchen objects, recipes).
- Utilize events and the Singleton pattern for communication between systems.
Unity Features & Tools
- Apply post-processing (Bloom, Vignette, Color Adjustments) for visual polish.
- Use Cinemachine for flexible and smooth camera handling.
- Use the new Input System for flexible and easily-rebindable controls, including keyboard and gamepad support.
- Employ physics checks (capsule casts, raycasts) for collision and interaction logic.
Game Mechanics
- Create modular counter prefabs (clear, container, cutting, stove, trash, plates, delivery).
- Implement kitchen object parenting logic to manage item placement/movement between counters and player.
- Use interfaces (
IKitchenObjectParent) for scalable item transfer between various parent types.
- Build plate logic to stack and display ingredients, and prevent duplicates.
UI & UX
- Design dynamic UI canvases for tutorials, countdowns, progress bars, recipe lists, and delivery popups.
- Enable in-game key rebinding and audio options (volume controls).
- Ensure full controller navigation and accessibility for the menu system.
Sound & Polish
- Add background music and varied sound effects using AudioSources and PlayClipAtPoint.
- Add moving particles, warning indicators, success/failure popups, and animated feedback for game events.
- Use Shader Graph for custom visual effects (e.g., moving delivery arrow).
Game Flow & State Management
- Set up a main menu, loading scene, and explicit scene loading system.
- Implement game states (WaitingToStart, Countdown, Playing, GameOver) with clean state transitions.
- Display game over screens and stats (recipes delivered).
- Use time scaling to pause/resume the game and manage pause menus with controller support.
Key Terms & Definitions
- ScriptableObject — A Unity asset type for storing data.
- Event — A C# feature allowing code to react to specific actions or state changes.
- Singleton Pattern — A design pattern ensuring a single instance of a class exists.
- Interface — A C# contract defining methods a class must implement.
- Cinemachine — A Unity package for advanced camera controls.
- URP — Universal Render Pipeline, a Unity rendering system for cross-platform projects.
- Post-processing — Visual effects applied after scene rendering.
Action Items / Next Steps
- Watch related videos for deeper understanding of advanced topics (e.g., events, interfaces, input system, Shader Graph).
- Download the provided project files and assets to follow along and experiment.
- Check the FAQ and course website for troubleshooting or to compare your progress.
- Review all sections if you wish to adapt the code for new genres or multiplayer features.