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();
        }
예제 #2
0
        public void OnGUI(Rect rect)
        {
            if (AudioMixerSnapshotListView.s_Styles == null)
            {
                AudioMixerSnapshotListView.s_Styles = new AudioMixerSnapshotListView.Styles();
            }
            EditorGUI.BeginDisabledGroup(this.m_Controller == null);
            Rect r;
            Rect rect2;

            AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2);
            AudioMixerDrawUtils.HeaderLabel(r, AudioMixerSnapshotListView.s_Styles.header, AudioMixerSnapshotListView.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(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)
 {
   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)
		{
			if (AudioMixerSnapshotListView.s_Styles == null)
			{
				AudioMixerSnapshotListView.s_Styles = new AudioMixerSnapshotListView.Styles();
			}
			EditorGUI.BeginDisabledGroup(this.m_Controller == null);
			Rect r;
			Rect rect2;
			AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2);
			AudioMixerDrawUtils.HeaderLabel(r, AudioMixerSnapshotListView.s_Styles.header, AudioMixerSnapshotListView.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(rect2);
				if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerSnapshotListView.s_Styles.addButton, EditorStyles.label))
				{
					this.Add();
				}
			}
		}