public void OnGUI(Rect rect) { int controlID = GUIUtility.GetControlID(FocusType.Keyboard); this.m_ScrollToItem = null; if (AudioMixerGroupTreeView.s_Styles == null) { AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles(); } this.m_AudioGroupTree.OnEvent(); Rect r; Rect rect2; using (new EditorGUI.DisabledScope(this.m_Controller == null)) { AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2); AudioMixerDrawUtils.HeaderLabel(r, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon); } if (this.m_Controller != null) { AudioMixerGroupController parent = (this.m_Controller.CachedSelection.Count != 1) ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0]; using (new EditorGUI.DisabledScope(EditorApplication.isPlaying)) { if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label)) { this.AddAudioMixerGroup(parent); } } this.m_AudioGroupTree.OnGUI(rect2, controlID); AudioMixerDrawUtils.DrawScrollDropShadow(rect2, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize().y); this.HandleKeyboardEvents(controlID); this.HandleCommandEvents(controlID); } }
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.viewsIcon); } if (m_Controller != null) { // Ensure in-sync if (m_ReorderableListWithRenameAndScrollView.list.index != m_Controller.currentViewIndex) { m_ReorderableListWithRenameAndScrollView.list.index = m_Controller.currentViewIndex; m_ReorderableListWithRenameAndScrollView.FrameItem(m_Controller.currentViewIndex); } m_ReorderableListWithRenameAndScrollView.OnGUI(contentRect); // Call after list to prevent id mismatch if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), s_Styles.addButton, EditorStyles.label)) { Add(); } } }
public void OnGUI(Rect rect) { if (AudioMixerGroupViewList.s_Styles == null) { AudioMixerGroupViewList.s_Styles = new AudioMixerGroupViewList.Styles(); } EditorGUI.BeginDisabledGroup(this.m_Controller == null); Rect r; Rect rect2; AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2); AudioMixerDrawUtils.HeaderLabel(r, AudioMixerGroupViewList.s_Styles.header, AudioMixerGroupViewList.s_Styles.viewsIcon); EditorGUI.EndDisabledGroup(); if (this.m_Controller != null) { if (this.m_ReorderableListWithRenameAndScrollView.list.index != this.m_Controller.currentViewIndex) { this.m_ReorderableListWithRenameAndScrollView.list.index = this.m_Controller.currentViewIndex; this.m_ReorderableListWithRenameAndScrollView.FrameItem(this.m_Controller.currentViewIndex); } this.m_ReorderableListWithRenameAndScrollView.OnGUI(rect2); if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerGroupViewList.s_Styles.addButton, EditorStyles.label)) { this.Add(); } } }
public void OnGUI(Rect rect) { int controlId = GUIUtility.GetControlID(FocusType.Keyboard); if (AudioMixersTreeView.s_Styles == null) { AudioMixersTreeView.s_Styles = new AudioMixersTreeView.Styles(); } this.m_TreeView.OnEvent(); Rect headerRect; Rect contentRect; AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect); AudioMixerDrawUtils.HeaderLabel(headerRect, AudioMixersTreeView.s_Styles.header, AudioMixersTreeView.s_Styles.audioMixerIcon); if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), AudioMixersTreeView.s_Styles.addText, EditorStyles.label)) { (this.m_TreeView.gui as AudioMixersTreeViewGUI).BeginCreateNewMixer(); } this.m_TreeView.OnGUI(contentRect, controlId); if (this.m_TreeView.data.rowCount == 0) { EditorGUI.BeginDisabledGroup(true); GUI.Label(new RectOffset(-20, 0, -2, 0).Add(contentRect), "No mixers found"); EditorGUI.EndDisabledGroup(); } AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, this.m_TreeView.state.scrollPos.y, this.m_TreeView.gui.GetTotalSize().y); this.HandleCommandEvents(controlId); this.HandleObjectSelectorResult(); }
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 (AudioMixerSnapshotListView.s_Styles == null) { AudioMixerSnapshotListView.s_Styles = new AudioMixerSnapshotListView.Styles(); } Rect r; Rect rect2; using (new EditorGUI.DisabledScope(this.m_Controller == null)) { AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2); AudioMixerDrawUtils.HeaderLabel(r, AudioMixerSnapshotListView.s_Styles.header, AudioMixerSnapshotListView.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(rect2); if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerSnapshotListView.s_Styles.addButton, EditorStyles.label)) { this.Add(); } } }
public void OnGUI(Rect rect) { int controlID = GUIUtility.GetControlID(FocusType.Keyboard); if (AudioMixersTreeView.s_Styles == null) { AudioMixersTreeView.s_Styles = new AudioMixersTreeView.Styles(); } this.m_TreeView.OnEvent(); Rect r; Rect rect2; AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2); AudioMixerDrawUtils.HeaderLabel(r, AudioMixersTreeView.s_Styles.header, AudioMixersTreeView.s_Styles.audioMixerIcon); if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixersTreeView.s_Styles.addText, EditorStyles.label)) { AudioMixersTreeViewGUI audioMixersTreeViewGUI = this.m_TreeView.gui as AudioMixersTreeViewGUI; audioMixersTreeViewGUI.BeginCreateNewMixer(); } this.m_TreeView.OnGUI(rect2, controlID); if (this.m_TreeView.data.rowCount == 0) { using (new EditorGUI.DisabledScope(true)) { GUI.Label(new RectOffset(-20, 0, -2, 0).Add(rect2), "No mixers found"); } } AudioMixerDrawUtils.DrawScrollDropShadow(rect2, this.m_TreeView.state.scrollPos.y, this.m_TreeView.gui.GetTotalSize().y); this.HandleCommandEvents(controlID); this.HandleObjectSelectorResult(); }
public void OnGUI(Rect rect) { int controlId = GUIUtility.GetControlID(FocusType.Keyboard); this.m_ScrollToItem = (AudioMixerGroupController)null; if (AudioMixerGroupTreeView.s_Styles == null) { AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles(); } this.m_AudioGroupTree.OnEvent(); EditorGUI.BeginDisabledGroup((UnityEngine.Object) this.m_Controller == (UnityEngine.Object)null); Rect headerRect; Rect contentRect; AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect); AudioMixerDrawUtils.HeaderLabel(headerRect, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon); EditorGUI.EndDisabledGroup(); if (!((UnityEngine.Object) this.m_Controller != (UnityEngine.Object)null)) { return; } AudioMixerGroupController parent = this.m_Controller.CachedSelection.Count != 1 ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0]; EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying); if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label)) { this.AddAudioMixerGroup(parent); } EditorGUI.EndDisabledGroup(); this.m_AudioGroupTree.OnGUI(contentRect, controlId); AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize().y); this.HandleKeyboardEvents(controlId); this.HandleCommandEvents(controlId); }
public void OnGUI(Rect rect) { Rect rect2; Rect rect3; if (s_Styles == null) { s_Styles = new Styles(); } EditorGUI.BeginDisabledGroup(this.m_Controller == null); AudioMixerDrawUtils.DrawRegionBg(rect, out rect2, out rect3); AudioMixerDrawUtils.HeaderLabel(rect2, s_Styles.header, s_Styles.snapshotsIcon); EditorGUI.EndDisabledGroup(); 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(); } } }
public void OnGUI(Rect rect) { if (AudioMixerSnapshotListView.s_Styles == null) { AudioMixerSnapshotListView.s_Styles = new AudioMixerSnapshotListView.Styles(); } EditorGUI.BeginDisabledGroup((UnityEngine.Object) this.m_Controller == (UnityEngine.Object)null); Rect headerRect; Rect contentRect; AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect); AudioMixerDrawUtils.HeaderLabel(headerRect, AudioMixerSnapshotListView.s_Styles.header, AudioMixerSnapshotListView.s_Styles.snapshotsIcon); EditorGUI.EndDisabledGroup(); if (!((UnityEngine.Object) this.m_Controller != (UnityEngine.Object)null)) { return; } 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(contentRect); if (!GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), AudioMixerSnapshotListView.s_Styles.addButton, EditorStyles.label)) { return; } this.Add(); }
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.viewsIcon); } if (this.m_Controller != null) { if (this.m_ReorderableListWithRenameAndScrollView.list.index != this.m_Controller.currentViewIndex) { this.m_ReorderableListWithRenameAndScrollView.list.index = this.m_Controller.currentViewIndex; this.m_ReorderableListWithRenameAndScrollView.FrameItem(this.m_Controller.currentViewIndex); } 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(); } } }
public void OnGUI(Rect rect) { int treeViewKeyboardControlID = GUIUtility.GetControlID(FocusType.Keyboard); m_ScrollToItem = null; if (s_Styles == null) { s_Styles = new Styles(); } m_AudioGroupTree.OnEvent(); 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.audioMixerGroupIcon); } if (m_Controller != null) { AudioMixerGroupController parent = (m_Controller.CachedSelection.Count == 1) ? m_Controller.CachedSelection[0] : m_Controller.masterGroup; using (new EditorGUI.DisabledScope(EditorApplication.isPlaying)) { if (GUI.Button(new Rect(headerRect.xMax - 17f, headerRect.y + 3f, 16f, 16f), s_Styles.addButton, EditorStyles.iconButton)) { AddAudioMixerGroup(parent); } } m_AudioGroupTree.OnGUI(contentRect, treeViewKeyboardControlID); AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, m_AudioGroupTree.state.scrollPos.y, m_AudioGroupTree.gui.GetTotalSize().y); HandleKeyboardEvents(treeViewKeyboardControlID); HandleCommandEvents(treeViewKeyboardControlID); } }
public void OnGUI(Rect rect) { int treeViewKeyboardControlID = GUIUtility.GetControlID(FocusType.Keyboard); if (s_Styles == null) { s_Styles = new Styles(); } m_TreeView.OnEvent(); Rect headerRect, contentRect; AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect); AudioMixerDrawUtils.HeaderLabel(headerRect, s_Styles.header, s_Styles.audioMixerIcon); if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), s_Styles.addText, EditorStyles.label)) { AudioMixersTreeViewGUI gui = m_TreeView.gui as AudioMixersTreeViewGUI; gui.BeginCreateNewMixer(); } m_TreeView.OnGUI(contentRect, treeViewKeyboardControlID); if (m_TreeView.data.rowCount == 0) { using (new EditorGUI.DisabledScope(true)) { GUI.Label(new RectOffset(-20, 0, -2, 0).Add(contentRect), "No mixers found"); } } AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, m_TreeView.state.scrollPos.y, m_TreeView.gui.GetTotalSize().y); HandleCommandEvents(treeViewKeyboardControlID); HandleObjectSelectorResult(); }