UnityEngine.GUILayout.EndHorizontal()

Here are the examples of the csharp api UnityEngine.GUILayout.EndHorizontal() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

906 Examples 7

19 View Source File : UICommpotScriptWindow.cs
License : MIT License
Project Creator : wufanjoin

private void OnGUI()
        {
            EditorGUILayout.LabelField("类名根据预制体自动生成");
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("生成UIComponent脚本"))
            {
                CreateScript(ScrpitType.Component);
            }
            this.coompotType = (CoompotType)EditorGUILayout.EnumPopup("CoompotType: ", this.coompotType);
            GUILayout.EndHorizontal();
            if (GUILayout.Button("生成UIItem脚本"))
            {
                CreateScript(ScrpitType.Item);
            }
            if (GUILayout.Button("生成View脚本"))
            {
                CreateScript(ScrpitType.View);
            }
            if (GUILayout.Button("生成UIFactory脚本"))
            {
                CreateScript(ScrpitType.Factory);
            }
            if (GUILayout.Button("生成Mediator脚本"))
            {
                CreateScript(ScrpitType.Mediator);
            }
            if (GUILayout.Button("添加UIType"))
            {
                CreateScript(ScrpitType.UIType);
            }
            if (GUILayout.Button("标记replacedetBundleName"))
            {
                SignreplacedetBundleName();
            }
            scriptText=EditorGUILayout.TextField("Script Text", scriptText);
        }

19 View Source File : BRT_HelpScreen.cs
License : MIT License
Project Creator : wufanjoin

public override void DrawGUI(Rect position, BuildInfo buildReportToDisplay)
	{
		GUI.SetNextControlName("BRT_HelpUnfocuser");
		GUI.TextField(new Rect(-100, -100, 10, 10), "");

		GUILayout.Space(10); // extra top padding

		GUILayout.BeginHorizontal();
		int newSelectedHelpIdx = GUILayout.SelectionGrid(_selectedHelpContentsIdx, _helpTypeLabels, 1);

		if (newSelectedHelpIdx != _selectedHelpContentsIdx)
		{
			GUI.FocusControl("BRT_HelpUnfocuser");
		}

		_selectedHelpContentsIdx = newSelectedHelpIdx;

			//GUILayout.Space((position.width - HELP_CONTENT_WIDTH) * 0.5f);

				if (_selectedHelpContentsIdx == HELP_TYPE_README_IDX)
				{
					_readmeScrollPos = GUILayout.BeginScrollView(
						_readmeScrollPos);

						float readmeHeight = GUI.skin.GetStyle(HELP_CONTENT_GUI_STYLE).CalcHeight(new GUIContent(_readmeContents), HELP_CONTENT_WIDTH);

						EditorGUILayout.SelectableLabel(_readmeContents, HELP_CONTENT_GUI_STYLE, GUILayout.Width(HELP_CONTENT_WIDTH), GUILayout.Height(readmeHeight));

					GUILayout.EndScrollView();
				}
				else if (_selectedHelpContentsIdx == HELP_TYPE_CHANGELOG_IDX)
				{
					_changelogScrollPos = GUILayout.BeginScrollView(
						_changelogScrollPos);

						float changelogHeight = GUI.skin.GetStyle(HELP_CONTENT_GUI_STYLE).CalcHeight(new GUIContent(_changelogContents), HELP_CONTENT_WIDTH);

						EditorGUILayout.SelectableLabel(_changelogContents, HELP_CONTENT_GUI_STYLE, GUILayout.Width(HELP_CONTENT_WIDTH), GUILayout.Height(changelogHeight));

					GUILayout.EndScrollView();
				}

		GUILayout.EndHorizontal();
	}

19 View Source File : BRT_SizeStatsScreen.cs
License : MIT License
Project Creator : wufanjoin

public override void DrawGUI(Rect position, BuildInfo buildReportToDisplay)
	{
		GUILayout.Space(2); // top padding for scrollbar

		_replacedetListScrollPos = GUILayout.BeginScrollView(_replacedetListScrollPos);

		GUILayout.Space(10); // top padding for content

		GUILayout.BeginHorizontal();
			GUILayout.Space(10); // extra left padding

			DrawTotalSize(buildReportToDisplay);

			GUILayout.Space(BuildReportTool.Window.Settings.CATEGORY_HORIZONTAL_SPACING);
			GUILayout.BeginVertical();

				DrawBuildSizes(buildReportToDisplay);

				GUILayout.Space(BuildReportTool.Window.Settings.CATEGORY_VERTICAL_SPACING);

				DrawDLLList(buildReportToDisplay);

			GUILayout.EndVertical();
			GUILayout.Space(20); // extra right padding
		GUILayout.EndHorizontal();

		GUILayout.EndScrollView();
	}

19 View Source File : ReferenceCollectorEditor.cs
License : MIT License
Project Creator : wufanjoin

public override void OnInspectorGUI()
	{
        //使ReferenceCollector支持撤销操作,还有Redo,不过没有在这里使用
        Undo.RecordObject(referenceCollector, "Changed Settings");
		var dataProperty = serializedObject.FindProperty("data");
        //开始水平布局,如果是比较新版本学习U3D的,可能不知道这东西,这个是老GUI系统的知识,除了用在编辑器里,还可以用在生成的游戏中
		GUILayout.BeginHorizontal();
        //下面几个if都是点击按钮就会返回true调用里面的东西
		if (GUILayout.Button("添加引用"))
		{
            //添加新的元素,具体的函数注释
            // Guid.NewGuid().GetHashCode().ToString() 就是新建后默认的key
            AddReference(dataProperty, Guid.NewGuid().GetHashCode().ToString(), null);
		}
		if (GUILayout.Button("全部删除"))
		{
			dataProperty.ClearArray();
		}
		if (GUILayout.Button("删除空引用"))
		{
			DelNullReference();
		}
		if (GUILayout.Button("排序"))
		{
			referenceCollector.Sort();
		}
		EditorGUILayout.EndHorizontal();
		EditorGUILayout.BeginHorizontal();
        //可以在编辑器中对searchKey进行赋值,只要输入对应的Key值,就可以点后面的删除按钮删除相对应的元素
        searchKey = EditorGUILayout.TextField(searchKey);
        //添加的可以用于选中Object的框,这里的object也是(UnityEngine.Object
        //第三个参数为是否只能引用scene中的Object
        EditorGUILayout.ObjectField(heroPrefab, typeof (Object), false);
		if (GUILayout.Button("删除"))
		{
			referenceCollector.Remove(searchKey);
			heroPrefab = null;
		}
		GUILayout.EndHorizontal();
		EditorGUILayout.Space();

		var delList = new List<int>();
        SerializedProperty property;
        //遍历ReferenceCollector中data list的所有元素,显示在编辑器中
        for (int i = referenceCollector.data.Count - 1; i >= 0; i--)
		{
			GUILayout.BeginHorizontal();
            //这里的知识点在ReferenceCollector中有说
            property = dataProperty.GetArrayElementAtIndex(i).FindPropertyRelative("key");
            EditorGUILayout.TextField(property.stringValue, GUILayout.Width(150));
            property = dataProperty.GetArrayElementAtIndex(i).FindPropertyRelative("gameObject");
            EditorGUILayout.ObjectField(property.objectReferenceValue, typeof(Object), true);
			if (GUILayout.Button("X"))
			{
                //将元素添加进删除list
				delList.Add(i);
			}
			GUILayout.EndHorizontal();
		}
		var eventType = Event.current.type;
        //在Inspector 窗口上创建区域,向区域拖拽资源对象,获取到拖拽到区域的对象
        if (eventType == EventType.DragUpdated || eventType == EventType.DragPerform)
		{
			// Show a copy icon on the drag
			DragAndDrop.visualMode = DragAndDropVisualMode.Copy;

			if (eventType == EventType.DragPerform)
			{
				DragAndDrop.AcceptDrag();
				foreach (var o in DragAndDrop.objectReferences)
				{
					AddReference(dataProperty, o.name, o);
				}
			}

			Event.current.Use();
		}

        //遍历删除list,将其删除掉
		foreach (var i in delList)
		{
			dataProperty.DeleteArrayElementAtIndex(i);
		}
		serializedObject.ApplyModifiedProperties();
		serializedObject.UpdateIfRequiredOrScript();
	}

19 View Source File : BRT_SizeStatsScreen.cs
License : MIT License
Project Creator : wufanjoin

void DrawDLLList(BuildInfo buildReportToDisplay)
	{
		BuildReportTool.BuildPlatform buildPlatform = BuildReportTool.ReportGenerator.GetBuildPlatformFromString(buildReportToDisplay.BuildType, buildReportToDisplay.BuildTargetUsed);

		GUILayout.BeginHorizontal();

			GUILayout.BeginVertical();
				GUILayout.Label(Labels.MONO_DLLS_LABEL, BuildReportTool.Window.Settings.INFO_replacedLE_STYLE_NAME);
				{
					GUILayout.BeginHorizontal(GUILayout.MaxWidth(500));
						DrawNames(buildReportToDisplay.MonoDLLs);
						DrawReadableSizes(buildReportToDisplay.MonoDLLs);
					GUILayout.EndHorizontal();
				}
			GUILayout.EndVertical();

			GUILayout.Space(15);

			GUILayout.BeginVertical();
				GUILayout.Label(Labels.SCRIPT_DLLS_LABEL, BuildReportTool.Window.Settings.INFO_replacedLE_STYLE_NAME);
				{
					GUILayout.BeginHorizontal(GUILayout.MaxWidth(500));
						DrawNames(buildReportToDisplay.ScriptDLLs);

						if (buildPlatform != BuildPlatform.WebGL)
						{
							DrawReadableSizes(buildReportToDisplay.ScriptDLLs);
						}
					GUILayout.EndHorizontal();
				}
			GUILayout.EndVertical();

		GUILayout.EndHorizontal();
	}

19 View Source File : BRT_SizeStatsScreen.cs
License : MIT License
Project Creator : wufanjoin

