FMOD Event Compiler - a helper tool for Unity

Hello everyone,

I wanted to post this here in case anybody finds it useful. I wrote a little utility tool that converts FMOD event hierarchy into a nested class hierarchy in C# with const fields pointing to event paths.

It allows you to do things like this: RuntimeManager.PlayOneShot(FMODEvents.UI.CoinLoot);
… where CoinLoot is a const that points to this event path: “event:/UI/CoinLoot”

It can also handle mix snapshots.

Link is here: GitHub - taylank/FMOD-Event-Compiler: An editor tool to generate a helper class that converts FMOD event paths to const properties for easy access in code.
Open to feedback. :slight_smile:

Here’s an example of generated code:

public class FMODEvents
{
    public class UI
    {
        public const string Click = "event:/UI/Click";
        public const string Unlock = "event:/UI/Unlock";
        public const string Hover = "event:/UI/Hover";
        public const string Repair = "event:/UI/Repair";
        public const string CoinLoot = "event:/UI/CoinLoot";
        public const string Upgrade = "event:/UI/Upgrade";
    }

    public class Abilities
    {
        public const string RamDash = "event:/Abilities/RamDash";
        public const string Gust = "event:/Abilities/Gust";
        public const string Burst = "event:/Abilities/Burst";
        public const string StinkExhaust = "event:/Abilities/StinkExhaust";
        public const string Repulse = "event:/Abilities/Repulse";
        public const string WeaponChange = "event:/Abilities/WeaponChange";
        public const string RapidFire = "event:/Abilities/RapidFire";
        public const string Dash = "event:/Abilities/Dash";
        public const string Concussive = "event:/Abilities/Concussive";
    } 
    
    .
    .
    .
    .
    

public class FMODSnapshots
{
    public const string UILayer = "snapshot:/UILayer";
    public const string GameOver = "snapshot:/GameOver";
}

Cheers

2 Likes

Very nice! There’s also a built-in header file generator in the FMOD script examples here:

It also uses GUIDs so you don’t need to load the Master.strings.bank file if you don’t want to.