UnityEngine.GUI.BeginScrollView(UnityEngine.Rect, UnityEngine.Vector2, UnityEngine.Rect, UnityEngine.GUIStyle, UnityEngine.GUIStyle)

Here are the examples of the csharp api UnityEngine.GUI.BeginScrollView(UnityEngine.Rect, UnityEngine.Vector2, UnityEngine.Rect, UnityEngine.GUIStyle, UnityEngine.GUIStyle) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : ScrollableDropdownSelection.cs
License : GNU General Public License v3.0
Project Creator : aelariane

protected internal override void Draw()
        {
            var pos = new Vector2(Event.current.mousePosition.x, Event.current.mousePosition.y);
            if (!cursorLimits.Contains(pos) || (guiOwner != null && guiOwner.IsActive == false))
            {
                Disable();
                return;
            }

            UnityEngine.GUI.Box(boxPosition, string.Empty, boxStyle);
            scroll = UnityEngine.GUI.BeginScrollView(boxPosition, scroll, viewRect, GUIStyle.none, GUIStyle.none);
            rect.Reset();
            bool wasPressed = false;
            for (int i = 0; i < selections.Length; i++)
            {
                if (UnityEngine.GUI.Button(rect, selections[i], i == refSet.Value ? activeButtonStyle : Style.Button))
                {
                    refSet.Value = i;
                    wasPressed = true;
                }
                rect.MoveY();
            }
            GUI.EndScrollView();

            if (wasPressed)
            {
                Disable();
                return;
            }
        }