void DrawBuildSizes(BuildInfo buildReportToDisplay)
	{
		if (!string.IsNullOrEmpty(buildReportToDisplay.CompressedBuildSize))
		{
			GUILayout.BeginVertical();
		}

		GUILayout.Label(Labels.TOTAL_SIZE_BREAKDOWN_LABEL, BuildReportTool.Window.Settings.INFO_replacedLE_STYLE_NAME);

		if (!string.IsNullOrEmpty(buildReportToDisplay.CompressedBuildSize))
		{
			GUILayout.BeginHorizontal();
				GUILayout.Label(Labels.TOTAL_SIZE_BREAKDOWN_MSG_PRE_BOLD, BuildReportTool.Window.Settings.INFO_SUBreplacedLE_STYLE_NAME);
				GUILayout.Label(Labels.TOTAL_SIZE_BREAKDOWN_MSG_BOLD, BuildReportTool.Window.Settings.INFO_SUBreplacedLE_BOLD_STYLE_NAME);
				GUILayout.Label(Labels.TOTAL_SIZE_BREAKDOWN_MSG_POST_BOLD, BuildReportTool.Window.Settings.INFO_SUBreplacedLE_STYLE_NAME);
				GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();

			GUILayout.EndVertical();
		}

		if (buildReportToDisplay.BuildSizes != null)
		{
			GUILayout.BeginHorizontal(GUILayout.MaxWidth(500));

			DrawNames(buildReportToDisplay.BuildSizes);
			DrawReadableSizes(buildReportToDisplay.BuildSizes);
			DrawPercentages(buildReportToDisplay.BuildSizes);

			GUILayout.EndHorizontal();
		}
	}

19 View Source File : CacheMaintenanceSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
#if !BESTHTTP_DISABLE_CACHING
                GUILayout.BeginHorizontal();

                    GUILayout.Label("Delete cached enreplacedies older then");

                    GUILayout.Label(value.ToString(), GUILayout.MinWidth(50));
                    value = (int)GUILayout.HorizontalSlider(value, 1, 60, GUILayout.MinWidth(100));

                    GUILayout.Space(10);

                    deleteOlderType = (DeleteOlderTypes)(int)GUILayout.SelectionGrid((int)deleteOlderType, new string[] { "Days", "Hours", "Mins", "Secs" }, 4);
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.Space(10);

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Max Cache Size (bytes): ", GUILayout.Width(150));
                    GUILayout.Label(maxCacheSize.ToString("N0"), GUILayout.Width(70));
                    maxCacheSize = (int)GUILayout.HorizontalSlider(maxCacheSize, 1024, 10 * 1024 * 1024);
                    GUILayout.EndHorizontal();

                    GUILayout.Space(10);

                    if (GUILayout.Button("Maintenance"))
                    {
                        TimeSpan deleteOlder = TimeSpan.FromDays(14);

                        switch (deleteOlderType)
                        {
                            case DeleteOlderTypes.Days: deleteOlder = TimeSpan.FromDays(value); break;
                            case DeleteOlderTypes.Hours: deleteOlder = TimeSpan.FromHours(value); break;
                            case DeleteOlderTypes.Mins: deleteOlder = TimeSpan.FromMinutes(value); break;
                            case DeleteOlderTypes.Secs: deleteOlder = TimeSpan.FromSeconds(value); break;
                        }

                    // Call the BeginMaintainence function. It will run on a thread to do not block the main thread.
                    HTTPCacheService.BeginMaintainence(new HTTPCacheMaintananceParams(deleteOlder, (ulong)maxCacheSize));
                    }
#endif
            });
        }

19 View Source File : ConnectionAPISample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
            {
                GUILayout.BeginVertical();

            #region To Everybody
            GUILayout.Label("To Everybody");

                GUILayout.BeginHorizontal();

                ToEveryBodyText = GUILayout.TextField(ToEveryBodyText, GUILayout.MinWidth(100));

                if (GUILayout.Button("Broadcast"))
                    Broadcast(ToEveryBodyText);

                if (GUILayout.Button("Broadcast (All Except Me)"))
                    BroadcastExceptMe(ToEveryBodyText);

                if (GUILayout.Button("Enter Name"))
                    EnterName(ToEveryBodyText);

                if (GUILayout.Button("Join Group"))
                    JoinGroup(ToEveryBodyText);

                if (GUILayout.Button("Leave Group"))
                    LeaveGroup(ToEveryBodyText);

                GUILayout.EndHorizontal();
            #endregion

            #region To Me
            GUILayout.Label("To Me");

                GUILayout.BeginHorizontal();

                ToMeText = GUILayout.TextField(ToMeText, GUILayout.MinWidth(100));

                if (GUILayout.Button("Send to me"))
                    SendToMe(ToMeText);

                GUILayout.EndHorizontal();
            #endregion

            #region Private Message
            GUILayout.Label("Private Message");

                GUILayout.BeginHorizontal();

                GUILayout.Label("Message:");
                PrivateMessageText = GUILayout.TextField(PrivateMessageText, GUILayout.MinWidth(100));

                GUILayout.Label("User or Group name:");
                PrivateMessageUserOrGroupName = GUILayout.TextField(PrivateMessageUserOrGroupName, GUILayout.MinWidth(100));

                if (GUILayout.Button("Send to user"))
                    SendToUser(PrivateMessageUserOrGroupName, PrivateMessageText);

                if (GUILayout.Button("Send to group"))
                    SendToGroup(PrivateMessageUserOrGroupName, PrivateMessageText);

                GUILayout.EndHorizontal();
            #endregion

            GUILayout.Space(20);

                if (signalRConnection.State == ConnectionStates.Closed)
                {
                    if (GUILayout.Button("Start Connection"))
                        signalRConnection.Open();
                }
                else if (GUILayout.Button("Stop Connection"))
                    signalRConnection.Close();

                GUILayout.Space(20);

            // Draw the messages
            GUILayout.Label("Messages");

                GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                messages.Draw(Screen.width - 20, 0);
                GUILayout.EndHorizontal();

                GUILayout.EndVertical();
            });
        }

19 View Source File : SampleSelector.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            var stats = HTTPManager.GetGeneralStatistics(StatisticsQueryFlags.All);

            // Connection statistics
            GUIHelper.DrawArea(new Rect(0, 0, Screen.width / 3, statisticsHeight), false, () =>
                {
                // Header
                GUIHelper.DrawCenteredText("Connections");

                    GUILayout.Space(5);

                    GUIHelper.DrawRow("Sum:", stats.Connections.ToString());
                    GUIHelper.DrawRow("Active:", stats.ActiveConnections.ToString());
                    GUIHelper.DrawRow("Free:", stats.FreeConnections.ToString());
                    GUIHelper.DrawRow("Recycled:", stats.RecycledConnections.ToString());
                    GUIHelper.DrawRow("Requests in queue:", stats.RequestsInQueue.ToString());
                });

            // Cache statistics
            GUIHelper.DrawArea(new Rect(Screen.width / 3, 0, Screen.width / 3, statisticsHeight), false, () =>
                {
                    GUIHelper.DrawCenteredText("Cache");

#if !BESTHTTP_DISABLE_CACHING
                if (!BestHTTP.Caching.HTTPCacheService.IsSupported)
                    {
#endif
                    GUI.color = Color.yellow;
                        GUIHelper.DrawCenteredText("Disabled in WebPlayer, WebGL & Samsung Smart TV Builds!");
                        GUI.color = Color.white;
#if !BESTHTTP_DISABLE_CACHING
                }
                    else
                    {
                        GUILayout.Space(5);

                        GUIHelper.DrawRow("Cached enreplacedies:", stats.CacheEnreplacedyCount.ToString());
                        GUIHelper.DrawRow("Sum Size (bytes): ", stats.CacheSize.ToString("N0"));

                        GUILayout.BeginVertical();

                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button("Clear Cache"))
                            BestHTTP.Caching.HTTPCacheService.BeginClear();

                        GUILayout.EndVertical();
                    }
#endif
            });

            // Cookie statistics
            GUIHelper.DrawArea(new Rect((Screen.width / 3) * 2, 0, Screen.width / 3, statisticsHeight), false, () =>
                {
                    GUIHelper.DrawCenteredText("Cookies");

#if !BESTHTTP_DISABLE_COOKIES
                if (!BestHTTP.Cookies.CookieJar.IsSavingSupported)
                {
#endif
                    GUI.color = Color.yellow;
                    GUIHelper.DrawCenteredText("Saving and loading from disk is disabled in WebPlayer, WebGL & Samsung Smart TV Builds!");
                    GUI.color = Color.white;
#if !BESTHTTP_DISABLE_COOKIES
                }
                else
                {
                    GUILayout.Space(5);

                    GUIHelper.DrawRow("Cookies:", stats.CookieCount.ToString());
                    GUIHelper.DrawRow("Estimated size (bytes):", stats.CookieJarSize.ToString("N0"));

                    GUILayout.BeginVertical();

                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Clear Cookies"))
                        BestHTTP.Cookies.CookieJar.Clear();

                    GUILayout.EndVertical();
                }
#endif
            });

            if (SelectedSample == null || (SelectedSample != null && !SelectedSample.IsRunning))
            {
                // Draw the list of samples
                GUIHelper.DrawArea(new Rect(0, statisticsHeight + 5, SelectedSample == null ? Screen.width : Screen.width / 3, Screen.height - statisticsHeight - 5), false, () =>
                    {
                        scrollPos = GUILayout.BeginScrollView(scrollPos);
                        for (int i = 0; i < Samples.Count; ++i)
                            DrawSample(Samples[i]);
                        GUILayout.EndScrollView();
                    });

                if (SelectedSample != null)
                    DrawSampleDetails(SelectedSample);
            }
            else if (SelectedSample != null && SelectedSample.IsRunning)
            {
                GUILayout.BeginArea(new Rect(0, Screen.height - 50, Screen.width, 50), string.Empty);
                GUILayout.FlexibleSpace();
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                GUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Back", GUILayout.MinWidth(100)))
                    SelectedSample.DestroyUnityObject();
                GUILayout.FlexibleSpace();
                GUILayout.EndVertical();

                GUILayout.EndHorizontal();
                GUILayout.EndArea();
            }
        }

19 View Source File : TextureDownloadSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
                    scrollPos = GUILayout.BeginScrollView(scrollPos);

                // Draw out the textures
                GUILayout.SelectionGrid(0, Textures, 3);

#if !BESTHTTP_DISABLE_CACHING
                    if (finishedCount == Images.Length && allDownloadedFromLocalCache)
                        GUIHelper.DrawCenteredText("All images loaded from the local cache!");
#endif

                    GUILayout.FlexibleSpace();

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Max Connection/Server: ", GUILayout.Width(150));
                    GUILayout.Label(HTTPManager.MaxConnectionPerServer.ToString(), GUILayout.Width(20));
                    HTTPManager.MaxConnectionPerServer = (byte)GUILayout.HorizontalSlider(HTTPManager.MaxConnectionPerServer, 1, 10);
                    GUILayout.EndHorizontal();

                    if (GUILayout.Button("Start Download"))
                        DownloadImages();

                    GUILayout.EndScrollView();
                });
        }

