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 : InitProjectView.cs
License : MIT License
Project Creator : github-for-unity

public override void OnGUI()
        {
            GUILayout.BeginVertical(Styles.GenericBoxStyle);
            {
                GUILayout.FlexibleSpace();
                GUILayout.Space(-140);

                GUILayout.BeginHorizontal();
                {
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(Styles.EmptyStateInit, GUILayout.MaxWidth(265), GUILayout.MaxHeight(136));
                    GUILayout.FlexibleSpace();
                }
                GUILayout.EndHorizontal();

                GUILayout.Label(NoReporeplacedle, Styles.BoldCenteredLabel);
                GUILayout.Space(4);

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

                    EditorGUI.BeginDisabledGroup(!gitExecutableIsSet || IsBusy || !isUserDataPresent);
                    {
                        if (GUILayout.Button(Localization.InitializeRepositoryButtonText, "Button"))
                        {
                            Manager.InitializeRepository();
                        }
                    }
                    EditorGUI.EndDisabledGroup();

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

                if (gitExecutableIsSet && hasCompletedInitialCheck && !isUserDataPresent)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.HelpBox(NoUserOrEmailError, MessageType.Error);
                }

                GUILayout.FlexibleSpace();
            }
            GUILayout.EndVertical();
        }

19 View Source File : LfsLocksModificationProcessor.cs
License : MIT License
Project Creator : github-for-unity

