public void OnEnable() { eventPlayable = target as FMODEventPlayable; if (eventPlayable && !string.IsNullOrEmpty(eventPlayable.eventName)) { editorEventRef = EventManager.EventFromPath(eventPlayable.eventName); eventPlayable.UpdateEventDuration(editorEventRef.IsOneShot ? editorEventRef.Length : float.PositiveInfinity); } }
public void OnEnable() { eventPlayable = target as FMODEventPlayable; parametersProperty = serializedObject.FindProperty("template.parameters"); parameterLinksProperty = serializedObject.FindProperty("template.parameterLinks"); parameterAutomationProperty = serializedObject.FindProperty("template.parameterAutomation"); parameterLinksView = new ListView(parameterLinksProperty); parameterLinksView.drawElementWithLabelCallback = DrawParameterLink; parameterLinksView.onCanAddCallback = (list) => missingParameterAutomations.Count > 0; parameterLinksView.onAddDropdownCallback = DoAddParameterLinkMenu; parameterLinksView.onRemoveCallback = (list) => DeleteParameterAutomation(list.index); initialParameterValuesView = new ListView(parametersProperty); initialParameterValuesView.drawElementWithLabelCallback = DrawInitialParameterValue; initialParameterValuesView.onCanAddCallback = (list) => missingInitialParameterValues.Count > 0; initialParameterValuesView.onAddDropdownCallback = DoAddInitialParameterValueMenu; initialParameterValuesView.onRemoveCallback = (list) => DeleteInitialParameterValue(list.index); RefreshEventRef(); Undo.undoRedoPerformed += OnUndoRedo; }