19 View Source File : AuthenticationSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
            {
                scrollPos = GUILayout.BeginScrollView(scrollPos, false, false);
                GUILayout.BeginVertical();

                if (signalRConnection.AuthenticationProvider == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Username (Enter 'User'):");
                    userName = GUILayout.TextField(userName, GUILayout.MinWidth(100));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Roles (Enter 'Invoker' or 'Admin'):");
                    role = GUILayout.TextField(role, GUILayout.MinWidth(100));
                    GUILayout.EndHorizontal();

                    if (GUILayout.Button("Log in"))
                        Restart();
                }

                for (int i = 0; i < signalRConnection.Hubs.Length; ++i)
                    (signalRConnection.Hubs[i] as BaseHub).Draw();

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            });
        }

19 View Source File : ConnectionStatusSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
            {
                GUILayout.BeginHorizontal();

                if (GUILayout.Button("START") && signalRConnection.State != ConnectionStates.Connected)
                    signalRConnection.Open();

                if (GUILayout.Button("STOP") && signalRConnection.State == ConnectionStates.Connected)
                {
                    signalRConnection.Close();
                    messages.Clear();
                }

                if (GUILayout.Button("PING") && signalRConnection.State == ConnectionStates.Connected)
                {
                // Call a Hub-method on the server.
                signalRConnection["StatusHub"].Call("Ping");
                }

                GUILayout.EndHorizontal();

                GUILayout.Space(20);

                GUILayout.Label("Connection Status Messages");

                GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                messages.Draw(Screen.width - 20, 0);
                GUILayout.EndHorizontal();
            });
        }

19 View Source File : DemoHubSample.cs
License : Apache License 2.0
Project Creator : wuhan005

public void Draw()
        {
            GUILayout.Label("Arbitrary Code");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(string.Format("Sending {0} from arbitrary code without the hub itself!", fromArbitraryCodeResult));
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Group Added");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(groupAddedResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Dynamic Task");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(dynamicTaskResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Report Progress");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginVertical();
            GUILayout.Label(longRunningJobStatus);
            GUILayout.HorizontalSlider(longRunningJobProgress, 0, 100);
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Generic Task");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Task With Exception");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(taskWithExceptionResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Generic Task With Exception");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskWithExceptionResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Synchronous Exception");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(synchronousExceptionResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Invoking hub method with dynamic");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(invokingHubMethodWithDynamicResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Simple Array");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(simpleArrayResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Complex Type");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(complexTypeResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Complex Array");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(complexArrayResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Overloads");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginVertical();
            GUILayout.Label(voidOverloadResult);
            GUILayout.Label(intOverloadResult);
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Read State Value");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(readStateResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Plain Task");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(plainTaskResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Generic Task With ContinueWith");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskWithContinueWithResult);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Message Pump");
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            invokeResults.Draw(Screen.width - 40, 270);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);
        }

19 View Source File : SimpleStreamingSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
            {
                GUILayout.Label("Messages");

                GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                messages.Draw(Screen.width - 20, 0);
                GUILayout.EndHorizontal();
            });
        }

19 View Source File : SocketIOChatSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void DrawChatScreen()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
                    GUILayout.BeginVertical();
                    scrollPos = GUILayout.BeginScrollView(scrollPos);
                    GUILayout.Label(chatLog, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
                    GUILayout.EndScrollView();

                    string typing = string.Empty;

                    if (typingUsers.Count > 0)
                    {
                        typing += string.Format("{0}", typingUsers[0]);

                        for (int i = 1; i < typingUsers.Count; ++i)
                            typing += string.Format(", {0}", typingUsers[i]);

                        if (typingUsers.Count == 1)
                            typing += " is typing!";
                        else
                            typing += " are typing!";
                    }

                    GUILayout.Label(typing);

                    GUILayout.Label("Type here:");

                    GUILayout.BeginHorizontal();
                    message = GUILayout.TextField(message);

                    if (GUILayout.Button("Send", GUILayout.MaxWidth(100)))
                        SendMessage();
                    GUILayout.EndHorizontal();

                    if (GUI.changed)
                        UpdateTyping();

                    GUILayout.EndVertical();
                });
        }

19 View Source File : GUIHelper.cs
License : Apache License 2.0
Project Creator : wuhan005

public static void DrawCenteredText(string msg)
        {
            Setup();

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(msg, centerAlignedLabel);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }

19 View Source File : GUIHelper.cs
License : Apache License 2.0
Project Creator : wuhan005

public static void DrawRow(string key, string value)
        {
            Setup();

            GUILayout.BeginHorizontal();
            GUILayout.Label(key);
            GUILayout.FlexibleSpace();
            GUILayout.Label(value, rightAlignedLabel);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }

19 View Source File : AuthenticationSample.cs
License : Apache License 2.0
Project Creator : wuhan005

public void Draw()
        {
            GUILayout.Label(this.replacedle);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            messages.Draw(Screen.width - 20, 100);
            GUILayout.EndHorizontal();
        }

19 View Source File : DemoHubSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
            {
                scrollPos = GUILayout.BeginScrollView(scrollPos, false, false);
                GUILayout.BeginVertical();

                demoHub.Draw();

                typedDemoHub.Draw();

                GUILayout.Label("Read State Value");
                GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                GUILayout.Label(vbReadStateResult);
                GUILayout.EndHorizontal();

                GUILayout.Space(10);

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            });

        }

19 View Source File : DemoHubSample.cs
License : Apache License 2.0
Project Creator : wuhan005

public void Draw()
        {
            GUILayout.Label("Typed callback");

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginVertical();
            GUILayout.Label(typedEcreplacedsult);
            GUILayout.Label(typedEchoClientResult);
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10);
        }

19 View Source File : SocketIOWePlaySample.cs
License : Apache License 2.0
Project Creator : wuhan005

void DrawControls()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Controls:");

            for (int i = 0; i < controls.Length; ++i)
                if (GUILayout.Button(controls[i]))
                    Socket.Emit("move", controls[i]);

            GUILayout.Label(" Connections: " + connections);

            GUILayout.EndHorizontal();
        }

19 View Source File : SocketIOWePlaySample.cs
License : Apache License 2.0
Project Creator : wuhan005

void DrawChat(bool withInput = true)
        {
            GUILayout.BeginVertical();

            // Draw the messages
            scrollPos = GUILayout.BeginScrollView(scrollPos, false, false);
            for (int i = 0; i < messages.Count; ++i)
                GUILayout.Label(messages[i], GUILayout.MinWidth(Screen.width));
            GUILayout.EndScrollView();

            if (withInput)
            {
                GUILayout.Label("Your message: ");

                GUILayout.BeginHorizontal();

                messageToSend = GUILayout.TextField(messageToSend);

                if (GUILayout.Button("Send", GUILayout.MaxWidth(100)))
                    SendMessage();

                GUILayout.EndHorizontal();
            }

            GUILayout.EndVertical();
        }

19 View Source File : WebSocketSample.cs
License : Apache License 2.0
Project Creator : wuhan005

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
                    scrollPos = GUILayout.BeginScrollView(scrollPos);
                    GUILayout.Label(Text);
                    GUILayout.EndScrollView();

                    GUILayout.Space(5);

                    GUILayout.FlexibleSpace();

                    address = GUILayout.TextField(address);

                    if (webSocket == null && GUILayout.Button("Open Web Socket"))
                    {
                        // Create the WebSocket instance
                        webSocket = new WebSocket.WebSocket(new Uri(address));

#if !UNITY_WEBGL
                    webSocket.StartPingThread = true;

#if !BESTHTTP_DISABLE_PROXY
                    if (HTTPManager.Proxy != null)
                        webSocket.InternalRequest.Proxy = new HTTPProxy(HTTPManager.Proxy.Address, HTTPManager.Proxy.Credentials, false);
#endif
#endif

                        // Subscribe to the WS events
                        webSocket.OnOpen += OnOpen;
                        webSocket.OnMessage += OnMessageReceived;
                        webSocket.OnClosed += OnClosed;
                        webSocket.OnError += OnError;

                        // Start connecting to the server
                        webSocket.Open();

                        Text += "Opening Web Socket...\n";
                    }

                    if (webSocket != null && webSocket.IsOpen)
                    {
                        GUILayout.Space(10);

                        GUILayout.BeginHorizontal();
                        msgToSend = GUILayout.TextField(msgToSend);

                        GUILayout.EndHorizontal();

                        if (GUILayout.Button("Send", GUILayout.MaxWidth(70)))
                        {
                            Text += "Sending message...\n";

                            // Send message to the server
                            webSocket.Send(msgToSend);
                        }

                        GUILayout.Space(10);

                        if (GUILayout.Button("Close"))
                        {
                            // Close the connection
                            webSocket.Close(1000, "Bye!");
                        }
                    }
                });
        }

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

void GUIStars()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();

        GUILayout.Label("Stars:", EditorStyles.boldLabel);

        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.Label("Star1", new GUILayoutOption[] { GUILayout.Width(100) });
        GUILayout.Label("Star2", new GUILayoutOption[] { GUILayout.Width(100) });
        GUILayout.Label("Star3", new GUILayoutOption[] { GUILayout.Width(100) });
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        int s = 0;
        s = EditorGUILayout.IntField("", star1, new GUILayoutOption[] { GUILayout.Width(100) });
        if (s != star1)
        {
            star1 = s;
            SaveLevel();
        }
        if (star1 < 0)
            star1 = 10;
        s = EditorGUILayout.IntField("", star2, new GUILayoutOption[] { GUILayout.Width(100) });
        if (s != star2)
        {
            star2 = s;
            SaveLevel();
        }
        if (star2 < star1)
            star2 = star1 + 10;
        s = EditorGUILayout.IntField("", star3, new GUILayoutOption[] { GUILayout.Width(100) });
        if (s != star3)
        {
            star3 = s;
            SaveLevel();
        }
        if (star3 < star2)
            star3 = star2 + 10;
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();

    }

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

void GUITarget()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();
        GUILayout.Label("Target:", EditorStyles.boldLabel);
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();
        Target saveTarget = target;
        target = (Target)EditorGUILayout.EnumPopup(target, GUILayout.Width(100));
        if (target == Target.Top)
        {
        }
        GUILayout.EndVertical();
        if (saveTarget != target)
        {
            SaveLevel();
        }
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();


        GUILayout.EndHorizontal();
    }

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

