void Lookup() { eventDescription = RuntimeManager.GetEventDescription(EventReference); if (eventDescription.isValid()) { for (int i = 0; i < Params.Length; i++) { FMOD.Studio.PARAMETER_DESCRIPTION param; eventDescription.getParameterDescriptionByName(Params[i].Name, out param); Params[i].ID = param.id; } } }
void Awake() { for (int i = 0; i < Emitters.Length; i++) { var emitterRef = Emitters[i]; if (emitterRef.Target != null && !emitterRef.Target.EventReference.IsNull) { FMOD.Studio.EventDescription eventDesc = RuntimeManager.GetEventDescription(emitterRef.Target.EventReference); if (eventDesc.isValid()) { for (int j = 0; j < Emitters[i].Params.Length; j++) { FMOD.Studio.PARAMETER_DESCRIPTION param; eventDesc.getParameterDescriptionByName(emitterRef.Params[j].Name, out param); emitterRef.Params[j].ID = param.id; } } } } }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { #if UNITY_EDITOR if (!eventReference.IsNull) #else if (!cachedParameters && !eventReference.IsNull) #endif { FMOD.Studio.EventDescription eventDescription = RuntimeManager.GetEventDescription(eventReference); for (int i = 0; i < parameters.Length; i++) { FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; eventDescription.getParameterDescriptionByName(parameters[i].Name, out parameterDescription); parameters[i].ID = parameterDescription.id; } List <ParameterAutomationLink> parameterLinks = template.parameterLinks; for (int i = 0; i < parameterLinks.Count; i++) { FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; eventDescription.getParameterDescriptionByName(parameterLinks[i].Name, out parameterDescription); parameterLinks[i].ID = parameterDescription.id; } cachedParameters = true; } var playable = ScriptPlayable <FMODEventPlayableBehavior> .Create(graph, template); behavior = playable.GetBehaviour(); behavior.TrackTargetObject = TrackTargetObject; behavior.eventReference = eventReference; behavior.stopType = stopType; behavior.parameters = parameters; behavior.OwningClip = OwningClip; return(playable); }
void Lookup() { eventDescription = RuntimeManager.GetEventDescription(Event); }