public void OnGUI(Rect rect) { if (s_Styles == null) { s_Styles = new Styles(); } Rect headerRect, contentRect; using (new EditorGUI.DisabledScope(m_Controller == null)) { AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect); AudioMixerDrawUtils.HeaderLabel(headerRect, s_Styles.header, s_Styles.snapshotsIcon); } if (m_Controller != null) { // Ensure gui is in-sync with backend (TargetSnapShotIndex can be changed anytime from the backend) int targetIndex = GetSnapshotIndex(m_Controller.TargetSnapshot); if (targetIndex != m_ReorderableListWithRenameAndScrollView.list.index) { m_ReorderableListWithRenameAndScrollView.list.index = targetIndex; m_ReorderableListWithRenameAndScrollView.FrameItem(targetIndex); } m_ReorderableListWithRenameAndScrollView.OnGUI(contentRect); if (GUI.Button(new Rect(headerRect.xMax - 17f, headerRect.y + 3f, 16f, 16f), s_Styles.addButton, EditorStyles.iconButton)) { Add(); } } }
public void OnGUI(Rect rect) { if (m_Controller == null) { return; } m_ReorderableListWithRenameAndScrollView.OnGUI(rect); }