void GUIBlocks()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();


        GUILayout.BeginVertical();
        GUILayout.Label("Tools:", EditorStyles.boldLabel);
        if (GUILayout.Button("Clear", new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) }))
        {
            for (int i = 0; i < levelSquares.Length; i++)
            {
                levelSquares[i] = 0;
            }
            SaveLevel();
        }
        GUILayout.EndVertical();


        GUILayout.Label("Balls:", EditorStyles.boldLabel);
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal();

        for (int i = 1; i <= System.Enum.GetValues(typeof(BallColor)).Length; i++)
        {
            if ((BallColor)i != 0)
            {
                if (GUILayout.Button(ballTex[i - 1], new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) }))
                {
                    if ((BallColor)i != BallColor.chicken)
                        brush = (BallColor)i;
                    else
                    {
                        target = Target.Chicken;
                        levelSquares[5 * maxCols + 5] = BallColor.chicken;
                        SaveLevel();
                    }
                }
            }


        }
        if (GUILayout.Button("  ", new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(50) }))
        {
            brush = 0;
        }
        //   GUILayout.Label(" - empty", EditorStyles.boldLabel);


        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();

    }

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

void GUIGameField()
    {
        GUILayout.BeginVertical();
        bool offset = false;
        for (int row = 0; row < maxRows; row++)
        {
            GUILayout.BeginHorizontal();
            if (offset)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(30);

            }
            for (int col = 0; col < maxCols; col++)
            {

                var imageButton = new object();
                if (levelSquares[row * maxCols + col] == 0)
                {
                    imageButton = "X";
                }
                else if (levelSquares[row * maxCols + col] != 0)
                {
                    if (levelSquares[row * maxCols + col] == BallColor.blue)
                    {
                        imageButton = ballTex[0];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.green)
                    {
                        imageButton = ballTex[1];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.red)
                    {
                        imageButton = ballTex[2];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.violet)
                    {
                        imageButton = ballTex[3];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.yellow)
                    {
                        imageButton = ballTex[4];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.random)
                    {
                        imageButton = ballTex[5];
                    }
                    else if (levelSquares[row * maxCols + col] == BallColor.chicken)
                    {
                        imageButton = ballTex[6];
                    }

                }

                if (GUILayout.Button(imageButton as Texture, new GUILayoutOption[] {
                    GUILayout.Width (50),
                    GUILayout.Height (50)
                }))
                {
                    SetType(col, row);
                }
            }
            GUILayout.EndHorizontal();
            if (offset)
            {
                GUILayout.EndHorizontal();

            }


            offset = !offset;
        }
        GUILayout.EndVertical();
    }

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

void GUILevelSelector()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("Level editor", EditorStyles.boldLabel, new GUILayoutOption[] { GUILayout.Width(150) });
        //if (GUILayout.Button("Test level", new GUILayoutOption[] { GUILayout.Width(150) }))
        //{
        //    PlayerPrefs.SetInt("OpenLevelTest", levelNumber);
        //    PlayerPrefs.SetInt("OpenLevel", levelNumber);
        //    PlayerPrefs.Save();

        //    EditorApplication.isPlaying = true;


        //}
        GUILayout.EndHorizontal();

        //     myString = EditorGUILayout.TextField("Text Field", myString);
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Level:", EditorStyles.boldLabel, new GUILayoutOption[] { GUILayout.Width(50) });
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        if (GUILayout.Button("<<", new GUILayoutOption[] { GUILayout.Width(50) }))
        {
            PreviousLevel();
        }
        string changeLvl = GUILayout.TextField(" " + levelNumber, new GUILayoutOption[] { GUILayout.Width(50) });
        try
        {
            if (int.Parse(changeLvl) != levelNumber)
            {
                if (LoadDataFromLocal(int.Parse(changeLvl)))
                    levelNumber = int.Parse(changeLvl);

            }
        }
        catch (Exception)
        {

            throw;
        }

        if (GUILayout.Button(">>", new GUILayoutOption[] { GUILayout.Width(50) }))
        {
            NextLevel();
        }

        if (GUILayout.Button("New level", new GUILayoutOption[] { GUILayout.Width(100) }))
        {
            AddLevel();
        }


        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Space(60);

        GUILayout.EndHorizontal();
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();

    }

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

void GUIColorLimit()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(60);

        int saveInt = colorLimit;
        GUILayout.Label("Color limit:", EditorStyles.label, new GUILayoutOption[] { GUILayout.Width(100) });
        colorLimit = (int)GUILayout.HorizontalSlider(colorLimit, 3, 5, new GUILayoutOption[] { GUILayout.Width(100) });
        colorLimit = EditorGUILayout.IntField("", colorLimit, new GUILayoutOption[] { GUILayout.Width(50) });
        if (colorLimit < 3)
            colorLimit = 3;
        if (colorLimit > 5)
            colorLimit = 5;

        GUILayout.EndHorizontal();

        if (saveInt != colorLimit)
        {
            SaveLevel();
        }

    }

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

void GUILimit()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(60);

        GUILayout.Label("Limit:", EditorStyles.label, new GUILayoutOption[] { GUILayout.Width(50) });
        LIMIT limitTypeSave = limitType;
        int oldLimit = limit;
        limitType = (LIMIT)EditorGUILayout.EnumPopup(limitType, GUILayout.Width(93));
        if (limitType == LIMIT.MOVES)
            limit = EditorGUILayout.IntField(limit, new GUILayoutOption[] { GUILayout.Width(50) });
        else
        {
            GUILayout.BeginHorizontal();
            int limitMin = EditorGUILayout.IntField(limit / 60, new GUILayoutOption[] { GUILayout.Width(30) });
            GUILayout.Label(":", new GUILayoutOption[] { GUILayout.Width(10) });
            int limitSec = EditorGUILayout.IntField(limit - (limit / 60) * 60, new GUILayoutOption[] { GUILayout.Width(30) });
            limit = limitMin * 60 + limitSec;
            GUILayout.EndHorizontal();
        }
        if (limit <= 0)
            limit = 1;
        GUILayout.EndHorizontal();

        if (limitTypeSave != limitType || oldLimit != limit)
            SaveLevel();

    }

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

void DrawLastSection (GridGraph graph) {
			GUILayout.BeginHorizontal();
			GUILayout.Space(18);
			graph.showMeshSurface = GUILayout.Toggle(graph.showMeshSurface, new GUIContent("Show surface", "Toggles gizmos for drawing the surface of the mesh"), EditorStyles.miniButtonLeft);
			graph.showMeshOutline = GUILayout.Toggle(graph.showMeshOutline, new GUIContent("Show outline", "Toggles gizmos for drawing an outline of the nodes"), EditorStyles.miniButtonMid);
			graph.showNodeConnections = GUILayout.Toggle(graph.showNodeConnections, new GUIContent("Show connections", "Toggles gizmos for drawing node connections"), EditorStyles.miniButtonRight);
			GUILayout.EndHorizontal();

			GUILayout.Label(new GUIContent("Advanced"), EditorStyles.boldLabel);

			DrawPenaltyModifications(graph);
			DrawJPS(graph);
		}

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

