Hello,
I’m trying to import my game’s previous assets into fmod. I have the following code working to import my sounds into a multi-instrument inside of a timeline. But my audio engineer said they should be in an action sheet.
How might I change this code to create a multi-instrument into an action sheet instead?
for(i = 0; i < data.length; i++){
console.log("Creating Event: " + data[i].name);
var category = data[i].audioSourceTemplateName.replace("Assets/Audio/SFX/", "").replace(".prefab", "");
folder = studio.project.create("EventFolder");
folder.name = category;
event = studio.project.create("Event");
event.name = data[i].name;
event.folder = folder;
var track = event.masterTrack;
var multiInstrument = track.addSound(event.timeline, 'MultiSound', 0, 10);
var sounds = data[i].sfxGroupNames;
for(h = 0; h < sounds.length; h++){
var assetNameFixed = sounds[h].substring(7);
console.log("\t Importing " + assetNameFixed);
audioFile = studio.project.importAudioFile(assetNameFixed);
var sound = studio.project.create(assetNameFixed);
sound.audioFile = audioFile;
sound.owner = multiInstrument;
}
}
Extra points if you can tell me why it seem the script created a timeline in a new event by default whereas the GUI doesn’t?
Thanks alot!