protected override void updateHeaderControl3(UnityEngine.Rect position) { AudioTrack track = TargetTrack.Behaviour as AudioTrack; if (track == null) { return; } Color temp = GUI.color; GUI.color = (track.AudioClips.Length > 0) ? Color.green : Color.red; int controlID = GUIUtility.GetControlID(track.GetInstanceID(), FocusType.Passive, position); if (GUI.Button(position, string.Empty, TrackGroupControl.styles.addIcon)) { EditorGUIUtility.ShowObjectPicker <AudioClip>(null, false, string.Empty, controlID); } if (Event.current.type == EventType.ExecuteCommand && Event.current.commandName == "ObjectSelectorClosed") { if (EditorGUIUtility.GetObjectPickerControlID() == controlID) { Object pickedObject = EditorGUIUtility.GetObjectPickerObject(); AudioClip clip = (pickedObject as AudioClip); if (clip != null) { CinemaAudio ca = CutsceneItemFactory.CreateCinemaAudio(track, clip, state.ScrubberPosition); Undo.RegisterCreatedObjectUndo(ca, string.Format("Created {0}", ca.name)); } Event.current.Use(); } } GUI.color = temp; }