public override void OnInspectorGUI (NavGraph target) {
			var graph = target as RecastGraph;

			bool preEnabled = GUI.enabled;

			System.Int64 estWidth = Mathf.RoundToInt(Mathf.Ceil(graph.forcedBoundsSize.x / graph.cellSize));
			System.Int64 estDepth = Mathf.RoundToInt(Mathf.Ceil(graph.forcedBoundsSize.z / graph.cellSize));

			// Show a warning if the number of voxels is too large
			if (estWidth*estDepth >= 1024*1024 || estDepth >= 1024*1024 || estWidth >= 1024*1024) {
				GUIStyle helpBox = GUI.skin.FindStyle("HelpBox") ?? GUI.skin.FindStyle("Box");

				Color preColor = GUI.color;
				if (estWidth*estDepth >= 2048*2048 || estDepth >= 2048*2048 || estWidth >= 2048*2048) {
					GUI.color = Color.red;
				} else {
					GUI.color = Color.yellow;
				}

				GUILayout.Label("Warning : Might take some time to calculate", helpBox);
				GUI.color = preColor;
			}

			GUI.enabled = false;
			EditorGUILayout.LabelField("Width (voxels)", estWidth.ToString());

			EditorGUILayout.LabelField("Depth (voxels)", estDepth.ToString());
			GUI.enabled = preEnabled;

			graph.cellSize = EditorGUILayout.FloatField(new GUIContent("Cell Size", "Size of one voxel in world units"), graph.cellSize);
			if (graph.cellSize < 0.001F) graph.cellSize = 0.001F;

			graph.useTiles = (UseTiles)EditorGUILayout.EnumPopup("Use Tiles", graph.useTiles ? UseTiles.UseTiles : UseTiles.DontUseTiles) == UseTiles.UseTiles;

			if (graph.useTiles) {
				EditorGUI.indentLevel++;
				graph.editorTileSize = EditorGUILayout.IntField(new GUIContent("Tile Size", "Size in voxels of a single tile.\n" +
						"This is the width of the tile.\n" +
						"\n" +
						"A large tile size can be faster to initially scan (but beware of out of memory issues if you try with a too large tile size in a large world)\n" +
						"smaller tile sizes are (much) faster to update.\n" +
						"\n" +
						"Different tile sizes can affect the quality of paths. It is often good to split up huge open areas into several tiles for\n" +
						"better quality paths, but too small tiles can lead to effects looking like invisible obstacles."), graph.editorTileSize);
				EditorGUI.indentLevel--;
			}

			graph.minRegionSize = EditorGUILayout.FloatField(new GUIContent("Min Region Size", "Small regions will be removed. In square world units"), graph.minRegionSize);

			graph.walkableHeight = EditorGUILayout.FloatField(new GUIContent("Walkable Height", "Minimum distance to the roof for an area to be walkable"), graph.walkableHeight);
			graph.walkableHeight = Mathf.Max(graph.walkableHeight, 0);

			graph.walkableClimb = EditorGUILayout.FloatField(new GUIContent("Walkable Climb", "How high can the character climb"), graph.walkableClimb);

			// A walkableClimb higher than this can cause issues when generating the navmesh since then it can in some cases
			// Both be valid for a character to walk under an obstacle and climb up on top of it (and that cannot be handled with a navmesh without links)
			if (graph.walkableClimb >= graph.walkableHeight) {
				graph.walkableClimb = graph.walkableHeight;
				EditorGUILayout.HelpBox("Walkable climb should be less than walkable height. Clamping to " + graph.walkableHeight+".", MessageType.Warning);
			} else if (graph.walkableClimb < 0) {
				graph.walkableClimb = 0;
			}

			graph.characterRadius = EditorGUILayout.FloatField(new GUIContent("Character Radius", "Radius of the character. It's good to add some margin.\nIn world units."), graph.characterRadius);
			graph.characterRadius = Mathf.Max(graph.characterRadius, 0);

			if (graph.characterRadius < graph.cellSize * 2) {
				EditorGUILayout.HelpBox("For best navmesh quality, it is recommended to keep the character radius at least 2 times as large as the cell size. Smaller cell sizes will give you higher quality navmeshes, but it will take more time to scan the graph.", MessageType.Warning);
			}

			graph.maxSlope = EditorGUILayout.Slider(new GUIContent("Max Slope", "Approximate maximum slope"), graph.maxSlope, 0F, 90F);
			graph.maxEdgeLength = EditorGUILayout.FloatField(new GUIContent("Max Border Edge Length", "Maximum length of one border edge in the completed navmesh before it is split. A lower value can often yield better quality graphs, but don't use so low values so that you get a lot of thin triangles."), graph.maxEdgeLength);
			graph.maxEdgeLength = graph.maxEdgeLength < graph.cellSize ? graph.cellSize : graph.maxEdgeLength;

			graph.contourMaxError = EditorGUILayout.FloatField(new GUIContent("Max Edge Error", "Amount of simplification to apply to edges.\nIn world units."), graph.contourMaxError);

			graph.rasterizeTerrain = EditorGUILayout.Toggle(new GUIContent("Rasterize Terrain", "Should a rasterized terrain be included"), graph.rasterizeTerrain);
			if (graph.rasterizeTerrain) {
				EditorGUI.indentLevel++;
				graph.rasterizeTrees = EditorGUILayout.Toggle(new GUIContent("Rasterize Trees", "Rasterize tree colliders on terrains. " +
						"If the tree prefab has a collider, that collider will be rasterized. " +
						"Otherwise a simple box collider will be used and the script will " +
						"try to adjust it to the tree's scale, it might not do a very good job though so " +
						"an attached collider is preferable."), graph.rasterizeTrees);
				if (graph.rasterizeTrees) {
					EditorGUI.indentLevel++;
					graph.colliderRasterizeDetail = EditorGUILayout.FloatField(new GUIContent("Collider Detail", "Controls the detail of the generated collider meshes. "+
							"Increasing does not necessarily yield better navmeshes, but lowering will speed up scan.\n"+
							"Spheres and capsule colliders will be converted to meshes in order to be able to rasterize them, a higher value will increase the number of triangles in those meshes."), graph.colliderRasterizeDetail);
					EditorGUI.indentLevel--;
				}

				graph.terrainSampleSize = EditorGUILayout.IntField(new GUIContent("Terrain Sample Size", "Size of terrain samples. A lower value is better, but slower"), graph.terrainSampleSize);
				graph.terrainSampleSize = graph.terrainSampleSize < 1 ? 1 : graph.terrainSampleSize;//Clamp to at least 1
				EditorGUI.indentLevel--;
			}

			graph.rasterizeMeshes = EditorGUILayout.Toggle(new GUIContent("Rasterize Meshes", "Should meshes be rasterized and used for building the navmesh"), graph.rasterizeMeshes);
			graph.rasterizeColliders = EditorGUILayout.Toggle(new GUIContent("Rasterize Colliders", "Should colliders be rasterized and used for building the navmesh"), graph.rasterizeColliders);
			if (graph.rasterizeColliders) {
				EditorGUI.indentLevel++;
				graph.colliderRasterizeDetail = EditorGUILayout.FloatField(new GUIContent("Collider Detail", "Controls the detail of the generated collider meshes. "+
						"Increasing does not necessarily yield better navmeshes, but lowering will speed up scan.\n"+
						"Spheres and capsule colliders will be converted to meshes in order to be able to rasterize them, a higher value will increase the number of triangles in those meshes."), graph.colliderRasterizeDetail);
				EditorGUI.indentLevel--;
			}

			if (graph.rasterizeMeshes && graph.rasterizeColliders) {
				EditorGUILayout.HelpBox("You are rasterizing both meshes and colliders, this might just be duplicating the work that is done if the colliders and meshes are similar in shape. You can use the RecastMeshObj component" +
					" to always include some specific objects regardless of what the above settings are set to.", MessageType.Info);
			}

			Separator();

			graph.forcedBoundsCenter = EditorGUILayout.Vector3Field("Center", graph.forcedBoundsCenter);
			graph.forcedBoundsSize = EditorGUILayout.Vector3Field("Size", graph.forcedBoundsSize);
			graph.rotation = EditorGUILayout.Vector3Field("Rotation", graph.rotation);

			if (GUILayout.Button(new GUIContent("Snap bounds to scene", "Will snap the bounds of the graph to exactly contain all meshes that the bounds currently touches"))) {
				graph.SnapForceBoundsToScene();
				GUI.changed = true;
			}

			Separator();

			EditorGUILayout.HelpBox("Objects contained in any of these masks will be rasterized", MessageType.None);
			graph.mask = EditorGUILayoutx.LayerMaskField("Layer Mask", graph.mask);
			tagMaskFoldout = EditorGUILayoutx.UnityTagMaskList(new GUIContent("Tag Mask"), tagMaskFoldout, graph.tagMask);

			Separator();

			GUILayout.BeginHorizontal();
			GUILayout.Space(18);
			graph.showMeshSurface = GUILayout.Toggle(graph.showMeshSurface, new GUIContent("Show surface", "Toggles gizmos for drawing the surface of the mesh"), EditorStyles.miniButtonLeft);
			graph.showMeshOutline = GUILayout.Toggle(graph.showMeshOutline, new GUIContent("Show outline", "Toggles gizmos for drawing an outline of the nodes"), EditorStyles.miniButtonMid);
			graph.showNodeConnections = GUILayout.Toggle(graph.showNodeConnections, new GUIContent("Show connections", "Toggles gizmos for drawing node connections"), EditorStyles.miniButtonRight);
			GUILayout.EndHorizontal();


			Separator();
			GUILayout.Label(new GUIContent("Advanced"), EditorStyles.boldLabel);

			if (GUILayout.Button("Export to .obj file")) {
				ExportToFile(graph);
			}

			graph.relevantGraphSurfaceMode = (RecastGraph.RelevantGraphSurfaceMode)EditorGUILayout.EnumPopup(new GUIContent("Relevant Graph Surface Mode",
					"Require every region to have a RelevantGraphSurface component inside it.\n" +
					"A RelevantGraphSurface component placed in the scene specifies that\n" +
					"the navmesh region it is inside should be included in the navmesh.\n\n" +
					"If this is set to OnlyForCompletelyInsideTile\n" +
					"a navmesh region is included in the navmesh if it\n" +
					"has a RelevantGraphSurface inside it, or if it\n" +
					"is adjacent to a tile border. This can leave some small regions\n" +
					"which you didn't want to have included because they are adjacent\n" +
					"to tile borders, but it removes the need to place a component\n" +
					"in every single tile, which can be tedious (see below).\n\n" +
					"If this is set to RequireForAll\n" +
					"a navmesh region is included only if it has a RelevantGraphSurface\n" +
					"inside it. Note that even though the navmesh\n" +
					"looks continous between tiles, the tiles are computed individually\n" +
					"and therefore you need a RelevantGraphSurface component for each\n" +
					"region and for each tile."),
				graph.relevantGraphSurfaceMode);

			graph.nearestSearchOnlyXZ = EditorGUILayout.Toggle(new GUIContent("Nearest node queries in XZ space",
					"Recomended for single-layered environments.\nFaster but can be inacurate esp. in multilayered contexts."), graph.nearestSearchOnlyXZ);

			if (graph.nearestSearchOnlyXZ && (Mathf.Abs(graph.rotation.x) > 1 || Mathf.Abs(graph.rotation.z) > 1)) {
				EditorGUILayout.HelpBox("Nearest node queries in XZ space is not recommended for rotated graphs since XZ space no longer corresponds to the ground plane", MessageType.Warning);
			}
		}

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

public static bool FixLabel (string label, string buttonLabel = "Fix", int buttonWidth = 40) {
			GUILayout.BeginHorizontal();
			GUILayout.Space(14*EditorGUI.indentLevel);
			GUILayout.BeginHorizontal(AstarPathEditor.helpBox);
			GUILayout.Label(label, EditorGUIUtility.isProSkin ? EditorStyles.whiteMiniLabel : EditorStyles.miniLabel, GUILayout.ExpandWidth(true));
			var returnValue = GUILayout.Button(buttonLabel, EditorStyles.miniButton, GUILayout.Width(buttonWidth));
			GUILayout.EndHorizontal();
			GUILayout.EndHorizontal();
			return returnValue;
		}

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

public static bool ToggleGroup (GUIContent label, bool value) {
			GUILayout.BeginHorizontal();
			GUILayout.Space(13*EditorGUI.indentLevel);
			value = GUILayout.Toggle(value, "", GUILayout.Width(10));
			GUIStyle boxHeader = AstarPathEditor.astarSkin.FindStyle("CollisionHeader");
			if (GUILayout.Button(label, boxHeader, GUILayout.Width(100))) {
				value = !value;
			}

			GUILayout.EndHorizontal();
			return value;
		}

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

void DrawWidthDepthFields (GridGraph graph, out int newWidth, out int newDepth) {
			lockStyle = lockStyle ?? AstarPathEditor.astarSkin.FindStyle("GridSizeLock") ?? new GUIStyle();

			GUILayout.BeginHorizontal();
			GUILayout.BeginVertical();
			newWidth = EditorGUILayout.IntField(new GUIContent("Width (nodes)", "Width of the graph in nodes"), graph.width);
			newDepth = EditorGUILayout.IntField(new GUIContent("Depth (nodes)", "Depth (or height you might also call it) of the graph in nodes"), graph.depth);

			// Clamping will be done elsewhere as well
			// but this prevents negative widths from being converted to positive ones (since an absolute value will be taken)
			newWidth = Mathf.Max(newWidth, 1);
			newDepth = Mathf.Max(newDepth, 1);

			GUILayout.EndVertical();

			Rect lockRect = GUILayoutUtility.GetRect(lockStyle.fixedWidth, lockStyle.fixedHeight);

			GUILayout.EndHorizontal();

			// All the layouts mess up the margin to the next control, so add it manually
			GUILayout.Space(2);

			// Add a small offset to make it better centred around the controls
			lockRect.y += 3;
			lockRect.width = lockStyle.fixedWidth;
			lockRect.height = lockStyle.fixedHeight;
			lockRect.x += lockStyle.margin.left;
			lockRect.y += lockStyle.margin.top;

			locked = GUI.Toggle(lockRect, locked,
				new GUIContent("", "If the width and depth values are locked, " +
					"changing the node size will scale the grid while keeping the number of nodes consistent " +
					"instead of keeping the size the same and changing the number of nodes in the graph"), lockStyle);
		}

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

