UnityEngine.GUILayout.BeginScrollView(UnityEngine.Vector2, bool, bool, UnityEngine.GUIStyle, UnityEngine.GUIStyle, params UnityEngine.GUILayoutOption[])

Here are the examples of the csharp api UnityEngine.GUILayout.BeginScrollView(UnityEngine.Vector2, bool, bool, UnityEngine.GUIStyle, UnityEngine.GUIStyle, params UnityEngine.GUILayoutOption[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : ConfigEditorSchema.cs
License : Apache License 2.0
Project Creator : KeyleXiao

protected virtual void RenderHead()
        {
            GUILayout.BeginScrollView(new Vector2(posv.x, 0), false, false, GUIStyle.none, GUIStyle.none,
                new GUILayoutOption[] {GUILayout.Height(Data.currentEditorSetting.TableHeadHeight)});

            GUILayout.BeginHorizontal(EditorGUIStyle.GetGroupBoxStyle(),
                new GUILayoutOption[] {GUILayout.Width(position.width)});

            //TODO Set Order
            foreach (var item in Data.CurrentClreplacedFieldsCache)
            {
                if (GUILayout.Button(
                    string.IsNullOrEmpty(item.config_editor_setting.Display)
                        ? item.field_info.Name
                        : item.config_editor_setting.Display, EditorGUIStyle.GetTagButtonStyle(),
                    new GUILayoutOption[]
                    {
                        GUILayout.Width(GetResizeWidth(item.config_editor_setting.Width,
                            item.config_editor_setting.MaxWidth))
                    }))
                    HeadButton_Click(item.field_info.Name);

                GUILayout.Space(Data.currentEditorSetting.ColumnSpan);
            }

            RenderExtensionHead();

            if (current_windowType == WindowType.CALLBACK)
                GUILayout.Label(Language.Select, EditorGUIStyle.GetTagButtonStyle(),
                    GUILayout.Width(Data.currentEditorSetting.ExtensionHeadTagWith));
            else if (current_windowType == WindowType.INPUT)
                GUILayout.Label(Language.Operation, EditorGUIStyle.GetTagButtonStyle(),
                    GUILayout.Width(Data.currentEditorSetting.ExtensionHeadTagWith));
            else
                GUILayout.Label(Language.Operation, EditorGUIStyle.GetTagButtonStyle(),
                    GUILayout.Width(Data.currentEditorSetting.ExtensionHeadTagWith));

            GUILayout.EndHorizontal();
            GUILayout.EndScrollView();
        }

19 View Source File : TrickOverViewPreview.cs
License : MIT License
Project Creator : XINCGer

public void Draw(bool drawCodeExample)
		{
			if (TrickOverViewPreview.exampleGroupStyle == null)
			{
				TrickOverViewPreview.exampleGroupStyle = new GUIStyle(GUIStyle.none)
				{
					padding = new RectOffset(1, 1, 10, 0)
				};
			}
			if (TrickOverViewPreview.previewStyle == null)
			{
				TrickOverViewPreview.previewStyle = new GUIStyle(GUIStyle.none)
				{
					padding = new RectOffset(0, 0, 0, 0)
				};
			}

			GUILayout.BeginVertical(TrickOverViewPreview.exampleGroupStyle, new GUILayoutOption[0]);
			GUILayout.Label("Preview:", SirenixGUIStyles.Boldreplacedle, new GUILayoutOption[0]);
			GUILayout.BeginVertical(TrickOverViewPreview.previewStyle, GUILayoutOptions.ExpandWidth(true));
			Rect rect = GUIHelper.GetCurrentLayoutRect().Expand(4f, 0f);
			SirenixEditorGUI.DrawSolidRect(rect, EditorGUIUtility.isProSkin ? TrickOverViewPreview.previewBackgroundColorDark : TrickOverViewPreview.previewBackgroundColorLight, true);
			SirenixEditorGUI.DrawBorders(rect, 1, true);
			GUILayout.Space(8f);
			
			m_DrawCallbaclAction.Invoke(rect);
			this.tree = (this.tree ?? PropertyTree.Create(m_Example));
			this.tree.Draw(false);
			
			GUILayout.Space(8f);
			GUILayout.EndVertical();
			if (drawCodeExample && m_Example.GetTrickOverViewInfo().Code != null)
			{
				GUILayout.Space(12f);
				GUILayout.Label("Code", SirenixGUIStyles.Boldreplacedle, new GUILayoutOption[0]);
				Rect rect2 = SirenixEditorGUI.BeginToolbarBox(new GUILayoutOption[0]);
				SirenixEditorGUI.DrawSolidRect(rect2.HorizontalPadding(1f), SyntaxHighlighter.BackgroundColor, true);
				SirenixEditorGUI.BeginToolbarBoxHeader(22f);
				if (SirenixEditorGUI.ToolbarButton(this.showRaw ? "Highlighted" : "Raw", false))
				{
					this.showRaw = !this.showRaw;
				}
				GUILayout.FlexibleSpace();
				EditorGUILayoutExtension.LinkFileLabelField("点击此处定位到脚本目录", this.m_Example.GetTrickOverViewInfo().CodePath);
				GUILayout.FlexibleSpace();
				if (SirenixEditorGUI.ToolbarButton("Copy", false))
				{
					Clipboard.Copy<string>(this.m_Example.GetTrickOverViewInfo().Code);
				}
				SirenixEditorGUI.EndToolbarBoxHeader();
				if (TrickOverViewPreview.codeTextStyle == null)
				{
					TrickOverViewPreview.codeTextStyle = new GUIStyle(SirenixGUIStyles.MultiLineLabel);
					TrickOverViewPreview.codeTextStyle.normal.textColor = SyntaxHighlighter.TextColor;
					TrickOverViewPreview.codeTextStyle.active.textColor = SyntaxHighlighter.TextColor;
					TrickOverViewPreview.codeTextStyle.focused.textColor = SyntaxHighlighter.TextColor;
					TrickOverViewPreview.codeTextStyle.wordWrap = false;
				}
				GUIContent content = GUIHelper.TempContent(this.showRaw ? this.m_Example.GetTrickOverViewInfo().Code.TrimEnd(new char[]
				{
					'\n',
					'\r'
				}) : this.highlightedCode);
				Vector2 vector = TrickOverViewPreview.codeTextStyle.CalcSize(content);
				GUILayout.BeginHorizontal(new GUILayoutOption[0]);
				GUILayout.Space(-3f);
				GUILayout.BeginVertical(new GUILayoutOption[0]);
				GUIHelper.PushEventType((Event.current.type == EventType.ScrollWheel) ? EventType.Used : Event.current.type);
				this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition, true, false, GUI.skin.horizontalScrollbar, GUIStyle.none, new GUILayoutOption[]
				{
					GUILayout.MinHeight(vector.y + 20f)
				});
				Rect rect3 = GUILayoutUtility.GetRect(vector.x + 50f, vector.y).AddXMin(4f).AddY(2f);
				if (this.showRaw)
				{
					EditorGUI.SelectableLabel(rect3, this.m_Example.GetTrickOverViewInfo().Code, TrickOverViewPreview.codeTextStyle);
					GUILayout.Space(-14f);
				}
				else
				{
					GUI.Label(rect3, content, TrickOverViewPreview.codeTextStyle);
				}
				GUILayout.EndScrollView();
				GUIHelper.PopEventType();
				GUILayout.EndVertical();
				GUILayout.Space(-3f);
				GUILayout.EndHorizontal();
				GUILayout.Space(-3f);
				SirenixEditorGUI.EndToolbarBox();
			}
			GUILayout.EndVertical();
		}