Best way to create our own RuntimeManager

Hi, due to our team having a lot of internal tools and startup flows we would like to make our own system like the RuntimeManager since we don’t want to modify that one and have it break when we upgrade the Integration some time in the future.

The problem is that much of the integration (Specifically the Platform and settings) are marked as internal and cant be accessed outside the FMOD assembly. Is there a workaround for this that does not involve going in and making these public instead of internal?

Hi,

It really depends on what exactly you’re trying to accomplish. The FMOD Unity integration comes with FMODUnity.PlatformCallbackHandler, which will allow you to provide a custom class that will receive callbacks from FMOD, and would be useful if what you need falls within its scope. Please see our Unity docs page on it for more info.

As for a workaround to the internal FMOD functions, you may wish to leverage friend assemblies to access them from your own Assembly. Depending on what you need, extension methods might be useful to add functionality to the existing FMOD classes if you don’t want to modify them.

If you do intend to create your own RuntimeManager class, it unfortunately won’t be as simple as just creating your own class - RuntimeManager itself is a lazy loaded singleton, so it will initialize when called into, and many other FMODUnity classes (StudioEventEmitter, StudioListener, etc.) explicitly call into it RuntimeManager and will need to be changed to accommodate your new class.

Ultimately, if you need a level of fine control that is beyond what the integration currently offers, you will need to either edit the source, or create your own set of classes to handle interaction with the FMOD API. That said, you can see a list of changes to the integration with each update on the fmod-for-unity GitHub repo, which may be helpful when you do need to upgrade.

Thanks for the help!

I ended up going with a Assembly Definition Reference´s and just link our own manager to the FMOD assembly so I could use the platform things and still use the settings i want to use. We do a lot of ESC stuff anyways so we arent gonna use many of the build in FMOD components but still want to keep all the editor stuff.

The github repro is gonna be super helpful for when we need upgrading, thanks!

1 Like

No problem, glad I could help!