void DrawPositionField (GridGraph graph) {
			GUILayout.BeginHorizontal();
			var normalizedPivotPoint = NormalizedPivotPoint(graph, pivot);
			var worldPoint = RoundVector3(graph.CalculateTransform().Transform(normalizedPivotPoint));
			var newWorldPoint = EditorGUILayout.Vector3Field(ObjectNames.NicifyVariableName(pivot.ToString()), worldPoint);
			var delta = newWorldPoint - worldPoint;
			if (delta.magnitude > 0.001f) {
				graph.center += delta;
			}

			pivot = PivotPointSelector(pivot);
			GUILayout.EndHorizontal();
		}

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

public override void OnInspectorGUI (NavGraph target) {
			var graph = target as NavMeshGraph;

			graph.sourceMesh = ObjectField("Source Mesh", graph.sourceMesh, typeof(Mesh), false) as Mesh;

			graph.offset = EditorGUILayout.Vector3Field("Offset", graph.offset);

			graph.rotation = EditorGUILayout.Vector3Field("Rotation", graph.rotation);

			graph.scale = EditorGUILayout.FloatField(new GUIContent("Scale", "Scale of the mesh"), graph.scale);
			graph.scale = Mathf.Abs(graph.scale) < 0.01F ? (graph.scale >= 0 ? 0.01F : -0.01F) : graph.scale;

			graph.nearestSearchOnlyXZ = EditorGUILayout.Toggle(new GUIContent("Nearest node queries in XZ space",
					"Recomended for single-layered environments.\nFaster but can be inaccurate esp. in multilayered contexts."), graph.nearestSearchOnlyXZ);

			if (graph.nearestSearchOnlyXZ && (Mathf.Abs(graph.rotation.x) > 1 || Mathf.Abs(graph.rotation.z) > 1)) {
				EditorGUILayout.HelpBox("Nearest node queries in XZ space is not recommended for rotated graphs since XZ space no longer corresponds to the ground plane", MessageType.Warning);
			}

			GUILayout.BeginHorizontal();
			GUILayout.Space(18);
			graph.showMeshSurface = GUILayout.Toggle(graph.showMeshSurface, new GUIContent("Show surface", "Toggles gizmos for drawing the surface of the mesh"), EditorStyles.miniButtonLeft);
			graph.showMeshOutline = GUILayout.Toggle(graph.showMeshOutline, new GUIContent("Show outline", "Toggles gizmos for drawing an outline of the nodes"), EditorStyles.miniButtonMid);
			graph.showNodeConnections = GUILayout.Toggle(graph.showNodeConnections, new GUIContent("Show connections", "Toggles gizmos for drawing node connections"), EditorStyles.miniButtonRight);
			GUILayout.EndHorizontal();
		}

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

void OnGUI () {
			if (largeStyle == null) {
				largeStyle = new GUIStyle(EditorStyles.largeLabel);
				largeStyle.fontSize = 32;
				largeStyle.alignment = TextAnchor.UpperCenter;
				largeStyle.richText = true;

				normalStyle = new GUIStyle(EditorStyles.label);
				normalStyle.wordWrap = true;
				normalStyle.richText = true;
			}

			if (version == null) {
				return;
			}

			GUILayout.Label("New Update Available!", largeStyle);
			GUILayout.Label("There is a new version of the <b>A* Pathfinding Project</b> available for download.\n" +
				"The new version is <b>" + version + "</b> you have <b>" + AstarPath.Version + "</b>\n\n"+
				"<i>Summary:</i>\n"+summary, normalStyle
				);

			GUILayout.FlexibleSpace();

			GUILayout.BeginHorizontal();
			GUILayout.FlexibleSpace();

			GUILayout.BeginVertical();

			Color col = GUI.color;
			GUI.backgroundColor *= new Color(0.5f,  1f, 0.5f);
			if (GUILayout.Button("Take me to the download page!", GUILayout.Height(30), GUILayout.MaxWidth(300))) {
				Application.OpenURL(AstarUpdateChecker.GetURL("download"));
			}
			GUI.backgroundColor = col;


			if (GUILayout.Button("What's new? (full changelog)")) {
				Application.OpenURL(AstarUpdateChecker.GetURL("changelog"));
			}

			GUILayout.EndVertical();

			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();

			GUILayout.FlexibleSpace();

			GUILayout.BeginHorizontal();

			if (GUILayout.Button("Skip this version", GUILayout.MaxWidth(100))) {
				EditorPrefs.SetString("AstarSkipUpToVersion", version.ToString());
				setReminder = true;
				Close();
			}

			if (GUILayout.Button("Remind me later ( 1 week )", GUILayout.MaxWidth(200))) {
				EditorPrefs.SetString("AstarRemindUpdateDate", DateTime.UtcNow.AddDays(7).ToString(System.Globalization.CultureInfo.InvariantCulture));
				EditorPrefs.SetString("AstarRemindUpdateVersion", version.ToString());
				setReminder = true;
				Close();
			}

			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
		}

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

public static void TagMaskField (GUIContent label, int value, System.Action<int> callback) {
			GUILayout.BeginHorizontal();

			EditorGUILayout.PrefixLabel(label, EditorStyles.layerMaskField);

			string[] tagNames = AstarPath.FindTagNames();

			string text;
			if (value == 0) {
				text = "Nothing";
			} else if (value == ~0) {
				text = "Everything";
			} else {
				text = "";
				for (int i = 0; i < 32; i++) {
					if (((value >> i) & 0x1) != 0) {
						// Add spacing between words
						if (text.Length > 0) text += ", ";

						text += tagNames[i];

						// Too long, just give up
						if (text.Length > 40) {
							text = "Mixed...";
							break;
						}
					}
				}
			}

			if (GUILayout.Button(text, EditorStyles.layerMaskField, GUILayout.ExpandWidth(true))) {
				GenericMenu.MenuFunction2 wrappedCallback = obj => callback((int)obj);

				var menu = new GenericMenu();

				menu.AddItem(new GUIContent("Everything"), value == ~0, wrappedCallback, ~0);
				menu.AddItem(new GUIContent("Nothing"), value == 0, wrappedCallback, 0);

				for (int i = 0; i < tagNames.Length; i++) {
					bool on = (value >> i & 1) != 0;
					int result = on ? value & ~(1 << i) : value | 1<<i;
					menu.AddItem(new GUIContent(tagNames[i]), on, wrappedCallback, result);
				}

				// Shortcut to open the tag editor
				menu.AddItem(new GUIContent("Edit Tag Names..."), false, AstarPathEditor.EditTags);
				menu.ShowAsContext();

				Event.current.Use();
			}

			GUILayout.EndHorizontal();
		}

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

public static bool UnityTagMaskList (GUIContent label, bool foldout, List<string> tagMask) {
			if (tagMask == null) throw new System.ArgumentNullException("tagMask");
			if (EditorGUILayout.Foldout(foldout, label)) {
				EditorGUI.indentLevel++;
				GUILayout.BeginVertical();
				for (int i = 0; i < tagMask.Count; i++) {
					tagMask[i] = EditorGUILayout.TagField(tagMask[i]);
				}
				GUILayout.BeginHorizontal();
				if (GUILayout.Button("Add Tag")) tagMask.Add("Untagged");

				EditorGUI.BeginDisabledGroup(tagMask.Count == 0);
				if (GUILayout.Button("Remove Last")) tagMask.RemoveAt(tagMask.Count-1);
				EditorGUI.EndDisabledGroup();

				GUILayout.EndHorizontal();
				GUILayout.EndVertical();
				EditorGUI.indentLevel--;
				return true;
			}
			return false;
		}

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

