$ show fmod/fmod-for-unity
This repository provides the FMOD Studio integration for Unity, enabling audio middleware functionality in Unity games. It consists of runtime components (MonoBehaviours like StudioEventEmitter, StudioListener, and StudioBankLoader) that interface with the native FMOD API via C# wrappers (fmod.cs and fmod_studio.cs), and extensive editor tools for setup, event browsing, bank management, and reference updating. The architecture features platform abstraction via a base Platform class with platform-specific subclasses, a Settings ScriptableObject for configuration, and reusable patterns like attribute/drawer systems for referencing FMOD events, parameters, and banks. Key entry points include RuntimeManager for initialization, StudioEventEmitter for playback, and editor windows such as EventReferenceUpdater for migrating obsolete references. The system handles 3D audio, Unity Timeline integration, and platform-specific binary loading across iOS, Android, Windows, macOS, Linux, WebGL, Apple TV, and VisionOS.
The LLM identified 4 files worth highlighting for reuse:
Implements a robust reference system for FMOD events using GUID/path duality with automatic mismatch detection and updating. Paired with EventReferenceDrawer, it provides a reusable pattern for handling asset references that may become outdated, demonstrating non-obvious skill in balancing runtime reliability with editor usability.
Provides a typed reference for FMOD parameters that resolves string names to runtime values, complemented by ParamRefDrawer for editor inspection. This isolated pattern enables clean parameter binding across components and shows careful separation of editor/runtime concerns, making it easily adaptable to other parameterized systems.
Defines an abstract base class for platform-specific FMOD configuration, with concrete subclasses (e.g., PlatformWindows, PlatformIOS) handling binary loading and settings. This pattern cleanly isolates platform differences, allowing runtime platform selection and demonstrating strong encapsulation skills for cross-platform Unity plugins.
Implements a project-wide reference migration tool using an atomic task system to update obsolete event references. The pattern breaks complex refactoring into validated, executable steps with UI feedback, showcasing advanced editor extension techniques that are reusable for any asset migration scenario.