UnityEngine.GUILayout.BeginVertical(UnityEngine.GUIContent, UnityEngine.GUIStyle, params UnityEngine.GUILayoutOption[])

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

234 Examples 7

19 View Source File : TimelineWindow_TrackGui.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

void DrawNoSequenceGUI(WindowState windowState)
        {
            bool showCreateButton = false;
            var currentlySelectedGo = UnityEditor.Selection.activeObject != null ? UnityEditor.Selection.activeObject as GameObject : null;
            var textContent = DirectorStyles.noTimelinereplacedetSelected;
            var existingDirector = currentlySelectedGo != null ? currentlySelectedGo.GetComponent<PlayableDirector>() : null;
            var existingreplacedet = existingDirector != null ? existingDirector.playablereplacedet : null;

            if (currentlySelectedGo != null && !TimelineUtility.IsPrefabOrreplacedet(currentlySelectedGo) && existingreplacedet == null)
            {
                showCreateButton = true;
                textContent = new GUIContent(String.Format(DirectorStyles.createTimelineOnSelection.text, currentlySelectedGo.name, "a Director component and a Timeline replacedet"));
            }
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.FlexibleSpace();

            GUILayout.Label(textContent);

            if (showCreateButton)
            {
                GUILayout.BeginHorizontal();
                var textSize = GUI.skin.label.CalcSize(textContent);
                GUILayout.Space((textSize.x / 2.0f) - (WindowConstants.createButtonWidth / 2.0f));
                if (GUILayout.Button("Create", GUILayout.Width(WindowConstants.createButtonWidth)))
                {
                    var message = DirectorStyles.createNewTimelineText.text + " '" + currentlySelectedGo.name + "'";
                    string newSequencePath = EditorUtility.SaveFilePanelInProject(DirectorStyles.createNewTimelineText.text, currentlySelectedGo.name + "Timeline", "playable", message, ProjectWindowUtil.GetActiveFolderPath());
                    if (!string.IsNullOrEmpty(newSequencePath))
                    {
                        var newreplacedet = TimelineUtility.CreateAndSaveTimelinereplacedet(newSequencePath);

                        Undo.IncrementCurrentGroup();

                        if (existingDirector == null)
                        {
                            existingDirector = Undo.AddComponent<PlayableDirector>(currentlySelectedGo);
                        }

                        existingDirector.playablereplacedet = newreplacedet;
                        SetCurrentTimeline(existingDirector);
                        windowState.previewMode = false;
                    }

                    // If we reach this point, the state of the pannel has changed; skip the rest of this GUI phase
                    // Fixes: case 955831 - [OSX] NullReferenceException when creating a timeline on a selected object
                    GUIUtility.ExitGUI();
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
        }

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 : Inspector.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

public static void AddArray(SerializedProperty prop, GUIContent guiContent, bool editHierarchy, bool changeOrder, DrawArrayElement drawArrayElement = null, OnAddToArray onAddToArray = null, DrawArrayElementLabel drawArrayElementLabel = null, bool showHeading = true) {
			int resetIndent = EditorGUI.indentLevel;

			// Array heading
			if (showHeading) {
				GUILayout.BeginHorizontal();
				GUILayout.Space(EditorGUI.indentLevel * indent);
				
				if (drawArrayElement == null) {
					GUILayout.Label(guiContent.text + " (" + prop.arraySize.ToString() + ")", GUILayout.Width(150));
				} else {
					EditorGUILayout.PropertyField(prop, new GUIContent(guiContent.text + " (" + prop.arraySize.ToString() + ")", string.Empty), false, GUILayout.Width(150));
				}
				
				GUILayout.EndHorizontal();
			}
			
			int deleteIndex = -1;
			
			if (drawArrayElement == null || !showHeading) prop.isExpanded = true;
			
			// Draw Array elements
			if (prop.isExpanded) {			
				for(int i = 0; i < prop.arraySize; i++) {
					GUILayout.BeginHorizontal(); // Main
					GUILayout.Space(((EditorGUI.indentLevel + 1) * indent));
					GUILayout.BeginVertical();
					
					element = prop.GetArrayElementAtIndex(i);

					// Label
					GUILayout.BeginHorizontal(); 
				
					if (editHierarchy && GUILayout.Button(new GUIContent("-", "Remove"), changeOrder? EditorStyles.miniButtonLeft: EditorStyles.miniButton, GUILayout.Width(20))){
						deleteIndex = i;
					}
					
					if (changeOrder) {
						if (GUILayout.Button(new GUIContent("<", "Move up"), editHierarchy? EditorStyles.miniButtonMid: EditorStyles.miniButtonLeft, GUILayout.Width(20))) {
							int moveTo = i == 0? prop.arraySize - 1: i - 1;
							prop.MoveArrayElement(i, moveTo);
							prop.isExpanded = true;
						}
							
						if (GUILayout.Button(new GUIContent(">", "Move down"), EditorStyles.miniButtonRight, GUILayout.Width(20))) {
							int moveTo = i == prop.arraySize - 1? 0: i + 1;
							prop.MoveArrayElement(i, moveTo);
							prop.isExpanded = true;
						}
					}
					
					// Calling the DrawArrayElementLabel delegate
					if (drawArrayElementLabel != null) {
						drawArrayElementLabel(element, editHierarchy);
					}
					
					GUILayout.EndHorizontal(); // End Label
					
					// Array Element
					GUILayout.BeginVertical();
					if (element.isExpanded && drawArrayElement != null) {
						drawArrayElement(element, editHierarchy);
					}
					GUILayout.EndVertical();
					
					GUILayout.Space(5);
					
					GUILayout.EndVertical(); // End Style
					GUILayout.EndHorizontal(); // End Main
				}
				
				// Deleting array elements
				if (deleteIndex != -1) prop.DeleteArrayElementAtIndex(deleteIndex);
				
				// Adding array elements
				GUILayout.BeginHorizontal();
				GUILayout.Space(((EditorGUI.indentLevel + 1) * indent) + 4);
				GUILayout.BeginVertical();
				
				if (editHierarchy && GUILayout.Button(new GUIContent("+", "Add"), EditorStyles.miniButton, GUILayout.Width(20))) {
					prop.arraySize ++;
					
					if (onAddToArray != null) onAddToArray(prop.GetArrayElementAtIndex(prop.arraySize - 1));
				}
				
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
				
			EditorGUI.indentLevel = resetIndent;
		}

void DrawControls()
        {
            GUILayout.Space(5f);

            if (position.width > position.height && position.width > k_TwoColumnControlsWidth)
            {
                m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, GUILayout.Width(315));
            }
            else
            {
                m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition);
            }

            GUILayout.Space(5f);

            GUILayout.Label(m_SelectedFontreplacedet != null ? string.Format("Font Settings [{0}]", m_SelectedFontreplacedet.name) : "Font Settings", EditorStyles.boldLabel);

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            EditorGUIUtility.labelWidth = 125f;
            EditorGUIUtility.fieldWidth = 5f;

            // Disable Options if already generating a font atlas texture.
            EditorGUI.BeginDisabledGroup(m_IsProcessing);
            {
                // FONT TTF SELECTION
                EditorGUI.BeginChangeCheck();
                m_SourceFontFile = EditorGUILayout.ObjectField("Source Font File", m_SourceFontFile, typeof(Font), false) as Font;
                if (EditorGUI.EndChangeCheck())
                {
                    m_SelectedFontreplacedet = null;
                    m_IsFontAtlasInvalid = true;
                }

                // FONT SIZING
                EditorGUI.BeginChangeCheck();
                if (m_PointSizeSamplingMode == 0)
                {
                    m_PointSizeSamplingMode = EditorGUILayout.Popup("Sampling Point Size", m_PointSizeSamplingMode, m_FontSizingOptions);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    m_PointSizeSamplingMode = EditorGUILayout.Popup("Sampling Point Size", m_PointSizeSamplingMode, m_FontSizingOptions, GUILayout.Width(225));
                    m_PointSize = EditorGUILayout.IntField(m_PointSize);
                    GUILayout.EndHorizontal();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    m_IsFontAtlasInvalid = true;
                }

                // FONT PADDING
                EditorGUI.BeginChangeCheck();
                m_Padding = EditorGUILayout.IntField("Padding", m_Padding);
                m_Padding = (int)Mathf.Clamp(m_Padding, 0f, 64f);
                if (EditorGUI.EndChangeCheck())
                {
                    m_IsFontAtlasInvalid = true;
                }

                // FONT PACKING METHOD SELECTION
                EditorGUI.BeginChangeCheck();
                m_PackingMode = (FontPackingModes)EditorGUILayout.EnumPopup("Packing Method", m_PackingMode);
                if (EditorGUI.EndChangeCheck())
                {
                    m_IsFontAtlasInvalid = true;
                }

                // FONT ATLAS RESOLUTION SELECTION
                GUILayout.BeginHorizontal();
                GUI.changed = false;

                EditorGUI.BeginChangeCheck();
                EditorGUILayout.PrefixLabel("Atlas Resolution");
                m_AtlasWidth = EditorGUILayout.IntPopup(m_AtlasWidth, m_FontResolutionLabels, m_FontAtlasResolutions);
                m_AtlasHeight = EditorGUILayout.IntPopup(m_AtlasHeight, m_FontResolutionLabels, m_FontAtlasResolutions);
                if (EditorGUI.EndChangeCheck())
                {
                    m_IsFontAtlasInvalid = true;
                }

                GUILayout.EndHorizontal();


                // FONT CHARACTER SET SELECTION
                EditorGUI.BeginChangeCheck();
                bool hreplacedelectionChanged = false;
                m_CharacterSetSelectionMode = EditorGUILayout.Popup("Character Set", m_CharacterSetSelectionMode, m_FontCharacterSets);
                if (EditorGUI.EndChangeCheck())
                {
                    m_CharacterSequence = "";
                    hreplacedelectionChanged = true;
                    m_IsFontAtlasInvalid = true;
                }

                switch (m_CharacterSetSelectionMode)
                {
                    case 0: // ASCII
                        //characterSequence = "32 - 126, 130, 132 - 135, 139, 145 - 151, 153, 155, 161, 166 - 167, 169 - 174, 176, 181 - 183, 186 - 187, 191, 8210 - 8226, 8230, 8240, 8242 - 8244, 8249 - 8250, 8252 - 8254, 8260, 8286";
                        m_CharacterSequence = "32 - 126, 160, 8203, 8230, 9633";
                        break;

                    case 1: // EXTENDED ASCII
                        m_CharacterSequence = "32 - 126, 160 - 255, 8192 - 8303, 8364, 8482, 9633";
                        // Could add 9632 for missing glyph
                        break;

                    case 2: // Lowercase
                        m_CharacterSequence = "32 - 64, 91 - 126, 160";
                        break;

                    case 3: // Uppercase
                        m_CharacterSequence = "32 - 96, 123 - 126, 160";
                        break;

                    case 4: // Numbers & Symbols
                        m_CharacterSequence = "32 - 64, 91 - 96, 123 - 126, 160";
                        break;

                    case 5: // Custom Range
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        GUILayout.Label("Enter a sequence of decimal values to define the characters to be included in the font replacedet or retrieve one from another font replacedet.", TMP_UIStyleManager.label);
                        GUILayout.Space(10f);

                        EditorGUI.BeginChangeCheck();
                        m_ReferencedFontreplacedet = EditorGUILayout.ObjectField("Select Font replacedet", m_ReferencedFontreplacedet, typeof(TMP_Fontreplacedet), false) as TMP_Fontreplacedet;
                        if (EditorGUI.EndChangeCheck() || hreplacedelectionChanged)
                        {
                            if (m_ReferencedFontreplacedet != null)
                                m_CharacterSequence = TMP_EditorUtility.GetDecimalCharacterSequence(TMP_Fontreplacedet.GetCharactersArray(m_ReferencedFontreplacedet));

                            m_IsFontAtlasInvalid = true;
                        }

                        // Filter out unwanted characters.
                        char chr = Event.current.character;
                        if ((chr < '0' || chr > '9') && (chr < ',' || chr > '-'))
                        {
                            Event.current.character = '\0';
                        }
                        GUILayout.Label("Character Sequence (Decimal)", EditorStyles.boldLabel);
                        EditorGUI.BeginChangeCheck();
                        m_CharacterSequence = EditorGUILayout.TextArea(m_CharacterSequence, TMP_UIStyleManager.textAreaBoxWindow, GUILayout.Height(120), GUILayout.ExpandWidth(true));
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_IsFontAtlasInvalid = true;
                        }

                        EditorGUILayout.EndVertical();
                        break;

                    case 6: // Unicode HEX Range
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        GUILayout.Label("Enter a sequence of Unicode (hex) values to define the characters to be included in the font replacedet or retrieve one from another font replacedet.", TMP_UIStyleManager.label);
                        GUILayout.Space(10f);

                        EditorGUI.BeginChangeCheck();
                        m_ReferencedFontreplacedet = EditorGUILayout.ObjectField("Select Font replacedet", m_ReferencedFontreplacedet, typeof(TMP_Fontreplacedet), false) as TMP_Fontreplacedet;
                        if (EditorGUI.EndChangeCheck() || hreplacedelectionChanged)
                        {
                            if (m_ReferencedFontreplacedet != null)
                                m_CharacterSequence = TMP_EditorUtility.GetUnicodeCharacterSequence(TMP_Fontreplacedet.GetCharactersArray(m_ReferencedFontreplacedet));

                            m_IsFontAtlasInvalid = true;
                        }

                        // Filter out unwanted characters.
                        chr = Event.current.character;
                        if ((chr < '0' || chr > '9') && (chr < 'a' || chr > 'f') && (chr < 'A' || chr > 'F') && (chr < ',' || chr > '-'))
                        {
                            Event.current.character = '\0';
                        }
                        GUILayout.Label("Character Sequence (Hex)", EditorStyles.boldLabel);
                        EditorGUI.BeginChangeCheck();
                        m_CharacterSequence = EditorGUILayout.TextArea(m_CharacterSequence, TMP_UIStyleManager.textAreaBoxWindow, GUILayout.Height(120), GUILayout.ExpandWidth(true));
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_IsFontAtlasInvalid = true;
                        }

                        EditorGUILayout.EndVertical();
                        break;

                    case 7: // Characters from Font replacedet
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        GUILayout.Label("Type the characters to be included in the font replacedet or retrieve them from another font replacedet.", TMP_UIStyleManager.label);
                        GUILayout.Space(10f);

                        EditorGUI.BeginChangeCheck();
                        m_ReferencedFontreplacedet = EditorGUILayout.ObjectField("Select Font replacedet", m_ReferencedFontreplacedet, typeof(TMP_Fontreplacedet), false) as TMP_Fontreplacedet;
                        if (EditorGUI.EndChangeCheck() || hreplacedelectionChanged)
                        {
                            if (m_ReferencedFontreplacedet != null)
                                m_CharacterSequence = TMP_Fontreplacedet.GetCharacters(m_ReferencedFontreplacedet);

                            m_IsFontAtlasInvalid = true;
                        }

                        EditorGUI.indentLevel = 0;

                        GUILayout.Label("Custom Character List", EditorStyles.boldLabel);
                        EditorGUI.BeginChangeCheck();
                        m_CharacterSequence = EditorGUILayout.TextArea(m_CharacterSequence, TMP_UIStyleManager.textAreaBoxWindow, GUILayout.Height(120), GUILayout.ExpandWidth(true));
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_IsFontAtlasInvalid = true;
                        }
                        EditorGUILayout.EndVertical();
                        break;

                    case 8: // Character List from File
                        EditorGUI.BeginChangeCheck();
                        m_CharactersFromFile = EditorGUILayout.ObjectField("Character File", m_CharactersFromFile, typeof(Textreplacedet), false) as Textreplacedet;
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_IsFontAtlasInvalid = true;
                        }

                        if (m_CharactersFromFile != null)
                        {
                            Regex rx = new Regex(@"(?<!\\)(?:\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})");

                            m_CharacterSequence = rx.Replace(m_CharactersFromFile.text,
                                match =>
                                {
                                    if (match.Value.StartsWith("\\U"))
                                        return char.ConvertFromUtf32(int.Parse(match.Value.Replace("\\U", ""), NumberStyles.HexNumber));

                                    return char.ConvertFromUtf32(int.Parse(match.Value.Replace("\\u", ""), NumberStyles.HexNumber));
                                });
                        }
                        break;
                }

                // FONT STYLE SELECTION
                //GUILayout.BeginHorizontal();
                //EditorGUI.BeginChangeCheck();
                ////m_FontStyle = (FaceStyles)EditorGUILayout.EnumPopup("Font Style", m_FontStyle, GUILayout.Width(225));
                ////m_FontStyleValue = EditorGUILayout.IntField((int)m_FontStyleValue);
                //if (EditorGUI.EndChangeCheck())
                //{
                //    m_IsFontAtlasInvalid = true;
                //}
                //GUILayout.EndHorizontal();

                // Render Mode Selection
                CheckForLegacyGlyphRenderMode();

                EditorGUI.BeginChangeCheck();
                m_GlyphRenderMode = (GlyphRenderMode)EditorGUILayout.EnumPopup("Render Mode", m_GlyphRenderMode);
                if (EditorGUI.EndChangeCheck())
                {
                    m_IsFontAtlasInvalid = true;
                }

                m_IncludeFontFeatures = EditorGUILayout.Toggle("Get Kerning Pairs", m_IncludeFontFeatures);

                EditorGUILayout.Space();
            }

            EditorGUI.EndDisabledGroup();

            if (!string.IsNullOrEmpty(m_WarningMessage))
            {
                EditorGUILayout.HelpBox(m_WarningMessage, MessageType.Warning);
            }

            GUI.enabled = m_SourceFontFile != null && !m_IsProcessing && !m_IsGenerationDisabled; // Enable Preview if we are not already rendering a font.
            if (GUILayout.Button("Generate Font Atlas") && GUI.enabled)
            {
                if (!m_IsProcessing && m_SourceFontFile != null)
                {
                    DestroyImmediate(m_FontAtlasTexture);
                    m_FontAtlasTexture = null;
                    m_SavedFontAtlas = null;

                    // Initialize font engine
                    FontEngineError errorCode = FontEngine.InitializeFontEngine();
                    if (errorCode != FontEngineError.Success)
                    {
                        Debug.Log("Font replacedet Creator - Error [" + errorCode + "] has occurred while Initializing the FreeType Library.");
                    }

                    // Get file path of the source font file.
                    string fontPath = replacedetDatabase.GetreplacedetPath(m_SourceFontFile);

                    if (errorCode == FontEngineError.Success)
                    {
                        errorCode = FontEngine.LoadFontFace(fontPath);

                        if (errorCode != FontEngineError.Success)
                        {
                            Debug.Log("Font replacedet Creator - Error Code [" + errorCode + "] has occurred trying to load the [" + m_SourceFontFile.name + "] font file. This typically results from the use of an incompatible or corrupted font file.", m_SourceFontFile);
                        }
                    }


                    // Define an array containing the characters we will render.
                    if (errorCode == FontEngineError.Success)
                    {
                        uint[] characterSet = null;

                        // Get list of characters that need to be packed and rendered to the atlas texture.
                        if (m_CharacterSetSelectionMode == 7 || m_CharacterSetSelectionMode == 8)
                        {
                            List<uint> char_List = new List<uint>();

                            for (int i = 0; i < m_CharacterSequence.Length; i++)
                            {
                                uint unicode = m_CharacterSequence[i];

                                // Handle surrogate pairs
                                if (i < m_CharacterSequence.Length - 1 && char.IsHighSurrogate((char)unicode) && char.IsLowSurrogate(m_CharacterSequence[i + 1]))
                                {
                                    unicode = (uint)char.ConvertToUtf32(m_CharacterSequence[i], m_CharacterSequence[i + 1]);
                                    i += 1;
                                }

                                // Check to make sure we don't include duplicates
                                if (char_List.FindIndex(item => item == unicode) == -1)
                                    char_List.Add(unicode);
                            }

                            characterSet = char_List.ToArray();
                        }
                        else if (m_CharacterSetSelectionMode == 6)
                        {
                            characterSet = ParseHexNumberSequence(m_CharacterSequence);
                        }
                        else
                        {
                            characterSet = ParseNumberSequence(m_CharacterSequence);
                        }

                        m_CharacterCount = characterSet.Length;

                        m_AtlasGenerationProgress = 0;
                        m_IsProcessing = true;
                        m_IsGenerationCancelled = false;

                        GlyphLoadFlags glyphLoadFlags = ((GlyphRasterModes)m_GlyphRenderMode & GlyphRasterModes.RASTER_MODE_HINTED) == GlyphRasterModes.RASTER_MODE_HINTED
                            ? GlyphLoadFlags.LOAD_RENDER
                            : GlyphLoadFlags.LOAD_RENDER | GlyphLoadFlags.LOAD_NO_HINTING;

                        glyphLoadFlags = ((GlyphRasterModes)m_GlyphRenderMode & GlyphRasterModes.RASTER_MODE_MONO) == GlyphRasterModes.RASTER_MODE_MONO
                            ? glyphLoadFlags | GlyphLoadFlags.LOAD_MONOCHROME
                            : glyphLoadFlags;

                        //
                        AutoResetEvent autoEvent = new AutoResetEvent(false);

                        // Worker thread to pack glyphs in the given texture space.
                        ThreadPool.QueueUserWorkItem(PackGlyphs =>
                        {
                            // Start Stop Watch
                            m_StopWatch = System.Diagnostics.Stopwatch.StartNew();

                            // Clear the various lists used in the generation process.
                            m_AvailableGlyphsToAdd.Clear();
                            m_MissingCharacters.Clear();
                            m_ExcludedCharacters.Clear();
                            m_CharacterLookupMap.Clear();
                            m_GlyphLookupMap.Clear();
                            m_GlyphsToPack.Clear();
                            m_GlyphsPacked.Clear();

                            // Check if requested characters are available in the source font file.
                            for (int i = 0; i < characterSet.Length; i++)
                            {
                                uint unicode = characterSet[i];
                                uint glyphIndex;

                                if (FontEngine.TryGetGlyphIndex(unicode, out glyphIndex))
                                {
                                    // Skip over potential duplicate characters.
                                    if (m_CharacterLookupMap.ContainsKey(unicode))
                                        continue;

                                    // Add character to character lookup map.
                                    m_CharacterLookupMap.Add(unicode, glyphIndex);

                                    // Skip over potential duplicate glyph references.
                                    if (m_GlyphLookupMap.ContainsKey(glyphIndex))
                                    {
                                        // Add additional glyph reference for this character.
                                        m_GlyphLookupMap[glyphIndex].Add(unicode);
                                        continue;
                                    }

                                    // Add glyph reference to glyph lookup map.
                                    m_GlyphLookupMap.Add(glyphIndex, new List<uint>() { unicode });

                                    // Add glyph index to list of glyphs to add to texture.
                                    m_AvailableGlyphsToAdd.Add(glyphIndex);
                                }
                                else
                                {
                                    // Add Unicode to list of missing characters.
                                    m_MissingCharacters.Add(unicode);
                                }
                            }

                            // Pack available glyphs in the provided texture space.
                            if (m_AvailableGlyphsToAdd.Count > 0)
                            {
                                int packingModifier = ((GlyphRasterModes)m_GlyphRenderMode & GlyphRasterModes.RASTER_MODE_BITMAP) == GlyphRasterModes.RASTER_MODE_BITMAP ? 0 : 1;

                                if (m_PointSizeSamplingMode == 0) // Auto-Sizing Point Size Mode
                                {
                                    // Estimate min / max range for auto sizing of point size.
                                    int minPointSize = 0;
                                    int maxPointSize = (int)Mathf.Sqrt((m_AtlasWidth * m_AtlasHeight) / m_AvailableGlyphsToAdd.Count) * 3;

                                    m_PointSize = (maxPointSize + minPointSize) / 2;

                                    bool optimumPointSizeFound = false;
                                    for (int iteration = 0; iteration < 15 && optimumPointSizeFound == false; iteration++)
                                    {
                                        m_AtlasGenerationProgressLabel = "Packing glyphs - Preplaced (" + iteration + ")";

                                        FontEngine.SetFaceSize(m_PointSize);

                                        m_GlyphsToPack.Clear();
                                        m_GlyphsPacked.Clear();

                                        m_FreeGlyphRects.Clear();
                                        m_FreeGlyphRects.Add(new GlyphRect(0, 0, m_AtlasWidth - packingModifier, m_AtlasHeight - packingModifier));
                                        m_UsedGlyphRects.Clear();

                                        for (int i = 0; i < m_AvailableGlyphsToAdd.Count; i++)
                                        {
                                            uint glyphIndex = m_AvailableGlyphsToAdd[i];
                                            Glyph glyph;

                                            if (FontEngine.TryGetGlyphWithIndexValue(glyphIndex, glyphLoadFlags, out glyph))
                                            {
                                                if (glyph.glyphRect.width > 0 && glyph.glyphRect.height > 0)
                                                {
                                                    m_GlyphsToPack.Add(glyph);
                                                }
                                                else
                                                {
                                                    m_GlyphsPacked.Add(glyph);
                                                }
                                            }
                                        }

                                        FontEngine.TryPackGlyphsInAtlas(m_GlyphsToPack, m_GlyphsPacked, m_Padding, (GlyphPackingMode)m_PackingMode, m_GlyphRenderMode, m_AtlasWidth, m_AtlasHeight, m_FreeGlyphRects, m_UsedGlyphRects);

                                        if (m_IsGenerationCancelled)
                                        {
                                            DestroyImmediate(m_FontAtlasTexture);
                                            m_FontAtlasTexture = null;
                                            return;
                                        }

                                        //Debug.Log("Glyphs remaining to add [" + m_GlyphsToAdd.Count + "]. Glyphs added [" + m_GlyphsAdded.Count + "].");

                                        if (m_GlyphsToPack.Count > 0)
                                        {
                                            if (m_PointSize > minPointSize)
                                            {
                                                maxPointSize = m_PointSize;
                                                m_PointSize = (m_PointSize + minPointSize) / 2;

                                                //Debug.Log("Decreasing point size from [" + maxPointSize + "] to [" + m_PointSize + "].");
                                            }
                                        }
                                        else
                                        {
                                            if (maxPointSize - minPointSize > 1 && m_PointSize < maxPointSize)
                                            {
                                                minPointSize = m_PointSize;
                                                m_PointSize = (m_PointSize + maxPointSize) / 2;

                                                //Debug.Log("Increasing point size from [" + minPointSize + "] to [" + m_PointSize + "].");
                                            }
                                            else
                                            {
                                                //Debug.Log("[" + iteration + "] iterations to find the optimum point size of : [" + m_PointSize + "].");
                                                optimumPointSizeFound = true;
                                            }
                                        }
                                    }
                                }
                                else // Custom Point Size Mode
                                {
                                    m_AtlasGenerationProgressLabel = "Packing glyphs...";

                                    // Set point size
                                    FontEngine.SetFaceSize(m_PointSize);

                                    m_GlyphsToPack.Clear();
                                    m_GlyphsPacked.Clear();

                                    m_FreeGlyphRects.Clear();
                                    m_FreeGlyphRects.Add(new GlyphRect(0, 0, m_AtlasWidth - packingModifier, m_AtlasHeight - packingModifier));
                                    m_UsedGlyphRects.Clear();

                                    for (int i = 0; i < m_AvailableGlyphsToAdd.Count; i++)
                                    {
                                        uint glyphIndex = m_AvailableGlyphsToAdd[i];
                                        Glyph glyph;

                                        if (FontEngine.TryGetGlyphWithIndexValue(glyphIndex, glyphLoadFlags, out glyph))
                                        {
                                            if (glyph.glyphRect.width > 0 && glyph.glyphRect.height > 0)
                                            {
                                                m_GlyphsToPack.Add(glyph);
                                            }
                                            else
                                            {
                                                m_GlyphsPacked.Add(glyph);
                                            }
                                        }
                                    }

                                    FontEngine.TryPackGlyphsInAtlas(m_GlyphsToPack, m_GlyphsPacked, m_Padding, (GlyphPackingMode)m_PackingMode, m_GlyphRenderMode, m_AtlasWidth, m_AtlasHeight, m_FreeGlyphRects, m_UsedGlyphRects);

                                    if (m_IsGenerationCancelled)
                                    {
                                        DestroyImmediate(m_FontAtlasTexture);
                                        m_FontAtlasTexture = null;
                                        return;
                                    }
                                    //Debug.Log("Glyphs remaining to add [" + m_GlyphsToAdd.Count + "]. Glyphs added [" + m_GlyphsAdded.Count + "].");
                                }

                            }
                            else
                            {
                                int packingModifier = ((GlyphRasterModes)m_GlyphRenderMode & GlyphRasterModes.RASTER_MODE_BITMAP) == GlyphRasterModes.RASTER_MODE_BITMAP ? 0 : 1;

                                FontEngine.SetFaceSize(m_PointSize);

                                m_GlyphsToPack.Clear();
                                m_GlyphsPacked.Clear();

                                m_FreeGlyphRects.Clear();
                                m_FreeGlyphRects.Add(new GlyphRect(0, 0, m_AtlasWidth - packingModifier, m_AtlasHeight - packingModifier));
                                m_UsedGlyphRects.Clear();
                            }

                            //Stop StopWatch
                            m_StopWatch.Stop();
                            m_GlyphPackingGenerationTime = m_StopWatch.Elapsed.TotalMilliseconds;
                            m_IsGlyphPackingDone = true;
                            m_StopWatch.Reset();

                            m_FontCharacterTable.Clear();
                            m_FontGlyphTable.Clear();
                            m_GlyphsToRender.Clear();

                            // Add glyphs and characters successfully added to texture to their respective font tables.
                            foreach (Glyph glyph in m_GlyphsPacked)
                            {
                                uint glyphIndex = glyph.index;

                                m_FontGlyphTable.Add(glyph);

                                // Add glyphs to list of glyphs that need to be rendered.
                                if (glyph.glyphRect.width > 0 && glyph.glyphRect.height > 0)
                                    m_GlyphsToRender.Add(glyph);

                                foreach (uint unicode in m_GlyphLookupMap[glyphIndex])
                                {
                                    // Create new Character
                                    m_FontCharacterTable.Add(new TMP_Character(unicode, glyph));
                                }
                            }

                            //
                            foreach (Glyph glyph in m_GlyphsToPack)
                            {
                                foreach (uint unicode in m_GlyphLookupMap[glyph.index])
                                {
                                    m_ExcludedCharacters.Add(unicode);
                                }
                            }

                            // Get the face info for the current sampling point size.
                            m_FaceInfo = FontEngine.GetFaceInfo();

                            autoEvent.Set();
                        });

                        // Worker thread to render glyphs in texture buffer.
                        ThreadPool.QueueUserWorkItem(RenderGlyphs =>
                        {
                            autoEvent.WaitOne();

                            // Start Stop Watch
                            m_StopWatch = System.Diagnostics.Stopwatch.StartNew();

                            m_IsRenderingDone = false;

                            // Allocate texture data
                            m_AtlasTextureBuffer = new byte[m_AtlasWidth * m_AtlasHeight];

                            m_AtlasGenerationProgressLabel = "Rendering glyphs...";

                            // Render and add glyphs to the given atlas texture.
                            if (m_GlyphsToRender.Count > 0)
                            {
                                FontEngine.RenderGlyphsToTexture(m_GlyphsToRender, m_Padding, m_GlyphRenderMode, m_AtlasTextureBuffer, m_AtlasWidth, m_AtlasHeight);
                            }

                            m_IsRenderingDone = true;

                            // Stop StopWatch
                            m_StopWatch.Stop();
                            m_GlyphRenderingGenerationTime = m_StopWatch.Elapsed.TotalMilliseconds;
                            m_IsGlyphRenderingDone = true;
                            m_StopWatch.Reset();
                        });
                    }

                    SaveCreationSettingsToEditorPrefs(SaveFontCreationSettings());
                }
            }

            // FONT RENDERING PROGRESS BAR
            GUILayout.Space(1);
            Rect progressRect = EditorGUILayout.GetControlRect(false, 20);

            GUI.enabled = true;
            progressRect.width -= 22;
            EditorGUI.ProgressBar(progressRect, Mathf.Max(0.01f, m_AtlasGenerationProgress), m_AtlasGenerationProgressLabel);
            progressRect.x = progressRect.x + progressRect.width + 2;
            progressRect.y -= 1;
            progressRect.width = 20;
            progressRect.height = 20;

            GUI.enabled = m_IsProcessing;
            if (GUI.Button(progressRect, "X"))
            {
                FontEngine.SendCancellationRequest();
                m_AtlasGenerationProgress = 0;
                m_IsProcessing = false;
                m_IsGenerationCancelled = true;
            }
            GUILayout.Space(5);

            // FONT STATUS & INFORMATION
            GUI.enabled = true;

            GUILayout.BeginVertical(EditorStyles.helpBox, GUILayout.Height(200));
            m_OutputScrollPosition = EditorGUILayout.BeginScrollView(m_OutputScrollPosition);
            EditorGUILayout.LabelField(m_OutputFeedback, TMP_UIStyleManager.label);
            EditorGUILayout.EndScrollView();
            GUILayout.EndVertical();

            // SAVE TEXTURE & CREATE and SAVE FONT XML FILE
            GUI.enabled = m_FontAtlasTexture != null && !m_IsProcessing;    // Enable Save Button if font_Atlas is not Null.

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Save") && GUI.enabled)
            {
                if (m_SelectedFontreplacedet == null)
                {
                    if (m_LegacyFontreplacedet != null)
                        SaveNewFontreplacedetWithSameName(m_LegacyFontreplacedet);
                    else
                        SaveNewFontreplacedet(m_SourceFontFile);
                }
                else
                {
                    // Save over exiting Font replacedet
                    string filePath = Path.GetFullPath(replacedetDatabase.GetreplacedetPath(m_SelectedFontreplacedet)).Replace('\\', '/');

                    if (((GlyphRasterModes)m_GlyphRenderMode & GlyphRasterModes.RASTER_MODE_BITMAP) == GlyphRasterModes.RASTER_MODE_BITMAP)
                            Save_Bitmap_Fontreplacedet(filePath);
                        else
                        Save_SDF_Fontreplacedet(filePath);
                }
            }
            if (GUILayout.Button("Save as...") && GUI.enabled)
            {
                if (m_SelectedFontreplacedet == null)
                {
                    SaveNewFontreplacedet(m_SourceFontFile);
                }
                else
                {
                    SaveNewFontreplacedetWithSameName(m_SelectedFontreplacedet);
                }
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.EndVertical();

            GUI.enabled = true; // Re-enable GUI

            if (position.height > position.width || position.width < k_TwoColumnControlsWidth)
            {
                DrawPreview();
                GUILayout.Space(5);
            }

            EditorGUILayout.EndScrollView();

            if (m_IsFontAtlasInvalid)
                ClearGeneratedData();
        }