void OnGUI()
		{
			if (!_isInit)
			{
				EditorGUILayout.LabelField("Initialising...");
				return;
			}

			GUILayout.Label("Having problems? We'll do our best to help.\n\nBelow is a collection of resources to help solve any issues you may encounter.", EditorStyles.wordWrappedLabel);
			GUILayout.Space(16f);

			/*GUI.color = Color.white;
			GUI.backgroundColor = Color.clear;
			if (_trySelfSolve)
			{
				GUI.color = Color.white;
				GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
				if (EditorGUIUtility.isProSkin)
				{
					GUI.backgroundColor = Color.black;
				}
			}
			GUILayout.BeginVertical("box");
			GUI.backgroundColor = Color.white;*/

			_selectionIndex = GUILayout.Toolbar(_selectionIndex, _gridNames);

			GUILayout.Space(16f);
			/*if (GUILayout.Button("Try Solve the Issue Yourself", EditorStyles.toolbarButton))
			{
				//_trySelfSolve = !_trySelfSolve;
				_trySelfSolve = true;
			}
			GUI.color = Color.white;
			if (_trySelfSolve)*/
			if (_selectionIndex == 0)
			{
				GUILayout.BeginHorizontal();
				GUILayout.Label("1) ");
				GUILayout.Label("Check you're using the latest version of AVPro Video via the replacedet Store.  This is version " + Helper.ScriptVersion, EditorStyles.wordWrappedLabel);
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.BeginHorizontal();
				GUILayout.Label("2) ");
				GUILayout.Label("Look at the example projects and scripts in the Demos folder");
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.BeginHorizontal();
				GUILayout.Label("3) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Read the Doreplacedentation", GUILayout.ExpandWidth(false)))
				{
					Application.OpenURL(MediaPlayerEditor.LinkUserManual);
				}
				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.BeginHorizontal();
				GUILayout.Label("4) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Read the Scripting Reference", GUILayout.ExpandWidth(false)))
				{
					Application.OpenURL(MediaPlayerEditor.LinkScriptingClreplacedReference);
				}
				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.BeginHorizontal();
				GUILayout.Label("5) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Visit the AVPro Video Website", GUILayout.ExpandWidth(false)))
				{
					Application.OpenURL(MediaPlayerEditor.LinkPluginWebsite);
				}
				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.BeginHorizontal();
				GUILayout.Label("6) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Browse the Unity Forum", GUILayout.ExpandWidth(false)))
				{
					Application.OpenURL(MediaPlayerEditor.LinkForumPage);
				}
				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
			}
			else if (_selectionIndex == 1)
			{
				GUILayout.Label("Coming soon...");
			}
			else if (_selectionIndex == 2)
			{
				GUILayout.Label("Please fill out these fields when sending us a new issue.\nThis makes it much easier and faster to resolve the issue.", EditorStyles.wordWrappedLabel);
				GUILayout.Space(16f);

				_scroll = GUILayout.BeginScrollView(_scroll);

				GUILayout.Label("Issue/Question replacedle", EditorStyles.boldLabel);
				_emailTopic = GUILayout.TextField(_emailTopic);

				GUILayout.Space(8f);
				GUILayout.Label("What's the problem?", EditorStyles.boldLabel);
				_emailDescription = EditorGUILayout.TextArea(_emailDescription, GUILayout.Height(64f));

				GUILayout.Space(8f);
				GUILayout.BeginHorizontal();
				GUILayout.Label("Tell us about your videos", EditorStyles.boldLabel);
				GUILayout.Label("- Number of videos, resolution, codec, frame-rate, example URLs", EditorStyles.miniBoldLabel);
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
				_emailVideoFormat = EditorGUILayout.TextField(_emailVideoFormat);

				GUILayout.Space(8f);
				GUILayout.BeginHorizontal();
				GUILayout.Label("Which devices are you having the issue with?", EditorStyles.boldLabel);
				GUILayout.Label("- Model, OS version number", EditorStyles.miniBoldLabel);
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
				_emailDeviceSpecs = EditorGUILayout.TextField(_emailDeviceSpecs);

				//GUILayout.Space(16f);
				////GUILayout.Label("System Information");
				//GUILayout.TextArea(CollectSupportData());

				string emailSubject = "AVPro Video - " + _emailTopic;

				string emailBody = System.Environment.NewLine + System.Environment.NewLine;
				emailBody += "Problem description:" + System.Environment.NewLine + System.Environment.NewLine + _emailDescription + System.Environment.NewLine + System.Environment.NewLine;
				emailBody += "Device (which devices are you having the issue with - model, OS version number):" + System.Environment.NewLine + System.Environment.NewLine + _emailDeviceSpecs + System.Environment.NewLine + System.Environment.NewLine;
				emailBody += "Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):" + System.Environment.NewLine + System.Environment.NewLine + _emailVideoFormat + System.Environment.NewLine + System.Environment.NewLine;
				emailBody += "System Information:" + System.Environment.NewLine + System.Environment.NewLine + CollectSupportData() + System.Environment.NewLine + System.Environment.NewLine;

				//GUILayout.Space(16f);
//
				//GUILayout.Label("Email Content");
				//EditorGUILayout.TextArea(emailBody);

				GUILayout.Space(16f);

				GUILayout.EndScrollView();

				GUILayout.BeginHorizontal();
				//GUILayout.FlexibleSpace();
				GUILayout.Label("1) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Ask via Email [email protected]"))
				{
					emailBody = emailBody.Replace(System.Environment.NewLine, "%0D%0A");
					Application.OpenURL(string.Format("mailto:[email protected]?subject={0}&body={1}", emailSubject, emailBody));
				}
				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();

				GUILayout.Label("or");

				GUILayout.BeginHorizontal();
				GUILayout.Label("2) ");
				GUI.color = Color.green;
				if (GUILayout.Button("Ask at the Unity Forum", GUILayout.ExpandWidth(false)))
				{
					PopupWindow.Show(buttonRect, new PopupExample(emailBody));
					//SupportWindowPopup.Init(emailBody);
					//EditorUtility.DisplayDialog("AVPro Video", "Please include as much information as you can in the forum post", "OK");
				}

				if (Event.current.type == EventType.Repaint)
				{
					buttonRect = GUILayoutUtility.GetLastRect();
				}

				GUI.color = Color.white;
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
			}
			//GUILayout.EndVertical();

			GUILayout.FlexibleSpace();

			if (GUILayout.Button("Close"))
			{
				this.Close();
			}			
		}

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

void OnGUI()
		{
			GUI.skin = _skin;

			if (_displaySheet != null)
			{
				GUI.DrawTexture(new Rect(0f, 0f, Screen.width, Screen.height), _displaySheet, ScaleMode.ScaleToFit, false);
			}

			float debugGuiScale = 4f * (Screen.height / 1080f);
			GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.idenreplacedy, new Vector3(debugGuiScale, debugGuiScale, 1.0f));

			GUILayout.Space(16f);
			GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true), GUILayout.Width(Screen.width / debugGuiScale));
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Start Extracting Frames"))
			{
				_frameIndex = 0;
				RenderTexture.active = _displaySheet;
				GL.Clear(false, true, Color.black, 0f);
				RenderTexture.active = null;
			}
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
		}

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

void OnGUI()
		{
			if (_mediaPlayer == null)
			{
				return;
			}

			// Make sure we're set to render after the background IMGUI
			GUI.depth = -10;

			// Apply skin
			if (_guiSkin != null)
			{
				GUI.skin = _guiSkin;
			}

			// Make sure the UI scales with screen resolution
			const float UIWidth = 1920f / 2.0f;
			const float UIHeight = 1080f / 2.0f;
			GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.idenreplacedy, new Vector3(Screen.width / UIWidth, Screen.height / UIHeight, 1f));

			GUILayout.BeginVertical("box");

			if (_mediaPlayer.Control != null)
			{
				// Display properties
				GUILayout.Label("Loaded: " + _mediaPlayer.m_VideoPath);
				GUILayout.Label(string.Format("Size: {0}x{1} FPS: {3} Duration: {2}ms", _width, _height, _mediaPlayer.Info.GetDurationMs(), _mediaPlayer.Info.GetVideoFrameRate().ToString("F2")));
				GUILayout.Label("Updates: " + _mediaPlayer.TextureProducer.GetTextureFrameCount() + "    Rate: " + _mediaPlayer.Info.GetVideoDisplayRate().ToString("F1"));

				GUILayout.BeginHorizontal();

				// Fade option
				_useFading = GUILayout.Toggle(_useFading, "Fade to Black During Loading");

				// Auto play
				_mediaPlayer.m_AutoStart = GUILayout.Toggle(_mediaPlayer.m_AutoStart, "Auto Play After Load");

				// Looping
				bool loopStatus = _mediaPlayer.m_Loop;
				bool newLoopStatus = GUILayout.Toggle(loopStatus, "Loop");
				if (newLoopStatus != loopStatus)
				{
					_mediaPlayer.m_Loop = newLoopStatus;
					_mediaPlayer.Control.SetLooping(newLoopStatus);
				}

				GUILayout.EndHorizontal();

				// Timeline scrubbing (note as use int as WebGL has float == precision issues)
				int currentTime = (int)_mediaPlayer.Control.GetCurrentTimeMs();
				int newTime = (int)GUILayout.HorizontalSlider(currentTime, 0f, _durationSeconds * 1000f);
				Rect timeSliderRect = GUILayoutUtility.GetLastRect();

				float thumbWidth = GUI.skin.horizontalSliderThumb.CalcSize(GUIContent.none).x;


				// Draw buffering indication
				Rect bufferingRect = timeSliderRect;
				GUI.color = Color.green;
				bufferingRect.xMin += thumbWidth;
				bufferingRect.y = bufferingRect.yMax - 4;
				bufferingRect.width -= thumbWidth * 1f;
				bufferingRect.width *= _mediaPlayer.Control.GetBufferingProgress();
				bufferingRect.height = 4;
				GUI.DrawTexture(bufferingRect, Texture2D.whiteTexture, ScaleMode.StretchToFill);
				

				GUI.color = Color.green;
				int timeRangeCount = _mediaPlayer.Control.GetBufferedTimeRangeCount();
				for (int i = 0; i < timeRangeCount; i++)
				{
					float startTimeMs = 0f;
					float endTimeMs = 0f;
					if (_mediaPlayer.Control.GetBufferedTimeRange(i, ref startTimeMs, ref endTimeMs))
					{
						bufferingRect.xMin = thumbWidth + timeSliderRect.x + (timeSliderRect.width - thumbWidth * 1f) * (startTimeMs / (_durationSeconds * 1000f));
						bufferingRect.xMax = thumbWidth + timeSliderRect.x + (timeSliderRect.width - thumbWidth * 1f) * (endTimeMs / (_durationSeconds * 1000f));
						GUI.DrawTexture(bufferingRect, Texture2D.whiteTexture, ScaleMode.StretchToFill);
					}
				}
				GUI.color = Color.white;


				// Handle possible slider move
				if (newTime != currentTime)
				{
					_mediaPlayer.Control.Seek((float)newTime);
				}

				if (!_mediaPlayer.Control.IsPlaying())
				{
					if (GUILayout.Button("Play"))
					{
						_mediaPlayer.Control.Play();
					}
				}
				else
				{
					if (GUILayout.Button("Pause"))
					{
						_mediaPlayer.Control.Pause();
					}
				}

			// Audio tracks
			GUILayout.BeginHorizontal();
			int numAudioTracks = _mediaPlayer.Info.GetAudioTrackCount();
			int selectedTrackIndex = _mediaPlayer.Control.GetCurrentAudioTrack();
			for (int i = 0; i < numAudioTracks; i++)
			{
				if (i == selectedTrackIndex)
				{
					GUI.color = Color.green;
				}
				if (GUILayout.Button("Audio Track #" + (i + 1)))
				{
					_mediaPlayer.Control.SetAudioTrack(i);
				}
				GUI.color = Color.white;
			}
			GUILayout.EndHorizontal();
			}

			GUILayout.Label("Select a new file to play:");

			// Display a grid of buttons containing the file names of videos to play
			int newSelection = GUILayout.SelectionGrid(-1, _filenames, 3);
			if (newSelection >= 0)
			{
				LoadVideo(System.IO.Path.Combine(_folder, _filenames[newSelection]));
			}

			GUILayout.Space(8f);

			GUILayout.Label("Select a new stream to play:");

			// Display a grid of buttons containing the file names of videos to play
			int newSteam = GUILayout.SelectionGrid(-1, _streams, 1);
			if (newSteam >= 0)
			{
				LoadVideo(_streams[newSteam], true);
			}

			GUILayout.Space(8f);

			GUILayout.Label("Recent Events: ");
            GUILayout.BeginVertical("box");
            int eventIndex = 0;
            foreach (string eventString in _eventLog)
            {
                GUI.color = Color.white;
                if (eventIndex == 0)
                {
                    GUI.color = new Color(1f, 1f, 1f, _eventTimer);
                }
                GUILayout.Label(eventString);
                eventIndex++;
            }
            GUILayout.EndVertical();
            GUI.color = Color.white;


            GUILayout.EndVertical();
		}

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

