Custom Export Script Get Event Bus

Hi,
I created a custom FMOD Script to export for Unity a class with a dictionnary, with the event path and the InGame Bus (its an enum)

But i cannot get the current event bus

textFile.writeText("    public class BusByEvent" + "\r\n    {\r\n");

  var whitespace = "";
  var identifierPrefix = "";
  var guidType = "";
  var guidConstructor = "";

  whitespace = "        ";
  guidType =
    "public static readonly Dictionary<string,SoundBus> Data = new Dictionary<string, SoundBus>(){\n";
  guidConstructor = "{";

  textFile.writeText(whitespace + guidType);

  managedObjects.forEach(function (object) {

    var bus = "SoundBus.InGame";

    //HERE GET THE EVENT BUS

    textFile.writeText(
      whitespace +
        "    " +
        guidConstructor +
        '"' +
        object.getPath() +
        '"' +
        "," +
        bus +
        "},\r\n"
    );
  });

  textFile.writeText("        };\r\n\r\n");

  textFile.writeText("    }\r\n\r\n");

I only need the comment line

Thank you for ur help :smiley:

I may have misunderstood what you’re trying to do, but assuming that each element of manageObjects is a given event, you can retrieve the mixer bus an event is routed into with object.mixerInput.output.

If this isn’t what you’re trying to do, can I get some more info from you on what exactly you’re trying to do, and what managedObjects contains and how you’ve retrieved/populated it?

Oh Thank you, was exactly what i needed. Yes the manageObjects was an event, i just reused the ExportGUID based script but didnt rename my variable.
Again TY :smiley:

1 Like