Get Instantiated Event Name in Unity

(Andrea Simeone) #1

Hello Support,

As the title suggest, I’m trying to get the name of the instantiated event (FMOD.Studio.EventInstance) I receive from another method.

It is possible to have it?

I so some very old posts on how to do that in C++ but it looks like it’s not working on Unity’s integration.



(Cameron Baron) #2

You can access the event path from the EventDescription.

(Andrea Simeone) #3

Thank you Cameron,

Worked without problems!

Here’s a snippet of C# for who wants to do the same:

public string GetInstantiatedEventName(FMOD.Studio.EventInstance instance)
    string result;
    FMOD.Studio.EventDescription description;

    instance.getDescription(out description);
    description.getPath(out result);

    // expect the result in the form event:/folder/sub-folder/eventName
    return result;