UnityEditor.AudioMixerDrawUtils.DrawScrollDropShadow C# (CSharp) Method

DrawScrollDropShadow() public static method

public static DrawScrollDropShadow ( Rect scrollViewRect, float scrollY, float contentHeight ) : void
scrollViewRect UnityEngine.Rect
scrollY float
contentHeight float
return void
        public static void DrawScrollDropShadow(Rect scrollViewRect, float scrollY, float contentHeight)
        {
            if ((Event.current.type == EventType.Repaint) && (contentHeight > scrollViewRect.height))
            {
                Color color = GUI.color;
                float a = (scrollY <= 10f) ? (scrollY / 10f) : 1f;
                if (a < 1f)
                {
                    GUI.color = new Color(1f, 1f, 1f, a);
                }
                if (a > 0f)
                {
                    GUI.DrawTexture(new Rect(scrollViewRect.x, scrollViewRect.y, scrollViewRect.width, 20f), styles.scrollShadowTexture);
                }
                if (a < 1f)
                {
                    GUI.color = color;
                }
                float num2 = Mathf.Max((float) (contentHeight - scrollViewRect.height), (float) 0f);
                float num3 = ((num2 - scrollY) <= 10f) ? ((num2 - scrollY) / 10f) : 1f;
                if (num3 < 1f)
                {
                    GUI.color = new Color(1f, 1f, 1f, num3);
                }
                if (num3 > 0f)
                {
                    GUI.DrawTextureWithTexCoords(new Rect(scrollViewRect.x, scrollViewRect.yMax - 10f, scrollViewRect.width, 10f), styles.scrollShadowTexture, new Rect(1f, 1f, -1f, -1f));
                }
                if (num3 < 1f)
                {
                    GUI.color = color;
                }
            }
        }

Usage Example

        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);
            }
        }
All Usage Examples Of UnityEditor.AudioMixerDrawUtils::DrawScrollDropShadow