public ParameterDescription this[string name] { get { PARAMETER_DESCRIPTION desc; _fmodEventDescription.getParameter(name, out desc).Check(); return(new ParameterDescription(desc)); } }
public void PlayMusic() { EventDescription = RuntimeManager.GetEventDescription(Event); //this assigns the EventDescription from the Event string variable that we set in the editor EventDescription.createInstance(out EventInstance); //this creates an EventInstance from the EventDescription EventInstance.start(); //this starts the event FMOD.Studio.EVENT_CALLBACK callback; //special type of variable defined by FMOD.studio called EVENT_CALLBACK callback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallBack); //pointer to the function that we're going to callback which is MusicEventCallBack EventInstance.setCallback(callback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT); // sets a callback on the event that is created with the flag to call this on every Timeline beat FMOD.Studio.PARAMETER_DESCRIPTION distanceToClue_fmodParam; EventDescription.getParameter("DistanceToClue", out distanceToClue_fmodParam); maxClueDistance = distanceToClue_fmodParam.maximum; // sets maxClueDistance to the maximum value of the game parameter in the fmod parameter (30) print("Max Distance to Clue = " + maxClueDistance); }