void OnGUI()
		{
			if (m_Info != null && m_DebugGui)
			{
				GUI.depth = s_GuiDepth;
				GUI.matrix = Matrix4x4.TRS(new Vector3(m_GuiPositionX, 10f, 0f), Quaternion.idenreplacedy, new Vector3(s_GuiScale, s_GuiScale, 1.0f));

				GUILayout.BeginVertical("box", GUILayout.MaxWidth(s_GuiWidth));
				GUILayout.Label(System.IO.Path.GetFileName(m_VideoPath));
				GUILayout.Label("Dimensions: " + m_Info.GetVideoWidth() + "x" + m_Info.GetVideoHeight() + "@" + m_Info.GetVideoFrameRate().ToString("F2"));
				GUILayout.Label("Time: " + (m_Control.GetCurrentTimeMs() * 0.001f).ToString("F1") + "s / " + (m_Info.GetDurationMs() * 0.001f).ToString("F1") + "s");
				GUILayout.Label("Rate: " + m_Info.GetVideoDisplayRate().ToString("F2") + "Hz");

				if (TextureProducer != null && TextureProducer.GetTexture() != null)
				{
#if REAL_ANDROID
					// In OES mode we can't display the texture without using a special shader, so just don't display it
					if (!_optionsAndroid.useFastOesPath)
#endif
					{
						// Show texture without and with alpha blending
						GUILayout.BeginHorizontal();
						Rect r1 = GUILayoutUtility.GetRect(32f, 32f);
						GUILayout.Space(8f);
						Rect r2 = GUILayoutUtility.GetRect(32f, 32f);
						Matrix4x4 prevMatrix = GUI.matrix;
						if (TextureProducer.RequiresVerticalFlip())
						{
							GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0, r1.y + (r1.height / 2f)));
						}
						GUI.DrawTexture(r1, TextureProducer.GetTexture(), ScaleMode.ScaleToFit, false);
						GUI.DrawTexture(r2, TextureProducer.GetTexture(), ScaleMode.ScaleToFit, true);
						GUI.matrix = prevMatrix;
						GUILayout.FlexibleSpace();
						GUILayout.EndHorizontal();
					}
				}

				if (m_DebugGuiControls)
				{
					GUILayout.BeginHorizontal();
					if (m_Control.IsPaused())
					{
						if (GUILayout.Button("Play", GUILayout.Width(50)))
						{
							m_Control.Play();
						}
					}
					else
					{
						if (GUILayout.Button("Pause", GUILayout.Width(50)))
						{
							m_Control.Pause();
						}
					}

					float duration = m_Info.GetDurationMs();
					float time = m_Control.GetCurrentTimeMs();
					float newTime = GUILayout.HorizontalSlider(time, 0f, duration);
					if (newTime != time)
					{
						m_Control.Seek(newTime);
					}
					GUILayout.EndHorizontal();
				}

#if AVPROVIDEO_DEBUG_DISPLAY_EVENTS
				// Dirty code to hack in an event monitor
				if (Event.current.type == EventType.Repaint)
				{
					this.Events.RemoveListener(OnMediaPlayerEvent);
					this.Events.AddListener(OnMediaPlayerEvent);
					UpdateEventLogs();
				}

				if (_eventLog != null && _eventLog.Count > 0)
				{
					GUILayout.Label("Recent Events: ");
					GUILayout.BeginVertical("box");
					int eventIndex = 0;
					foreach (string eventString in _eventLog)
					{
						GUI.color = Color.white;
						if (eventIndex == 0)
						{
							GUI.color = new Color(1f, 1f, 1f, _eventTimer);
						}
						GUILayout.Label(eventString);
						eventIndex++;
					}
					GUILayout.EndVertical();
					GUI.color = Color.white;
				}
#endif
				GUILayout.EndVertical();
			}
		}

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

public override void OnGUI(Rect rect)
		{
			GUILayout.BeginHorizontal();
			GUILayout.Label("Copy-Paste this text, then ", EditorStyles.boldLabel);
			GUI.color = Color.green;
			if (GUILayout.Button("Go to Forum", GUILayout.ExpandWidth(true)))
			{
				Application.OpenURL(MediaPlayerEditor.LinkForumLastPage);
			}
			GUILayout.EndHorizontal();
			GUI.color = Color.white;
			EditorGUILayout.TextArea(_text);
		}

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

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
                    scrollPos = GUILayout.BeginScrollView(scrollPos);

                // Draw out the textures
                GUILayout.SelectionGrid(0, Textures, 3);

#if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
                    if (finishedCount == Images.Length && allDownloadedFromLocalCache)
                        GUIHelper.DrawCenteredText("All images loaded from the local cache!");
#endif

                    GUILayout.FlexibleSpace();

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Max Connection/Server: ", GUILayout.Width(150));
                    GUILayout.Label(HTTPManager.MaxConnectionPerServer.ToString(), GUILayout.Width(20));
                    HTTPManager.MaxConnectionPerServer = (byte)GUILayout.HorizontalSlider(HTTPManager.MaxConnectionPerServer, 1, 10);
                    GUILayout.EndHorizontal();

                    if (GUILayout.Button("Start Download"))
                        DownloadImages();

                    GUILayout.EndScrollView();
                });
        }

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

void OnGUI()
        {
            GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
                {
#if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
                GUILayout.BeginHorizontal();

                    GUILayout.Label("Delete cached enreplacedies older then");

                    GUILayout.Label(value.ToString(), GUILayout.MinWidth(50));
                    value = (int)GUILayout.HorizontalSlider(value, 1, 60, GUILayout.MinWidth(100));

                    GUILayout.Space(10);

                    deleteOlderType = (DeleteOlderTypes)(int)GUILayout.SelectionGrid((int)deleteOlderType, new string[] { "Days", "Hours", "Mins", "Secs" }, 4);
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.Space(10);

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Max Cache Size (bytes): ", GUILayout.Width(150));
                    GUILayout.Label(maxCacheSize.ToString("N0"), GUILayout.Width(70));
                    maxCacheSize = (int)GUILayout.HorizontalSlider(maxCacheSize, 1024, 10 * 1024 * 1024);
                    GUILayout.EndHorizontal();

                    GUILayout.Space(10);

                    if (GUILayout.Button("Maintenance"))
                    {
                        TimeSpan deleteOlder = TimeSpan.FromDays(14);

                        switch (deleteOlderType)
                        {
                            case DeleteOlderTypes.Days: deleteOlder = TimeSpan.FromDays(value); break;
                            case DeleteOlderTypes.Hours: deleteOlder = TimeSpan.FromHours(value); break;
                            case DeleteOlderTypes.Mins: deleteOlder = TimeSpan.FromMinutes(value); break;
                            case DeleteOlderTypes.Secs: deleteOlder = TimeSpan.FromSeconds(value); break;
                        }

                    // Call the BeginMaintainence function. It will run on a thread to do not block the main thread.
                    HTTPCacheService.BeginMaintainence(new HTTPCacheMaintananceParams(deleteOlder, (ulong)maxCacheSize));
                    }
#endif
            });
        }

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

void OnGUI()
    {
        GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
        {
            GUILayout.BeginVertical();

                #region To Everybody
                GUILayout.Label("To Everybody");

                GUILayout.BeginHorizontal();

                    ToEveryBodyText = GUILayout.TextField(ToEveryBodyText, GUILayout.MinWidth(100));

                    if (GUILayout.Button("Broadcast"))
                        Broadcast(ToEveryBodyText);

                    if (GUILayout.Button("Broadcast (All Except Me)"))
                        BroadcastExceptMe(ToEveryBodyText);

                    if (GUILayout.Button("Enter Name"))
                        EnterName(ToEveryBodyText);

                    if (GUILayout.Button("Join Group"))
                        JoinGroup(ToEveryBodyText);

                    if (GUILayout.Button("Leave Group"))
                        LeaveGroup(ToEveryBodyText);

                GUILayout.EndHorizontal();
                #endregion

                #region To Me
                GUILayout.Label("To Me");

                GUILayout.BeginHorizontal();

                ToMeText = GUILayout.TextField(ToMeText, GUILayout.MinWidth(100));

                if (GUILayout.Button("Send to me"))
                    SendToMe(ToMeText);

                GUILayout.EndHorizontal();
                #endregion

                #region Private Message
                GUILayout.Label("Private Message");

                GUILayout.BeginHorizontal();

                    GUILayout.Label("Message:");
                    PrivateMessageText = GUILayout.TextField(PrivateMessageText, GUILayout.MinWidth(100));

                    GUILayout.Label("User or Group name:");
                    PrivateMessageUserOrGroupName = GUILayout.TextField(PrivateMessageUserOrGroupName, GUILayout.MinWidth(100));

                    if (GUILayout.Button("Send to user"))
                        SendToUser(PrivateMessageUserOrGroupName, PrivateMessageText);

                    if (GUILayout.Button("Send to group"))
                        SendToGroup(PrivateMessageUserOrGroupName, PrivateMessageText);

                GUILayout.EndHorizontal();
                #endregion

                GUILayout.Space(20);

                if (signalRConnection.State == ConnectionStates.Closed)
                {
                    if (GUILayout.Button("Start Connection"))
                        signalRConnection.Open();
                }
                else if (GUILayout.Button("Stop Connection"))
                        signalRConnection.Close();

                GUILayout.Space(20);

                // Draw the messages
                GUILayout.Label("Messages");

                GUILayout.BeginHorizontal();
                    GUILayout.Space(20);
                    messages.Draw(Screen.width - 20, 0);
                GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        });
    }

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

public void Draw()
    {
        GUILayout.Label("Arbitrary Code");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(string.Format("Sending {0} from arbitrary code without the hub itself!", fromArbitraryCodeResult));
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Group Added");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(groupAddedResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Dynamic Task");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(dynamicTaskResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Report Progress");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginVertical();
                GUILayout.Label(longRunningJobStatus);
                GUILayout.HorizontalSlider(longRunningJobProgress, 0, 100);
            GUILayout.EndVertical();
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Generic Task");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Task With Exception");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(taskWithExceptionResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Generic Task With Exception");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskWithExceptionResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Synchronous Exception");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(synchronousExceptionResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Invoking hub method with dynamic");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(invokingHubMethodWithDynamicResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Simple Array");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(simpleArrayResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Complex Type");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(complexTypeResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Complex Array");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(complexArrayResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Overloads");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginVertical();
                GUILayout.Label(voidOverloadResult);
                GUILayout.Label(intOverloadResult);
            GUILayout.EndVertical();
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Read State Value");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(readStateResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Plain Task");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(plainTaskResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Generic Task With ContinueWith");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label(genericTaskWithContinueWithResult);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.Label("Message Pump");
        GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            invokeResults.Draw(Screen.width - 40, 270);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);
    }

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

void OnGUI()
    {
        GUIHelper.DrawArea(GUIHelper.ClientArea, true, () =>
        {
            GUILayout.Label("Messages");

            GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                messages.Draw(Screen.width - 20, 0);
            GUILayout.EndHorizontal();
        });
    }

See More Examples