private static void InspectorHeaderFinished(Editor editor)
        {
            string message = "";
            if (!IsOpenForEdit(replacedetDatabase.GetreplacedetPath(editor.target), out message))
            {
                var enabled = GUI.enabled;
                GUI.enabled = true;
                GUILayout.BeginVertical();
                {
                    GUILayout.Space(9);
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.BeginVertical(GUILayout.Width(32));
                        {
                            GUILayout.Label(Utility.GetIcon("big-logo.png", "[email protected]", Utility.IsDarkTheme), GUILayout.Width(32), GUILayout.Height(32));
                        }
                        GUILayout.EndVertical();

                        GUILayout.BeginVertical();
                        {
                            GUILayout.Space(9);
                            GUILayout.Label(message, Styles.HeaderBranchLabelStyle);
                        }
                        GUILayout.EndVertical();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
                GUI.enabled = enabled;
            }

        }

19 View Source File : LoadingView.cs
License : MIT License
Project Creator : github-for-unity

public override void OnGUI()
        {
            GUILayout.BeginVertical();
            {
                GUILayout.FlexibleSpace();
                GUILayout.BeginHorizontal();
                {
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(Windowreplacedle);
                    GUILayout.FlexibleSpace();
                }
                GUILayout.EndHorizontal();
                GUILayout.FlexibleSpace();
            }
            GUILayout.EndVertical();
        }

19 View Source File : LocksView.cs
License : MIT License
Project Creator : github-for-unity

private Rect RenderEntry(Rect entryRect, GitLockEntry entry)
        {
            var isSelected = entry == SelectedEntry;
            var iconWidth = 32;
            var iconHeight = 32;
            var iconBadgeWidth = 16;
            var iconBadgeHeight = 16;
            var hasKeyboardFocus = GUIUtility.keyboardControl == controlId;

            GUILayout.BeginHorizontal(isSelected ? Styles.SelectedArea : Styles.Label);
            GUILayout.Label(entry.Icon, GUILayout.Height(iconWidth), GUILayout.Width(iconHeight));
            if (Event.current.type == EventType.Repaint)
            {
                var iconRect = GUILayoutUtility.GetLastRect();
                var iconBadgeRect = new Rect(iconRect.x + iconBadgeWidth, iconRect.y + iconBadgeHeight, iconBadgeWidth, iconBadgeHeight);
                Styles.Label.Draw(iconBadgeRect, entry.IconBadge, false, false, false, hasKeyboardFocus);
            }
            GUILayout.BeginVertical();
            GUILayout.Label(entry.GitLock.Path, isSelected ? Styles.SelectedLabel : Styles.Label);
            GUILayout.Label(string.Format("Locked {0} by {1}", entry.LockedAt, entry.GitLock.Owner.Name), isSelected ? Styles.LocksViewLockedBySelectedStyle : Styles.LocksViewLockedByStyle);
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            var itemRect = GUILayoutUtility.GetLastRect();
            return itemRect;
        }

19 View Source File : Window.cs
License : MIT License
Project Creator : github-for-unity

private void DoHeaderGUI()
        {
            GUILayout.BeginHorizontal(Styles.HeaderBoxStyle);
            {
                GUILayout.Space(3);
                GUILayout.BeginVertical(GUILayout.Width(16));
                {
                    GUILayout.Space(9);
                    GUILayout.Label(Styles.RepoIcon, GUILayout.Height(20), GUILayout.Width(20));
                }
                GUILayout.EndVertical();

                GUILayout.BeginVertical();
                {
                    GUILayout.Space(3);

                    GUILayout.Label(currentRemoteUrlContent, Styles.HeaderRepoLabelStyle);
                    GUILayout.Space(-2);
                    GUILayout.Label(currentBranchContent, Styles.HeaderBranchLabelStyle);
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : ChangesView.cs
License : MIT License
Project Creator : github-for-unity

private void DoChangesTreeGUI()
        {
            var rect = GUILayoutUtility.GetLastRect();
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical(Styles.CommitFileAreaStyle);
            {
                treeScroll = GUILayout.BeginScrollView(treeScroll);
                {
                    OnTreeGUI(new Rect(0f, 0f, Position.width, Position.height - rect.height + Styles.CommitAreaPadding));
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }

19 View Source File : ChangesView.cs
License : MIT License
Project Creator : github-for-unity

private void DoButtonBarGUI()
        {
            GUILayout.BeginHorizontal();
            {
                EditorGUI.BeginDisabledGroup(gitStatusEntries == null || gitStatusEntries.Count == 0);
                {
                    if (GUILayout.Button(SelectAllButton, EditorStyles.miniButtonLeft))
                    {
                        SelectAll();
                    }

                    if (GUILayout.Button(SelectNoneButton, EditorStyles.miniButtonRight))
                    {
                        SelectNone();
                    }
                }
                EditorGUI.EndDisabledGroup();

                GUILayout.FlexibleSpace();

                GUILayout.Label(changedFilesText, EditorStyles.miniLabel);
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : GitHubAuthenticationView.cs
License : MIT License
Project Creator : github-for-unity

public override void OnGUI()
        {
            HandleEnterPressed();

            EditorGUIUtility.labelWidth = 90f;

            scroll = GUILayout.BeginScrollView(scroll);
            {
                GUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
                {
                  GUILayout.Label(Authreplacedle, Styles.HeaderRepoLabelStyle);
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginVertical();
                {
                    if (!need2fa)
                    {
                        OnGUILogin();
                    }
                    else
                    {
                        OnGUI2FA();
                    }
                }

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

19 View Source File : HistoryView.cs
License : MIT License
Project Creator : github-for-unity

protected void HistoryDetailsEntry(GitLogEntry entry)
        {
            GUILayout.BeginVertical(Styles.HeaderBoxStyle);
            GUILayout.Label(entry.Summary, Styles.HistoryDetailsreplacedleStyle);

            GUILayout.Space(-5);

            GUILayout.BeginHorizontal();
            GUILayout.Label(entry.PrettyTimeString, Styles.HistoryDetailsMetaInfoStyle);
            GUILayout.Label(entry.AuthorName, Styles.HistoryDetailsMetaInfoStyle);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            GUILayout.Space(3);
            GUILayout.EndVertical();
        }

19 View Source File : StereoControllerEditor.cs
License : MIT License
Project Creator : harshitjuneja

public override void OnInspectorGUI() {
    DrawDefaultInspector();
    GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));
    GUILayout.FlexibleSpace();
    if (GUILayout.Button(updateButton, GUILayout.ExpandWidth(false))) {
      var controller = (StereoController)target;
      DoUpdateStereoCameras(controller.gameObject);
    }
    GUILayout.FlexibleSpace();
    GUILayout.EndHorizontal();
  }

19 View Source File : Demo.cs
License : MIT License
Project Creator : harshitjuneja

private void OnGUI()
    {
        GUILayout.BeginVertical(GUILayout.Width(Screen.width));

        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Previous character (Q)"))
        {
            m_cameraLogic.PreviousTarget();
        }

        if (GUILayout.Button("Next character (E)"))
        {
            m_cameraLogic.NextTarget();
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(16);

        for(int i = 0; i < m_animations.Length; i++)
        {
            if(i == 0) { GUILayout.BeginHorizontal(); }

            if(GUILayout.Button(m_animations[i]))
            {
                for(int j = 0; j < m_animators.Length; j++)
                {
                    m_animators[j].SetTrigger(m_animations[i]);
                }
            }

            if(i == m_animations.Length - 1) { GUILayout.EndHorizontal(); }
            else if (i == (m_animations.Length / 2)) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); }
        }

        GUILayout.Space(16);

        Color oldColor = GUI.color;
        GUI.color = Color.black;

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label("WASD or arrows: Move");
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label("Left Shift: Walk");
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label("Space: Jump");
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUI.color = oldColor;

        GUILayout.EndVertical();
    }

19 View Source File : HumanMonitorEditor.cs
License : MIT License
Project Creator : HectorPulido

public override void OnInspectorGUI()
		{       
			if(h == null)
				h = (HumanMonitor) target;

			serializedObject.Update();

			EditorGUILayout.PropertyField(serializedObject.FindProperty("meditionPeriod"));
			EditorGUILayout.PropertyField(serializedObject.FindProperty("meditionCount"));
			EditorGUILayout.PropertyField(serializedObject.FindProperty("loadData"));

			if(h.loadData)
			{
				EditorGUILayout.HelpBox("If you load the data, a dataset will be load and you will not play", MessageType.Warning);
			}
			EditorGUILayout.PropertyField(serializedObject.FindProperty("saveData"));
			if(!h.saveData)
			{
				EditorGUILayout.HelpBox("If you do not save your data, it will be lost", MessageType.Warning);
			}
			
			if(h.saveData || h.loadData)
			{				
				var dropArea = GUILayoutUtility.GetRect(Screen.width, 35, GUILayout.MaxWidth(Screen.width - 40));

				if (string.IsNullOrEmpty(h.dataPath))
					GUI.Box(dropArea, "Drag a data file");
				else
					GUI.Box(dropArea, Path.GetFileName(h.dataPath));

				DragAndDropFile(dropArea);

				EditorGUILayout.Space();

				GUILayout.BeginHorizontal();
				if (GUILayout.Button("Clear", GUILayout.MaxWidth(Screen.width/2 - 20)))
				{
					h.dataPath = "";
				}
				if (GUILayout.Button("Create", GUILayout.MaxWidth(Screen.width/2 - 20)))
				{
					CreateFile();
				}
				GUILayout.EndHorizontal();
			}

			serializedObject.ApplyModifiedProperties();
		}

19 View Source File : BrainEditor.cs
License : MIT License
Project Creator : HectorPulido

public override void OnInspectorGUI()
                {       
                    if(b == null)
                        b = (Brain) target;

                    serializedObject.Update();
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("epoch"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("topology"), true);
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("lossShowRate"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("batchSize"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("activationFunction"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("learningRate"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("save"));                  

                    if(b.save)
                    {
                        var dropArea = GUILayoutUtility.GetRect(Screen.width, 35, GUILayout.MaxWidth(Screen.width - 40));

                        if (string.IsNullOrEmpty(b.dataPath))
                            GUI.Box(dropArea, "Drag an neural network");
                        else
                            GUI.Box(dropArea, Path.GetFileName(b.dataPath));

                        DragAndDropFile(dropArea);

                        EditorGUILayout.Space();

                        GUILayout.BeginHorizontal();
                        if (GUILayout.Button("Clear", GUILayout.MaxWidth(Screen.width/2 - 20)))
                        {
                            b.dataPath = "";
                        }
                        if (GUILayout.Button("Create", GUILayout.MaxWidth(Screen.width/2 - 20)))
                        {
                            CreateFile();
                        }
                        GUILayout.EndHorizontal();

                        //EditorGUILayout.Space();
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("If you do not save your training, it will be lost", MessageType.Warning);
                    }

                    serializedObject.ApplyModifiedProperties();
                }

19 View Source File : ExportSettingsEditor.cs
License : MIT License
Project Creator : Hello-Meow

public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            GUILayout.Space(5);

            EditorGUILayout.PropertyField(_name, new GUIContent("Mod Name*:"));
            EditorGUILayout.PropertyField(_author, new GUIContent("Author:"));
            EditorGUILayout.PropertyField(_version, new GUIContent("Version:"));

            EditorGUILayout.PropertyField(_description, new GUIContent("Description:"), GUILayout.Height(60));

            GUILayout.Space(5);

            _platforms.intValue = platforms.DoMaskField("Platforms*:", _platforms.intValue);
            _content.intValue = content.DoMaskField("Content*:", _content.intValue);
            LogUtility.logLevel = (LogLevel)EditorGUILayout.EnumPopup("Log Level:", LogUtility.logLevel);

            bool enabled = GUI.enabled;

            GUILayout.BeginHorizontal();

            GUI.enabled = false;

            EditorGUILayout.TextField("Output Directory*:", GetShortString(_outputDirectory.stringValue));

            GUI.enabled = enabled;

            if (GUILayout.Button("...", GUILayout.Width(30)))
            {
                string selectedDirectory = EditorUtility.SaveFolderPanel("Choose output directory", _outputDirectory.stringValue, "");
                if (!string.IsNullOrEmpty(selectedDirectory))
                    _outputDirectory.stringValue = selectedDirectory;

                Repaint();
            }

            GUILayout.EndHorizontal();

            GUILayout.Space(20);

            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }

19 View Source File : BhapticsVRCEditorInspector.cs
License : Apache License 2.0
Project Creator : HerpDerpinstine

void OnSceneGUI()
    {
        if (script == null)
        {
            return;
        }
		
		if (!script.enabled)
			return;

        if (script.anim == null)
        {
            return;
        }

        if (script.anim.avatar == null)
        {
            return;
        }

        if (script.avatarDescriptor == null)
        {
            return;
        }

        if (Event.current != null && Event.current.type == EventType.Layout)
        {
            HandleUtility.AddDefaultControl(0);
        }

        Handles.BeginGUI();

        GUIStyle windowStyle = new GUIStyle("Window");
        windowStyle.margin.left = 15;
        GUILayout.BeginVertical("Bhaptics VRC Editor", windowStyle, GUILayout.Width(300), GUILayout.MaxHeight(10), GUILayout.ExpandHeight(true));

        GUILayout.BeginHorizontal();
        GUIStyle topMarginStyle = new GUIStyle(GUI.skin.label);
        topMarginStyle.margin.top = 0;
        GUILayout.Label("Device Type", topMarginStyle, GUILayout.Width(80));

        GUILayout.BeginVertical();
        script.selectedDeviceType = (BhapticsDeviceType)EditorGUILayout.EnumPopup(string.Empty, script.selectedDeviceType, GUILayout.ExpandWidth(true), GUILayout.MinWidth(10));
        GUILayout.EndVertical();

        script.selectedDevice = script.deviceGameObjects[(int)script.selectedDeviceType] == null ? null : script.deviceGameObjects[(int)script.selectedDeviceType].transform;
        if (script.selectedDevice != null)
        {
            GUIStyle selectButtonStyle = new GUIStyle(GUI.skin.button);
            selectButtonStyle.margin.top = 0;
            if (GUILayout.Button("Select", selectButtonStyle, GUILayout.Width(50)))
            {
                Selection.activeGameObject = script.selectedDevice.gameObject;
            }
        }
        GUILayout.EndHorizontal();

        if (script.selectedDevice == null)
        {
            GUILayout.Space(10);
            script.symmetry = false;
            GUIStyle addButtonStyle = new GUIStyle(GUI.skin.button);
            addButtonStyle.richText = true;
            if (GUILayout.Button("<color=green>Add</color> " + script.selectedDeviceType + " Object", addButtonStyle, GUILayout.Height(30)))
            {
                script.AddDevicePrefab(script.selectedDeviceType.ToString());
                Debug.Log("BhapticsVRCEditor / <color=green>Add </color>" + script.selectedDeviceType.ToString() + " Object");
                return;
            }
        }
        else
        {
            GUILayout.Space(2);

			if (previousGameObject != script.selectedDevice)
			{
				previousGameObject = script.selectedDevice;
		
				Camera[] cams = script.selectedDevice.GetComponentsInChildren<Camera>(true);
				foreach (Camera cam in cams)
					if (cam.gameObject.name.ToLowerInvariant().Contains("dummy"))
					{
						IsVisualized = cam.gameObject.active;
						break;
					}
			}
			
            GUILayout.BeginHorizontal();
            GUILayout.Label("Visible Mode", GUILayout.Width(80));
            GUIStyle visualButtonStyle = new GUIStyle(GUI.skin.button);
            visualButtonStyle.margin.top = 1;
            if (GUILayout.Button(IsVisualized ? "Visualized" : "Hidden", visualButtonStyle, GUILayout.Width(100), GUILayout.Height(18)))
            {
				IsVisualized = !IsVisualized;
				
				MeshRenderer[] render = script.selectedDevice.GetComponentsInChildren<MeshRenderer>(true);
				foreach (MeshRenderer renderer in render)
					if (renderer.gameObject == script.selectedDevice.gameObject)
						renderer.enabled = IsVisualized;
					else
						renderer.gameObject.SetActive(IsVisualized);
					
				SkinnedMeshRenderer[] render2 = script.selectedDevice.GetComponentsInChildren<SkinnedMeshRenderer>(true);
				foreach (SkinnedMeshRenderer renderer in render2)
					if (renderer.gameObject == script.selectedDevice.gameObject)
						renderer.enabled = IsVisualized;
					else
						renderer.gameObject.SetActive(IsVisualized);
					
				Camera[] cams = script.selectedDevice.GetComponentsInChildren<Camera>(true);
				foreach (Camera cam in cams)
					if (cam.gameObject.name.ToLowerInvariant().Contains("dummy"))
						cam.gameObject.SetActive(IsVisualized);
					
                string visual = "<color=green>Visualized</color>";
                string hide = "<color=red>Hidden</color>";
				Debug.Log($"BhapticsVRCEditor / Change Visible Mode {(!IsVisualized ? visual : hide)} -> {(IsVisualized ? visual : hide)}");
                return;
            }
            GUILayout.EndHorizontal();

            var isLeft = script.selectedDevice.name.Contains("Left");
            var isRight = script.selectedDevice.name.Contains("Right");
            if (isLeft || isRight)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("Symmetry", GUILayout.Width(80));
                script.symmetry = EditorGUILayout.Toggle(script.symmetry);
                GUILayout.EndHorizontal();

                if (script.symmetry)
                {
                    if (isLeft)
                    {
                        script.symmetryDevice = script.FindDeviceObject(script.selectedDevice.name.Replace("Left", "Right"));
                    }
                    else if (isRight)
                    {
                        script.symmetryDevice = script.FindDeviceObject(script.selectedDevice.name.Replace("Right", "Left"));
                    }

                    if (script.symmetryDevice == null)
                    {
                        EditorGUILayout.HelpBox("Symmetry object is not found! Create one.", MessageType.Error);
                    }
                }
                else
                {
                    script.symmetryDevice = null;
                }
            }
            else
            {
                script.symmetryDevice = null;
            }

            GUILayout.BeginHorizontal();
            GUILayout.Label("Edit Mode", GUILayout.Width(80));

            GUILayout.BeginVertical();

            GUIStyle boldStyle = new GUIStyle(GUI.skin.label);
            boldStyle.fontStyle = FontStyle.Bold;

            GUIStyle tooltipStyle = new GUIStyle(GUI.skin.label);
            tooltipStyle.richText = true;
            tooltipStyle.padding.top = -3;

            if (Tools.current == Tool.Move)
            {
                GUILayout.Label("Position", boldStyle, GUILayout.Width(60));
                GUILayout.Label("<size=9>*shortcut = </size><b>[W]</b><size=9> E R</size>", tooltipStyle);
            }
            else if (Tools.current == Tool.Rotate)
            {
                GUILayout.Label("Rotation", boldStyle, GUILayout.Width(60));
                GUILayout.Label("<size=9>*shortcut = W </size><b>[E]</b><size=9> R</size>", tooltipStyle);
            }
            else if (Tools.current == Tool.Scale)
            {
                GUILayout.Label("Scale", boldStyle, GUILayout.Width(60));
                GUILayout.Label("<size=9>*shortcut = W E </size><b>[R]</b>", tooltipStyle);
            }
            else
            {
                GUILayout.Label("Etc");
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Position", GUILayout.Width(80));
            script.selectedDevice.localPosition = EditorGUILayout.Vector3Field("", script.RoundVector3(script.selectedDevice.localPosition), GUILayout.Width(200));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Rotation", GUILayout.Width(80));
            script.selectedDevice.localEulerAngles = EditorGUILayout.Vector3Field("", script.RoundVector3(script.selectedDevice.localEulerAngles), GUILayout.Width(200));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Scale", GUILayout.Width(80));
            script.selectedDevice.localScale = EditorGUILayout.Vector3Field("", script.RoundVector3(script.selectedDevice.localScale), GUILayout.Width(200));
            var cameras = script.selectedDevice.GetComponentsInChildren<Camera>(true);
            for (int i = 0; i < cameras.Length; ++i)
				FixCameraScaling(cameras[i]);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUIStyle deleteButtonStyle = new GUIStyle(GUI.skin.button);
            deleteButtonStyle.richText = true;
            if (GUILayout.Button("<color=red>Delete</color> " + script.selectedDeviceType + " Object [Del]", deleteButtonStyle, GUILayout.Height(30)))
            {
				Undo.DestroyObjectImmediate(script.selectedDevice.gameObject);
                Debug.Log("BhapticsVRCEditor / <color=red>Delete </color>" + script.selectedDeviceType.ToString() + " Object");
                return;
            }
        }
        GUILayout.Space(2);

        GUILayout.EndVertical();
        Handles.EndGUI();




        Color buttonColor = new Color(0.9f, 0.9f, 0.3f);
        Color defaultColor = new Color(0.6f, 0.6f, 0.6f);
        Handles.color = buttonColor;

        for (int i = 0; i < script.deviceGameObjects.Length; ++i)
        {
            if (script.deviceGameObjects[i] == null)
            {
                continue;
            }
            if (script.selectedDevice != null && script.selectedDevice == script.deviceGameObjects[i].transform)
            {
                continue;
            }
            var buttonSize = HandleUtility.GetHandleSize(script.deviceGameObjects[i].transform.position) / 10f;
            if (Handles.Button(script.deviceGameObjects[i].transform.position, Quaternion.idenreplacedy, buttonSize, buttonSize, Handles.DotHandleCap))
            {
                script.selectedDeviceType = (BhapticsDeviceType)i;
                return;
            }
        }
        Handles.color = defaultColor;

        if (script.selectedDevice != null)
        {
            try
            {
                if (Tools.current == Tool.Move)
                {
                    Handles.CubeHandleCap(0, script.selectedDevice.position, Quaternion.idenreplacedy, HandleUtility.GetHandleSize(script.selectedDevice.position) / 7f, EventType.Repaint);
                    script.selectedDevice.position = Handles.PositionHandle(script.selectedDevice.position, script.selectedDevice.rotation);
                }
                else if (Tools.current == Tool.Rotate)
                {
                    script.selectedDevice.rotation = Handles.RotationHandle(script.selectedDevice.rotation, script.selectedDevice.position);
                }
                else if (Tools.current == Tool.Scale)
                {
                    script.selectedDevice.localScale = Handles.ScaleHandle(script.selectedDevice.localScale, script.selectedDevice.position, script.selectedDevice.rotation,
                                                                           HandleUtility.GetHandleSize(script.selectedDevice.position));
                    var cameras = script.selectedDevice.GetComponentsInChildren<Camera>(true);
                    for (int i = 0; i < cameras.Length; ++i)
						FixCameraScaling(cameras[i]);
                }
            }
            catch (Exception e)
            {
            }

            if (script.symmetry && script.symmetryDevice != null)
            {
                script.symmetryDevice.position = Vector3.Reflect(script.selectedDevice.position - script.transform.position, script.transform.right);
                script.symmetryDevice.eulerAngles = Vector3.Reflect(script.selectedDevice.eulerAngles, script.transform.up);
                script.symmetryDevice.localScale = script.selectedDevice.localScale;
                var symmetryCameras = script.symmetryDevice.GetComponentsInChildren<Camera>(true);
                for (int i = 0; i < symmetryCameras.Length; ++i)
					FixCameraScaling(symmetryCameras[i]);
                Undo.RecordObjects(new Transform[] { script.selectedDevice, script.symmetryDevice }, "Change TargetObject and SymmetryTargetObject");
            }
            else
            {
                Undo.RecordObject(script.selectedDevice, "Change TargetObject");
            }

            if (Event.current != null && Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Delete)
            {
                script.DestroyDevicePrefab(script.selectedDeviceType.ToString());
                Debug.Log("BhapticsVRCEditor / <color=red>Delete </color>" + script.selectedDeviceType.ToString() + " Object");
                Event.current.Use();
                return;
            }
        }
    }

19 View Source File : PanelCanvasEditor.cs
License : MIT License
Project Creator : Hertzole

public override void OnInspectorGUI()
        {
            if (ancreplaceddPanelGUIStyle == null)
            {
                ancreplaceddPanelGUIStyle = new GUIStyle("box")
                {
                    alignment = TextAnchor.MiddleCenter,
                    clipping = TextClipping.Clip
                };
            }

            if (justClickedAncreplaceddPanel != null && Event.current.type == EventType.Layout)
            {
                selectedAncreplaceddPanel = justClickedAncreplaceddPanel;
                selectedAncreplaceddPanelTabs = selectedAncreplaceddPanel.panel.tabs;

                justClickedAncreplaceddPanel = null;
            }

            serializedObject.Update();
            reorderableListIndex = 0;

            bool multiObjectEditing = targets.Length > 1;
            bool guiEnabled = !EditorApplication.isPlaying || replacedetDatabase.Contains(((PanelCanvas)serializedObject.targetObject).gameObject);

            GUI.enabled = guiEnabled;
            GUILayout.BeginVertical();

            EditorGUILayout.LabelField("= Properties =", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(panelPrefab);
            EditorGUILayout.PropertyField(leaveFreeSpace);
            EditorGUI.indentLevel++;
            GUI.enabled = guiEnabled && leaveFreeSpace.boolValue;
            EditorGUILayout.PropertyField(minimumFreeSpace);
            GUI.enabled = guiEnabled;
            EditorGUI.indentLevel--;
            EditorGUILayout.PropertyField(preventDetachingLastDockedPanel);
            EditorGUILayout.PropertyField(panelResizableAreaLength);
            EditorGUILayout.PropertyField(canvasAnchorZoneLength);
            EditorGUILayout.PropertyField(panelAnchorZoneLength);

            GUILayout.Space(10f);

            EditorGUILayout.LabelField("= Free Panels =", EditorStyles.boldLabel);
            if (multiObjectEditing)
            {
                GUILayout.Label("Multi-object editing not supported");
            }
            else if (!guiEnabled)
            {
                GUILayout.Label("Can't edit in Play mode");
            }
            else
            {
                List<PanelCanvas.PanelProperties> initialPanelsUnancreplacedd = settings.InitialPanelsUnancreplacedd;
                int selectedReorderableListIndex = -1;
                for (int i = 0; i < initialPanelsUnancreplacedd.Count; i++)
                {
                    if (DrawReorderableListFor(initialPanelsUnancreplacedd[i]))
                    {
                        selectedReorderableListIndex = i;
                    }

                    if (i < initialPanelsUnancreplacedd.Count - 1)
                    {
                        // Draw a horizontal line to separate the panels
                        GUILayout.Space(5f);
                        GUILayout.Box(GUIContent.none, GUILayout.ExpandWidth(true), GUILayout.Height(2f));
                    }

                    GUILayout.Space(5f);
                }

                GUILayout.BeginHorizontal();

                if (GUILayout.Button("Add New", GUILayout.Height(1.35f * EditorGUIUtility.singleLineHeight)))
                {
                    Undo.IncrementCurrentGroup();
                    Undo.RecordObject((PanelCanvas)target, "Add Free Panel");

                    initialPanelsUnancreplacedd.Add(new PanelCanvas.PanelProperties());
                }

                if (selectedReorderableListIndex < 0)
                {
                    GUI.enabled = false;
                }

                if (GUILayout.Button("Remove Selected", GUILayout.Height(1.35f * EditorGUIUtility.singleLineHeight)))
                {
                    Undo.IncrementCurrentGroup();
                    Undo.RecordObject((PanelCanvas)target, "Remove Free Panel");

                    initialPanelsUnancreplacedd.RemoveAt(selectedReorderableListIndex);
                }

                GUI.enabled = guiEnabled;

                GUILayout.EndHorizontal();
            }

            GUILayout.Space(13f);

            EditorGUILayout.LabelField("= Docked Panels =", EditorStyles.boldLabel);
            if (multiObjectEditing)
            {
                GUILayout.Label("Multi-object editing not supported");
            }
            else if (!guiEnabled)
            {
                GUILayout.Label("Can't edit in Play mode");
            }
            else
            {
                PanelCanvas.AncreplaceddPanelProperties initialPanelsAncreplacedd = settings.InitialPanelsAncreplacedd;

                Rect previewRect = EditorGUILayout.GetControlRect(false, ANCreplacedD_PANELS_PREVIEW_HEIGHT);
                DrawAncreplaceddPanelsPreview(previewRect, initialPanelsAncreplacedd);

                if (selectedAncreplaceddPanel != null)
                {
                    GUILayout.BeginVertical(EditorStyles.helpBox);
                    GUILayout.Space(5f);
                    EditorGUILayout.LabelField("Selected panel:", EditorStyles.boldLabel);

                    if (selectedAncreplaceddPanelTabs != settings.InitialPanelsAncreplacedd.panel.tabs)
                    {
                        string initialSizeLabel = selectedAncreplaceddPanel.initialSize == Vector2.zero ? "Initial Size (not set):" : "Initial Size:";

                        EditorGUI.BeginChangeCheck();
                        Vector2 panelInitialSize = EditorGUILayout.Vector2Field(initialSizeLabel, selectedAncreplaceddPanel.initialSize);
                        if (EditorGUI.EndChangeCheck())
                        {
                            Undo.RecordObject((PanelCanvas)target, "Change Initial Size");
                            selectedAncreplaceddPanel.initialSize = panelInitialSize;
                        }

                        DrawReorderableListFor(selectedAncreplaceddPanel.panel);
                    }
                    else
                    {
                        GUILayout.Label("- nothing -");
                    }

                    PanelDirection direction = ShowDirectionButtons("Dock new panel inside: ");
                    if (direction != PanelDirection.None)
                    {
                        Undo.IncrementCurrentGroup();
                        Undo.RecordObject((PanelCanvas)target, "Dock New Panel");

                        selectedAncreplaceddPanel.subPanels.Add(new PanelCanvas.AncreplaceddPanelProperties() { anchorDirection = direction });
                    }

                    if (selectedAncreplaceddPanelTabs != settings.InitialPanelsAncreplacedd.panel.tabs)
                    {
                        GUILayout.Space(5f);
                        if (GUILayout.Button("Remove Selected", GUILayout.Height(1.35f * EditorGUIUtility.singleLineHeight)))
                        {
                            RemoveAncreplaceddPanel(settings.InitialPanelsAncreplacedd, selectedAncreplaceddPanel);
                        }
                    }

                    GUILayout.EndVertical();
                }

                GUILayout.Space(6f);

                PanelDirection rootDirection = ShowDirectionButtons("Dock new panel to canvas: ");
                if (rootDirection != PanelDirection.None)
                {
                    Undo.IncrementCurrentGroup();
                    Undo.RecordObject((PanelCanvas)target, "Dock New Panel");

                    settings.InitialPanelsAncreplacedd.subPanels.Insert(0, new PanelCanvas.AncreplaceddPanelProperties() { anchorDirection = rootDirection });
                }
            }

            GUI.enabled = true;
            GUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }

19 View Source File : BhapticsVRCEditorInspector.cs
License : Apache License 2.0
Project Creator : HerpDerpinstine

public override void OnInspectorGUI()
    {
		if (script == null)
            return;
	
        if (script.anim == null)
        {
            EditorGUILayout.HelpBox("BhapticsVRCEditor / Required Animator component & avatar.", MessageType.Error);
            return;
        }

        if (script.anim.avatar == null)
        {
            EditorGUILayout.HelpBox("BhapticsVRCEditor / Required Animator component & avatar.", MessageType.Error);
            return;
        }

        if (script.avatarDescriptor == null)
        {
            EditorGUILayout.HelpBox("BhapticsVRCEditor / Required VRC AvatarDescriptor component.", MessageType.Error);
            return;
        }

        GUILayout.Space(10);

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUIStyle deviceIconStyle = new GUIStyle(GUI.skin.label);
        deviceIconStyle.margin = new RectOffset(20, 20, 12, 5);

        GUIStyle deviceOnIconStyle = new GUIStyle(GUI.skin.label);
        deviceOnIconStyle.margin = new RectOffset(20, 20, 12, 5);

        for (int i = 0; i < script.deviceIcons.Length; ++i)
        {
            if (script.deviceIcons[i] != null)
            {
                var deviceTypeIndex = script.ConvertIconIndexToDeviceTypeIndex(i);
                if (deviceTypeIndex == -1)
                {
                    continue;
                }
                if (script.deviceGameObjects[deviceTypeIndex] == null)
                {
                    if (GUILayout.Button(new GUIContent(script.deviceIcons[i], "CLICK: Add object"), deviceIconStyle, GUILayout.Width(50), GUILayout.Height(50)))
                    {
                        script.selectedDeviceType = (BhapticsDeviceType)deviceTypeIndex;
                        script.AddDevicePrefab(script.selectedDeviceType.ToString());
                        Debug.Log("BhapticsVRCEditor / <color=green>Add </color>" + script.selectedDeviceType.ToString() + " Object");
                    }
                }
                else
                {
                    if (GUILayout.Button(script.deviceOnIcons[i], deviceOnIconStyle, GUILayout.Width(50), GUILayout.Height(50)))
                    {
                        script.selectedDeviceType = (BhapticsDeviceType)deviceTypeIndex;
                        OnSceneGUI();
                    }
                }
                if (Screen.width < 580 && i == script.deviceIcons.Length / 2 - 1)
                {
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                }
            }
        }
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        if (GUILayout.Button("Finish Editor", GUILayout.Height(30)))
        {
            Undo.DestroyObjectImmediate(script);
        }

        EditorGUILayout.HelpBox("If you finished setup, press [Finish Editor] button.", MessageType.Info);
        GUILayout.Space(2);

        if (Event.current != null && Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Delete)
        {
            script.DestroyDevicePrefab(script.selectedDeviceType.ToString());
            Debug.Log("BhapticsVRCEditor / <color=red>Delete </color>" + script.selectedDeviceType.ToString() + " Object");
            Event.current.Use();
            return;
        }
    }

19 View Source File : GoldPlayerProjectSettingsProvider.cs
License : MIT License
Project Creator : Hertzole

protected override void CloseScope()
            {
                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
                GUILayout.EndVertical();
                EditorGUIUtility.labelWidth = labelWidth;
            }

19 View Source File : PanelCanvasEditor.cs
License : MIT License
Project Creator : Hertzole

private PanelDirection ShowDirectionButtons(string label)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(label);

            PanelDirection result = PanelDirection.None;
            if (GUILayout.Button("Left"))
            {
                result = PanelDirection.Left;
            }

            if (GUILayout.Button("Top"))
            {
                result = PanelDirection.Top;
            }

            if (GUILayout.Button("Right"))
            {
                result = PanelDirection.Right;
            }

            if (GUILayout.Button("Bottom"))
            {
                result = PanelDirection.Bottom;
            }

            GUILayout.EndHorizontal();

            return result;
        }

19 View Source File : LevelEditorResourceViewEditor.cs
License : MIT License
Project Creator : Hertzole

public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(resources);
            
            EditorGUILayout.PropertyField(folderTree);
            EditorGUILayout.PropertyField(showRoot);
            EditorGUILayout.PropertyField(rootName);
            EditorGUILayout.PropertyField(replacedetsContent);
            EditorGUILayout.PropertyField(replacedetButtonPrefab);
            EditorGUILayout.PropertyField(displayFirstSpriteAsIcon);
            EditorGUILayout.PropertyField(iconHandling);
            EditorGUILayout.PropertyField(generateAsync);
            EditorGUILayout.PropertyField(asyncWaitMethod);

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(isOrthographic);
            EditorGUILayout.PropertyField(backgroundColor);
            padding.floatValue = EditorGUILayout.Slider(padding.displayName, padding.floatValue, -0.25f, 0.25f);

            EditorGUILayout.PropertyField(previewDirection);
            EditorGUILayout.PropertyField(imageSize);

            if (EditorGUI.EndChangeCheck())
            {
                generatePreview = true;
            }

            EditorGUIHelper.DrawFancyFoldout(isOrthographic, "Preview", false, () =>
            {
                if (generatePreview)
                {
                    if (previewTexture != null)
                    {
                        DestroyImmediate(previewTexture);
                    }

                    RuntimePreviewGenerator.OrthographicMode = isOrthographic.boolValue;
                    RuntimePreviewGenerator.Padding = padding.floatValue;
                    RuntimePreviewGenerator.BackgroundColor = backgroundColor.colorValue;
                    RuntimePreviewGenerator.PreviewDirection = previewDirection.vector3Value;

                    GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube);
                    previewTexture = RuntimePreviewGenerator.GenerateModelPreview(go.transform, imageSize.vector2IntValue.x, imageSize.vector2IntValue.y, true);
                    DestroyImmediate(go);

                    generatePreview = false;
                }

                Color oColor = GUI.backgroundColor;
                GUI.backgroundColor = Color.clear;
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();


                GUILayout.Box(previewTexture, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth));

                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                GUI.backgroundColor = oColor;

            });

            serializedObject.ApplyModifiedProperties();
        }

19 View Source File : OSCPanelControllers.cs
License : MIT License
Project Creator : hizzlehoff

protected override void DrawContent(ref Rect contentRect)
	    {
		    _defaultColor = GUI.color;

		    using (new GUILayout.HorizontalScope(EditorStyles.toolbar))
		    {
			    GUILayout.FlexibleSpace();
		    }

		    using (var scroll = new GUILayout.ScrollViewScope(_scrollPosition))
		    {
				EditorGUILayout.HelpBox("For component activation in Edit Mode you need to choose appropriate GameObject and have \"Work In Editor\" turned on.",
				    MessageType.Info);

			    var expand = contentRect.width > 350;
			    if (expand)
				    GUILayout.BeginHorizontal();

			    using (new GUILayout.VerticalScope())
			    {
				    GUILayout.Label(_transmittersContent, OSCEditorStyles.ConsoleBoldLabel);

				    if (_transmitters.Length > 0)
				    {
						for (var i = 0; i < _transmitters.Length; ++i)
					    {
						    DrawElement(_transmitters[i]);
					    }
				    }
				    else
				    {
					    EditorGUILayout.HelpBox("Scene doesn't have OSCTransmitter.", MessageType.Info);
				    }
			    }

			    using (new GUILayout.VerticalScope())
			    {
				    GUILayout.Label(_receiversContent, OSCEditorStyles.ConsoleBoldLabel);

				    if (_receivers.Length > 0)
				    {
					    for (var i = 0; i < _receivers.Length; ++i)
					    {
						    DrawElement(_receivers[i]);
					    }
				    }
				    else
				    {
					    EditorGUILayout.HelpBox("Scene doesn't have OSCReceiver.", MessageType.Info);
				    }
			    }

			    if (expand)
				    GUILayout.EndHorizontal();

			    _scrollPosition = scroll.scrollPosition;
		    }
	    }

19 View Source File : OSCMultiplySlidersEditor.cs
License : MIT License
Project Creator : hizzlehoff

public override void OnInspectorGUI()
        {
            serializedObject.Update();

            OSCEditorInterface.LogoLayout();

            GUILayout.Label(string.Format("Sliders: {0}", _slidersProperty.arraySize), EditorStyles.boldLabel);
            GUILayout.BeginVertical(OSCEditorStyles.Box);

            GUILayout.Label("Settings:", EditorStyles.boldLabel);
            GUILayout.BeginVertical(OSCEditorStyles.Box);
            base.OnInspectorGUI();
            GUILayout.EndVertical();

            GUILayout.Label("Multiply Sliders Settings:", EditorStyles.boldLabel);
            GUILayout.BeginVertical(OSCEditorStyles.Box);
            EditorGUILayout.PropertyField(_layoutGroupProperty);

            if (_layoutGroupProperty.objectReferenceValue != null)
            {
                GUILayout.EndVertical();

                GUILayout.Label("Sliders Settings:", EditorStyles.boldLabel);
                GUILayout.BeginVertical(OSCEditorStyles.Box);
                EditorGUILayout.PropertyField(_defaultColorProperty);
                EditorGUILayout.PropertyField(_addressProperty);
                //OSCEditorLayout.TransmittersPopup(_transmitterProperty, new GUIContent("Transmitter"));
	            EditorGUILayout.PropertyField(_transmitterProperty, new GUIContent("Transmitter"));
				GUILayout.EndVertical();

                GUILayout.BeginHorizontal(OSCEditorStyles.Box);
                GUILayout.BeginVertical(OSCEditorStyles.Box);
                GUI.color = Color.red;
                var removeButton = GUILayout.Button("-", GUILayout.Width(20), GUILayout.Height(20));
                GUI.color = Color.white;
                GUILayout.EndVertical();
                GUILayout.BeginVertical(OSCEditorStyles.Box);
                EditorGUILayout.LabelField(_slidersProperty.arraySize.ToString(), OSCEditorStyles.CenterLabel, GUILayout.Height(20));
                GUILayout.EndVertical();
                GUILayout.BeginVertical(OSCEditorStyles.Box);
                GUI.color = Color.green;
                var createButton = GUILayout.Button("+", GUILayout.Width(20), GUILayout.Height(20));
                GUI.color = Color.white;
                GUILayout.EndVertical();
                GUILayout.EndHorizontal();

                GUILayout.Label("Value Settings:", EditorStyles.boldLabel);
                GUILayout.BeginVertical(OSCEditorStyles.Box);
                EditorGUILayout.PropertyField(_minValueProperty);
                EditorGUILayout.PropertyField(_maxValueProperty);
                EditorGUILayout.PropertyField(_wholeNumbersProperty);
                GUILayout.EndVertical();

                GUILayout.EndVertical();

                if (createButton) AddSlider();
                if (removeButton) RemoveSlider();
            }
            else
            {
                EditorGUILayout.HelpBox("You need to set \"HorizontalOrVerticalLayoutGroup Group\" for correct work of the component.", MessageType.Warning);
                GUILayout.EndVertical();
            }

            serializedObject.ApplyModifiedProperties();
        }

19 View Source File : FaceCapLiveModeReceiverEditor.cs
License : MIT License
Project Creator : hizzlehoff

public override void OnInspectorGUI()
    {
        script._OSCReceiverPort = EditorGUILayout.IntField("OSC Port", script._OSCReceiverPort);

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        GameObject blendshapeMesh = script.blendshapeMesh;

        blendshapeMesh = EditorGUILayout.ObjectField("Blendshape Mesh", blendshapeMesh, typeof(GameObject), true) as GameObject;

        if (blendshapeMesh != script.blendshapeMesh)
        {
            script.blendshapeMesh = blendshapeMesh;
            EditorUtility.SetDirty(script);
        }

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        bool usePositionData = script.usePositionData;
        bool useRotationData = script.useRotationData;

        usePositionData = EditorGUILayout.Toggle("Use Position Data", usePositionData);
        useRotationData = EditorGUILayout.Toggle("Use Rotation Data", useRotationData);

        if (usePositionData != script.usePositionData || useRotationData != script.useRotationData)
        {
            script.usePositionData = usePositionData;
            script.useRotationData = useRotationData;
            EditorUtility.SetDirty(script);
        }

        if (usePositionData || useRotationData)
        {
            EditorGUILayout.Space();

            Transform headTransform = script.headTransform;

            headTransform = EditorGUILayout.ObjectField("Head Transform", headTransform, typeof(Transform), true) as Transform;
            if (headTransform != script.headTransform)
            {
                script.headTransform = headTransform;
                EditorUtility.SetDirty(script);
            }

            bool neckTransformEnabled = script.neckTransformEnabled;
            neckTransformEnabled = EditorGUILayout.Toggle("Neck", neckTransformEnabled);
            if (neckTransformEnabled != script.neckTransformEnabled)
            {
                script.neckTransformEnabled = neckTransformEnabled;
                EditorUtility.SetDirty(script);
            }

            if (neckTransformEnabled)
            {
                Transform neckTransform = script.neckTransform;
                float neckTransformBlendFactor = script.neckTransformBlendFactor;

                neckTransform = EditorGUILayout.ObjectField("Neck Transform", neckTransform, typeof(Transform), true) as Transform;
                neckTransformBlendFactor = EditorGUILayout.FloatField("Neck Blend", neckTransformBlendFactor);

                if (neckTransform != script.neckTransform || neckTransformBlendFactor != script.neckTransformBlendFactor)
                {
                    script.neckTransform = neckTransform;
                    script.neckTransformBlendFactor = neckTransformBlendFactor;
                    EditorUtility.SetDirty(script);
                }
            }

            bool spineTransformEnabled = script.spineTransformEnabled;
            spineTransformEnabled = EditorGUILayout.Toggle("Spine", spineTransformEnabled);
            if (spineTransformEnabled != script.spineTransformEnabled)
            {
                script.spineTransformEnabled = spineTransformEnabled;
                EditorUtility.SetDirty(script);
            }

            if (spineTransformEnabled)
            {
                Transform spineTransform = script.spineTransform;
                float spineTransformBlendFactor = script.spineTransformBlendFactor;

                spineTransform = EditorGUILayout.ObjectField("Spine Transform", spineTransform, typeof(Transform), true) as Transform;
                spineTransformBlendFactor = EditorGUILayout.FloatField("Spine Blend", spineTransformBlendFactor);

                if (spineTransform != script.spineTransform || spineTransformBlendFactor != script.spineTransformBlendFactor)
                {
                    script.spineTransform = spineTransform;
                    script.spineTransformBlendFactor = spineTransformBlendFactor;
                    EditorUtility.SetDirty(script);
                }
            }
        }

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        bool useEyeDirectionData = script.useEyeDirectionData;
        useEyeDirectionData = EditorGUILayout.Toggle("Use Eye Direction Data", useEyeDirectionData);
        if (useEyeDirectionData != script.useEyeDirectionData)
        {
            script.useEyeDirectionData = useEyeDirectionData;
            EditorUtility.SetDirty(script);
        }

        if (useEyeDirectionData)
        {
            EditorGUILayout.Space();

            Transform leftEyeTransform = script.leftEyeTransform;
            Transform rightEyeTransform = script.rightEyeTransform;

            leftEyeTransform = EditorGUILayout.ObjectField("Left Eye Transform", leftEyeTransform, typeof(Transform), true) as Transform;
            rightEyeTransform = EditorGUILayout.ObjectField("Right Eye Transform", rightEyeTransform, typeof(Transform), true) as Transform;

            if (leftEyeTransform != script.leftEyeTransform || rightEyeTransform != script.rightEyeTransform)
            {
                script.leftEyeTransform = leftEyeTransform;
                script.rightEyeTransform = rightEyeTransform;
                EditorUtility.SetDirty(script);
            }
        }

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        EditorGUILayout.LabelField("Blendshape configuration:");

        if (blendshapeMesh != null)
        {
            SkinnedMeshRenderer smr = blendshapeMesh.GetComponent<SkinnedMeshRenderer>();
            if (!smr)
            {
                GUILayout.BeginHorizontal(EditorStyles.helpBox);
                EditorGUILayout.LabelField("Warning: replacedigned blendshape mesh has no skinned mesh renderer.");
                GUILayout.EndHorizontal();
                return;
            }

            if (smr.sharedMesh.blendShapeCount == 0)
            {
                GUILayout.BeginHorizontal(EditorStyles.helpBox);
                EditorGUILayout.LabelField("Warning: replacedigned blendshape mesh has no blendshapes.");
                GUILayout.EndHorizontal();
                return;
            }

            int[] blendShapeIndexes = script.blendShapeIndexes;

            if (blendShapeIndexes == null)
            {
                blendShapeIndexes = InitializeBlendshapes(smr);
                blendShapeIndexes = AutoConfigureBlendshapes(smr);

                if (blendShapeIndexes != script.blendShapeIndexes)
                {
                    script.blendShapeIndexes = blendShapeIndexes;
                    EditorUtility.SetDirty(script);
                }
            }

            for (int i = 0; i < blendShapeIndexes.Length; i++)
            {
                GUILayout.BeginHorizontal(EditorStyles.label);
                string blendShapeName = smr.sharedMesh.GetBlendShapeName(i);
                blendShapeIndexes[i] = EditorGUILayout.Popup(blendShapeName, blendShapeIndexes[i], faceCapBlendshapeNames);

                if (blendShapeIndexes[i] != script.blendShapeIndexes[i])
                {
                    script.blendShapeIndexes[i] = blendShapeIndexes[i];
                    EditorUtility.SetDirty(script);
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.BeginHorizontal(EditorStyles.helpBox);
            if (GUILayout.Button("Initialize"))
            {
                blendShapeIndexes = InitializeBlendshapes(smr);
                if (blendShapeIndexes != script.blendShapeIndexes)
                {
                    script.blendShapeIndexes = blendShapeIndexes;
                    EditorUtility.SetDirty(script);
                }
            }
            if (GUILayout.Button("Automatic"))
            {
                blendShapeIndexes = AutoConfigureBlendshapes(smr);
                if (blendShapeIndexes != script.blendShapeIndexes)
                {
                    script.blendShapeIndexes = blendShapeIndexes;
                    EditorUtility.SetDirty(script);
                }
            }
            GUILayout.EndHorizontal();
        }
        else
        {
            GUILayout.BeginHorizontal(EditorStyles.helpBox);
            EditorGUILayout.LabelField("Warning: Blendshape mesh not replacedigned.");
            GUILayout.EndHorizontal();
            return;
        }

        EditorGUILayout.Space();
    }

19 View Source File : OSCPanelPacket.cs
License : MIT License
Project Creator : hizzlehoff

protected override void DrawContent(ref Rect contentRect)
        {
            if (_selectedMessage == null)
            {
                GUILayout.BeginHorizontal(EditorStyles.toolbar);
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();

                EditorGUILayout.LabelField(_packetNotSelectedContent, OSCEditorStyles.CenterLabel, GUILayout.Height(contentRect.height));

                return;
            }

            if (_selectedMessage != null)
            {
                GUILayout.BeginHorizontal(EditorStyles.toolbar);

                GUILayout.FlexibleSpace();

                var debugButton = GUILayout.Button(_openInDebugContent, EditorStyles.toolbarButton);
                if (debugButton)
                {
                    OSCWindowDebug.OpenPacket(SelecedMessage.Packet);
                }

                GUILayout.EndHorizontal();

                _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
                _packetDrawer.DrawLayout(_selectedMessage.Packet);

                EditorGUILayout.EndScrollView();
            }
        }

19 View Source File : BonesControlEditor.cs
License : MIT License
Project Creator : huailiang

public override void OnInspectorGUI()
    {
        BonesControl target = (BonesControl)serializedObject.targetObject;
        serializedObject.Update();
        EditorGUILayout.Space();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Init"))
        {
            target.InitDefautData(true);
            MakeSceneDirty();
        }
        if (GUILayout.Button("Reset"))
        {
            target.ResetData();
            MakeSceneDirty();
        }
        GUILayout.EndHorizontal();

        EditorGUILayout.Space();
        for (int i = 0; i < (int)KneadType.MAX; i++)
        {
            if (i != (int)KneadType.Rotation)
            {
                DrawBoneControl(target, (KneadType)i);
            }
            else
            {
                DrawBoneControlRot(target, (KneadType)i);
            }
        }
        serializedObject.ApplyModifiedProperties();
    }

19 View Source File : LODAsset.cs
License : MIT License
Project Creator : huailiang

public LodUtil.Direct GUI(LodUtil.Direct direct)
        {
            if (meshes != null && go != null)
            {
                scroll = GUILayout.BeginScrollView(scroll);
                GUILayout.BeginVertical();
                GUILayout.BeginHorizontal();
                GUILayout.Label(go.name, LODGUI.totalStyle);
                direct = (LodUtil.Direct)EditorGUILayout.EnumPopup(direct, GUILayout.MaxWidth(80));
                if (GUILayout.Button("Visualize Bounds", GUILayout.MaxWidth(110)))
                {
                    LodUtil.AttachCollider(go);
                }
                GUILayout.EndHorizontal();
                GUILayout.Label("total verts: " + vertCnt + " tris: " + triCnt, LODGUI.totalStyle);

                GUILayout.BeginHorizontal();

                GUILayout.BeginVertical();
                int i = 0;
                foreach (var mesh in meshes)
                {
                    GUILayout.BeginHorizontal();
                    GUIMesh(mesh);
                    GUILayout.BeginVertical();
                    GUILayout.Space(24);
                    GUILayout.Label(mesh.name);
                    GUILayout.Label("verts: " + mesh.vertexCount);
                    GUILayout.Label("tris:  " + mesh.triangles.Length / 3);
                    GUILayout.Label("bounds: " + mesh.bounds);

                    GUILayout.BeginHorizontal();
                    var render = renders[i++];
                    var desc = "render bones: " + render.bones.Length + " matrix:" + mesh.bindposes.Length + " weights:" + mesh.boneWeights.Length;
                    if (GUILayout.Button(desc, UnityEngine.GUI.skin.label) || string.IsNullOrEmpty(boneInfo)) BoneInfo(render);
                    GUILayout.EndHorizontal();

                    desc = "skin ";
                    if (has(mesh.uv)) desc += "uv ";
                    if (has(mesh.uv2)) desc += "uv2 ";
                    if (has(mesh.uv3)) desc += "uv3 ";
                    if (has(mesh.uv4)) desc += "uv4 ";
                    if (has(mesh.normals)) desc += "normal ";
                    if (has(mesh.tangents)) desc += "tangent ";
                    if (has(mesh.colors)) desc += "color ";
                    if (mesh.subMeshCount > 1) desc += "submesh ";
                    GUILayout.Label(desc);
                    GUILayout.EndVertical();
                    GUILayout.EndHorizontal();
                }

                GUILayout.EndHorizontal();
                GUILayout.Space(10);
                GUILayout.Label(boneInfo);
                GUILayout.EndHorizontal();

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            }
            else
            {
                GUILayout.Label("no gameobject attached");
            }
            return direct;
        }

19 View Source File : LodDataEditor.cs
License : MIT License
Project Creator : huailiang

public override void OnInspectorGUI()
        {
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label(icon, LODGUI.Styles.LODRendererButton, GUILayout.MaxWidth(32), GUILayout.MaxHeight(32));
            GUILayout.Label("Lod Data", LODGUI.replacedleLableStyle);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            LodNode action = null;
            search = GuiSearch(search);
            if (Data.nodes != null)
            {
                for (int i = 0; i < Data.nodes.Length; i++)
                {
                    var node = Data.nodes[i];
                    if (node.Match(search))
                    {
                        var op = node.GUI();
                        if (op == LodOP.DELETE)
                        {
                            Data.nodes = LodUtil.Remv<LodNode>(Data.nodes, i);
                            break;
                        }
                        else if (op == LodOP.DETAIL)
                        {
                            action = node;
                        }
                    }
                }
            }
            GuiButtons();
            GUILayout.EndVertical();
            if (action != null) OpenLodWin(action);
        }

19 View Source File : LodDataEditor.cs
License : MIT License
Project Creator : huailiang

private void GuiButtons()
        {
            GUILayout.Space(8);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add"))
            {
                LodUtil.Add<LodNode>(ref odData.nodes, new LodNode("role"));
            }
            if (GUILayout.Button("Save"))
            {
                odData.Save();
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : LodWindow.cs
License : MIT License
Project Creator : huailiang

private void OnGUI()
        {
            var initiallyEnabled = GUI.enabled;
            if (SelectedLOD >= m_NumberOfLODs)
            {
                SelectedLOD = m_NumberOfLODs - 1;
            }
            GUILayout.BeginVertical();
            GUILayout.Space(10);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Select Role: ");

            role_pop = EditorGUILayout.Popup(role_pop, roles);
            GUILayout.Space(8);
            if (GUILayout.Button("load"))
            {
                LoadRole(lodNode);
                UpdateInfo();
            }
            if (GUILayout.Button("save"))
            {
                float[] levels = m_LODs.Where(x => x.screenPercentage > 0 && x.screenPercentage < 1).Select(x => x.screenPercentage).ToArray();
                string prefab = lodNode.prefab;
                config.AddorUpdate(prefab, levels);
                config.Save();
                LodExport.Export(m_LODs.ToArray(), lodNode);

                LodUtil.ReLoad(m_LODs, lodNode);
                return;
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(18);

            var sliderBarPosition = GUILayoutUtility.GetRect(0, LODGUI.kSliderBarHeight, GUILayout.ExpandWidth(true));
            var lods = LODGUI.CreateLODInfos(m_NumberOfLODs, sliderBarPosition,
                  i => string.Format("LOD {0}", i),
                  i => m_LODs[i].screenPercentage);

            DrawLODLevelSlider(sliderBarPosition, lods);
            GUILayout.Space(LODGUI.kSliderBarBottomMargin);

            if (QualitySettings.lodBias != 1.0f)
                EditorGUILayout.HelpBox(string.Format("Active LOD bias is {0:0.0#}. Distances are adjusted accordingly.", QualitySettings.lodBias), MessageType.Warning);

            GUILayout.Space(8);
            GUILayout.Label(SelectedLOD < 0 ? "Culled" : "LOD " + SelectedLOD, LODGUI.selectStyle);
            GUILayout.Space(8);
            if (SelectedLOD >= 0)
            {
                var direct = m_LODs[SelectedLOD].GUI(m_direct);
                if (m_direct != direct)
                {
                    m_direct = direct;
                    UpdateBehavic();
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : LightCamera.cs
License : MIT License
Project Creator : huailiang

private void OnGUI()
    {
        light = (Light)EditorGUILayout.ObjectField("light", light, typeof(Light), true);
        resolution = EditorGUILayout.IntField("resolution", resolution);
        player = (GameObject)EditorGUILayout.ObjectField("player", player, typeof(GameObject), true);
        if (light && player && lightCamera)
        {
            lightCamera.transform.rotation = light.transform.rotation;
            lightCamera.transform.position = player.transform.position - 2 * light.transform.forward;
        }

        strength = EditorGUILayout.Slider("light strength", strength, 0, 1);
        bias = EditorGUILayout.Slider("Shadow Bias", bias, 0.001f, 0.01f);
        Shader.SetGlobalFloat("_gShadowStrength", strength);
        Shader.SetGlobalFloat("_gShadowBias", bias);
        EditorGUILayout.ObjectField("caster", shadowCaster, typeof(Shader), false);
        EditorGUILayout.ObjectField("lightmap", rt_2d, typeof(RenderTexture), true);
        if (lightCamera && lightCamera.enabled) lightCamera.enabled = false;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Generate RT")) Create2DTextureFor();
        if (GUILayout.Button("Select Camera")) Selection.activeObject = lightCamera.gameObject;
        GUILayout.EndHorizontal();
    }

19 View Source File : SeqenceWindow_Header.cs
License : MIT License
Project Creator : huailiang

void SeqenceHeaderGUI()
        {
            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal(GUILayout.Width(WindowConstants.sliderWidth));
            AddButtonGUI();
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }

19 View Source File : SeqenceWindow_Toolbar.cs
License : MIT License
Project Creator : huailiang

void TransportToolbarGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.BeginHorizontal(GUILayout.Width(WindowConstants.playmodeWidth));
            {
                PlayModeGUI();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal(GUILayout.Width(WindowConstants.sliderWidth));
            {
                GotoBeginingSequenceGUI();
                PreviousEventButtonGUI();
                PlayButtonGUI();
                NextEventButtonGUI();
                GotoEndSequenceGUI();
                GUILayout.FlexibleSpace();
                TimeCodeGUI();
            }
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(state.Name);
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal(GUILayout.Width(WindowConstants.sliderWidth));
            {
                NewButtonGUI();
                OpenButtonGUI();
                SaveButtonGUI();
                GUILayout.Space(4);
                InspectGUI();
            }
            GUILayout.EndHorizontal();
            GUILayout.EndHorizontal();
        }

19 View Source File : AssetConfig.cs
License : MIT License
Project Creator : huailiang

private void GuiButtons()
        {
            GUILayout.Space(8);

            GUILayout.BeginVertical();
            if (conf.marks != null)
            {
                foreach (var mark in conf.marks)
                {
                    mark.OnGUI();
                }
            }
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("AddMark"))
            {
                AddMark();
            }
            if (GUILayout.Button("Save"))
            {
                OnSave();
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }

19 View Source File : DefaultGraphRenderer.cs
License : MIT License
Project Creator : huailiang

private void DrawLegendEntry(Color color, string label, bool active)
        {
            GUILayout.Space(5);
            GUILayout.BeginHorizontal(GUILayout.Height(20));

            Rect legendIconRect = GUILayoutUtility.GetRect(1, 1, GUILayout.Width(20), GUILayout.Height(20));
            DrawRect(legendIconRect, color, string.Empty, active);

            GUILayout.Label(label, m_LegendLabelStyle);

            GUILayout.EndHorizontal();
        }

19 View Source File : EditorTrack.cs
License : MIT License
Project Creator : huailiang

public void OnInspector()
        {
            var c = trackColor;
            c.a = 1;
            GUILayout.BeginHorizontal();
            using (new GUIColorOverride(c))
            {
                trackF = EditorGUILayout.Foldout(trackF, trackHeader, SeqenceStyle.boldFoldStyle);
            }
            if (warn)
            {
                GUILayout.FlexibleSpace();
                GUILayout.Label(SeqenceStyle.warn_ico);
            }
            GUILayout.EndHorizontal();
            if (trackF)
            {
                EditorGUI.indentLevel++;
                OnInspectorTrack();
                int i = 0;
                if (track.clips != null)
                {
                    foreach (var clip in track.clips)
                    {
                        EditorGUILayout.LabelField("clip" + (++i) + ": " + clip.Display, SeqenceStyle.replacedleStyle);
                        OnInspectorClip(clip);
                    }
                }
                if (track.marks != null)
                {
                    SetupEMarks();
                    foreach (var mark in emarks)
                    {
                        mark.Inspector();
                    }
                }
                EditorGUI.indentLevel--;
            }
        }

19 View Source File : EditorTransformTrack.cs
License : MIT License
Project Creator : huailiang

protected override void OnInspectorTrack()
        {
            base.OnInspectorTrack();
            if (track.parent == null) EditorGUILayout.HelpBox("no parent bind", MessageType.Warning);

            GUILayout.Label("time: " + SeqenceWindow.inst.seqence.Time.ToString("f2"));
            bool recd = track.record;
            Vector3 pos = target.transform.localPosition;
            float rot = target.transform.localEulerAngles.y;
            if (recd)
            {
                EditorGUI.BeginChangeCheck();
                using (new GUIColorOverride(Color.red))
                {
                    pos = EditorGUILayout.Vector3Field("pos", pos);
                    rot = EditorGUILayout.FloatField("rotY", rot);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    target.transform.localPosition = pos;
                    var v3 = target.transform.localEulerAngles;
                    v3.y = rot;
                    target.transform.localEulerAngles = v3;
                    AddItem(SeqenceWindow.inst.seqence.Time);
                }
            }
            else
            {
                pos = EditorGUILayout.Vector3Field("pos", pos);
                rot = EditorGUILayout.FloatField("rotY", rot);
            }

            folder = EditorGUILayout.Foldout(folder, "frames");
            if (Data?.time != null)
            {
                if (folder)
                {
                    EditorGUILayout.Space();
                    for (int i = 0; i < Data.time.Length; i++)
                    {
                        GUILayout.BeginHorizontal();
                        GUILayout.Space(16);
                        GUILayout.Label((i + 1) + ". time: " + Data.time[i].ToString("f2"), SeqenceStyle.replacedleStyle);
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button("x", GUI.skin.label, GUILayout.MaxWidth(20)))
                        {
                            (track as XTransformTrack).RmItemAt(i);
                            SeqenceWindow.inst.Repaint();
                            GUIUtility.ExitGUI();
                        }
                        GUILayout.EndHorizontal();

                        pos = Data.pos[i];
                        pos = EditorGUILayout.Vector3Field("pos", pos);
                        rot = Data.pos[i].w;
                        rot = EditorGUILayout.FloatField("rotY", rot);
                        Data.pos[i] = new Vector4(pos.x, pos.y, pos.z, rot);
                        EditorGUILayout.Space();
                    }
                }
            }
            else
            {
                EditorGUILayout.HelpBox("not config time frame", MessageType.Warning);
            }
        }

19 View Source File : DefaultGraphRenderer.cs
License : MIT License
Project Creator : huailiang

private void DrawLegend(GraphSettings graphSettings, Rect legendArea)
        {
            EditorGUI.DrawRect(legendArea, s_LegendBackground);

            // Add a border around legend area
            legendArea.x += s_BorderSize;
            legendArea.width -= s_BorderSize * 2;
            legendArea.y += s_BorderSize;
            legendArea.height -= s_BorderSize * 2;

            GUILayout.BeginArea(legendArea);
            GUILayout.BeginVertical();

            if (graphSettings.showInspector)
            {
                GUILayout.Label("Inspector", m_SubreplacedleStyle);

                if (m_SelectedNode != null)
                {
                    using (var scrollView = new EditorGUILayout.ScrollViewScope(m_ScrollPos))
                    {
                        m_ScrollPos = scrollView.scrollPosition;
                        GUILayout.Label(m_SelectedNode.ToString(), m_InspectorStyle);
                    }
                }
                else
                {
                    GUILayout.Label("Click on a node\nto display its details.");
                }
            }

            GUILayout.FlexibleSpace();

            if (graphSettings.showLegend)
            {
                GUILayout.Label("Legend", m_SubreplacedleStyle);

                foreach (var pair in m_LegendForType)
                {
                    DrawLegendEntry(pair.Value.color, pair.Value.label, false);
                }

                DrawLegendEntry(Color.gray, "Playing", true);

                GUILayout.Space(20);

                GUILayout.Label("Edge weight", m_SubreplacedleStyle);
                GUILayout.BeginHorizontal();
                GUILayout.Label("0");
                GUILayout.FlexibleSpace();
                GUILayout.Label("1");
                GUILayout.EndHorizontal();

                DrawEdgeWeightColorBar(legendArea.width);

                GUILayout.Space(20);
            }

            GUILayout.EndVertical();
            GUILayout.EndArea();
        }

19 View Source File : PlayableGraphVisualizerWindow.cs
License : MIT License
Project Creator : huailiang

private static void ShowMessage(string msg)
        {
            GUILayout.BeginVertical();
            GUILayout.FlexibleSpace();

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

            GUILayout.Label(msg);

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

            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
        }

19 View Source File : EditorMark.cs
License : MIT License
Project Creator : huailiang

public void Inspector()
        {
            GUILayout.BeginHorizontal();
            GUIContent cont = SeqenceWindow.inst.state.config.GetIcon(baseMarker.type);
            EditorGUI.indentLevel++;
            EditorGUILayout.LabelField("- " + baseMarker.type, SeqenceStyle.replacedleStyle);
            GUILayout.Space(4);
            GUILayout.Box(cont, GUIStyle.none, GUILayout.MaxWidth(10), GUILayout.MaxHeight(12));
            GUILayout.EndHorizontal();
            baseMarker.time = EditorGUILayout.FloatField(" time", baseMarker.time);
            baseMarker.reverse = EditorGUILayout.Toggle(" reverse", baseMarker.reverse);
            OnInspector();
            EditorGUI.indentLevel--;
        }

19 View Source File : EditorTrack.cs
License : MIT License
Project Creator : huailiang

protected void GUIHeader()
        {
            var tmp = RenderHead;
            tmp.y += tmp.height / 4;
            GUILayout.BeginArea(tmp);
            GUILayout.BeginHorizontal();
            GUILayout.Space(5);
            GUILayout.Label(trackHeader);
            OnGUIHeader();
            if (track.mute)
            {
                if (GUILayout.Button(SeqenceStyle.muteContent, SeqenceStyle.icoStyle)) track.SetFlag(TrackMode.Mute, false);
            }
            if (track.locked)
            {
                if (GUILayout.Button(SeqenceStyle.lockContent, SeqenceStyle.icoStyle)) track.SetFlag(TrackMode.Lock, false);
            }
            if (warn)
            {
                GUILayout.Label(SeqenceStyle.warn_ico, GUILayout.MaxWidth(20));
            }
            var tree = SeqenceWindow.inst.tree;
            if (track.hasChilds)
            {
                GUILayout.Space(4);
                if (GUILayout.Button(SeqenceStyle.sequenceSelectorIcon, SeqenceStyle.bottomShadow))
                {
                    if (showChild)
                        tree.RmChildTrack(track);
                    else
                        tree.AddChildTracks(track);
                    showChild = !showChild;
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }

19 View Source File : CacheMaintenanceSample.cs
License : MIT License
Project Creator : huanzi-qch

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 : MIT License
Project Creator : huanzi-qch

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 : AuthenticationSample.cs
License : MIT License
Project Creator : huanzi-qch

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 : MIT License
Project Creator : huanzi-qch

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 : MIT License
Project Creator : huanzi-qch

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 : MIT License
Project Creator : huanzi-qch

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 : DemoHubSample.cs
License : MIT License
Project Creator : huanzi-qch

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 : GUIHelper.cs
License : MIT License
Project Creator : huanzi-qch

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

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

19 View Source File : SimpleStreamingSample.cs
License : MIT License
Project Creator : huanzi-qch

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 : MIT License
Project Creator : huanzi-qch

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();
                });
        }

See More Examples