In Fmod in folder Music I have event “Music” with parameter “Game”. In event “Music” I have 5 event sounds. One of them is “Mario” with 3 parameters “Lead”, “Bass”, “Drums”. I have it implemented in Unity5.
public class MusicScript : MonoBehaviour {
private FMOD.Studio.EventInstance musicEvent;
private FMOD.Studio.ParameterInstance Game;
void Start () {
musicEvent = FMOD_StudioSystem.instance.GetEvent ("event:/Music/Music");
if (musicEvent.getParameter ("Game", out Game) != FMOD.RESULT.OK) {
Debug.LogError ("Can't find Game parameter on the event");
}
musicEvent.start();
}
void OnTriggerEnter (Collider other) {
if (other.tag == "Green") {
Game.setValue (1);
}
if (other.tag == "Blue") {
Game.setValue (2);
}
if (other.tag == "Yellow") {
Game.setValue (3);
}
if (other.tag == "Pink") {
Game.setValue (4);
}
if (other.tag == "Red") {
Game.setValue (5);
}
}
void OnTriggerExit (Collider other) {
if (other.tag == "Green" || other.tag == "Blue" || other.tag == "Yellow" || other.tag == "Pink" || other.tag == "Red") {
Game.setValue (0);
}
}
}
That works. I’ve done it before. The problem is that I don’t know how to get to e.g. parameter Lead in Mario event sound in Music event. It’s not other event but a child of it.