public void OnGUI(Rect rect)
{
Rect rect2;
Rect rect3;
if (s_Styles == null)
{
s_Styles = new Styles();
}
using (new EditorGUI.DisabledScope(this.m_Controller == null))
{
AudioMixerDrawUtils.DrawRegionBg(rect, out rect2, out rect3);
AudioMixerDrawUtils.HeaderLabel(rect2, s_Styles.header, s_Styles.snapshotsIcon);
}
if (this.m_Controller != null)
{
int snapshotIndex = this.GetSnapshotIndex(this.m_Controller.TargetSnapshot);
if (snapshotIndex != this.m_ReorderableListWithRenameAndScrollView.list.index)
{
this.m_ReorderableListWithRenameAndScrollView.list.index = snapshotIndex;
this.m_ReorderableListWithRenameAndScrollView.FrameItem(snapshotIndex);
}
this.m_ReorderableListWithRenameAndScrollView.OnGUI(rect3);
if (GUI.Button(new Rect(rect2.xMax - 15f, rect2.y + 3f, 15f, 15f), s_Styles.addButton, EditorStyles.label))
{
this.Add();
}
}
}
void DoSections(Rect totalRectOfSections, Rect[] sectionRects, SectionType[] sectionOrder) { Event evt = Event.current; bool enabledGUI = m_Controller == null || AudioMixerController.EditingTargetSnapshot(); for (int i = 0; i < sectionOrder.Length; ++i) { Rect sectionRect = sectionRects[i]; if (sectionRect.height <= 0.0f) { continue; } switch (sectionOrder[i]) { case SectionType.MixerTree: m_MixersTree.OnGUI(sectionRect); break; case SectionType.SnapshotList: using (new EditorGUI.DisabledScope(!enabledGUI)) { m_SnapshotListView.OnGUI(sectionRect); } break; case SectionType.GroupTree: m_GroupTree.OnGUI(sectionRect); break; case SectionType.ViewList: m_GroupViews.OnGUI(sectionRect); break; default: Debug.LogError("Unhandled enum value"); break; } if (evt.type == EventType.ContextClick) { Rect sectionHeaderRect = new Rect(sectionRect.x, sectionRect.y, sectionRect.width - 15f, AudioMixerDrawUtils.kSectionHeaderHeight); if (sectionHeaderRect.Contains(evt.mousePosition)) { ReorderContextMenu(sectionHeaderRect, i); evt.Use(); } } } }