19 View Source File : SteamVR_Skeleton_PoserEditor.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

void DrawBlendingBehaviourMenu()
        {
            if (handMaskTextures == null)
            {
                handMaskTextures = new Texture[] { (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Palm.png"),
                (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Thumb.png"),
                (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Index.png"),
                (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Middle.png"),
                (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Ring.png"),
                (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/handmask_Pinky.png")
                };
            }

            GUILayout.Space(10);
            GUILayout.BeginVertical("box");

            blendEditorExpanded.boolValue = IndentedFoldoutHeader(blendEditorExpanded.boolValue, "Blending Editor");

            if (blendEditorExpanded.boolValue)
            {
                //show selectable menu of all poses, highlighting the one that is selected
                EditorGUILayout.Space();
                for (int i = 0; i < blendingBehaviourArray.arraySize; i++)
                {

                    SerializedProperty blender = blendingBehaviourArray.GetArrayElementAtIndex(i);
                    SerializedProperty blenderName = blender.FindPropertyRelative("name");
                    SerializedProperty blenderEnabled = blender.FindPropertyRelative("enabled");
                    SerializedProperty blenderInfluence = blender.FindPropertyRelative("influence");
                    SerializedProperty blenderPose = blender.FindPropertyRelative("pose");
                    SerializedProperty blenderType = blender.FindPropertyRelative("type");
                    SerializedProperty blenderUseMask = blender.FindPropertyRelative("useMask");
                    SerializedProperty blenderValue = blender.FindPropertyRelative("value");
                    SerializedProperty blenderMask = blender.FindPropertyRelative("mask").FindPropertyRelative("values");

                    SerializedProperty blenderPreview = blender.FindPropertyRelative("previewEnabled");

                    GUILayout.Space(10);
                    float bright = blenderEnabled.boolValue ? 0.6f : 0.9f; // grey out box when disabled
                    if (EditorGUIUtility.isProSkin) bright = 1;
                    GUI.color = new Color(bright, bright, bright);
                    GUILayout.BeginVertical("box");
                    GUI.color = Color.white;

                    blenderPreview.boolValue = IndentedFoldoutHeader(blenderPreview.boolValue, blenderName.stringValue, 1);

                    //SerializedProperty blenderValue = blender.FindProperty("value");

                    EditorGUIUtility.labelWidth = 64;

                    EditorGUILayout.BeginHorizontal();
                    DrawBlenderLogo(blenderType);
                    EditorGUILayout.PropertyField(blenderEnabled);
                    GUILayout.FlexibleSpace();

                    EditorGUI.BeginDisabledGroup(i == 0);
                    if (GUILayout.Button("Move Up"))
                    {
                        blendingBehaviourArray.MoveArrayElement(i, i - 1);
                    }
                    EditorGUI.EndDisabledGroup();

                    EditorGUI.BeginDisabledGroup(i == blendingBehaviourArray.arraySize - 1);
                    if (GUILayout.Button("Move Down"))
                    {
                        blendingBehaviourArray.MoveArrayElement(i, i + 1);
                    }
                    EditorGUI.EndDisabledGroup();

                    GUILayout.Space(6);
                    GUI.color = new Color(0.9f, 0.8f, 0.78f);
                    if (GUILayout.Button("Delete"))
                    {
                        if (EditorUtility.DisplayDialog("", "Do you really want to delete this Blend Behaviour?", "Yes", "Cancel"))
                        {
                            blendingBehaviourArray.DeleteArrayElementAtIndex(i);
                            return;
                        }
                    }
                    GUI.color = Color.white;
                    EditorGUILayout.EndHorizontal();

                    if (blenderPreview.boolValue)
                    {

                        EditorGUILayout.PropertyField(blenderName);



                        EditorGUILayout.BeginHorizontal();


                        //EditorGUILayout.BeginVertical();


                        EditorGUILayout.BeginVertical();

                        EditorGUILayout.Slider(blenderInfluence, 0, 1);

                        blenderPose.intValue = EditorGUILayout.Popup("Pose", blenderPose.intValue, poser.poseNames);

                        GUILayout.Space(20);

                        EditorGUILayout.PropertyField(blenderType);

                        if (Application.isPlaying)
                        {
                            GUILayout.Space(10);
                            GUI.color = new Color(0, 0, 0, 0.3f);
                            EditorGUILayout.LabelField("", GUI.skin.box, GUILayout.Height(20), GUILayout.ExpandWidth(true));
                            GUI.color = Color.white;
                            Rect fillRect = GUILayoutUtility.GetLastRect();
                            EditorGUI.DrawRect(fillRectHorizontal(fillRect, blenderValue.floatValue), Color.green);
                        }

                        EditorGUILayout.EndVertical();



                        EditorGUILayout.BeginVertical(GUILayout.MaxWidth(100));
                        EditorGUILayout.PropertyField(blenderUseMask);
                        if (blenderUseMask.boolValue)
                        {
                            DrawMaskEnabled(blenderMask);
                        }
                        else
                        {
                            DrawMaskDisabled(blenderMask);
                        }
                        EditorGUILayout.EndVertical();

                        EditorGUILayout.EndHorizontal();



                        DrawDivider();

                        EditorGUIUtility.labelWidth = 0;


                        if (blenderType.intValue == (int)SteamVR_Skeleton_Poser.PoseBlendingBehaviour.BlenderTypes.Manual)
                        {
                            EditorGUILayout.Slider(blenderValue, 0, 1);
                        }
                        if (blenderType.intValue == (int)SteamVR_Skeleton_Poser.PoseBlendingBehaviour.BlenderTypes.replacedogAction)
                        {
                            SerializedProperty blenderAction = blender.FindPropertyRelative("action_single");
                            SerializedProperty blenderSmooth = blender.FindPropertyRelative("smoothingSpeed");
                            EditorGUILayout.PropertyField(blenderAction);
                            EditorGUILayout.PropertyField(blenderSmooth);
                        }
                        if (blenderType.intValue == (int)SteamVR_Skeleton_Poser.PoseBlendingBehaviour.BlenderTypes.BooleanAction)
                        {
                            SerializedProperty blenderAction = blender.FindPropertyRelative("action_bool");
                            SerializedProperty blenderSmooth = blender.FindPropertyRelative("smoothingSpeed");
                            EditorGUILayout.PropertyField(blenderAction);
                            EditorGUILayout.PropertyField(blenderSmooth);
                        }
                    }

                    GUILayout.EndVertical();

                }


                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("+", GUILayout.MaxWidth(32)))
                {
                    int i = blendingBehaviourArray.arraySize;
                    blendingBehaviourArray.InsertArrayElementAtIndex(i);
                    blendingBehaviourArray.GetArrayElementAtIndex(i).FindPropertyRelative("name").stringValue = "New Behaviour";
                    blendingBehaviourArray.GetArrayElementAtIndex(i).FindPropertyRelative("enabled").boolValue = true;
                    blendingBehaviourArray.GetArrayElementAtIndex(i).FindPropertyRelative("influence").floatValue = 1;
                    blendingBehaviourArray.GetArrayElementAtIndex(i).FindPropertyRelative("previewEnabled").boolValue = true;
                    serializedObject.ApplyModifiedProperties();
                    poser.blendingBehaviours[i].mask.Reset();
                }
                GUILayout.FlexibleSpace();

                EditorGUILayout.EndHorizontal();

            }
            GUILayout.EndVertical();

        }

19 View Source File : GUIDebug.cs
License : MIT License
Project Creator : blueinsert

private void ShowMessage(Dictionary<string, string> msgDic, int areaIndex)
    {
        GUIStyle fontStyle = new GUIStyle();
        fontStyle.normal.background = null;    //设置背景填充
        fontStyle.normal.textColor = new Color(0, 0, 1);   //设置字体颜色
        fontStyle.fontSize = 35;       //字体大小
 
        var areaStartPos = m_areaStartPos[areaIndex];
        GUI.color = Color.blue;
        GUILayout.BeginArea(new UnityEngine.Rect(areaStartPos.x, areaStartPos.y, m_areaSize.x, m_areaSize.y));
        m_scrollPositions[areaIndex] = GUILayout.BeginScrollView(m_scrollPositions[areaIndex], GUILayout.Width(Screen.width / 2), GUILayout.Height(Screen.height));
        GUILayout.BeginVertical();
        foreach (var kv in msgDic)
        {
            GUILayout.Label(new GUIContent(kv.Key + ":" + kv.Value), fontStyle);
        }
        GUILayout.EndVertical();
        GUILayout.EndScrollView();
        GUILayout.EndArea();
    }

19 View Source File : ToluaInjectionBlackListPanel.cs
License : MIT License
Project Creator : focus-creative-games

void OnGUI()
    {
        InitPathsInfo();
        InitFilterListDrawer();

        bool execGenerate = false;
        GUILayout.BeginHorizontal(EditorStyles.toolbar);
        {
            if (GUILayout.Button("Add", EditorStyles.toolbarButton))
            {
                AddNewPath();
            }
            if (GUILayout.Button("Save", EditorStyles.toolbarButton))
            {
                SavePathsInfo();
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Generate", EditorStyles.toolbarButton))
            {
                execGenerate = true;
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginVertical();
        {
            scrollPosition = GUILayout.BeginScrollView(scrollPosition);
            {
                pathUIList.DoLayoutList();
            }
            GUILayout.EndScrollView();
        }
        GUILayout.EndVertical();

        if (execGenerate)
        {
            Generate();
            Close();
        }
    }

19 View Source File : ExampleHelpWindow.cs
License : MIT License
Project Creator : BattleDawnNZ

private void DrawWindow(int id, float maxWidth)
    {
        GUILayout.BeginVertical(GUI.skin.box);
        GUILayout.Label(m_Description);
        GUILayout.EndVertical();
        if (GUILayout.Button("Got it!"))
        {
            mShowingHelpWindow = false;
        }
    }

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 : TMP_PackageUtilities.cs
License : MIT License
Project Creator : BattleDawnNZ

void OnGUI()
        {
            GUILayout.BeginVertical();
            {
                // Scan project files and resources
                GUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    GUILayout.Label("Scan Project Files", EditorStyles.boldLabel);
                    GUILayout.Label("Press the <i>Scan Project Files</i> button to begin scanning your project for files & resources that were created with a previous version of TextMesh Pro.", TMP_UIStyleManager.label);
                    GUILayout.Space(10f);
                    GUILayout.Label("Project folder to be scanned. Example \"replacedets/TextMesh Pro\"");
                    m_ProjectFolderToScan = EditorGUILayout.TextField("Folder Path:      replacedets/", m_ProjectFolderToScan);
                    GUILayout.Space(5f);

                    GUI.enabled = m_IsAlreadyScanningProject == false ? true : false;
                    if (GUILayout.Button("Scan Project Files"))
                    {
                        m_CancelScanProcess = false;

                        // Make sure replacedet Serialization mode is set to ForceText and Version Control mode to Visible Meta Files.
                        if (CheckProjectSerializationAndSourceControlModes() == true)
                        {
                            m_ProjectPath = Path.GetFullPath("replacedets/..");
                            TMP_EditorCoroutine.StartCoroutine(ScanProjectFiles());
                        }
                        else
                        {
                            EditorUtility.DisplayDialog("Project Settings Change Required", "In menu options \"Edit - Project Settings - Editor\", please change replacedet Serialization Mode to ForceText and Source Control Mode to Visible Meta Files.", "OK", string.Empty);
                        }
                    }
                    GUI.enabled = true;

                    // Display progress bar
                    Rect rect = GUILayoutUtility.GetRect(0f, 20f, GUILayout.ExpandWidth(true));
                    EditorGUI.ProgressBar(rect, m_ProgressPercentage, "Scan Progress (" + m_ScanningCurrentFileIndex + "/" + m_ScanningTotalFiles + ")");

                    // Display cancel button and name of file currently being scanned.
                    if (m_IsAlreadyScanningProject)
                    {
                        Rect cancelRect = new Rect(rect.width - 20, rect.y + 2, 20, 16);
                        if (GUI.Button(cancelRect, "X"))
                        {
                            m_CancelScanProcess = true;
                        }
                        GUILayout.Label(k_ProjectScanLabelPrefix + m_ScanningCurrentFileName, TMP_UIStyleManager.label);
                    }
                    else
                        GUILayout.Label(string.Empty);

                    GUILayout.Space(5);

                    // Creation Feedback
                    GUILayout.BeginVertical(TMP_UIStyleManager.textAreaBoxWindow, GUILayout.ExpandHeight(true));
                    {
                        m_ProjectScanResultScrollPosition = EditorGUILayout.BeginScrollView(m_ProjectScanResultScrollPosition, GUILayout.ExpandHeight(true));
                        EditorGUILayout.LabelField(m_ProjectScanResults, TMP_UIStyleManager.label);
                        EditorGUILayout.EndScrollView();
                    }
                    GUILayout.EndVertical();
                    GUILayout.Space(5f);
                }
                GUILayout.EndVertical();

                // Scan project files and resources
                GUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    GUILayout.Label("Save Modified Project Files", EditorStyles.boldLabel);
                    GUILayout.Label("Pressing the <i>Save Modified Project Files</i> button will update the files in the <i>Project Scan Results</i> listed above. <color=#FFFF80>Please make sure that you have created a backup of your project first</color> as these file modifications are permanent and cannot be undone.", TMP_UIStyleManager.label);
                    GUILayout.Space(5f);

                    GUI.enabled = m_IsAlreadyScanningProject == false && m_ModifiedreplacedetList.Count > 0 ? true : false;
                    if (GUILayout.Button("Save Modified Project Files"))
                    {
                        UpdateProjectFiles();
                    }
                    GUILayout.Space(10f);
                }
                GUILayout.EndVertical();

            }
            GUILayout.EndVertical();
            GUILayout.Space(5f);
        }

19 View Source File : TestManifest.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

public override void Render() {

			if(automationInactive) {

				GUIStyle autoInactivate = new GUIStyle(GUI.skin.label);
				autoInactivate.normal.textColor = Color.red;
				autoInactivate.wordWrap = true;
				autoInactivate.padding = new RectOffset(10, 10, 20, 0);
				EditorGUILayout.LabelField("Automation inactive. Make sure you add AutomationMaster.Initialize() to game start up.", autoInactivate);

			}

            colorIgnore = new Color32(0, 210, 225, 255);
            colorSkipped = new Color32(225, 180, 0, 255);
            colorPreplaceded = new Color32(0, 210, 0, 255);
            colorFailed = new Color32(210, 0, 0, 255);
            colorButtonTextDefault = new Color32(165, 165, 165, 255);
            paddingShow = new RectOffset(0, 0, -6, 0);
            paddingHide = new RectOffset(2, 0, -2, 0);

            GUIStyle buttonGroup = new GUIStyle();
            buttonGroup.margin = new RectOffset(8, 0, 0, 0);

            fo = new GUIStyle(EditorStyles.foldout);
            fo.padding = new RectOffset(10, 0, 0, 2);
            fo.normal.textColor = Swat.WindowDefaultTextColor;
            fo.normal.background = Swat.WindowBackgroundTexture;

            filter = new GUIStyle(GUI.skin.label);
            filter.margin = new RectOffset(14, 0, 0, 0);
            filter.normal.textColor = Swat.WindowDefaultTextColor;
            filter.normal.background = Swat.WindowBackgroundTexture;

            filterField = new GUIStyle(GUI.skin.label);
            filterField.normal.textColor = filterField.active.textColor = filterField.focused.textColor = Swat.WindowDefaultTextColor;
            filterField.normal.background = filterField.active.background = filterField.focused.background = Swat.TabButtonBackgroundTexture;

            testStatusBox = new GUIStyle(GUI.skin.box);
            testStatusBox.margin = new RectOffset(10, 10, 0, 0);
            _lastWindowWidth = Nexus.Self.position.width;

            //Flip replacedembly unlock flag if applicable.
            if(!editorPlayModeActivationHandled && EditorApplication.isPlaying && AutomationMaster.Busy) {

                editorPlayModeActivationHandled = true;
                Lockreplacedemblies = AutomationMaster.ConfigReader.GetBool("NEVER_AUTO_LOCK_RELOAD_replacedEMBLIES") ? false : AutomationMaster.Busy;

            }

            //Application has launched in Editor Play Mode. Retrieve the test results again.
            if((!_isEditorRunning && Application.isPlaying) || (_isEditorRunning && !Application.isPlaying)) {

                _isEditorRunning = !_isEditorRunning;
                AutomationReport.GetMostRecentsResults();
                _lastResultsRetrieval = DateTime.Now;

            }

            if(!Update_Data) {

                //Only perform logic-based operations every `LOGIC_UPDATE_INTERVAL_SECONDS_FOR_RETAINING_PERFORMANCE` seconds.
                Update_Data = System.Math.Abs(_lastLogicUpdate.Subtract(DateTime.UtcNow).TotalSeconds) > LOGIC_UPDATE_INTERVAL_SECONDS_FOR_RETAINING_PERFORMANCE;

            }

            //Must be after the previous conditional in the case that Update_Data has been set to true by outside logic.
            if(Update_Data) {

                _lastLogicUpdate = DateTime.UtcNow;

            }

            //Resize an open alert window if resizing this window.
            if(Nexus.Self.SwatPopups.Find(s => s.GetType() == typeof(RunTestsAlert)) != null && Nexus.Self.SwatPopups.Find(s => s.GetType() == typeof(RunTestsAlert)).Visible() && _lastWindowWidth != Nexus.Self.position.width) {

                Nexus.Self.SwatPopups.Find(s => s.GetType() == typeof(RunTestsAlert)).PositionWindow();

            }

            testStatusBox.normal.background = Swat.BoxAreaBackgroundTexture;

            GUILayout.Space(10);
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Filter: ", filter, new GUILayoutOption[] { GUILayout.Width(35) });
            _filterField = EditorGUILayout.TextField(_filterField, filterField, new GUILayoutOption[] { GUILayout.Width(240) });
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(10);

            horizontalToolbarGroup = new GUIStyle();
            horizontalToolbarGroup.margin = Nexus.BaseRectOffset;
            EditorGUILayout.BeginHorizontal(horizontalToolbarGroup);
            toolBarButtons = new GUIStyle(GUI.skin.button);

            int extraToolCount = 0;

            //Stop running Automation processes.
            if(AutomationMaster.Busy && Application.isPlaying && !_hardStop) {

                toolBarButtons.fontSize = Nexus.isPc ? 24: 30;
                toolBarButtons.normal.textColor = new Color32(250, 0, 0, 255);

                Nexus.Self.Button(STOP, "Stops running tests.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        GameObject helper = GameObject.Find(TestMonitorHelpers.NAME);
                        if(helper != null) AutomationMaster.Destroy(helper);
                        AutomationMaster.Destroy(AutomationMaster.StaticSelf);
                        AutomationMaster.Initialize();
                        AutomationMaster.StaticSelfComponent.ResetTestRunner();
                        AutoConsole.PostMessage("Automation Hard Stop!", MessageLevel.Abridged);
                        _hardStop = true;
                    }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
                extraToolCount++;

            } else {

                toolBarButtons.fontSize = 14;
                toolBarButtons.normal.textColor = Nexus.TextGreen;

                Nexus.Self.Button(RUNALL, "Launches all tests.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        Nexus.IsRunAll = true;
                        LaunchTests("all", "all");
                    }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
                extraToolCount++;

            }

            toolBarButtons.normal.textColor = Swat.WindowDefaultTextColor;
            toolBarButtons.fontSize = 22;
            if(_viewModeCategory) {

                //Collapse/Expand all foldouts.
                Nexus.Self.Button(expandCategories ? COLLAPSE : EXPAND, "Toggle expansion of all categories.",
                    new Nexus.SwatDelegate(delegate () {
                        expandCategories = !expandCategories;
                        for(int cat = 0; cat < Categories.Count; cat++) {
                            Categories[cat] = expandCategories;
                        }
                        for(int subCat = 0; subCat < _subCategoryBools.Count; subCat++) {
                            _subCategoryBools[subCat] = expandCategories;
                        }
                    }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
                extraToolCount++;

            }

            toolBarButtons.normal.textColor = Nexus.Overseer.pauseOnFailure ? Nexus.TextGreen : Color.red;
            toolBarButtons.fontSize = 16;
            toolBarButtons.fontStyle = FontStyle.Bold;
            string togglePauseOnError = Nexus.Overseer.pauseOnFailure ? "Currently ON - Editor play mode will pause when a test fails." : "Currently OFF - Test failures will not pause Unity Editor.";
            Nexus.Self.Button(PAUSE_ON_FAILURE, togglePauseOnError,
                new Nexus.SwatDelegate(delegate () {
                    Nexus.Overseer.pauseOnFailure = !Nexus.Overseer.pauseOnFailure;
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            //Soft restart. Value defaults to settings key stored in Trilleon config.
            toolBarButtons.normal.textColor = _resetOnStart ? Nexus.TextGreen : Color.red;
            toolBarButtons.fontSize = !Nexus.isPc ? 26 : 18;
            toolBarButtons.fontStyle = FontStyle.Bold;
            toolBarButtons.padding = !Nexus.isPc ? new RectOffset(0, 0, 0, 5) : new RectOffset(0, 4, 0, 0);
            string toggleReset = _resetOnStart ? "Currently ON - Account will reset when editor play mode starts." : "Currently OFF - Account will not be affected when editor play mode starts.";
            Nexus.Self.Button(SOFTRESET, toggleReset,
                new Nexus.SwatDelegate(delegate () {
                    _resetOnStart = !_resetOnStart;
                    Nexus.Overseer.softReset = _resetOnStart;
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            //Clear cached data toolbar button.
            toolBarButtons.normal.textColor = Color.black;
            toolBarButtons.fontSize = 19;
            toolBarButtons.padding = new RectOffset(0, 4, 2, 0);
            Nexus.Self.Button(CLEARCACHE, "Clears cached data, excluding test reports and last results data.",
                new Nexus.SwatDelegate(delegate () {
                    FileBroker.ClearCache();
                    TestMonitorHelpers.CreateTestObjectHelper();
                    SimpleAlert.Pop("Cache cleared.", null);
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            //Toggle Buddy Tests toolbar button.
            if(_ignoreBuddyTests) {
                toolBarButtons.normal.textColor = Color.red;
            } else {
                toolBarButtons.normal.textColor = Nexus.TextGreen;
            }
            toolBarButtons.fontSize = !Nexus.isPc ? 20 : 25;
            toolBarButtons.padding = !Nexus.isPc ? new RectOffset(0, 0, 0, 0) : new RectOffset(0, 0, 0, 5);
            Nexus.Self.Button(TOGGLEBUDDY, string.Format("Buddy tests will{0} be run.", _ignoreBuddyTests ? " NOT" : string.Empty),
                new Nexus.SwatDelegate(delegate () {
                    _ignoreBuddyTests = !_ignoreBuddyTests;
                    AutomationMaster.LockIgnoreBuddyTestsFlag = false;
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            /* TODO: Add when Unity fixes their broken replacedembly locking.
            //Toggle Buddy Tests toolbar button.
            if(Lockreplacedemblies) {
                toolBarButtons.normal.textColor = Color.red; 
            } else {
                toolBarButtons.normal.textColor = Nexus.TextGreen; 
            }
            toolBarButtons.fontSize = !Nexus.isPc ? 19 : 19;
            toolBarButtons.padding = !Nexus.isPc ? new RectOffset(0, 4, 0, 2): new RectOffset(0, 4, 0, 2);
            Nexus.Self.Button(Lockreplacedemblies ? RELOADLOCKON : RELOADLOCKOFF, string.Format("Toggle replacedembly lock, allowing/stopping automatic recompile as you make edits to tests. Currently {0}.", Lockreplacedemblies ? "Locked" : "Unlocked"), 
                new Nexus.SwatDelegate(delegate() {                
                    Lockreplacedemblies = !Lockreplacedemblies;
                    if(Lockreplacedemblies) {

                        EditorApplication.LockReloadreplacedemblies();

                    } else {

                        EditorApplication.UnlockReloadreplacedemblies();

                    }
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;
            */

            //Validate framework toolbar button.
            if(AutomationMaster.Validated_Phase1 == null && AutomationMaster.Validated_Phase2 == null) {
                toolBarButtons.normal.textColor = Swat.WindowDefaultTextColor;
            } else if(AutomationMaster.Validated_Phase1 != null && AutomationMaster.Validated_Phase2 != null && (bool)AutomationMaster.Validated_Phase1 && (bool)AutomationMaster.Validated_Phase2) {
                toolBarButtons.normal.textColor = Nexus.TextGreen;
            } else if((AutomationMaster.Validated_Phase1 != null && (bool)AutomationMaster.Validated_Phase1) || (AutomationMaster.Validated_Phase2 != null && (bool)AutomationMaster.Validated_Phase2)) {
                toolBarButtons.normal.textColor = Color.yellow;
            } else {
                toolBarButtons.normal.textColor = Color.red;
            }
            toolBarButtons.fontSize = !Nexus.isPc ? 24 : 20; ;
            toolBarButtons.padding = !Nexus.isPc ? new RectOffset(0, 2, 0, 2) : new RectOffset(0, 4, 0, 0);
            Nexus.Self.Button(VALIDATE, "Validates Framework integrity at this moment using compiled code",
                new Nexus.SwatDelegate(delegate () {
                    Nexus.IsRunAll = false;
                    Nexus.Self.SelectTab(Nexus.Self.Console); //Auto select console tab to display validation progress.
                    AutoConsole.SaveConsoleMessagesForAppPlay();
                    LaunchTests("Trilleon/Validation", "clreplaced");
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            toolBarButtons.fontSize = 18;
            toolBarButtons.normal.textColor = Color.black;
            Nexus.Self.Button(FAVORITE, "Show Favorites test run options.",
                new Nexus.SwatDelegate(delegate () {
                    Nexus.Self.SelectTab(Nexus.Self.Favorites);
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            toolBarButtons.fontSize = 18;
            toolBarButtons.padding = new RectOffset(1, 0, 0, 0);
            Nexus.Self.Button(AutomationMaster.UnitTestMode ? INTEGRATION_TEST_VIEW : UNIT_TEST_VIEW, "Toggle between viewing integration tests and unit tests.",
                new Nexus.SwatDelegate(delegate () {
                    AutomationMaster.UnitTestMode = !AutomationMaster.UnitTestMode;
                    _reget = Update_Data = true;
                    Nexus.Self.Favorites.FavoritesList = new List<KeyValuePair<string, List<KeyValuePair<bool, string>>>>();
                    Nexus.Self.Favorites.Set();
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            toolBarButtons.fontSize = 20;
            toolBarButtons.normal.textColor = Swat.ToggleButtonTextColor;
            toolBarButtons.normal.background = Swat.ToggleButtonBackgroundTexture;
            toolBarButtons.padding = new RectOffset(0, 0, -1, 0);
            Nexus.Self.Button(VIEW_MODE, "Toggle between viewing tests in flat list or organized under category names.",
                new Nexus.SwatDelegate(delegate () {
                    _viewModeCategory = !_viewModeCategory;
                }), toolBarButtons, new GUILayoutOption[] { GUILayout.Width(25), GUILayout.Height(25) });
            extraToolCount++;

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            if(!string.IsNullOrEmpty(selectedTest)) {

                GUILayout.BeginVertical(testStatusBox, new GUILayoutOption[] { GUILayout.MaxWidth(extraToolCount * 25) }); //Begin box border around test details.

                //Close this box/view.
                closeBox = new GUIStyle(GUI.skin.button);
                closeBox.fontSize = 14;
                closeBox.padding = new RectOffset(1, 0, 0, 0);
                closeBox.margin = new RectOffset(260, 0, 0, 0);
                closeBox.normal.textColor = Color.red;
                closeBox.normal.background = Swat.BoxAreaBackgroundTexture;

                Nexus.Self.Button("X", "Show/Hide test status details section.",
                    new Nexus.SwatDelegate(delegate () {
                        selectedTest = string.Empty;
                        lastSelectedTest = string.Empty;
                        hideBoxArea = !hideBoxArea;
                    }), closeBox, new GUILayoutOption[] { GUILayout.Width(20), GUILayout.Height(20) });

                if(selectedTest != lastSelectedTest || !_selectedMethodAttributes.Any() || _selectedMethodAttributes.Count != _selectedTestCategories.Count) {

                    SelectedMethodsGetData();
                    _selectedTestCategories = new List<bool>();
                    for(int c = 0; c < _selectedMethodAttributes.Count; c++) {
                        _selectedTestCategories.Add(true);
                    }

                }

                GUIStyle boxLabelMargin = new GUIStyle(GUI.skin.label);
                GUIStyle boxFoMargin = new GUIStyle(EditorStyles.foldout);
                boxFoMargin.margin = new RectOffset(10, 0, 2, 2);

                for(int s = 0; s < _selectedMethodAttributes.Count; s++) {

                    boxLabelMargin.padding = new RectOffset(10, 0, 2, 2);
                    int isInt = 0;
                    if(int.TryParse(_selectedMethodAttributes[s].Value, out isInt)) {

                        EditorGUILayout.LabelField(string.Format("{0}: {1}", _selectedMethodAttributes[s].Key, isInt), boxLabelMargin);
                        continue;

                    }

                    _selectedTestCategories[s] = Nexus.Self.Foldout(_selectedTestCategories[s], new GUIContent(_selectedMethodAttributes[s].Key), true, boxFoMargin);
                    if(_selectedTestCategories[s]) {

                        boxLabelMargin.padding = new RectOffset(25, 0, 0, 0);
                        string[] vals = _selectedMethodAttributes[s].Value.Split(',');
                        for(int attrs = 0; attrs < vals.Length; attrs++) {

                            EditorGUILayout.LabelField(vals[attrs], boxLabelMargin);

                        }

                    }

                }

                closeBox.normal.textColor = Swat.TextGreen;
                Nexus.Self.Button(RUNALL, "Run this individual test.",
                    new Nexus.SwatDelegate(delegate () {
                        LaunchTestDependenciesCheck(selectedTest, "test");
                    }), closeBox, new GUILayoutOption[] { GUILayout.Width(20), GUILayout.Height(20) });

                GUILayout.EndVertical(); //End box border around test details.
            }

            if(!hideBoxArea) {

                GUILayout.BeginVertical(testStatusBox, new GUILayoutOption[] { GUILayout.MaxWidth(extraToolCount * 25) }); //Begin box border around test status data.
                EditorGUILayout.Space();

                EditorGUI.indentLevel++;

                b = new GUIStyle(GUI.skin.label);
                h = new GUIStyle(GUI.skin.label);
                h.fixedWidth = 50;
                h.fixedHeight = 20;
                Color32 toggleOffColor;
                Color32 toggleOnColor = toggleOffColor = new Color32(150, 150, 150, 255);
                int defaultFontSize = 12;
                b.fontSize = defaultFontSize;
                b.fontStyle = FontStyle.Bold;
                b.margin = Nexus.BaseRectOffset;

                EditorGUILayout.Space();
                EditorGUILayout.BeginHorizontal();
                int preplacedCount = AutomationReport.testsMeta.FindAll(x => {
                    return x.Value.ToList().FindAll(y => y.Split(':')[0].ToLower() == "status" && y.Split(':')[1].ToLower() == "preplaceded").Any();
                }).Count;
                b.normal.textColor = Nexus.TextGreen;
                b.padding = new RectOffset(-1, 0, 0, 0);
                EditorGUILayout.LabelField("Preplaceded: ", b, new GUILayoutOption[] { GUILayout.Width(75) });
                b.padding = new RectOffset(0, 0, 0, 0);
                b.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField(preplacedCount.ToString(), b, new GUILayoutOption[] { GUILayout.Width(40) });
                b.normal.textColor = Nexus.TextGreen;
                b.fontSize = 14;
                if(GUILayout.Button(PreplacedED, b, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    LaunchTestDependenciesCheck("Preplaceded", "status");
                }
                h.padding = showPreplaceded ? paddingShow : paddingHide;
                h.normal.textColor = showPreplaceded ? toggleOnColor : toggleOffColor;
                h.fontSize = showPreplaceded ? defaultFontSize + 15 : defaultFontSize + 8;
                if(GUILayout.Button(showPreplaceded ? Nexus.TOGGLE_ON : Nexus.TOGGLE_OFF, h, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    showPreplaceded = !showPreplaceded;
                }
                if(Nexus.Self.MouseOver()) {
                    Nexus.Self.SetToolTip("Toggle visibility of tests that preplaceded in their last run.");
                }
                b.fontSize = defaultFontSize;
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();
                EditorGUILayout.BeginHorizontal();
                int failCount = AutomationReport.testsMeta.FindAll(x => {
                    return x.Value.ToList().FindAll(y => y.Split(':')[0].ToLower() == "status" && y.Split(':')[1].ToLower() == "failed").Any();
                }).Count;
                b.normal.textColor = colorFailed;
                EditorGUILayout.LabelField("Failed: ", b, new GUILayoutOption[] { GUILayout.Width(75) });
                b.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField(failCount.ToString(), b, new GUILayoutOption[] { GUILayout.Width(40) });
                b.normal.textColor = colorFailed;
                b.fontSize = 15;
                if(GUILayout.Button(FAILED, b, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    LaunchTestDependenciesCheck("Failed", "status");
                }
                h.padding = showFailed ? paddingShow : paddingHide;
                h.normal.textColor = showFailed ? toggleOnColor : toggleOffColor;
                h.fontSize = showFailed ? defaultFontSize + 15 : defaultFontSize + 8;
                if(GUILayout.Button(showFailed ? Nexus.TOGGLE_ON : Nexus.TOGGLE_OFF, h, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    showFailed = !showFailed;
                }
                if(Nexus.Self.MouseOver()) {
                    Nexus.Self.SetToolTip("Toggle visibility of tests that failed in their last run.");
                }
                b.fontSize = defaultFontSize;
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                int skipCount = AutomationReport.testsMeta.FindAll(x => {
                    return x.Value.ToList().FindAll(y => y.Split(':')[0].ToLower() == "status" && y.Split(':')[1].ToLower() == "skipped").Any();
                }).Count;
                b.normal.textColor = colorSkipped;
                EditorGUILayout.LabelField("Skipped: ", b, new GUILayoutOption[] { GUILayout.Width(75) });
                b.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField(skipCount.ToString(), b, new GUILayoutOption[] { GUILayout.Width(40) });
                b.normal.textColor = colorSkipped;
                b.fontSize = 15;
                if(GUILayout.Button(SKIPPED, b, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    LaunchTestDependenciesCheck("Skipped", "status");
                }
                h.padding = showSkipped ? paddingShow : paddingHide;
                h.normal.textColor = showSkipped ? toggleOnColor : toggleOffColor;
                h.fontSize = showSkipped ? defaultFontSize + 15 : defaultFontSize + 8;
                if(GUILayout.Button(showSkipped ? Nexus.TOGGLE_ON : Nexus.TOGGLE_OFF, h, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    showSkipped = !showSkipped;
                }
                if(Nexus.Self.MouseOver()) {
                    Nexus.Self.SetToolTip("Toggle visibility of tests that were skipped in their last run.");
                }
                b.fontSize = defaultFontSize;
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                int ignoreCount = AutomationReport.testsMeta.FindAll(x => {
                    return x.Value.ToList().FindAll(y => y.Split(':')[0].ToLower() == "status" && y.Split(':')[1].ToLower() == "ignored").Any();
                }).Count;
                b.normal.textColor = colorIgnore;
                EditorGUILayout.LabelField("Ignored: ", b, new GUILayoutOption[] { GUILayout.Width(75) });
                b.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField(ignoreCount.ToString(), b, new GUILayoutOption[] { GUILayout.Width(40) });
                b.padding = new RectOffset(0, 0, 4, 0);
                b.normal.textColor = colorIgnore;
                b.fontSize = 10;
                b.fontStyle = FontStyle.Bold;
                if(GUILayout.Button(IGNORED, b, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    LaunchTestDependenciesCheck("Ignored", "status");
                }
                h.padding = showIgnored ? paddingShow : paddingHide;
                h.normal.textColor = showIgnored ? toggleOnColor : toggleOffColor;
                h.fontSize = showIgnored ? defaultFontSize + 15 : defaultFontSize + 8;
                if(GUILayout.Button(showIgnored ? Nexus.TOGGLE_ON : Nexus.TOGGLE_OFF, h, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    showIgnored = !showIgnored;
                }
                if(Nexus.Self.MouseOver()) {
                    Nexus.Self.SetToolTip("Toggle visibility of tests that were ignored in their last run.");
                }
                b.fontSize = defaultFontSize;
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                int noDataCount = AutomationReport.testsMeta.Count - (preplacedCount + failCount + ignoreCount + skipCount);
                b.normal.textColor = Color.grey;
                EditorGUILayout.LabelField("No Data: ", b, new GUILayoutOption[] { GUILayout.Width(75) });
                b.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField(noDataCount.ToString(), b, new GUILayoutOption[] { GUILayout.Width(40) });
                b.normal.textColor = Color.grey;
                b.padding = new RectOffset(0, 0, 2, 0);
                b.fontSize = 18;
                if(GUILayout.Button(NODATA, b, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    LaunchTestDependenciesCheck("NoData", "status");
                }
                h.padding = showNoData ? new RectOffset(0, 0, -4, 0) : new RectOffset(2, 0, 0, 0);
                h.normal.textColor = showNoData ? toggleOnColor : toggleOffColor;
                h.fontSize = showNoData ? defaultFontSize + 15 : defaultFontSize + 8;
                if(GUILayout.Button(showNoData ? Nexus.TOGGLE_ON : Nexus.TOGGLE_OFF, h, new GUILayoutOption[] { GUILayout.Width(40) })) {
                    showNoData = !showNoData;
                }
                if(Nexus.Self.MouseOver()) {
                    Nexus.Self.SetToolTip("Toggle visibility of tests that lack previous run data.");
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();
                EditorGUILayout.Space();

                EditorGUI.indentLevel--;

                GUILayout.EndVertical(); //End box border around test status data and launch buttons.

            }

            if(_viewModeCategory) {

                if(Update_Data) {

                    GetTestMethods();
                    List<string> methodsToNamesList = new List<string>();
                    for(int m = 0; m < _methods.Count; m++) {

                        methodsToNamesList.Add(_methods[m].Name);

                    }
                    if(_allMethodsLast.GetUniqueObjectsBetween(methodsToNamesList).Any()) {

                        _reget = true;

                    }

                }

                if(_reget) {

                    _reget = false;
		            _firstPreplaced = true;
                    GetTestMethods();
                    _allMethodsLast = _allMethods;
                    SetTestData();
                    int lastCategoryCount = _categoryTests.Count;
                    _categoryTests = new List<KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>>();

                    for(int i = 0; i < _allMethodsLast.Count; i++) {

                        MethodInfo methodInfo = _all.Find(x => x.Value.Name == _allMethodsLast[i]).Value;
                        if(AutomationMaster.UnitTestMode) {

                            UnityTest[] ut = (UnityTest[])Attribute.GetCustomAttributes(methodInfo, typeof(UnityTest));
                            for(int u = 0; u < ut.Length; u++) {

                                //Don not consider reserverved categories.
                                if(AutomationMaster.ConfigReader.GetStringList("RESERVED_CATEGORY_NAMES").Any() && AutomationMaster.ConfigReader.GetStringList("RESERVED_CATEGORY_NAMES").FindAll(x => ut[u].CategoryName.StartsWith(x)).Any()) {

                                    continue;

                                }
                                string[] subCategory = ut[u].CategoryName.Split('/');

                                List<KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>> thisVal = _categoryTests.FindAll(x => x.Key == subCategory[0]);
                                List<KeyValuePair<string, List<KeyValuePair<string, string>>>> existingSubset = thisVal.Any() ? thisVal.First().Value.FindAll(x => x.Key == subCategory[subCategory.Length == 1 ? 0 : 1]) : new List<KeyValuePair<string, List<KeyValuePair<string, string>>>>();

                                List<KeyValuePair<string, string>> methods = existingSubset.Any() ? existingSubset.First().Value : new List<KeyValuePair<string, string>>();
                                methods.Add(new KeyValuePair<string, string>(_allMethodsLast[i], string.Empty));
                                methods = methods.OrderByKeys();

                                List<KeyValuePair<string, List<KeyValuePair<string, string>>>> subset = new List<KeyValuePair<string, List<KeyValuePair<string, string>>>>();
                                subset.Add(new KeyValuePair<string, List<KeyValuePair<string, string>>>(subCategory[subCategory.Length == 1 ? 0 : 1], GetMethodStatuses(methods)));

                                if(thisVal.Any()) {

                                    List<KeyValuePair<string, List<KeyValuePair<string, string>>>> otherSubCategoryGroupingsSansStatuses = _categoryTests.FindAll(x => x.Key == subCategory[0]).First().Value.FindAll(y => y.Key != subCategory[subCategory.Length == 1 ? 0 : 1]);
                                    if(otherSubCategoryGroupingsSansStatuses.Any()) {

                                        for(int s = 0; s < otherSubCategoryGroupingsSansStatuses.Count; s++) {

                                            List<KeyValuePair<string, string>> SubCategoryTests = GetMethodStatuses(otherSubCategoryGroupingsSansStatuses[s].Value).OrderByKeys();
                                            subset.Add(new KeyValuePair<string, List<KeyValuePair<string, string>>>(otherSubCategoryGroupingsSansStatuses[s].Key, SubCategoryTests));

                                        }

                                    }

                                }
                                subset = subset.OrderByKeys();

                                //Add to _categoryTests, which is used to build the foldouts. The sub cats should not appear as a top level foldout, so we only add the sub category to _categorySubcategoryTests, which is used to build the dropdown for category test launches (the only place where a sub category is treated the same as a top level category).
                                KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>> thisEntry = new KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>(subCategory[0], subset);
                                _categoryTests = _categoryTests.FindAll(x => x.Key != subCategory[0]); //Remove the original entry.
                                _categorySubcategoryTests = _categorySubcategoryTests.FindAll(x => x.Key != subCategory[0]); //Remove the original entry.
                                _categoryTests.Add(thisEntry); //Add new or updated entry.
                                _categorySubcategoryTests.Add(thisEntry); //Add new or updated entry.
                                if(subCategory.Length > 1) {

                                    _categorySubcategoryTests = _categorySubcategoryTests.FindAll(x => x.Key != subCategory[1]); //Remove any existing entry for this sub category.
                                    _categorySubcategoryTests.Add(new KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>(subCategory[1], subset)); //Add new or updated entry.

                                }

                            }

                        } else {

                            Automation[] aut = (Automation[])Attribute.GetCustomAttributes(methodInfo, typeof(Automation));
                            for(int a = 0; a < aut.Length; a++) {

                                //Don not consider reserverved categories.
                                if(AutomationMaster.ConfigReader.GetStringList("RESERVED_CATEGORY_NAMES").Any() && AutomationMaster.ConfigReader.GetStringList("RESERVED_CATEGORY_NAMES").FindAll(x => aut[a].CategoryName.StartsWith(x)).Any()) {

                                    continue;

                                }
                                string[] subCategory = aut[a].CategoryName.Split('/');

                                List<KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>> thisVal = _categoryTests.FindAll(x => x.Key == subCategory[0]);
                                List<KeyValuePair<string, List<KeyValuePair<string, string>>>> existingSubset = thisVal.Any() ? thisVal.First().Value.FindAll(x => x.Key == subCategory[subCategory.Length == 1 ? 0 : 1]) : new List<KeyValuePair<string, List<KeyValuePair<string, string>>>>();

                                List<KeyValuePair<string, string>> methods = existingSubset.Any() ? existingSubset.First().Value : new List<KeyValuePair<string, string>>();
                                methods.Add(new KeyValuePair<string, string>(_allMethodsLast[i], string.Empty));
                                methods = methods.OrderByKeys();

                                List<KeyValuePair<string, List<KeyValuePair<string, string>>>> subset = new List<KeyValuePair<string, List<KeyValuePair<string, string>>>>();
                                subset.Add(new KeyValuePair<string, List<KeyValuePair<string, string>>>(subCategory[subCategory.Length == 1 ? 0 : 1], GetMethodStatuses(methods)));

                                if(thisVal.Any()) {

                                    List<KeyValuePair<string, List<KeyValuePair<string, string>>>> otherSubCategoryGroupingsSansStatuses = _categoryTests.FindAll(x => x.Key == subCategory[0]).First().Value.FindAll(y => y.Key != subCategory[subCategory.Length == 1 ? 0 : 1]);
                                    if(otherSubCategoryGroupingsSansStatuses.Any()) {

                                        for(int s = 0; s < otherSubCategoryGroupingsSansStatuses.Count; s++) {

                                            List<KeyValuePair<string, string>> SubCategoryTests = GetMethodStatuses(otherSubCategoryGroupingsSansStatuses[s].Value).OrderByKeys();
                                            subset.Add(new KeyValuePair<string, List<KeyValuePair<string, string>>>(otherSubCategoryGroupingsSansStatuses[s].Key, SubCategoryTests));

                                        }

                                    }

                                }
                                subset = subset.OrderByKeys();

                                //Add to _categoryTests, which is used to build the foldouts. The sub cats should not appear as a top level foldout, so we only add the sub category to _categorySubcategoryTests, which is used to build the dropdown for category test launches (the only place where a sub category is treated the same as a top level category).
                                KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>> thisEntry = new KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>(subCategory[0], subset);
                                _categoryTests = _categoryTests.FindAll(x => x.Key != subCategory[0]); //Remove the original entry.
                                _categorySubcategoryTests = _categorySubcategoryTests.FindAll(x => x.Key != subCategory[0]); //Remove the original entry.
                                _categoryTests.Add(thisEntry); //Add new or updated entry.
                                _categorySubcategoryTests.Add(thisEntry); //Add new or updated entry.
                                if(subCategory.Length > 1) {

                                    _categorySubcategoryTests = _categorySubcategoryTests.FindAll(x => x.Key != subCategory[1]); //Remove any existing entry for this sub category.
                                    _categorySubcategoryTests.Add(new KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>(subCategory[1], subset)); //Add new or updated entry.

                                }

                            }

                        }

                    }

                    //Sort all by cateogry name alphabetically.
                    _categoryTests = _categoryTests.OrderByKeys();

                    if((Categories.Count != lastCategoryCount && lastCategoryCount != 0) || _firstPreplaced) {

                        Categories = new List<bool>();

                        for(int x = 0; x < _categoryTests.Count; x++) {

                            Categories.Add(false);

                        }

                    }

                    _firstPreplaced = false;

                }

                if(_categoryTests.Last().Key.ToLower() != "debug" || _categoryTests.Last().Key.ToLower() != "<debug>") {

                    //Pull out Debug test category, and then re-append it to the end of the list. It should always appear last.
                    KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>> debugCategory = _categoryTests.Find(d => d.Key.ToLower() == "debug" || d.Key.ToLower() == "<debug>");
                    _categoryTests.Remove(debugCategory);
                    _categoryTests.Add(new KeyValuePair<string, List<KeyValuePair<string, List<KeyValuePair<string, string>>>>>("<Debug>", debugCategory.Value));

                }

                EditorGUILayout.Space();

                GUIStyle launchCatLabel = new GUIStyle(GUI.skin.label);
                launchCatLabel.padding = new RectOffset(10, 0, 0, 0);
                launchCatLabel.normal.textColor = Swat.WindowDefaultTextColor;
                EditorGUILayout.LabelField("Launch Category: ", launchCatLabel);

                if(Update_Data) {

                    catKeys = new List<string>();
                    for(int c = 0; c < _categoryTests.Count; c++) {

                        //See if top-level category has any test replacedigned directly to it, along with sub categories. If this is the case...
                        //... add an option to launch ALL tests recursively under the parent category, or to ignore sub category tests.
                        if(_categoryTests[c].Value.FindAll(x => x.Key == _categoryTests[c].Key).Any() && _categoryTests[c].Value.Count > 1) {

                            catKeys.Add(string.Format("{0} (All)", _categoryTests[c].Key));
                            catKeys.Add(string.Format("{0} (Top)", _categoryTests[c].Key));

                        } else {

                            catKeys.Add(_categoryTests[c].Key);

                        }

                        for(int sc = 0; sc < _categoryTests[c].Value.Count; sc++) {

                            if(_categoryTests[c].Value[sc].Key != _categoryTests[c].Key) {

                                catKeys.Add(string.Format("{0} ({1})", _categoryTests[c].Key, _categoryTests[c].Value[sc].Key));

                            }

                        }

                    }
                    //Prepend Favorites to category list.
                    if(Nexus.Self.Favorites.FavoritesList.Count == 0) {

                        Nexus.Self.Favorites.Set();

                    }
                    List<string> favorites = Nexus.Self.Favorites.FavoritesList.ExtractListOfKeysFromKeyValList();
                    if(favorites.Any()) {

                        for(int f = 0; f < favorites.Count; f++) {

                            favorites[f] = string.Format("*{0}", favorites[f]);

                        }

                        favorites.Sort();
                        catKeys = catKeys.PrependRange(favorites);

                    }

                }
                _selectedCategory = Nexus.Self.DropDown(_selectedCategory, catKeys.ToArray(), 12);
                GUILayout.Space(2);
                EditorGUILayout.BeginHorizontal(buttonGroup);

                Nexus.Self.Button("Go", "Launches category tests.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        if(!AutomationMaster.Busy) {

                            if(catKeys[_selectedCategory].StartsWith("*")) {

                                //This is a Favorite list, and not a true Category. Gather requested tests/clreplacedes.
                                List<KeyValuePair<bool, string>> favoriteList = Nexus.Self.Favorites.FavoritesList.Find(x => x.Key == catKeys[_selectedCategory].Replace("*", string.Empty)).Value;
                                string commandClreplacedes = string.Empty;
                                string commandTests = string.Empty;
                                for(int x = 0; x < favoriteList.Count; x++) {

                                    //Is the next item in the list a test? If so, this category is only meant to define the tests that follow, so ignore it.
                                    if(favoriteList[x].Key && x + 1 < favoriteList.Count ? !favoriteList[x + 1].Key : false) {

                                        continue;

                                    }

                                    if(favoriteList[x].Key) {

                                        //All Tests In This Clreplaced
                                        string category = string.Empty;
                                        if(favoriteList[x].Value.Contains("(")) {
                                            category = favoriteList[x].Value.Replace("*", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty).Split('(')[1].Trim(')');
                                        } else {
                                            category = favoriteList[x].Value.Replace("*", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty);
                                        }
                                        commandClreplacedes += string.Format("{0},", category);

                                    } else {

                                        //Just This Test
                                        commandTests += string.Format("{0},", favoriteList[x].Value);

                                    }

                                }
                                string command = string.Format("&&{0}%{1}", commandClreplacedes.Trim(','), commandTests.Trim(',')); ;
                                Nexus.Self.Tests.LaunchTests(command, "mix");

                            } else {

                                string categoryParsed = catKeys[_selectedCategory].Replace("<", string.Empty).Replace(">", string.Empty);
                                if(categoryParsed.Contains("(All)")) {
                                    categoryParsed = categoryParsed.Split('(')[0].Trim();
                                } else if(categoryParsed.Contains("(Top)")) {
                                    categoryParsed = string.Format("{0}^", categoryParsed.Split('(')[0].Trim());
                                } else if(categoryParsed.Contains("(")) {
                                    categoryParsed = categoryParsed.Split('(')[1].Trim(')');
                                }
                                LaunchTestDependenciesCheck(categoryParsed, "category");

                            }

                        } else {

                            if(Application.isPlaying) {

                                SimpleAlert.Pop("The test runner is currently active. Stop test execution, or wait for it to complete, before launching new test runs.", null);

                            }

                        }
                    }), null, new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(25) });

                GUILayout.Space(-2f);

                Nexus.Self.Button("Subset", "Launches selected subset of category tests.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        if(!AutomationMaster.Busy) {
                            AutomationMaster.LaunchType = LaunchType.CategoryName;
                            string categoryParsed = catKeys[_selectedCategory].Replace("<", string.Empty).Replace(">", string.Empty);
                            if(categoryParsed.Contains("(")) {
                                categoryParsed = categoryParsed.Split('(')[1].Trim(')');
                            }
                            if(categoryParsed.ToLower() == "all") {
                                categoryParsed = catKeys[_selectedCategory].Split('(').First().Trim();
                            }
                            RunTestsAlert.Pop(Nexus.AutoMaster.GetAllMethodsToRun(GetLaunchCommand(categoryParsed, "category")), null, catKeys[_selectedCategory].Replace("<", string.Empty).Replace(">", string.Empty), "category");
                        } else {
                            if(Application.isPlaying) {
                                SimpleAlert.Pop("The test runner is currently active. Stop test execution, or wait for it to complete, before launching new test runs.", null);
                            }
                        }
                    }), null, new GUILayoutOption[] { GUILayout.Width(70), GUILayout.Height(25) });

                GUILayout.Space(-2);

                Nexus.Self.Button("Multiple", "Choose multiple categories to launch. Selected categories launch ALL children.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        if(!AutomationMaster.Busy) {
                            AutomationMaster.LaunchType = LaunchType.CategoryName;
                            RunClreplacedesAlert.Pop(catKeys);
                        } else {
                            if(Application.isPlaying) {
                                SimpleAlert.Pop("The test runner is currently active. Stop test execution, or wait for it to complete, before launching new test runs.", null);
                            }
                        }
                    }), null, new GUILayoutOption[] { GUILayout.Width(70), GUILayout.Height(25) });

                EditorGUILayout.EndHorizontal();
                GUILayout.Space(5);

                if(Update_Data) {

                    if(_categoryTests.Any()) {

                        _categoryTests = _categoryTests.OrderByKeys();

                    }

                }

                for(int z = 0; z < Categories.Count; z++) {

                    //Ignore rendering of empty categories
                    if(_categoryTests.Count <= z) {

                        continue;

                    }

                    EditorGUILayout.Space();
                    fo.fontSize = 12;
                    fo.normal.textColor = Swat.WindowDefaultTextColor;
                    fo.margin = new RectOffset(10, 0, 5, 0);

                    //Skip this category's rendering if no test methods contained in it match the filter field string.
                    List<string> allTestsInSingleCat = new List<string>();
                    for(int ca = 0; ca < _categoryTests[z].Value.Count; ca++) {

                        allTestsInSingleCat.AddRange(_categoryTests[z].Value[ca].Value.ExtractListOfKeysFromKeyValList());

                    }

                    if(!string.IsNullOrEmpty(_filterField)) {

                        if(!allTestsInSingleCat.FindAll(x => x.ToLower().Contains(_filterField.ToLower())).Any()) {

                            continue;

                        }

                    }

                    //Skip this category's rendering if no test methods contained in it have a status that has visibility toggled on.
                    List<string> showStatuses = new List<string>();
                    if(showIgnored) {

                        showStatuses.Add(ignored);

                    }
                    if(showPreplaceded) {

                        showStatuses.Add(preplaceded);

                    }
                    if(showSkipped) {

                        showStatuses.Add(skipped);

                    }
                    if(showFailed) {

                        showStatuses.Add(failed);

                    }
                    if(showNoData) {

                        showStatuses.Add(noData);

                    }

                    //TODO: Fix this logic!
                    /*
                    //Skip this category's rendering if no test methods contained in it have a status that has visibility toggled on.
                    if(AutomationReport.testsMeta.Any()) {

                        //If any of these tests are not included in AutomationReport.testsMeta, then they are No Data tests that should be displayed. 
                        if(_categoryTests[z].Value[a].Value.FindAll(x => AutomationReport.testsMeta.FindAll(y => y.Key == x.Key).Count <= _categoryTests[z].Value[a].Value.Count).Any()) {

                            continue;

                        }

                    }
                    */

                    Categories[z] = Nexus.Self.Foldout(Categories[z], string.Format("  {0}", _categoryTests[z].Key), true, fo);

                    EditorGUI.indentLevel++;

                    if(Categories[z]) {

                        if(!AutomationReport.testsMeta.Any() && DateTime.Now.Subtract(_lastResultsRetrieval).TotalSeconds > _redrawRateSeconds) {

                            AutomationReport.GetMostRecentsResults();
                            _lastResultsRetrieval = DateTime.Now;

                        }

                        for(int a = 0; a < _categoryTests[z].Value.Count; a++) {

                            string SubcatName = _categoryTests[z].Key.Replace("<", string.Empty).Replace(">", string.Empty); //Remove debug and system indicator chars from name for string comparison purposes.
                                                                                                                             //Is a sub-category.
                            if(SubcatName != _categoryTests[z].Value[a].Key) {

                                if(!string.IsNullOrEmpty(_filterField)) {

                                    //Skip this category's rendering if no test methods contained in it match the filter field string.
                                    if(!_categoryTests[z].Value[a].Value.ExtractListOfKeysFromKeyValList().FindAll(x => x.ToLower().Contains(_filterField.ToLower())).Any()) {

                                        continue;

                                    }

                                }

                                int index = 0;
                                if(!_subCategoryNames.Contains(_categoryTests[z].Value[a].Key)) {

                                    _subCategoryNames.Add(_categoryTests[z].Value[a].Key);
                                    _subCategoryBools.Add(false);
                                    index = _subCategoryNames.Count - 1;

                                } else {

                                    index = _subCategoryNames.FindIndex(x => x == _categoryTests[z].Value[a].Key);

                                }

                                _subCategoryBools[index] = Nexus.Self.Foldout(_subCategoryBools[index], string.Format("  ↳ {0}", _categoryTests[z].Value[a].Key), true, fo);
                                if(_subCategoryBools[index]) {

                                    for(int m = 0; m < _categoryTests[z].Value[a].Value.Count; m++) {

                                        RenderTest(_categoryTests[z].Value[a].Value[m].Key, fo, Swat.WindowDefaultTextColor, true);

                                    }

                                }

                            } else {

                                for(int m = 0; m < _categoryTests[z].Value[a].Value.Count; m++) {
                                    RenderTest(_categoryTests[z].Value[a].Value[m].Key, fo, Swat.WindowDefaultTextColor, false);
                                }

                            }

                        }

                        EditorGUILayout.Space();

                    }

                    EditorGUI.indentLevel--;

                }

            } else {

                GUILayout.Space(15);
                fo.fontSize = 12;
                if(!_allMethods.Any() || _reget) {

                    GetTestMethods();
                    SetTestData();

                }
                _allMethods.Sort();

                EditorGUILayout.BeginHorizontal(buttonGroup);

                Nexus.Self.Button("Multiple", "Launches selected subset of tests.",
                    new Nexus.SwatDelegate(delegate () {
                        loopModeActive = false;
                        if(!AutomationMaster.Busy) {
                            if(AutomationMaster.AllMethodsInFramework.Count == 0) {
                                AutomationMaster.SetAllMethodsInFramework();
                            }
                            //Filter debug tests from the list provided here.
                            List<KeyValuePair<string, MethodInfo>> allMethods = AutomationMaster.AllMethodsInFramework.FindAll(x => {
                                if(AutomationMaster.UnitTestMode) {
                                    List<Automation> auts = ((Automation[])x.Value.GetCustomAttributes(typeof(Automation), false)).ToList();
                                    return !auts.FindAll(a => a.CategoryName.ToLower().StartsWith("debug")).Any();
                                } else {
                                    List<UnityTest> uts = ((UnityTest[])x.Value.GetCustomAttributes(typeof(UnityTest), false)).ToList();
                                    return !uts.FindAll(u => u.CategoryName.ToLower().StartsWith("debug")).Any();
                                }
                            });
                            RunTestsAlert.Pop(allMethods, null, "all", "Multiple Tests", isTestSubset: true);
                        } else {
                            if(Application.isPlaying) {
                                SimpleAlert.Pop("The test runner is currently active. Stop test execution, or wait for it to complete, before launching new test runs.", null);
                            }
                        }
                    }), null, new GUILayoutOption[] { GUILayout.Width(70), GUILayout.Height(25) });

                Nexus.Self.Button("Loop", "Loops selected test the requested number of times.",
                    new Nexus.SwatDelegate(delegate () {
                        if(!AutomationMaster.Busy) {
                            loopModeActive = !loopModeActive;
                        } else {
                            if(Application.isPlaying) {
                                SimpleAlert.Pop("The test runner is currently active. Stop test execution, or wait for it to complete, before launching new test runs.", null);
                            }
                        }
                    }), null, new GUILayoutOption[] { GUILayout.Width(70), GUILayout.Height(25) });
                EditorGUILayout.EndHorizontal();

                if(loopModeActive) {

                    GUIStyle loopArea = new GUIStyle();
                    loopArea.fixedWidth = 50;
                    loopArea.margin = new RectOffset(10, 0, 5, 0);
                    EditorGUILayout.BeginHorizontal(loopArea);
                    EditorGUILayout.LabelField("Loop Times", new GUILayoutOption[] { GUILayout.MaxWidth(60) });
                    GUIStyle loopCountField = new GUIStyle(GUI.skin.textField);
                    loopCountField.fixedWidth = 20;
                    loopCounter = EditorGUILayout.IntField(loopCounter, loopCountField);
                    GUIStyle notice = new GUIStyle(GUI.skin.label);
                    notice.normal.textColor = Color.magenta;
                    notice.margin = new RectOffset(-5, 0, 0, 0);
                    GUILayout.Space(-30);
                    EditorGUILayout.LabelField("Select test to loop.", notice);
                    EditorGUILayout.EndHorizontal();

                }
                GUILayout.Space(15);

                //If test view.
                for(int t = 0; t < _allMethods.Count; t++) {

                    RenderTest(_allMethods[t], fo, Swat.WindowDefaultTextColor, false, true);

                }

            }

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            Update_Data = false; //Reset;

            if(AutomationMaster.Busy && Application.isPlaying && !_hardStop) {

                GUIStyle load = new GUIStyle(GUI.skin.box);
                load.normal.background = Swat.MakeTextureFromColor((Color)new Color32(75, 75, 75, 255));
                load.normal.textColor = Color.white;
                load.fontSize = 24;
                load.alignment = TextAnchor.MiddleLeft;

                //This button is the height of the window. Subtract the height of the (3) characters "<". 
                //Then, divide by how many new-line paddings are needed (4) between each character and the top/bottom of the window.
                int newLineCountPieces = Convert.ToInt32(Math.Round(((Nexus.Self.position.height - load.fontSize * 3) / 4) / load.fontSize, 0));
                string newLinePadding = ("\n").Duplicate(newLineCountPieces);
                string buttonText = string.Format("{0}<{0}<{0}<{0}", newLinePadding);
                //, new GUILayoutOption[] { GUILayout.Width(35), GUILayout.Height(Nexus.Self.position.height) }
                if(GUI.Button(new Rect(Nexus.Self.position.width - 35, 0, 35, Nexus.Self.position.height), buttonText, load)) {

                    Nexus.Self.SelectTab(Nexus.Self.Manifest);

                }

            }

        }

19 View Source File : Yodo1AdIntegrationManagerWindow.cs
License : MIT License
Project Creator : Crazy-Marvin

private void OnGUI()
        {
            // OnGUI is called on each frame draw, so we don't want to do any unnecessary calculation if we can avoid it. So only calculate it when the width actually changed.
            if (Math.Abs(previousWindowWidth - position.width) > 1)
            {
                previousWindowWidth = position.width;
                CalculateFieldWidth();
            }

            using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPosition, false, false))
            {
                scrollPosition = scrollView.scrollPosition;

                GUILayout.Space(5);
                EditorGUILayout.LabelField("Conflict SDKs", replacedleLabelStyle);
                if (Yodo1AdBuildCheck.HasConflict())
                {
                    // Draw mediated networks
                    DrawMediatedNetworks();

                    // Draw doreplacedentation notes
                    EditorGUILayout.LabelField(new GUIContent(note), wrapTextLabelStyle);
                    if (GUILayout.Button(new GUIContent(doreplacedentationLink), linkLabelStyle))
                    {
                        Application.OpenURL(doreplacedentationLink);
                    }
                }
                else
                {
                    GUIStyle gUIStyle2 = new GUIStyle();
                    gUIStyle2.padding = new RectOffset(0, 10, 10, 0);
                    GUILayout.BeginVertical(gUIStyle2, new GUILayoutOption[0]);
                    GUILayout.Label("There is no conflict with MAS SDK");
                    GUILayout.EndVertical();
                }


            }
        }

19 View Source File : TimelineWindow_TrackGui.cs
License : MIT License
Project Creator : BattleDawnNZ

void DrawNoSequenceGUI(WindowState windowState)
        {
            bool showCreateButton = false;
            var currentlySelectedGo = UnityEditor.Selection.activeObject != null ? UnityEditor.Selection.activeObject as GameObject : null;
            var textContent = DirectorStyles.noTimelinereplacedetSelected;
            var existingDirector = currentlySelectedGo != null ? currentlySelectedGo.GetComponent<PlayableDirector>() : null;
            var existingreplacedet = existingDirector != null ? existingDirector.playablereplacedet : null;

            if (currentlySelectedGo != null && !TimelineUtility.IsPrefabOrreplacedet(currentlySelectedGo) && existingreplacedet == null)
            {
                showCreateButton = true;
                textContent = new GUIContent(String.Format(DirectorStyles.createTimelineOnSelection.text, currentlySelectedGo.name, "a Director component and a Timeline replacedet"));
            }
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.FlexibleSpace();

            GUILayout.Label(textContent);

            if (showCreateButton)
            {
                GUILayout.BeginHorizontal();
                var textSize = GUI.skin.label.CalcSize(textContent);
                GUILayout.Space((textSize.x / 2.0f) - (WindowConstants.createButtonWidth / 2.0f));
                if (GUILayout.Button("Create", GUILayout.Width(WindowConstants.createButtonWidth)))
                {
                    var message = DirectorStyles.createNewTimelineText.text + " '" + currentlySelectedGo.name + "'";
                    string newSequencePath = EditorUtility.SaveFilePanelInProject(DirectorStyles.createNewTimelineText.text, currentlySelectedGo.name + "Timeline", "playable", message, ProjectWindowUtil.GetActiveFolderPath());
                    if (!string.IsNullOrEmpty(newSequencePath))
                    {
                        var newreplacedet = CreateInstance<Timelinereplacedet>();
                        replacedetDatabase.Createreplacedet(newreplacedet, newSequencePath);

                        Undo.IncrementCurrentGroup();

                        if (existingDirector == null)
                        {
                            existingDirector = Undo.AddComponent<PlayableDirector>(currentlySelectedGo);
                        }

                        existingDirector.playablereplacedet = newreplacedet;
                        SetCurrentTimeline(existingDirector);
                        var newTrack = TimelineHelpers.CreateTrack<AnimationTrack>();

                        windowState.previewMode = false;
                        TimelineUtility.SetSceneGameObject(windowState.editSequence.director, newTrack, currentlySelectedGo);
                    }

                    // If we reach this point, the state of the pannel has changed; skip the rest of this GUI phase
                    // Fixes: case 955831 - [OSX] NullReferenceException when creating a timeline on a selected object
                    GUIUtility.ExitGUI();
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
        }

19 View Source File : TMP_SpriteAssetImporter.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

void DrawEditorPanel()
        {
            // label
            GUILayout.Label("Import Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            // Sprite Texture Selection
            m_JsonFile = EditorGUILayout.ObjectField("Sprite Data Source", m_JsonFile, typeof(Textreplacedet), false) as Textreplacedet;

            m_SpriteDataFormat = (SpritereplacedetImportFormats)EditorGUILayout.EnumPopup("Import Format", m_SpriteDataFormat);

            // Sprite Texture Selection
            m_SpriteAtlas = EditorGUILayout.ObjectField("Sprite Texture Atlas", m_SpriteAtlas, typeof(Texture2D), false) as Texture2D;

            if (EditorGUI.EndChangeCheck())
            {
                m_CreationFeedback = string.Empty;
            }

            GUILayout.Space(10);

            GUI.enabled = m_JsonFile != null && m_SpriteAtlas != null && m_SpriteDataFormat != SpritereplacedetImportFormats.None;

            // Create Sprite replacedet
            if (GUILayout.Button("Create Sprite replacedet"))
            {
                m_CreationFeedback = string.Empty;

                // Clean up sprite replacedet object that may have been previously created.
                if (m_Spritereplacedet != null && !EditorUtility.IsPersistent(m_Spritereplacedet))
                    DestroyImmediate(m_Spritereplacedet);

                // Read json data file
                if (m_JsonFile != null)
                {
                    switch (m_SpriteDataFormat)
                    {
                        case SpritereplacedetImportFormats.TexturePackerJsonArray:
                            TexturePacker_JsonArray.SpriteDataObject jsonData = null;
                            try
                            {
                                jsonData = JsonUtility.FromJson<TexturePacker_JsonArray.SpriteDataObject>(m_JsonFile.text);
                            }
                            catch
                            {
                                m_CreationFeedback = "The Sprite Data Source file [" + m_JsonFile.name + "] appears to be invalid or incorrectly formatted.";
                            }

                            if (jsonData != null && jsonData.frames != null && jsonData.frames.Count > 0)
                            {
                                int spriteCount = jsonData.frames.Count;

                                // Update import results
                                m_CreationFeedback = "<b>Import Results</b>\n--------------------\n";
                                m_CreationFeedback += "<color=#C0ffff><b>" + spriteCount + "</b></color> Sprites were imported from file.";

                                // Create new Sprite replacedet
                                m_Spritereplacedet = CreateInstance<TMP_Spritereplacedet>();

                                // replacedign sprite sheet / atlas texture to sprite replacedet
                                m_Spritereplacedet.spriteSheet = m_SpriteAtlas;

                                List<TMP_SpriteGlyph> spriteGlyphTable = new List<TMP_SpriteGlyph>();
                                List<TMP_SpriteCharacter> spriteCharacterTable = new List<TMP_SpriteCharacter>();

                                PopulateSpriteTables(jsonData, spriteCharacterTable, spriteGlyphTable);

                                m_Spritereplacedet.spriteCharacterTable = spriteCharacterTable;
                                m_Spritereplacedet.spriteGlyphTable = spriteGlyphTable;
                            }
                            break;
                    }
                }
            }

            GUI.enabled = true;

            // Creation Feedback
            GUILayout.Space(5);
            GUILayout.BeginVertical(EditorStyles.helpBox, GUILayout.Height(60));
            {
                EditorGUILayout.TextArea(m_CreationFeedback, TMP_UIStyleManager.label);
            }
            GUILayout.EndVertical();

            GUILayout.Space(5);
            GUI.enabled = m_JsonFile != null && m_SpriteAtlas && m_SpriteInfoList != null && m_Spritereplacedet != null;
            if (GUILayout.Button("Save Sprite replacedet") && m_JsonFile != null)
            {
                string filePath = EditorUtility.SaveFilePanel("Save Sprite replacedet File", new FileInfo(replacedetDatabase.GetreplacedetPath(m_JsonFile)).DirectoryName, m_JsonFile.name, "replacedet");

                if (filePath.Length == 0)
                    return;

                SaveSpritereplacedet(filePath);
            }
            GUI.enabled = true;
        }

19 View Source File : EntitiesItemsHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_enreplacedy_name :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyPrefabIdx = RGUI.SearchableSelectionPopup(s_enreplacedyPrefabIdx, s_enreplacedyPrefabsFiltered.ToArray(), ref s_enreplacedySearchTerms);

                    SearchItem(s_enreplacedySearchTerms);
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_quanreplacedy :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyQuanreplacedyText = GUILayout.TextField(s_enreplacedyQuanreplacedyText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_level :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyLevelIdx = RGUI.SelectionPopup(s_enreplacedyLevelIdx, s_enreplacedyLevels.ToArray());
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_button")))
                {
                    if (int.TryParse(s_enreplacedyQuanreplacedyText, out int enreplacedyQuanreplacedy) && int.TryParse(s_enreplacedyLevels[s_enreplacedyLevelIdx], out int enreplacedyLevel))
                    {
                        if (enreplacedyQuanreplacedy <= 100 && s_enreplacedyPrefabIdx < s_enreplacedyPrefabsFiltered.Count && s_enreplacedyPrefabIdx >= 0)
                        {
                            SpawnEnreplacedies(s_enreplacedyPrefabsFiltered[s_enreplacedyPrefabIdx], enreplacedyLevel, enreplacedyQuanreplacedy);
                        }
                    }
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_drops_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_enreplacedies_drops_button")))
                {
                    RemoveAllDrops();
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                if (GUILayout.Button(EntryPoint.s_showItemGiver ? VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_button_hide") : VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_button_show")))
                {
                    EntryPoint.s_showItemGiver = !EntryPoint.s_showItemGiver;
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : SoftMaskableEditor.cs
License : GNU General Public License v3.0
Project Creator : FluffyFishGames

public override void OnInspectorGUI ()
		{
			base.OnInspectorGUI ();

			serializedObject.Update();
			DrawMaskInteractions();

//			maskInteraction = (MaskInteraction)EditorGUILayout.EnumPopup("Mask Interaction", maskInteraction);
			serializedObject.ApplyModifiedProperties();
			/*
			EditorGUI.indentLevel++;
			var l = EditorGUIUtility.labelWidth;
			EditorGUIUtility.labelWidth = 60;
			using (new EditorGUILayout.HorizontalScope())
			{
				EditorGUILayout.ObjectField("Mask 0", null, typeof(Mask), false);
				EditorGUILayout.EnumPopup (MaskIntr.None);
			}
			EditorGUIUtility.labelWidth = l;
			EditorGUI.indentLevel--;

			var spMaskInteraction = serializedObject.FindProperty ("m_MaskInteraction");
			MaskIntr intr0 = (MaskIntr)((spMaskInteraction.intValue >> 0) & 0x3);
			MaskIntr intr1 = (MaskIntr)((spMaskInteraction.intValue >> 2) & 0x3);
			MaskIntr intr2 = (MaskIntr)((spMaskInteraction.intValue >> 4) & 0x3);
			MaskIntr intr3 = (MaskIntr)((spMaskInteraction.intValue >> 6) & 0x3);

			using (var ccs = new EditorGUI.ChangeCheckScope ()) {

				intr0 = (MaskIntr)EditorGUILayout.EnumPopup ("Layer 0", intr0);
				intr1 = (MaskIntr)EditorGUILayout.EnumPopup ("Layer 1", intr1);
				intr2 = (MaskIntr)EditorGUILayout.EnumPopup ("Layer 2", intr2);
				intr3 = (MaskIntr)EditorGUILayout.EnumPopup ("Layer 3", intr3);

				if (ccs.changed) {
					current.SetMaskInteractions (intr0,intr1,intr2,intr3);
				}
			}
			*/

//			spMaskInteraction.intValue = (intr0 << 0) | (intr1 << 2) | (intr2 << 4) | (intr3 << 6);
//
//			serializedObject.ApplyModifiedProperties ();



			var current = target as SoftMaskable;

			current.GetComponentsInChildren<Graphic> (true, s_Graphics);
			var fixTargets = s_Graphics.Where (x => x.gameObject != current.gameObject && !x.GetComponent<SoftMaskable> () && (!x.GetComponent<Mask> () || x.GetComponent<Mask> ().showMaskGraphic)).ToList ();
			if (0 < fixTargets.Count)
			{
				GUILayout.BeginHorizontal ();
				EditorGUILayout.HelpBox ("There are child Graphics that does not have a SoftMaskable component.\nAdd SoftMaskable component to them.", MessageType.Warning);
				GUILayout.BeginVertical ();
				if (GUILayout.Button ("Fix"))
				{
					foreach (var p in fixTargets)
					{
						p.gameObject.AddComponent<SoftMaskable> ();
					}
				}
				if (GUILayout.Button ("Ping"))
				{
					EditorGUIUtility.PingObject (fixTargets [0]);
				}
				GUILayout.EndVertical ();
				GUILayout.EndHorizontal ();
			}

			if(s_TypeTMPro != null)
			{
				ShowTMProWarning (_shader, _mobileShader, _spriteShader, m => { });
				var textMeshPro = current.GetComponent (s_TypeTMPro);
				if (textMeshPro != null)
				{
					Material [] fontSharedMaterials = s_PiFontSharedMaterials.GetValue (textMeshPro, new object [0]) as Material [];
					ShowMaterialEditors (fontSharedMaterials, 1, fontSharedMaterials.Length - 1);
				}
			}
			
			if (!DetectMask (current.transform.parent))
			{
				GUILayout.BeginHorizontal ();
				EditorGUILayout.HelpBox ("This is unnecessary SoftMaskable.\nCan't find any SoftMask components above.", MessageType.Warning);
				if (GUILayout.Button ("Remove", GUILayout.Height (40)))
				{
					DestroyImmediate (current);
					
					Utils.MarkPrefabDirty ();
				}
				GUILayout.EndHorizontal ();
			}
		}

19 View Source File : NameMgrWindow.cs
License : MIT License
Project Creator : BlueMonk1107

private void OnGUI()
    {
        GUILayout.Label("资源名称管理器");

        NameMgrWindowData.UpdateData();

        foreach (var pair in NameMgrWindowData.SpriteDic)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label("路径:", GUILayout.MaxWidth(50));
            GUILayout.Label(pair.Key.FolderPath, GUILayout.MaxWidth(150));
            GUILayout.Label("范例:", GUILayout.MaxWidth(50));
            GUILayout.Label(pair.Key.NameTip, GUILayout.MaxWidth(150));

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            foreach (var path in pair.Value)
            {
                GUILayout.BeginVertical();

                var texture2D = replacedetDatabase.LoadreplacedetAtPath<Texture2D>(path);
                GUILayout.Box(texture2D, GUILayout.Height(80), GUILayout.Width(80));
                var name = Path.GetFileNameWithoutExtension(path);
                if (!_namesDic.ContainsKey(name)) _namesDic[name] = name;
                GUILayout.BeginHorizontal();
                _namesDic[name] = GUILayout.TextArea(_namesDic[name], GUILayout.Width(40));
                if (GUILayout.Button("确认", GUILayout.Width(30)))
                {
                    if (name != _namesDic[name])
                    {
                        ChangeFileName(name, _namesDic[name], path);
                        _namesDic.Remove(name);
                    }

                    replacedetDatabase.Refresh();
                }

                GUILayout.EndHorizontal();


                GUILayout.EndVertical();
            }

            GUILayout.EndHorizontal();
        }
    }

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 : TMP_PackageUtilities.cs
License : MIT License
Project Creator : ashishgopalhattimare

void OnGUI()
        {
            GUILayout.BeginVertical();
            {
                // Scan project files and resources
                GUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    GUILayout.Label("Scan Project Files", EditorStyles.boldLabel);
                    GUILayout.Label("Press the <i>Scan Project Files</i> button to begin scanning your project for files & resources that were created with a previous version of TextMesh Pro.", TMP_UIStyleManager.label);
                    GUILayout.Space(10f);
                    GUILayout.Label("Project folder to be scanned. Example \"replacedets/TextMesh Pro\"");
                    m_ProjectFolderToScan = EditorGUILayout.TextField("Folder Path:      replacedets/", m_ProjectFolderToScan);
                    GUILayout.Space(5f);

                    GUI.enabled = m_IsAlreadyScanningProject == false ? true : false;
                    if (GUILayout.Button("Scan Project Files"))
                    {
                        m_CancelScanProcess = false;

                        // Make sure replacedet Serialization mode is set to ForceText and Version Control mode to Visible Meta Files.
                        if (CheckProjectSerializationAndSourceControlModes() == true)
                        {
                            EditorCoroutine.StartCoroutine(ScanProjectFiles());
                        }
                        else
                        {
                            EditorUtility.DisplayDialog("Project Settings Change Required", "In menu options \"Edit - Project Settings - Editor\", please change replacedet Serialization Mode to ForceText and Source Control Mode to Visible Meta Files.", "OK", string.Empty);
                        }
                    }
                    GUI.enabled = true;

                    // Display progress bar
                    Rect rect = GUILayoutUtility.GetRect(0f, 20f, GUILayout.ExpandWidth(true));
                    EditorGUI.ProgressBar(rect, m_ProgressPercentage, "Scan Progress (" + m_ScanningCurrentFileIndex + "/" + m_ScanningTotalFiles + ")");

                    // Display cancel button and name of file currently being scanned.
                    if (m_IsAlreadyScanningProject)
                    {
                        Rect cancelRect = new Rect(rect.width - 20, rect.y + 2, 20, 16);
                        if (GUI.Button(cancelRect, "X"))
                        {
                            m_CancelScanProcess = true;
                        }
                        GUILayout.Label("Scanning: " + m_ScanningCurrentFileName);
                    }
                    else
                        GUILayout.Label(string.Empty);

                    GUILayout.Space(5);

                    // Creation Feedback
                    GUILayout.BeginVertical(TMP_UIStyleManager.textAreaBoxWindow, GUILayout.ExpandHeight(true));
                    {
                        m_ProjectScanResultScrollPosition = EditorGUILayout.BeginScrollView(m_ProjectScanResultScrollPosition, GUILayout.ExpandHeight(true));
                        EditorGUILayout.LabelField(m_ProjectScanResults, TMP_UIStyleManager.label);
                        EditorGUILayout.EndScrollView();
                    }
                    GUILayout.EndVertical();
                    GUILayout.Space(5f);
                }
                GUILayout.EndVertical();

                // Scan project files and resources
                GUILayout.BeginVertical(EditorStyles.helpBox);
                { 
                    GUILayout.Label("Save Modified Project Files", EditorStyles.boldLabel);
                    GUILayout.Label("Pressing the <i>Save Modified Project Files</i> button will update the files in the <i>Project Scan Results</i> listed above. <color=#FFFF80>Please make sure that you have created a backup of your project first</color> as these file modifications are permanent and cannot be undone.", TMP_UIStyleManager.label);
                    GUILayout.Space(5f);

                    GUI.enabled = m_IsAlreadyScanningProject == false && m_ModifiedreplacedetList.Count > 0 ? true : false;
                    if (GUILayout.Button("Save Modified Project Files"))
                    {
                        UpdateProjectFiles();
                    }
                    GUILayout.Space(10f);
                }
                GUILayout.EndVertical();

            }
            GUILayout.EndVertical();
            GUILayout.Space(5f);
        }

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

public override void OnUI()
        {
            base.OnUI();

            GUILayout.BeginVertical(Styles.HeaderStyle);

            if (HasRepository)
            {
                DoActionbarGUI();
                DoHeaderGUI();
            }

            DoToolbarGUI();
            DoActiveViewGUI();

            GUILayout.EndVertical();
        }

19 View Source File : PickUp2Handed.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

void OnGUI() {
			GUILayout.BeginHorizontal();
			GUILayout.Space(GUIspace);

			if (!holding) {

				if (GUILayout.Button("Pick Up " + obj.name)) {
					interactionSystem.StartInteraction(FullBodyBipedEffector.LeftHand, obj, false);
					interactionSystem.StartInteraction(FullBodyBipedEffector.RightHand, obj, false);
				}
				
			} else {
                GUILayout.BeginVertical();
                if (holdingRight)
                {
                    if (GUILayout.Button("Release Right"))
                    {
                        interactionSystem.ResumeInteraction(FullBodyBipedEffector.RightHand);
                    }
                }
                if (holdingLeft)
                {
                    if (GUILayout.Button("Release Left"))
                    {
                        interactionSystem.ResumeInteraction(FullBodyBipedEffector.LeftHand);
                    }
                }
				if (GUILayout.Button("Drop " + obj.name)) {
                    interactionSystem.ResumeAll();
                }
                GUILayout.EndVertical();
			}

			GUILayout.EndHorizontal();
		}

19 View Source File : SteamVR_Skeleton_PoserEditor.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

void DrawPoseEditorMenu()
        {
            if (Application.isPlaying)
            {
                EditorGUILayout.LabelField("Cannot modify pose while in play mode.");
            }
            else
            {
                bool createNew = false;

                LoadDefaultPreviewHands();


                activePoseIndex = previewPoseSelection.intValue;
                if (activePoseIndex == 0)
                    activePoseProp = skeletonMainPoseProperty;
                else
                    activePoseProp = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(activePoseIndex - 1);


                //box containing all pose editing controls
                GUILayout.BeginVertical("box");


                poseEditorExpanded.boolValue = IndentedFoldoutHeader(poseEditorExpanded.boolValue, "Pose Editor");


                if (poseEditorExpanded.boolValue)
                {
                    //show selectable menu of all poses, highlighting the one that is selected
                    EditorGUILayout.Space();


                    poser.poseNames = new string[skeletonAdditionalPosesProperty.arraySize + 1];

                    for (int i = 0; i < skeletonAdditionalPosesProperty.arraySize + 1; i++)
                    {
                        if (i == 0)
                            // main pose special case
                            poser.poseNames[i] = skeletonMainPoseProperty.objectReferenceValue == null ? "[not set]" : skeletonMainPoseProperty.objectReferenceValue.name + " (MAIN)";
                        else
                            // additional poses from array
                            poser.poseNames[i] = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(i - 1).objectReferenceValue == null ? "[not set]" : skeletonAdditionalPosesProperty.GetArrayElementAtIndex(i - 1).objectReferenceValue.name;
                    }

                    EditorGUILayout.BeginHorizontal();
                    int poseSelected = GUILayout.Toolbar(activePoseIndex, poser.poseNames);

                    if (poseSelected != activePoseIndex)
                    {
                        forceUpdateHands = true;
                        activePoseIndex = poseSelected;
                        PoseChanged = true;
                        previewPoseSelection.intValue = activePoseIndex;
                        serializedObject.ApplyModifiedProperties();
                    }




                    EditorGUILayout.BeginVertical(GUILayout.MaxWidth(32));
                    if (GUILayout.Button("+", GUILayout.MaxWidth(32)))
                    {
                        skeletonAdditionalPosesProperty.InsertArrayElementAtIndex(skeletonAdditionalPosesProperty.arraySize);
                    }
                    //only allow deletion of additional poses
                    EditorGUI.BeginDisabledGroup(skeletonAdditionalPosesProperty.arraySize == 0 || activePoseIndex == 0);
                    if (GUILayout.Button("-", GUILayout.MaxWidth(32)) && skeletonAdditionalPosesProperty.arraySize > 0)
                    {
                        skeletonAdditionalPosesProperty.DeleteArrayElementAtIndex(activePoseIndex - 1);
                        skeletonAdditionalPosesProperty.DeleteArrayElementAtIndex(activePoseIndex - 1);
                        if (activePoseIndex >= skeletonAdditionalPosesProperty.arraySize + 1)
                        {
                            activePoseIndex = skeletonAdditionalPosesProperty.arraySize;
                            previewPoseSelection.intValue = activePoseIndex;
                            return;
                        }
                    }

                    EditorGUI.EndDisabledGroup();
                    EditorGUILayout.EndVertical();
                    GUILayout.FlexibleSpace();

                    EditorGUILayout.EndHorizontal();

                    GUILayout.BeginVertical("box");

                    // sides of pose editor
                    GUILayout.BeginHorizontal();

                    //pose controls
                    GUILayout.BeginVertical(GUILayout.MaxWidth(200));

                    GUILayout.Label("Current Pose:");

                    if (PoseChanged)
                    {
                        PoseChanged = false;
                        forceUpdateHands = true;

                        if (activePoseIndex == 0)
                            activePoseProp = skeletonMainPoseProperty;
                        else
                            activePoseProp = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(activePoseIndex - 1);
                        activePose = (SteamVR_Skeleton_Pose)activePoseProp.objectReferenceValue;

                    }


                    activePose = (SteamVR_Skeleton_Pose)activePoseProp.objectReferenceValue;
                    if (activePoseProp.objectReferenceValue == null)
                    {
                        if (previewLeftInstanceProperty.objectReferenceValue != null)
                            DestroyImmediate(previewLeftInstanceProperty.objectReferenceValue);
                        if (previewRightInstanceProperty.objectReferenceValue != null)
                            DestroyImmediate(previewRightInstanceProperty.objectReferenceValue);

                        EditorGUILayout.BeginHorizontal();
                        activePoseProp.objectReferenceValue = EditorGUILayout.ObjectField(activePoseProp.objectReferenceValue, typeof(SteamVR_Skeleton_Pose), false);
                        if (GUILayout.Button("Create")) createNew = true;
                        EditorGUILayout.EndHorizontal();
                        if (createNew)
                        {
                            string fullPath = EditorUtility.SaveFilePanelInProject("Create New Skeleton Pose", "newPose", "replacedet", "Save file");

                            if (string.IsNullOrEmpty(fullPath) == false)
                            {
                                SteamVR_Skeleton_Pose newPose = ScriptableObject.CreateInstance<SteamVR_Skeleton_Pose>();
                                replacedetDatabase.Createreplacedet(newPose, fullPath);
                                replacedetDatabase.Savereplacedets();

                                activePoseProp.objectReferenceValue = newPose;
                                serializedObject.ApplyModifiedProperties();
                            }
                        }
                    }
                    else
                    {
                        activePoseProp.objectReferenceValue = EditorGUILayout.ObjectField(activePoseProp.objectReferenceValue, typeof(SteamVR_Skeleton_Pose), false);

                        DrawPoseControlButtons();

                        UpdatePreviewHand(previewLeftInstanceProperty, showLeftPreviewProperty, SteamVR_Settings.instance.previewHandLeft, activePose.leftHand, activePose, forceUpdateHands);
                        UpdatePreviewHand(previewRightInstanceProperty, showRightPreviewProperty, SteamVR_Settings.instance.previewHandRight, activePose.rightHand, activePose, forceUpdateHands);

                        forceUpdateHands = false;

                        GUILayout.EndVertical();




                        GUILayout.Space(10);

                        if (handTexL == null)
                            handTexL = (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/HandLeftIcon.png");
                        if (handTexR == null)
                            handTexR = (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/HandRightIcon.png");


                        //Left Hand

                        GUILayout.Space(32);
                        EditorGUILayout.BeginVertical();
                        EditorGUILayout.BeginVertical("box");
                        EditorGUILayout.BeginHorizontal();
                        GUI.color = new Color(1, 1, 1, showLeftPreviewProperty.boolValue ? 1 : 0.25f);
                        if (GUILayout.Button(handTexL, GUI.skin.label, GUILayout.Width(64), GUILayout.Height(64)))
                        {
                            showLeftPreviewProperty.boolValue = !showLeftPreviewProperty.boolValue;
                            //forceUpdateHands = true;
                        }
                        GUI.color = Color.white;

                        EditorGUIUtility.labelWidth = 48;
                        EditorGUILayout.LabelField("Left Hand", EditorStyles.boldLabel);
                        EditorGUIUtility.labelWidth = 0;
                        GUILayout.FlexibleSpace();
                        EditorGUILayout.EndHorizontal();

                        bool showLeft = showLeftPreviewProperty.boolValue;


                        DrawHand(showLeft, activePose.leftHand, activePose.rightHand, getLeftFromOpposite, showLeftPreviewProperty);
                        EditorGUILayout.EndVertical();
                        EditorGUI.BeginDisabledGroup((showLeftPreviewProperty.boolValue && showRightPreviewProperty.boolValue) == false);
                        getRightFromOpposite = GUILayout.Button("Copy Left pose to Right hand");
                        EditorGUI.EndDisabledGroup();
                        EditorGUILayout.EndVertical();



                        EditorGUILayout.BeginVertical();
                        EditorGUILayout.BeginVertical("box");

                        EditorGUILayout.BeginHorizontal();
                        GUILayout.FlexibleSpace();
                        EditorGUIUtility.labelWidth = 48;
                        EditorGUILayout.LabelField("Right Hand", EditorStyles.boldLabel);
                        EditorGUIUtility.labelWidth = 0;
                        GUI.color = new Color(1, 1, 1, showRightPreviewProperty.boolValue ? 1 : 0.25f);
                        if (GUILayout.Button(handTexR, GUI.skin.label, GUILayout.Width(64), GUILayout.Height(64)))
                        {
                            showRightPreviewProperty.boolValue = !showRightPreviewProperty.boolValue;
                            //forceUpdateHands = true;
                        }
                        GUI.color = Color.white;
                        EditorGUILayout.EndHorizontal();

                        bool showRight = showLeftPreviewProperty.boolValue;

                        DrawHand(showRight, activePose.rightHand, activePose.leftHand, getRightFromOpposite, showRightPreviewProperty);
                        EditorGUILayout.EndVertical();
                        EditorGUI.BeginDisabledGroup((showLeftPreviewProperty.boolValue && showRightPreviewProperty.boolValue) == false);
                        getLeftFromOpposite = GUILayout.Button("Copy Right pose to Left hand");
                        EditorGUI.EndDisabledGroup();

                    }







                    /*




                    if (activePoseProp.objectReferenceValue == null)
                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.PropertyField(activePoseProp);
                        createNew = GUILayout.Button("Create");
                        EditorGUILayout.EndHorizontal();
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(activePoseProp);

                        DrawDivider();


                        DrawSaveButtons();

                        if (PoseChanged)
                        {
                            PoseChanged = false;
                            forceUpdateHands = true;
                        }

                        UpdatePreviewHand(previewLeftInstanceProperty, showLeftPreviewProperty, previewLeftHandPrefab, activePose.leftHand, forceUpdateHands);
                        UpdatePreviewHand(previewRightInstanceProperty, showRightPreviewProperty, previewRightHandPrefab, activePose.rightHand, forceUpdateHands);

                    }

                                activePoseProp.objectReferenceValue = newPose;
                                serializedObject.ApplyModifiedProperties();
                            }
                        }
                    */
                    GUILayout.EndVertical();
                    EditorGUILayout.EndVertical();
                    GUILayout.EndHorizontal();


                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.BeginHorizontal();
                    EditorGUIUtility.labelWidth = 120;
                    poserScale.floatValue = EditorGUILayout.FloatField("Preview Pose Scale", poserScale.floatValue);
                    if (poserScale.floatValue <= 0) poserScale.floatValue = 1;
                    EditorGUIUtility.labelWidth = 0;
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                    if (EditorGUI.EndChangeCheck())
                    {
                        forceUpdateHands = true;
                    }
                }

                GUILayout.EndVertical();
            }
        }

19 View Source File : TMP_SpriteAssetImporter.cs
License : MIT License
Project Creator : ashishgopalhattimare

void DrawEditorPanel()
        {
            // label
            GUILayout.Label("Import Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            // Sprite Texture Selection
            m_JsonFile = EditorGUILayout.ObjectField("Sprite Data Source", m_JsonFile, typeof(Textreplacedet), false) as Textreplacedet;

            m_SpriteDataFormat = (SpritereplacedetImportFormats)EditorGUILayout.EnumPopup("Import Format", m_SpriteDataFormat);
                    
            // Sprite Texture Selection
            m_SpriteAtlas = EditorGUILayout.ObjectField("Sprite Texture Atlas", m_SpriteAtlas, typeof(Texture2D), false) as Texture2D;

            if (EditorGUI.EndChangeCheck())
            {
                m_CreationFeedback = string.Empty;
            }

            GUILayout.Space(10);

            GUI.enabled = m_JsonFile != null && m_SpriteAtlas != null && m_SpriteDataFormat == SpritereplacedetImportFormats.TexturePacker;

            // Create Sprite replacedet
            if (GUILayout.Button("Create Sprite replacedet"))
            {
                m_CreationFeedback = string.Empty;

                // Read json data file
                if (m_JsonFile != null && m_SpriteDataFormat == SpritereplacedetImportFormats.TexturePacker)
                {
                    TexturePacker.SpriteDataObject sprites = JsonUtility.FromJson<TexturePacker.SpriteDataObject>(m_JsonFile.text);

                    if (sprites != null && sprites.frames != null && sprites.frames.Count > 0)
                    {
                        int spriteCount = sprites.frames.Count;

                        // Update import results
                        m_CreationFeedback = "<b>Import Results</b>\n--------------------\n";
                        m_CreationFeedback += "<color=#C0ffff><b>" + spriteCount + "</b></color> Sprites were imported from file.";

                        // Create sprite info list
                        m_SpriteInfoList = CreateSpriteInfoList(sprites);
                    }
                }

            }

            GUI.enabled = true;

            // Creation Feedback
            GUILayout.Space(5);
            GUILayout.BeginVertical(EditorStyles.helpBox, GUILayout.Height(60));
            {
                EditorGUILayout.LabelField(m_CreationFeedback, TMP_UIStyleManager.label);
            }
            GUILayout.EndVertical();

            GUILayout.Space(5);
            GUI.enabled = m_JsonFile != null && m_SpriteAtlas && m_SpriteInfoList != null && m_SpriteInfoList.Count > 0;    // Enable Save Button if font_Atlas is not Null.
            if (GUILayout.Button("Save Sprite replacedet") && m_JsonFile != null)
            {
                string filePath = EditorUtility.SaveFilePanel("Save Sprite replacedet File", new FileInfo(replacedetDatabase.GetreplacedetPath(m_JsonFile)).DirectoryName, m_JsonFile.name, "replacedet");

                if (filePath.Length == 0)
                    return;

                SaveSpritereplacedet(filePath);
            }
            GUI.enabled = true;
        }

19 View Source File : SteamVR_Menu.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

void OnGUI()
        {
            if (overlay == null)
                return;

            var texture = overlay.texture as RenderTexture;

            var prevActive = RenderTexture.active;
            RenderTexture.active = texture;

            if (Event.current.type == EventType.Repaint)
                GL.Clear(false, true, Color.clear);

            var area = new Rect(0, 0, texture.width, texture.height);

            // Account for screen smaller than texture (since mouse position gets clamped)
            if (Screen.width < texture.width)
            {
                area.width = Screen.width;
                overlay.uvOffset.x = -(float)(texture.width - Screen.width) / (2 * texture.width);
            }
            if (Screen.height < texture.height)
            {
                area.height = Screen.height;
                overlay.uvOffset.y = (float)(texture.height - Screen.height) / (2 * texture.height);
            }

            GUILayout.BeginArea(area);

            if (background != null)
            {
                GUI.DrawTexture(new Rect(
                    (area.width - background.width) / 2,
                    (area.height - background.height) / 2,
                    background.width, background.height), background);
            }

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

            if (logo != null)
            {
                GUILayout.Space(area.height / 2 - logoHeight);
                GUILayout.Box(logo);
            }

            GUILayout.Space(menuOffset);

            bool bHideMenu = GUILayout.Button("[Esc] - Close menu");

            GUILayout.BeginHorizontal();
            GUILayout.Label(string.Format("Scale: {0:N4}", scale));
            {
                var result = GUILayout.HorizontalSlider(scale, scaleLimits.x, scaleLimits.y);
                if (result != scale)
                {
                    SetScale(result);
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(string.Format("Scale limits:"));
            {
                var result = GUILayout.TextField(scaleLimitX);
                if (result != scaleLimitX)
                {
                    if (float.TryParse(result, out scaleLimits.x))
                        scaleLimitX = result;
                }
            }
            {
                var result = GUILayout.TextField(scaleLimitY);
                if (result != scaleLimitY)
                {
                    if (float.TryParse(result, out scaleLimits.y))
                        scaleLimitY = result;
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(string.Format("Scale rate:"));
            {
                var result = GUILayout.TextField(scaleRateText);
                if (result != scaleRateText)
                {
                    if (float.TryParse(result, out scaleRate))
                        scaleRateText = result;
                }
            }
            GUILayout.EndHorizontal();

            if (SteamVR.active)
            {
                var vr = SteamVR.instance;

                GUILayout.BeginHorizontal();
                {
                    var t = SteamVR_Camera.sceneResolutionScale;
                    int w = (int)(vr.sceneWidth * t);
                    int h = (int)(vr.sceneHeight * t);
                    int pct = (int)(100.0f * t);
                    GUILayout.Label(string.Format("Scene quality: {0}x{1} ({2}%)", w, h, pct));
                    var result = Mathf.RoundToInt(GUILayout.HorizontalSlider(pct, 50, 200));
                    if (result != pct)
                    {
                        SteamVR_Camera.sceneResolutionScale = (float)result / 100.0f;
                    }
                }
                GUILayout.EndHorizontal();
            }

            var tracker = SteamVR_Render.Top();
            if (tracker != null)
            {
                tracker.wireframe = GUILayout.Toggle(tracker.wireframe, "Wireframe");

                if (SteamVR.settings.trackingSpace == ETrackingUniverseOrigin.TrackingUniverseSeated)
                {
                    if (GUILayout.Button("Switch to Standing"))
                        SteamVR.settings.trackingSpace = ETrackingUniverseOrigin.TrackingUniverseStanding;

                    if (GUILayout.Button("Center View"))
                    {
                        var chaperone = OpenVR.Chaperone;
                        if (chaperone != null)
                            chaperone.ResetZeroPose(SteamVR.settings.trackingSpace);
                    }
                }
                else
                {
                    if (GUILayout.Button("Switch to Seated"))
                        SteamVR.settings.trackingSpace = ETrackingUniverseOrigin.TrackingUniverseSeated;
                }
            }

#if !UNITY_EDITOR
		if (GUILayout.Button("Exit"))
			Application.Quit();
#endif
            GUILayout.Space(menuOffset);

            var env = System.Environment.GetEnvironmentVariable("VR_OVERRIDE");
            if (env != null)
            {
                GUILayout.Label("VR_OVERRIDE=" + env);
            }

            GUILayout.Label("Graphics device: " + SystemInfo.graphicsDeviceVersion);

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

            GUILayout.EndArea();

            if (cursor != null)
            {
                float x = Input.mousePosition.x, y = Screen.height - Input.mousePosition.y;
                float w = cursor.width, h = cursor.height;
                GUI.DrawTexture(new Rect(x, y, w, h), cursor);
            }

            RenderTexture.active = prevActive;

            if (bHideMenu)
                HideMenu();
        }

19 View Source File : TimelineWindow_Gui.cs
License : MIT License
Project Creator : BattleDawnNZ

void TimelineSectionGUI()
        {
            GUILayout.BeginVertical();
            {
                GUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.Width(position.width - state.sequencerHeaderWidth));
                {
                    DoSequenceSelectorGUI();
                    DoBreadcrumbGUI();
                    OptionsGUI();
                }
                GUILayout.EndHorizontal();

                TimelineGUI();
            }
            GUILayout.EndVertical();
        }

19 View Source File : ConsoleMessage.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

public override void OnGUI() {

			if(Nexus.Self == null || Nexus.Self.SelectedTab.Window.GetType() != constraint) {

				Close();
				return;

			}

			if(lastWindowWidth != Nexus.Self.position.width) {

				DoPositionWindow = true;

			}

			if(DoPositionWindow) {

				DoPositionWindow = false;
				lastWindowWidth = Nexus.Self.position.width;
				PositionWindow();

			}

			GUI.skin.textArea.wordWrap = true;

			buttons = new GUIStyle(GUI.skin.button);
			buttons.fixedHeight = buttonHeight;
			buttons.fixedWidth = buttonWidth;
			buttons.margin = new RectOffset(0, 0, 10, 0);
			buttons.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
			buttonGroup = new GUIStyle();

			closeBox = new GUIStyle(GUI.skin.button);
			closeBox.fontSize = 16;
			closeBox.padding = new RectOffset(2, 0, 0, 0);
			closeBox.normal.textColor = Color.red; 

			detailsBox = new GUIStyle(GUI.skin.box);
			detailsBox.margin = new RectOffset(10, 25, 0, 0);
			detailsBox.fixedWidth = minSize.x - 20;
			detailsBox.fixedHeight = minSize.y - 100;

			detailsLabel = new GUIStyle(GUI.skin.label);
			detailsLabel.fontStyle = FontStyle.Bold;
			detailsLabel.fontSize = 12;

			details = new GUIStyle(GUI.skin.textArea);
			details.fixedHeight = detailsBox.fixedHeight - 150;
			details.fixedWidth = detailsBox.fixedWidth - 15;
			details.padding = detailsBox.padding = new RectOffset(5, 5, 5, 5);

			divider = new GUIStyle(GUI.skin.box);
			divider.normal.background = Swat.MakeTextureFromColor(Color.white);
			divider.margin = new RectOffset(25, 0, 10, 20);

			header = new GUIStyle(GUI.skin.label);
			header.fontSize = 14;
			header.fixedHeight = 25;
			header.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
			header.fontStyle = FontStyle.Bold;
			header.alignment = TextAnchor.MiddleCenter;
			header.padding = new RectOffset(0, 0, -20, 0);

			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.Space();
			Nexus.Self.Button("X", "Show/Hide test status details section.", 
				new Nexus.SwatDelegate(delegate() {                
					IsVisible = false;
					Close();
				}), closeBox, new GUILayoutOption[] { GUILayout.Width(20), GUILayout.Height(20) });
			EditorGUILayout.EndHorizontal();
			EditorGUILayout.LabelField("Console Message", header);
			GUILayout.Space(10);

			GUILayout.BeginVertical(detailsBox);
			EditorGUILayout.LabelField("Time:", detailsLabel, new GUILayoutOption[] { GUILayout.Width(120)});
			EditorGUILayout.SelectableLabel(Timestamp);
			EditorGUILayout.Space();
			EditorGUILayout.LabelField("Type:", detailsLabel, new GUILayoutOption[] { GUILayout.Width(120)});
			EditorGUILayout.SelectableLabel(MessageType);
			EditorGUILayout.Space();
			EditorGUILayout.LabelField("Verbosity:", detailsLabel, new GUILayoutOption[] { GUILayout.Width(120)});
			EditorGUILayout.SelectableLabel(MessageLevel);
			EditorGUILayout.Space();
			EditorGUILayout.LabelField("Message:", detailsLabel, new GUILayoutOption[] { GUILayout.Width(120)});
			GUILayout.BeginHorizontal();
			_scrollConsoleDetails = GUILayout.BeginScrollView(_scrollConsoleDetails, false, true, GUIStyle.none, GUI.skin.verticalScrollbar);
			EditorGUILayout.SelectableLabel(Message, details);
			GUILayout.EndScrollView();
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();

			buttonGroup.margin = new RectOffset(System.Convert.ToInt32(System.Math.Round(position.width / 2)) - 25, 0, 0, 10);
			EditorGUILayout.BeginHorizontal(buttonGroup);
			if(GUILayout.Button("Close", buttons)) {
				IsVisible = false;
				Close();
			}
			EditorGUILayout.EndHorizontal();

		}

19 View Source File : Yodo1AdWindows.cs
License : MIT License
Project Creator : Crazy-Marvin

private void OnGUI()
        {
            this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition, new GUILayoutOption[0]);
            DrawContent();
            GUIStyle gUIStyle = new GUIStyle();
            gUIStyle.padding = new RectOffset(10, 10, 10, 0);
            GUILayout.BeginVertical(gUIStyle, new GUILayoutOption[0]);
            if (GUILayout.Button("Save Configuration"))
            {
                this.SaveConfig();
            }
            GUILayout.EndVertical();

            GUILayout.EndScrollView();
        }

19 View Source File : TimelineWindow_TrackGui.cs
License : MIT License
Project Creator : BattleDawnNZ

void TracksGUI(Rect clientRect, WindowState state, TimelineModeGUIState trackState)
        {
            if (Event.current.type == EventType.Repaint && treeView != null)
            {
                state.spaceParreplacedioner.Clear();
            }

            if (state.IsEditingASubTimeline() && !state.IsEditingAnEmptyTimeline())
            {
                var headerRect = clientRect;
                headerRect.width = state.sequencerHeaderWidth;
                Graphics.DrawBackgroundRect(state, headerRect);

                var clipRect = clientRect;
                clipRect.xMin = headerRect.xMax;
                Graphics.DrawBackgroundRect(state, clipRect, subSequenceMode: true);
            }
            else
            {
                Graphics.DrawBackgroundRect(state, clientRect);
            }

            if (!state.IsEditingAnEmptyTimeline())
                m_TimeArea.DrawMajorTicks(sequenceContentRect, state.referenceSequence.frameRate);

            GUILayout.BeginVertical();
            {
                GUILayout.Space(5.0f);
                GUILayout.BeginHorizontal();

                if (this.state.editSequence.replacedet == null)
                    DrawNoSequenceGUI(state);
                else
                    DrawTracksGUI(clientRect, trackState);

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

            Graphics.DrawShadow(clientRect);
        }

19 View Source File : RunnerConsole.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

public override void Render() {

			GUIStyle horizontal = new GUIStyle();
			horizontal.margin = new RectOffset(10, 11, 0, 0);

			GUIStyle statusColor = new GUIStyle(GUI.skin.label);
			statusColor.margin = new RectOffset(0, 0, 3, 0);
			statusColor.normal.textColor = AutoConsole.Paused ? Color.red : Nexus.TextGreen;
			statusColor.fixedWidth = 125;
			statusColor.fontStyle = FontStyle.Bold;

			GUILayout.Space(15);
			EditorGUILayout.BeginHorizontal(horizontal); //For "Running" notification and FPS counter.

			if(Application.isPlaying && AutomationMaster.Busy) {

				EditorGUILayout.LabelField("Running Test(s)", statusColor);

			} else {

				AutomationMaster.Busy = false;
				EditorGUILayout.LabelField(string.Empty, statusColor);

			}
				
			if(Application.isPlaying) {

				if(renderPreplacedes == FPS_SAMPLE_RATE && Application.isPlaying) {

					fpsSample = Math.Round(1 / Time.deltaTime, 0);
					renderPreplacedes = 0;

				}
				GUIStyle fps  = new GUIStyle(GUI.skin.label);
				fps.fontSize = 26;
				fps.padding = new RectOffset(0, 0, -8, 0);
				fps.normal.textColor = GetFpsColor(fpsSample);

				GUILayout.FlexibleSpace();
				EditorGUILayout.LabelField(string.Format("FPS   {0}", fpsSample), new GUILayoutOption[] { GUILayout.Width(50) });
				EditorGUILayout.LabelField(string.Format("◈", fpsSample), fps, new GUILayoutOption[] { GUILayout.Width(35) });
				GUILayout.Space(-18);

				renderPreplacedes++;

			}
			EditorGUILayout.EndHorizontal(); //End for "Running" notification and FPS counter.

			GUIStyle scrollStatus = new GUIStyle(GUI.skin.button);
			scrollStatus.margin = new RectOffset(0, 0, 0, 0);
			scrollStatus.fontStyle = _autoScroll ? FontStyle.Bold : FontStyle.Normal;
			scrollStatus.normal.background = Swat.ToggleButtonBackgroundSelectedTexture;
			scrollStatus.normal.textColor = _pubsubMode ? Nexus.TextGreen : Swat.WindowDefaultTextColor;
			EditorGUILayout.Space();

			GUILayout.BeginHorizontal(horizontal);
			EditorGUILayout.LabelField(string.Format("{0}  -  {1}", AutoConsole.Paused ? "Paused" : "Active", AutoConsole.FilterLevel == MessageLevel.Verbose ? "Verbose" : "Abridged") , statusColor);
			EditorGUILayout.Space();
			GUILayout.Space(-100);
			Nexus.Self.Button("Pubsub", "Show received Pubsub messages.", 
				new Nexus.SwatDelegate(delegate() {                
					_pubsubMode = !_pubsubMode;
				}), scrollStatus, new GUILayoutOption[] { GUILayout.Width(75), GUILayout.Height(22) });
			GUILayout.Space(0.65f);
			scrollStatus.normal.textColor = _autoScroll ? Nexus.TextGreen : Color.red;
			Nexus.Self.Button("Auto Scroll", "Remove all messages in the console.", 
				new Nexus.SwatDelegate(delegate() {                
					_autoScroll = !_autoScroll;
				}), scrollStatus, new GUILayoutOption[] { GUILayout.Width(75), GUILayout.Height(22) });
			GUILayout.EndHorizontal();

			EditorGUILayout.Space();

			GUILayout.BeginHorizontal(horizontal);
			GUIStyle button = new GUIStyle(GUI.skin.button);  
			button.margin = new RectOffset(0, 0, 0, 0);
			button.normal.textColor = Swat.ToggleButtonTextColor;
			button.normal.background = Swat.ToggleButtonBackgroundTexture;

			Nexus.Self.Button("Clear", "Remove all messages in the console.", 
				new Nexus.SwatDelegate(delegate() {                
					FileBroker.SaveUnboundFile(string.Format("{0}{1}{2}/console_before_start.txt", FileBroker.BASE_NON_UNITY_PATH, AutomationMaster.ConfigReader.GetString("EDITOR_RESOURCE_CONSOLE_LOG_DIRECTORY"), GameMaster.GAME_NAME), string.Empty);
					AutoConsole.messageListDisplayed = new List<AutoConsoleMessage>();
					AutoConsole.messageListQueued = new List<AutoConsoleMessage>();
					_selectedConsoleMessage = null;
				}), button, new GUILayoutOption[] { GUILayout.Width(60), GUILayout.Height(22) });

			GUILayout.Space(0.5f);

			Nexus.Self.Button(AutoConsole.Paused ? "Resume" : "Pause", "Pause/Continue rendering of new messages in the console. Messages are still received and stored when paused, and will appear immediately when resuming.", 
				new Nexus.SwatDelegate(delegate() {                
					AutoConsole.Paused = !AutoConsole.Paused;
				}), button, new GUILayoutOption[] { GUILayout.Width(60), GUILayout.Height(22) });

			EditorGUILayout.Space();

			Nexus.Self.Button("Verbose", "Post ALL messages from the automation framework in the console.", 
				new Nexus.SwatDelegate(delegate() {                
					AutoConsole.FilterLevel = MessageLevel.Verbose; 
					if(_autoScroll) {

						_scroll.y = 99999;
						_scroll.x = 0;

					}
				}), button, new GUILayoutOption[] { GUILayout.Width(75), GUILayout.Height(22) });

			GUILayout.Space(0.65f);

			GUIStyle abridged = new GUIStyle(GUI.skin.button);  
			abridged.margin = new RectOffset(0, 0, 0, 0);
			abridged.normal.textColor = Swat.ToggleButtonTextColor;
			abridged.normal.background = Swat.ToggleButtonBackgroundTexture;
			Nexus.Self.Button("Abridged", "Post only automation messages marked as high priority in the console.", 
				new Nexus.SwatDelegate(delegate() {                
					AutoConsole.FilterLevel = MessageLevel.Abridged; 
					if(_autoScroll) {

						_scroll.y = 99999;
						_scroll.x = 0;

					}
				}), abridged, new GUILayoutOption[] { GUILayout.Width(75), GUILayout.Height(22) });

			GUILayout.EndHorizontal();

			float messageHeight = 15;

			GUIStyle consoleBox = new GUIStyle(GUI.skin.box);
			consoleBox.fixedHeight = Nexus.Self.position.height - (Application.isPlaying ? 125 : 105);
			consoleBox.fixedWidth = Nexus.Self.position.width - 20;
			consoleBox.margin = new RectOffset(10, 0, 0, 10);
			consoleBox.normal.background = Swat.TabButtonBackgroundTexture;

			GUILayout.BeginVertical(consoleBox); //Begin box border around console.
			_scroll = GUILayout.BeginScrollView(_scroll);

			GUIStyle messageBox = new GUIStyle(GUI.skin.box);
			messageBox.normal.background = Swat.TabButtonBackgroundSelectedTexture;
			messageBox.margin = new RectOffset(2, 2, 1, 1);
			GUIStyle messageBoxText = new GUIStyle(GUI.skin.label);
			messageBoxText.normal.textColor = Swat.WindowDefaultTextColor;
			messageBox.fixedWidth = consoleBox.fixedWidth - 10;
			messageBoxText.fixedWidth = messageBox.fixedWidth - 5;

			string lastConsoleMessage = string.Empty;
			int duplicateCount = 0;
			List<AutoConsoleMessage> consoleMessages = AutoConsole.messageListDisplayed;
			for(int m = 0; m < consoleMessages.Count; m++) {

				if((_pubsubMode && consoleMessages[m].messageType != ConsoleMessageType.Pubsub) ||(!_pubsubMode && consoleMessages[m].messageType == ConsoleMessageType.Pubsub)) {

					continue;

				}

				//If this is a new console message, and auto scroll is on, scroll down automatically.
				if(_autoScroll && m == _lastPreplacedConsoleMessageCount) {

					_scroll.y = 99999;
					_scroll.x = 0;

				}

				//Render only messages of the requested filter level.
				if(_pubsubMode ||(AutoConsole.FilterLevel == MessageLevel.Abridged && consoleMessages[m].level == MessageLevel.Abridged) || AutoConsole.FilterLevel == MessageLevel.Verbose) {

					messageBoxText.normal.textColor = AutoConsole.MessageColor(consoleMessages[m].messageType);
					GUILayout.BeginHorizontal(messageBox, new GUILayoutOption[] {
						GUILayout.MinWidth(225),
						GUILayout.MaxHeight(messageHeight)
					});

					if(lastConsoleMessage == consoleMessages[m].message) {

						duplicateCount++;
						consoleMessages.RemoveAt(m - 1);

					} else {

						lastConsoleMessage = consoleMessages[m].message;
						duplicateCount = 0;

					}
						
					if(consoleMessages.Count > m) {
						
						if(GUILayout.Button(string.Format("{0} {1}", duplicateCount > 0 ?(duplicateCount + 1).ToString() : string.Empty, consoleMessages[m].message), messageBoxText)) {

							if(_selectedConsoleMessage == consoleMessages[m]) {

								//If the message has been double-clicked, open this test failure as a single-test, temporary report.
								if(DateTime.Now.Subtract(_lastConsoleMessageButtonClick).TotalSeconds < 0.75d && !string.IsNullOrEmpty(consoleMessages[m].testMethod)) {

									if(_consoleAbridgedReportTypes.Contains(consoleMessages[m].messageType)) {

										_selectedConsoleMessage = null; //Prevents details panel from appearing. We only want it to appear for a single click, not a double click.
										AutomationReport.BuildTemporaryReportForSingleConsoleFailure(consoleMessages[m].testMethod);
										System.Diagnostics.Process.Start(string.Format("{0}SingleTestAsReportTemp.html", FileBroker.RESOURCES_DIRECTORY));
										OpenedTestReport = DateTime.UtcNow;

									} 

								} else {

									ConsoleMessage.Pop(_selectedConsoleMessage.message, Enum.GetName(typeof(ConsoleMessageType), _selectedConsoleMessage.messageType), Enum.GetName(typeof(MessageLevel), _selectedConsoleMessage.level), _selectedConsoleMessage.timestamp.ToString());
									_selectedConsoleMessage = null;

								}

							}

							_selectedConsoleMessage = consoleMessages[m];
							_lastConsoleMessageButtonClick = DateTime.Now;

						}

					}
					GUILayout.EndHorizontal();
				}

			}

			_lastPreplacedConsoleMessageCount = consoleMessages.Count;

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

		}

19 View Source File : PlayerHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_general_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                {
                    GUILayout.Space(EntryPoint.s_boxSpacing);

                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_god_mode : " + (Player.m_localPlayer.VTInGodMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetGodMode(!Player.m_localPlayer.VTInGodMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_inf_stamina_me : " + (s_isInfiniteStaminaMe ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isInfiniteStaminaMe = !s_isInfiniteStaminaMe;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_inf_stamina_others : " + (s_isInfiniteStaminaOthers ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isInfiniteStaminaOthers = !s_isInfiniteStaminaOthers;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_no_stamina : " + (s_isNoStaminaOthers ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isNoStaminaOthers = !s_isNoStaminaOthers;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_fly_mode : " + (Player.m_localPlayer.VTInFlyMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetFlyMode(!Player.m_localPlayer.VTInFlyMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_ghost_mode : " + (Player.m_localPlayer.VTInGhostMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetGhostMode(!Player.m_localPlayer.VTInGhostMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_nop_lacement_cost : " + (Player.m_localPlayer.VTIsNoPlacementCost() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetNoPlacementCost(!Player.m_localPlayer.VTIsNoPlacementCost());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_explore_minimap")))
                    {
                        Minimap.instance.VTExploreAll();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_reset_minimap")))
                    {
                        Minimap.instance.VTReset();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_tame_creatures")))
                    {
                        Player.m_localPlayer.VTTameNearbyCreatures();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_infinite_weight : " + (Player.m_localPlayer.VTIsInventoryInfiniteWeight() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTInventoryInfiniteWeight(!Player.m_localPlayer.VTIsInventoryInfiniteWeight());
                    }
                }
                GUILayout.EndVertical();

                GUILayout.BeginVertical();
                {
                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_teleport_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_teleport_player :"), GUILayout.ExpandWidth(false));

                            s_teleportTargetIdx = RGUI.SelectionPopup(s_teleportTargetIdx, s_netPlayerNames.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_teleport_button")))
                        {
                            if (s_netPlayers != null && s_teleportTargetIdx < s_netPlayers.Count && s_teleportTargetIdx >= 0)
                            {
                                Player.m_localPlayer.VTTeleportTo(s_netPlayers[s_teleportTargetIdx]);
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_heal_manager_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_heal_player :"), GUILayout.ExpandWidth(false));

                            s_healTargetIdx = RGUI.SelectionPopup(s_healTargetIdx, s_playerNames.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_heal_selected_player")))
                        {
                            if (s_healTargetIdx < s_players.Count && s_healTargetIdx >= 0)
                            {
                                s_players[s_healTargetIdx].VTHeal();
                            }
                        }
                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_heal_all_players")))
                        {
                            foreach (Player player in s_players)
                            {
                                player.VTHeal();
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_power_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_power_name :"), GUILayout.ExpandWidth(false));
                            s_guardianPowerIdx = RGUI.SelectionPopup(s_guardianPowerIdx, s_guardianPowers.Keys.Select(p => VTLocalization.instance.Localize(p)).ToArray());
                        }
                        GUILayout.EndHorizontal();


                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_power_active_me")))
                        {
                            if (Player.m_localPlayer != null)
                            {
                                Player.m_localPlayer.VTActiveGuardianPower(s_guardianPowers[s_guardianPowerIdx]);
                            }
                        }
                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_power_active_all")))
                        {
                            if (s_guardianPowers.ContainsKey(s_guardianPowerIdx))
                            {
                                AllPlayersActiveGuardianPower(s_guardianPowers[s_guardianPowerIdx]);
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_skill_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_skill_name :"), GUILayout.ExpandWidth(false));
                            s_skillNameIdx = RGUI.SelectionPopup(s_skillNameIdx, s_skills.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_skill_level :"), GUILayout.ExpandWidth(false));
                            s_skillLevelIdx = RGUI.SelectionPopup(s_skillLevelIdx, s_levels.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_skill_button")))
                        {
                            if (s_skillNameIdx < s_skills.Count && s_skillNameIdx >= 0)
                            {
                                if (int.TryParse(s_levels[s_skillLevelIdx], out int levelInt))
                                {
                                    Player.m_localPlayer.VTUpdateSkillLevel(s_skills[s_skillNameIdx], levelInt);
                                }
                            }
                        }
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : PluginSettings.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

[SettingsProvider]
    private static SettingsProvider RiderPreferencesItem()
    {
      if (!RiderScriptEditor.IsRiderInstallation(RiderScriptEditor.CurrentEditor))
        return null;
      if (!RiderScriptEditorData.instance.shouldLoadEditorPlugin)
        return null;
      var provider = new SettingsProvider("Preferences/Rider", SettingsScope.User)
      {
        label = "Rider",
        keywords = new[] { "Rider" },
        guiHandler = (searchContext) =>
        {
          EditorGUIUtility.labelWidth = 200f;
          EditorGUILayout.BeginVertical();

          GUILayout.BeginVertical();
          LogEventsCollectorEnabled =
            EditorGUILayout.Toggle(new GUIContent("Preplaced Console to Rider:"), LogEventsCollectorEnabled);

          GUILayout.EndVertical();
          GUILayout.Label("");

          if (!string.IsNullOrEmpty(EditorPluginInterop.LogPath))
          {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Log file:");
            var previous = GUI.enabled;
            GUI.enabled = previous && SelectedLoggingLevel != LoggingLevel.OFF;
            var button = GUILayout.Button(new GUIContent("Open log"));
            if (button)
            {
              //UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(PluginEntryPoint.LogPath, 0);
              // works much faster than the commented code, when Rider is already started
              CodeEditor.CurrentEditor.OpenProject(EditorPluginInterop.LogPath, 0, 0);
            }

            GUI.enabled = previous;
            GUILayout.EndHorizontal();
          }

          var loggingMsg =
            @"Sets the amount of Rider Debug output. If you are about to report an issue, please select Verbose logging level and attach Unity console output to the issue.";
          SelectedLoggingLevel =
            (LoggingLevel) EditorGUILayout.EnumPopup(new GUIContent("Logging Level:", loggingMsg),
              SelectedLoggingLevel);


          EditorGUILayout.HelpBox(loggingMsg, MessageType.None);

          LinkButton("https://github.com/JetBrains/resharper-unity");

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

          GUILayout.FlexibleSpace();
          var replacedembly = EditorPluginInterop.EditorPluginreplacedembly;
          if (replacedembly != null)
          {
            var version = replacedembly.GetName().Version;
            GUILayout.Label("Plugin version: " + version, ourVersionInfoStyle);
          }

          GUILayout.EndHorizontal();

          EditorGUILayout.EndVertical();
        }
      };
      return provider;
    }

19 View Source File : TimelineWindow_TrackGui.cs
License : MIT License
Project Creator : BattleDawnNZ

void DrawTracksGUI(Rect clientRect, TimelineModeGUIState trackState)
        {
            GUILayout.BeginVertical(GUILayout.Height(clientRect.height));
            if (treeView != null)
            {
                if (Event.current.type == EventType.Layout)
                {
                    OverlayDrawData.Clear();
                }

                treeView.OnGUI(clientRect);

                if (Event.current.type == EventType.Repaint)
                {
                    foreach (var overlayData in OverlayDrawData)
                    {
                        using (new GUIViewportScope(sequenceContentRect))
                            DrawOverlay(overlayData);
                    }
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : TimelineWindow_TrackGui.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

void TracksGUI(Rect clientRect, WindowState state, TimelineModeGUIState trackState)
        {
            if (Event.current.type == EventType.Repaint && treeView != null)
            {
                state.headerSpaceParreplacedioner.Clear();
                state.spaceParreplacedioner.Clear();
            }

            if (state.IsEditingASubTimeline() && !state.IsEditingAnEmptyTimeline())
            {
                var headerRect = clientRect;
                headerRect.width = state.sequencerHeaderWidth;
                Graphics.DrawBackgroundRect(state, headerRect);

                var clipRect = clientRect;
                clipRect.xMin = headerRect.xMax;
                Graphics.DrawBackgroundRect(state, clipRect, subSequenceMode: true);
            }
            else
            {
                Graphics.DrawBackgroundRect(state, clientRect);
            }

            if (!state.IsEditingAnEmptyTimeline())
                m_TimeArea.DrawMajorTicks(sequenceContentRect, state.referenceSequence.frameRate);

            GUILayout.BeginVertical();
            {
                GUILayout.Space(5.0f);
                GUILayout.BeginHorizontal();

                if (this.state.editSequence.replacedet == null)
                    DrawNoSequenceGUI(state);
                else
                    DrawTracksGUI(clientRect, trackState);

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

            Graphics.DrawShadow(clientRect);
        }

19 View Source File : ARCoreProjectSettingsWindow.cs
License : GNU General Public License v3.0
Project Creator : ARPOISE

private void OnGUI()
        {
            GUILayout.BeginVertical();
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);
            GUIStyle replacedleStyle = new GUIStyle(GUI.skin.label);
            replacedleStyle.alignment = TextAnchor.MiddleCenter;
            replacedleStyle.stretchWidth = true;
            replacedleStyle.fontSize = 14;
            replacedleStyle.fixedHeight = 20;

            EditorGUILayout.LabelField("ARCore Project Settings", replacedleStyle);
            GUILayout.Space(15);

            ARCoreProjectSettings.Instance.IsARCoreRequired =
                EditorGUILayout.Toggle("ARCore Required", ARCoreProjectSettings.Instance.IsARCoreRequired);
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            ARCoreProjectSettings.Instance.IsInstantPreviewEnabled =
                EditorGUILayout.Toggle("Instant Preview enabled",
                    ARCoreProjectSettings.Instance.IsInstantPreviewEnabled);
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            bool newARCoreIOSEnabled =
                EditorGUILayout.Toggle("iOS Support Enabled",
                    ARCoreProjectSettings.Instance.IsIOSSupportEnabled);
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            EditorGUILayout.LabelField("Cloud Anchor API Keys");

            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(s_GroupFieldIndent);
            EditorGUILayout.LabelField("Android", GUILayout.Width(EditorGUIUtility.labelWidth - s_GroupFieldIndent));
            ARCoreProjectSettings.Instance.CloudServicesApiKey =
                EditorGUILayout.TextField(ARCoreProjectSettings.Instance.CloudServicesApiKey);
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(s_GroupFieldIndent);
            EditorGUILayout.LabelField("iOS", GUILayout.Width(EditorGUIUtility.labelWidth - s_GroupFieldIndent));
            ARCoreProjectSettings.Instance.IosCloudServicesApiKey =
                EditorGUILayout.TextField(ARCoreProjectSettings.Instance.IosCloudServicesApiKey);
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(10);

            if (GUI.changed)
            {
                if (newARCoreIOSEnabled != ARCoreProjectSettings.Instance.IsIOSSupportEnabled)
                {
                    ARCoreProjectSettings.Instance.IsIOSSupportEnabled = newARCoreIOSEnabled;

                    ARCoreIOSSupportHelper.SetARCoreIOSSupportEnabled(newARCoreIOSEnabled);
                }

                ARCoreProjectSettings.Instance.Save();
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Close", GUILayout.Width(50), GUILayout.Height(20)))
            {
                Close();
            }

            EditorGUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }

19 View Source File : BindingsPrinterWindow.cs
License : MIT License
Project Creator : Djohnnie

protected void OnGUI() {
            if (!editor) {
                editor = (BindingsPrinterWindow) EditorWindow.GetWindow<BindingsPrinterWindow>();
            }

            if (!Application.isPlaying) {
                GUILayout.FlexibleSpace();
                GUILayout.Label("Please execute the bindings printer on Play Mode", EditorStyles.message);
                GUILayout.FlexibleSpace();
                return;
            }

            if (ContextRoot.containersData == null || ContextRoot.containersData.Count == 0) {
                GUILayout.FlexibleSpace();
                GUILayout.Label("There are no containers in the current scene", EditorStyles.message);
                GUILayout.FlexibleSpace();
                return;
            }

            // Add window margin.
            GUILayout.BeginHorizontal();
            GUILayout.Space(WINDOW_MARGIN);
            GUILayout.BeginVertical();
			
            this.scrollPosition = GUILayout.BeginScrollView(scrollPosition);

            GUILayout.Space(WINDOW_MARGIN);
            GUILayout.Label("Adic Bindings Printer", EditorStyles.replacedle);
            GUILayout.Label("Displays all bindings of all available containers", EditorStyles.containerInfo);            

            // Display the containers and their bindings.
            for (int dataIndex = 0; dataIndex < ContextRoot.containersData.Count; dataIndex++) {
                var data = ContextRoot.containersData[dataIndex];
                var bindings = data.container.GetBindings();

                GUILayout.Space(20f);
                GUILayout.Label("CONTAINER", EditorStyles.containerInfo);
                GUILayout.Label(
                    string.Format("[{1}] {0} ({2} | {3})", data.container.GetType().FullName, dataIndex,
                        data.container.identifier, (data.destroyOnLoad ? "destroy on load" : "singleton")
                    ),
                    EditorStyles.replacedle
                );

                GUILayout.Space(10f);

                // Add indentation.
                GUILayout.BeginHorizontal();
                GUILayout.Space(10);
                GUILayout.BeginVertical();

                for (int bindingIndex = 0; bindingIndex < bindings.Count; bindingIndex++) {
                    var binding = bindings[bindingIndex];

                    GUILayout.Label(binding.ToString(), EditorStyles.bindinds);
                }
				
                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
            }

            GUILayout.Space(WINDOW_MARGIN);
            GUILayout.EndScrollView();
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }

19 View Source File : TweenMainEditor.cs
License : MIT License
Project Creator : blueinsert

protected void BeginContents()
        {
            EditorGUILayout.BeginHorizontal(GUILayout.MinHeight(10f));
            GUILayout.Space(10f);
            GUILayout.BeginVertical();
            GUILayout.Space(2f);
        }

19 View Source File : SoftMaskEditor.cs
License : GNU General Public License v3.0
Project Creator : FluffyFishGames

public override void OnInspectorGUI ()
		{
			base.OnInspectorGUI ();

			var current = target as SoftMask;
			current.GetComponentsInChildren<Graphic> (true, s_Graphics);
			var fixTargets = s_Graphics.Where (x => x.gameObject != current.gameObject && !x.GetComponent<SoftMaskable> () && (!x.GetComponent<Mask> () || x.GetComponent<Mask> ().showMaskGraphic)).ToList ();
			if (0 < fixTargets.Count)
			{
				GUILayout.BeginHorizontal ();
				EditorGUILayout.HelpBox ("There are child Graphics that does not have a SoftMaskable component.\nAdd SoftMaskable component to them.", MessageType.Warning);
				GUILayout.BeginVertical ();
				if (GUILayout.Button ("Fix"))
				{
					foreach (var p in fixTargets)
					{
						p.gameObject.AddComponent<SoftMaskable> ();
					}
					
					Utils.MarkPrefabDirty ();
				}
				if (GUILayout.Button ("Ping"))
				{
					EditorGUIUtility.PingObject (fixTargets[0]);
				}
				GUILayout.EndVertical ();
				GUILayout.EndHorizontal ();
			}

			// Preview buffer.
			GUILayout.BeginHorizontal (EditorStyles.helpBox);
			if (s_Preview != (s_Preview = EditorGUILayout.ToggleLeft ("Preview Buffer", s_Preview, GUILayout.MaxWidth (EditorGUIUtility.labelWidth))))
			{
				EditorPrefs.SetBool (k_PrefsPreview, s_Preview);
			}
			if (s_Preview)
			{
				var tex = current.softMaskBuffer;
				var width = tex.width * 64 / tex.height;
				EditorGUI.DrawPreviewTexture (GUILayoutUtility.GetRect (width, 64), tex, null, ScaleMode.ScaleToFit);
				Repaint ();
			}
			GUILayout.FlexibleSpace ();
			GUILayout.EndHorizontal ();
		}

19 View Source File : SimpleHealthBarWindow.cs
License : GNU Affero General Public License v3.0
Project Creator : AugustToko

void OnGUI ()
	{
		if( style == null )
		{
			GUILayout.BeginVertical( "Box" );
			GUILayout.FlexibleSpace();
			ErrorScreen();
			GUILayout.FlexibleSpace();
			EditorGUILayout.EndVertical();
			return;
		}

		GUI.skin = style;

		paragraphStyle = GUI.skin.GetStyle( "ParagraphStyle" );
		itemHeaderStyle = GUI.skin.GetStyle( "ItemHeader" );
		sectionHeaderStyle = GUI.skin.GetStyle( "SectionHeader" );

		if( !configuredFontSize )
		{
			configuredFontSize = true;
			if( paragraphStyle.fontSize == 14 )
				fontSize = FontSize.Large;
			else if( paragraphStyle.fontSize == 12 )
				fontSize = FontSize.Medium;
			else
				fontSize = FontSize.Small;
		}
		
		GUILayout.BeginVertical( "Box" );
		
		EditorGUILayout.BeginHorizontal();

		EditorGUILayout.LabelField( "Simple Health Bar FREE", GUI.skin.GetStyle( "Windowreplacedle" ) );

		if( GUILayout.Button( "", GUI.skin.GetStyle( "SettingsButton" ) ) && currentPage != settings && !pageHistory.Contains( settings ) )
			NavigateForward( settings );

		var rect = GUILayoutUtility.GetLastRect();
		EditorGUIUtility.AddCursorRect( rect, MouseCursor.Link );

		EditorGUILayout.EndHorizontal();

		GUILayout.Space( 3 );
		
		if( GUILayout.Button( "Version " + version, GUI.skin.GetStyle( "VersionNumber" ) ) && currentPage != changeLog && !pageHistory.Contains( changeLog ) )
			NavigateForward( changeLog );
		rect = GUILayoutUtility.GetLastRect();
		EditorGUIUtility.AddCursorRect( rect, MouseCursor.Link );

		GUILayout.Space( 12 );

		EditorGUILayout.BeginHorizontal();
		GUILayout.Space( 5 );
		if( pageHistory.Count > 1 && !pageHistory.Contains( thankYou ) )
		{
			if( GUILayout.Button( "", GUI.skin.GetStyle( "BackButton" ), GUILayout.Width( 80 ), GUILayout.Height( 40 ) ) )
				NavigateBack();
			rect = GUILayoutUtility.GetLastRect();
			EditorGUIUtility.AddCursorRect( rect, MouseCursor.Link );
		}
		else
			GUILayout.Space( 80 );

		GUILayout.Space( 15 );
		EditorGUILayout.LabelField( menureplacedle, GUI.skin.GetStyle( "Menureplacedle" ) );
		GUILayout.FlexibleSpace();
		GUILayout.Space( 80 );
		EditorGUILayout.EndHorizontal();

		GUILayout.Space( itemHeaderSpace );

		EditorGUILayout.BeginHorizontal();
		GUILayout.FlexibleSpace();
		
		if( currentPage.targetMethod != null )
			currentPage.targetMethod();

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

		GUILayout.FlexibleSpace();

		GUILayout.Space( 25 );
		
		EditorGUILayout.EndVertical();

		Repaint();
	}

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

public override void OnGUI()
        {
            DoButtonBarGUI();
            if (gitStatusEntries.Count == 0)
            {
                GUILayout.BeginVertical(Styles.CommitFileAreaStyle);
                DoEmptyGUI();
                GUILayout.EndVertical();
            }
            else
            {
                EditorGUI.BeginDisabledGroup(isBusy);
                DoChangesTreeGUI();
                EditorGUI.EndDisabledGroup();
            }
            EditorGUI.BeginDisabledGroup(isBusy);

            DoProgressGUI();

            // Do the commit details area
            DoCommitGUI();
            EditorGUI.EndDisabledGroup();
        }

19 View Source File : IKSolverFullBodyBipedInspector.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

private static void AddLimb(SerializedProperty prop, SerializedProperty chain, FullBodyBipedChain chainType, GUIContent guiContent) {
			EditorGUILayout.PropertyField(chain, guiContent, false);
			GUILayout.BeginHorizontal();
			GUILayout.Space(10);
			GUILayout.BeginVertical();
			
			if (chain.isExpanded) {
				var effectors = prop.FindPropertyRelative("effectors");
				var endEffector = effectors.GetArrayElementAtIndex(GetEndEffectorIndex(chainType));
				var startEffector = effectors.GetArrayElementAtIndex(GetStartEffectorIndex(chainType));
				var mapping = prop.FindPropertyRelative("limbMappings").GetArrayElementAtIndex(GetLimbMappingIndex(chainType));

				GUILayout.BeginVertical(style);
				
				DrawLabel(GetEndEffectorName(chainType), endEffectorIcon);

				AddProperty(endEffector.FindPropertyRelative("target"), new GUIContent("Target", "Target Transform (optional, you can also use IKEffector.position and IKEffector.rotation directly)."));
				AddProperty(endEffector.FindPropertyRelative("positionWeight"), new GUIContent("Position Weight", "The weight of pinning the effector bone to the effector position."));
				AddProperty(endEffector.FindPropertyRelative("rotationWeight"), new GUIContent("Rotation Weight", "The weight of pinning the effector bone to the effector rotation."));
				AddProperty(endEffector.FindPropertyRelative("maintainRelativePositionWeight"), new GUIContent("Maintain Relative Pos", "Maintains the position of the hand/foot fixed relative to the chest/hips while effector positionWeight is not weighed in."));
				
				DrawLabel(GetStartEffectorName(chainType), startEffectorIcon);

				AddProperty(startEffector.FindPropertyRelative("target"), new GUIContent("Target", "Target Transform (optional, you can also use IKEffector.position and IKEffector.rotation directly)."));
				AddProperty(startEffector.FindPropertyRelative("positionWeight"), new GUIContent("Position Weight", "The weight of pinning the effector bone to the effector position."));
				
				DrawLabel("Chain", null);
				
				AddProperty(chain.FindPropertyRelative("pull"), new GUIContent("Pull", "The weight of pulling other chains."));
				AddProperty(chain.FindPropertyRelative("reach"), new GUIContent("Reach", "Pulls the first node closer to the last node of the chain."));
				AddProperty(chain.FindPropertyRelative("push"), new GUIContent("Push", "The weight of the end-effector pushing the first node."));
				AddProperty(chain.FindPropertyRelative("pushParent"), new GUIContent("Push Parent", "The amount of push force transferred to the parent (from hand or foot to the body)."));
				AddProperty(chain.FindPropertyRelative("reachSmoothing"), new GUIContent("Reach Smoothing", "Smoothing the effect of the Reach with the expense of some accuracy."));
				AddProperty(chain.FindPropertyRelative("pushSmoothing"), new GUIContent("Push Smoothing", "Smoothing the effect of the Push."));
				AddProperty(chain.FindPropertyRelative("bendConstraint").FindPropertyRelative("bendGoal"), new GUIContent("Bend Goal", "The Transform to bend towards (optional, you can also use ik.leftArmChain.bendConstraint.direction)."));
				AddProperty(chain.FindPropertyRelative("bendConstraint").FindPropertyRelative("weight"), new GUIContent("Bend Goal Weight", "The weight of to bending towards the Bend Goal (optional, you can also use ik.leftArmChain.bendConstraint.weight)."));

				DrawLabel("Mapping", null);
				
				AddProperty(mapping.FindPropertyRelative("weight"), new GUIContent("Mapping Weight", "The weight of mapping the limb to it's IK pose. This can be useful if you want to disable the effect of IK for the limb."));
				AddProperty(mapping.FindPropertyRelative("maintainRotationWeight"), new GUIContent(GetEndBoneMappingName(chainType), "The weight of maintaining the bone's animated rotation in world space."));
				
				GUILayout.Space(5);
				GUILayout.EndVertical();
			}

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

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 : UIPopupListInspector.cs
License : Apache License 2.0
Project Creator : 365082218

public override void OnInspectorGUI ()
	{
		EditorGUIUtility.LookLikeControls(80f);
		mList = target as UIPopupList;

		ComponentSelector.Draw<UIAtlas>(mList.atlas, OnSelectAtlas);
		ComponentSelector.Draw<UIFont>(mList.font, OnSelectFont);

		GUILayout.BeginHorizontal();
		UILabel lbl = EditorGUILayout.ObjectField("Text Label", mList.textLabel, typeof(UILabel), true) as UILabel;

		if (mList.textLabel != lbl)
		{
			RegisterUndo();
			mList.textLabel = lbl;
			if (lbl != null) lbl.text = mList.selection;
		}
		GUILayout.Space(44f);
		GUILayout.EndHorizontal();

		if (mList.atlas != null)
		{
			NGUIEditorTools.SpriteField("Background", mList.atlas, mList.backgroundSprite, OnBackground);
			NGUIEditorTools.SpriteField("Highlight", mList.atlas, mList.highlightSprite, OnHighlight);

			GUILayout.BeginHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label("Options");
			GUILayout.EndHorizontal();

			string text = "";
			foreach (string s in mList.items) text += s + "\n";

			GUILayout.Space(-14f);
			GUILayout.BeginHorizontal();
			GUILayout.Space(84f);
			string modified = EditorGUILayout.TextArea(text, GUILayout.Height(100f));
			GUILayout.EndHorizontal();

			if (modified != text)
			{
				RegisterUndo();
				string[] split = modified.Split(new char[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries);
				mList.items.Clear();
				foreach (string s in split) mList.items.Add(s);

				if (string.IsNullOrEmpty(mList.selection) || !mList.items.Contains(mList.selection))
				{
					mList.selection = mList.items.Count > 0 ? mList.items[0] : "";
				}
			}

			string sel = NGUIEditorTools.DrawList("Selection", mList.items.ToArray(), mList.selection);

			if (mList.selection != sel)
			{
				RegisterUndo();
				mList.selection = sel;
			}

			UIPopupList.Position pos = (UIPopupList.Position)EditorGUILayout.EnumPopup("Position", mList.position);

			if (mList.position != pos)
			{
				RegisterUndo();
				mList.position = pos;
			}

			float ts = EditorGUILayout.FloatField("Text Scale", mList.textScale);
			Color tc = EditorGUILayout.ColorField("Text Color", mList.textColor);
			Color bc = EditorGUILayout.ColorField("Background", mList.backgroundColor);
			Color hc = EditorGUILayout.ColorField("Highlight", mList.highlightColor);

			GUILayout.BeginHorizontal();
			bool isLocalized = EditorGUILayout.Toggle("Localized", mList.isLocalized, GUILayout.Width(100f));
			bool isAnimated = EditorGUILayout.Toggle("Animated", mList.isAnimated);
			GUILayout.EndHorizontal();

			if (mList.textScale != ts ||
				mList.textColor != tc ||
				mList.highlightColor != hc ||
				mList.backgroundColor != bc ||
				mList.isLocalized != isLocalized ||
				mList.isAnimated != isAnimated)
			{
				RegisterUndo();
				mList.textScale = ts;
				mList.textColor = tc;
				mList.backgroundColor = bc;
				mList.highlightColor = hc;
				mList.isLocalized = isLocalized;
				mList.isAnimated = isAnimated;
			}

			NGUIEditorTools.DrawSeparator();

			GUILayout.BeginHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label("Padding", GUILayout.Width(76f));
			GUILayout.BeginVertical();
			GUILayout.Space(-12f);
			Vector2 padding = EditorGUILayout.Vector2Field("", mList.padding);
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			
			if (mList.padding != padding)
			{
				RegisterUndo();
				mList.padding = padding;
			}

			EditorGUIUtility.LookLikeControls(100f);

			GameObject go = EditorGUILayout.ObjectField("Event Receiver", mList.eventReceiver,
				typeof(GameObject), true) as GameObject;

			string fn = EditorGUILayout.TextField("Function Name", mList.functionName);

			if (mList.eventReceiver != go || mList.functionName != fn)
			{
				RegisterUndo();
				mList.eventReceiver = go;
				mList.functionName = fn;
			}
		}
	}

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

public override void OnUI()
        {
            base.OnUI();

            if (selectedObject != null)
            {
                GUILayout.BeginVertical(Styles.HeaderStyle);
                {
                    DoHeaderGUI();

                    fileHistoryView.OnGUI();
                }
                GUILayout.EndVertical();
            }
        }

19 View Source File : IKSolverFullBodyBipedInspector.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

private static void AddBody(SerializedProperty prop, SerializedProperty chain, GUIContent guiContent) {
			EditorGUILayout.PropertyField(chain, guiContent, false);
			GUILayout.BeginHorizontal();
			GUILayout.Space(10);
			GUILayout.BeginVertical();

			if (chain.isExpanded) {
				var effectors = prop.FindPropertyRelative("effectors");
				var effector = effectors.GetArrayElementAtIndex(0);
				var spineMapping = prop.FindPropertyRelative("spineMapping");
				var headMapping = prop.FindPropertyRelative("boneMappings").GetArrayElementAtIndex(0);

				GUILayout.BeginVertical(style);
				
				DrawLabel("Body Effector", startEffectorIcon);

				AddProperty(effector.FindPropertyRelative("target"), new GUIContent("Target", "Target Transform (optional, you can also use bodyEffector.position and bodyEffector.rotation directly)."));
				AddProperty(effector.FindPropertyRelative("positionWeight"), new GUIContent("Position Weight", "The weight of pinning the effector bone to the effector position."));
				AddProperty(effector.FindPropertyRelative("effectChildNodes"), new GUIContent("Use Thighs", "If true, the effect of the body effector will be applied to also the thigh effectors (IKEffector.effectChildNodes)."));
				
				DrawLabel("Chain", null);
				
				// Spine stiffness
				AddProperty(prop.FindPropertyRelative("spineStiffness"), new GUIContent("Spine Stiffness", "The bend resistance of the spine."));
				
				// Pull Body
				AddProperty(prop.FindPropertyRelative("pullBodyVertical"), new GUIContent("Pull Body Vertical", "Weight of hand effectors pulling the body vertically."));
				AddProperty(prop.FindPropertyRelative("pullBodyHorizontal"), new GUIContent("Pull Body Horizontal", "Weight of hand effectors pulling the body horizontally."));
				
				DrawLabel("Mapping", null);
				
				AddProperty(spineMapping.FindPropertyRelative("iterations"), new GUIContent("Spine Iterations", "The number of FABRIK iterations for mapping the spine bones to the solver armature."));
				AddProperty(spineMapping.FindPropertyRelative("twistWeight"), new GUIContent("Spine Twist Weight", "The weight of spine twist."));
				AddProperty(headMapping.FindPropertyRelative("maintainRotationWeight"), new GUIContent("Maintain Head Rot", "The weight of maintaining the bone's animated rotation in world space."));
				
				GUILayout.Space(5);
				GUILayout.EndVertical();
			}

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

19 View Source File : PluginSettings.cs
License : MIT License
Project Creator : BattleDawnNZ

[SettingsProvider]
    private static SettingsProvider RiderPreferencesItem()
    {
      if (!RiderScriptEditor.IsRiderInstallation(RiderScriptEditor.CurrentEditor))
        return null;
      if (!RiderScriptEditorData.instance.shouldLoadEditorPlugin)
        return null;
      var provider = new SettingsProvider("Preferences/Rider", SettingsScope.User)
      {
        label = "Rider",
        keywords = new[] { "Rider" },
        guiHandler = (searchContext) =>
        {
          EditorGUIUtility.labelWidth = 200f;
          EditorGUILayout.BeginVertical();

          GUILayout.BeginVertical();
          LogEventsCollectorEnabled =
            EditorGUILayout.Toggle(new GUIContent("Preplaced Console to Rider:"), LogEventsCollectorEnabled);

          GUILayout.EndVertical();
          GUILayout.Label("");

          if (!string.IsNullOrEmpty(EditorPluginInterop.LogPath))
          {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Log file:");
            var previous = GUI.enabled;
            GUI.enabled = previous && SelectedLoggingLevel != LoggingLevel.OFF;
            var button = GUILayout.Button(new GUIContent("Open log"));
            if (button)
            {
              //UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(PluginEntryPoint.LogPath, 0);
              // works much faster than the commented code, when Rider is already started
              CodeEditor.CurrentEditor.OpenProject(EditorPluginInterop.LogPath, 0, 0);
            }

            GUI.enabled = previous;
            GUILayout.EndHorizontal();
          }

          var loggingMsg =
            @"Sets the amount of Rider Debug output. If you are about to report an issue, please select Verbose logging level and attach Unity console output to the issue.";
          SelectedLoggingLevel =
            (LoggingLevel) EditorGUILayout.EnumPopup(new GUIContent("Logging Level:", loggingMsg),
              SelectedLoggingLevel);


          EditorGUILayout.HelpBox(loggingMsg, MessageType.None);

          var githubRepo = "https://github.com/JetBrains/resharper-unity";
          var caption = $"<color=#0000FF>{githubRepo}</color>";
          LinkButton(caption: caption, url: githubRepo);

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

          GUILayout.FlexibleSpace();
          var replacedembly = EditorPluginInterop.EditorPluginreplacedembly;
          if (replacedembly != null)
          {
            var version = replacedembly.GetName().Version;
            GUILayout.Label("Plugin version: " + version, ourVersionInfoStyle);
          }
          
          GUILayout.EndHorizontal();

          EditorGUILayout.EndVertical();
        }
      };
      return provider;
    }

19 View Source File : ComponentSelector.cs
License : Apache License 2.0
Project Creator : 365082218

static public void Draw<T> (string buttonName, T obj, OnSelectionCallback cb, params GUILayoutOption[] options) where T : MonoBehaviour
	{
		GUILayout.BeginHorizontal();
		bool show = GUILayout.Button(buttonName, "DropDownButton", GUILayout.Width(76f));
#if !UNITY_3_4
		GUILayout.BeginVertical();
		GUILayout.Space(5f);
#endif
		T o = EditorGUILayout.ObjectField(obj, typeof(T), false, options) as T;
#if !UNITY_3_4
		GUILayout.EndVertical();
#endif
		if (o != null && Selection.activeObject != o.gameObject && GUILayout.Button("Edit", GUILayout.Width(40f)))
		{
			Selection.activeObject = o.gameObject;
		}
		GUILayout.EndHorizontal();
		if (show) Show<T>(cb);
		else if (o != obj) cb(o);
	}

19 View Source File : CloudSettingsEditor.cs
License : MIT License
Project Creator : adrianpolimeni

private static Texture2D TextureField(string name, Texture2D texture)
        {
            GUILayout.BeginVertical();
            var style = new GUIStyle(GUI.skin.label);
            style.alignment = TextAnchor.UpperCenter;
            style.fixedWidth = 64;
            GUILayout.Label(name, style);
            var result = (Texture2D)EditorGUILayout.ObjectField(texture, typeof(Texture2D), false, GUILayout.Width(64), GUILayout.Height(64));
            GUILayout.EndVertical();
            return result;
        }

19 View Source File : MiscHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_damage_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_damage_player :"), GUILayout.ExpandWidth(false));
                    s_playerDamageIdx = RGUI.SelectionPopup(s_playerDamageIdx, s_playerNames.ToArray());
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_damage_value :"), GUILayout.ExpandWidth(false));
                    s_damageToDeal = GUILayout.TextField(s_damageToDeal, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_player")))
                {
                    
                    if (int.TryParse(s_damageToDeal, out int damage))
                    {
                        s_players[s_playerDamageIdx].VTDamage(damage);
                    }
                }
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_enreplacedies")))
                {
                    DamageAllCharacters();
                }
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_players")))
                {
                    DamageAllOtherPlayers();
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_event_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_event_message :"), GUILayout.ExpandWidth(false));
                    s_worldMessageText = GUILayout.TextField(s_worldMessageText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_event_button")))
                {
                    MessageAllInRange(MessageHud.MessageType.Center, s_worldMessageText);
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_chat_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_username :"), GUILayout.ExpandWidth(false));
                    s_chatUsernameText = GUILayout.TextField(s_chatUsernameText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_message :"), GUILayout.ExpandWidth(false));
                    s_chatMessageText = GUILayout.TextField(s_chatMessageText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    s_isShoutMessage = GUILayout.Toggle(s_isShoutMessage, "");
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_shout"));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_chat_button")))
                {
                    ChatMessage(s_isShoutMessage ? Talker.Type.Shout : Talker.Type.Normal, s_chatUsernameText, s_chatMessageText);
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_esp_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_player_esp_button : " + (EntryPoint.s_showPlayerESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showPlayerESP = !EntryPoint.s_showPlayerESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_monster_esp_button : " + (EntryPoint.s_showMonsterESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showMonsterESP = !EntryPoint.s_showMonsterESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_dropped_esp_button : " + (EntryPoint.s_showDroppedESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showDroppedESP = !EntryPoint.s_showDroppedESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_deposit_esp_button : " + (EntryPoint.s_showDepositESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showDepositESP = !EntryPoint.s_showDepositESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_pickable_esp_button : " + (EntryPoint.s_showPickableESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showPickableESP = !EntryPoint.s_showPickableESP;
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : TimelineWindow_HeaderGui.cs
License : MIT License
Project Creator : BattleDawnNZ

void SequencerHeaderGUI()
        {
            using (new EditorGUI.DisabledScope(state.editSequence.replacedet == null))
            {
                GUILayout.BeginVertical();
                {
                    TransportToolbarGUI();

                    GUILayout.BeginHorizontal(GUILayout.Width(sequenceHeaderRect.width));
                    {
                        if (state.editSequence.replacedet != null)
                        {
                            GUILayout.Space(DirectorStyles.kBaseIndent);
                            AddButtonGUI();
                            GUILayout.FlexibleSpace();
                            EditModeToolbarGUI(currentMode);
                            ShowMarkersButton();
                            EditorGUILayout.Space();
                        }
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
            }
        }

19 View Source File : Yodo1AdWindows.cs
License : MIT License
Project Creator : Crazy-Marvin

private void DrawContent()
        {
            GUIStyle gUIStyle = new GUIStyle
            {
                padding = new RectOffset(20, 10, 20, 0)
            };
            GUILayout.BeginVertical(gUIStyle, new GUILayoutOption[0]);


            GUIStyle gUIStyle2 = new GUIStyle();
            gUIStyle2.padding = new RectOffset(0, 10, 10, 0);

            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal(gUIStyle2, new GUILayoutOption[0]);
            //Set AppKey

            GUILayout.Label("MAS App Key", GUILayout.Width(120));
            if (selectPlarformTab == PlatfromTab.iOS)
            {
                this.App_iOSKey = GUILayout.TextField(this.App_iOSKey.Trim());
                if (!string.IsNullOrEmpty(this.App_iOSKey))
                {
                    if (!IsIOSRunTime && string.IsNullOrEmpty(this.adSettings.iOSSettings.AdmobAppID.Trim()))
                    {
                        resultString = RequestAdmobConfig(this.App_iOSKey);
                        IsIOSRunTime = true;
                    }
                }
            }
            else
            {
                this.App_AndroidKey = GUILayout.TextField(this.App_AndroidKey.Trim());
                if (!string.IsNullOrEmpty(this.App_AndroidKey))
                {
                    if (!IsAndroidRunTime && string.IsNullOrEmpty(this.adSettings.androidSettings.AdmobAppID.Trim()))
                    {
                        resultString = RequestAdmobConfig(this.adSettings.androidSettings.AppKey);
                        IsAndroidRunTime = true;
                    }
                }
            }


            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            if (selectPlarformTab == PlatfromTab.iOS)
            {
                if (string.IsNullOrEmpty(this.adSettings.iOSSettings.AppKey.Trim()))
                {
                    EditorGUILayout.HelpBox("Please fill in the MAS app key correctly, you can find your app key on the MAS dashboard.", MessageType.Error);
                    GUILayout.Space(15);
                }
            }
            else
            {
                if (string.IsNullOrEmpty(this.adSettings.androidSettings.AppKey.Trim()))
                {
                    EditorGUILayout.HelpBox("Please fill in the MAS app key correctly, you can find your app key on the MAS dashboard.", MessageType.Error);
                    GUILayout.Space(15);
                }
            }

            GUILayout.EndVertical();

            GUILayout.BeginVertical(gUIStyle2, new GUILayoutOption[0]);

            GUILayout.Label("Select the MAS SDK to be integrated:");


            string imagePath = Application.dataPath + "/Yodo1/MAS/Editor/refresh.png";
            FileStream fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
            byte[] thebytes = new byte[fs.Length];
            fs.Read(thebytes, 0, (int)fs.Length);
            fs.Close();
            fs.Dispose();

            Texture2D image = new Texture2D(30, 30);
            image.LoadImage(thebytes);

            GUILayout.BeginHorizontal(gUIStyle2, new GUILayoutOption[0]);

            //Set AdMob App ID

            GUILayout.Label("AdMob App ID", GUILayout.Width(120));

            if (selectPlarformTab == PlatfromTab.iOS)
            {
                this.adSettings.iOSSettings.AdmobAppID = GUILayout.TextField(this.adSettings.iOSSettings.AdmobAppID);

                GUILayout.Space(20);
                if (GUILayout.Button("Refresh", GUILayout.Width(60)))
                {
                    resultString = RequestAdmobConfig(this.adSettings.iOSSettings.AppKey);
                    this.SaveConfig();
                }

            }
            else
            {
                this.adSettings.androidSettings.AdmobAppID = GUILayout.TextField(this.adSettings.androidSettings.AdmobAppID);

                GUILayout.Space(20);
                if (GUILayout.Button("Refresh", GUILayout.Width(60)))
                {
                    resultString = RequestAdmobConfig(this.adSettings.androidSettings.AppKey);
                    this.SaveConfig();
                }


            }



            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            if (selectPlarformTab == PlatfromTab.iOS)
            {
                if (string.IsNullOrEmpty(this.adSettings.iOSSettings.AdmobAppID.Trim()))
                {
                    if (string.IsNullOrEmpty(resultString))
                    {
                        EditorGUILayout.HelpBox("A null or incorrect value will cause a crash when it builds. Please make sure to copy Admob App ID from MAS dashboard.", MessageType.Info);
                    }
                    else
                    {
                        EditorGUILayout.HelpBox(resultString, MessageType.Error);
                    }
                }
            }
            else
            {
                if (string.IsNullOrEmpty(this.adSettings.androidSettings.AdmobAppID.Trim()))
                {
                    if (string.IsNullOrEmpty(resultString))
                    {
                        EditorGUILayout.HelpBox("A null or incorrect value will cause a crash when it builds. Please make sure to copy Admob App ID from MAS dashboard.", MessageType.Info);
                    }
                    else
                    {
                        EditorGUILayout.HelpBox(resultString, MessageType.Error);
                    }
                }
            }
            GUILayout.EndVertical();
            GUILayout.EndVertical();
        }

See More Examples