UnityEditor.TrueTypeFontImporterInspector.OnInspectorGUI C# (CSharp) Method

OnInspectorGUI() public method

public OnInspectorGUI ( ) : void
return void
        public override void OnInspectorGUI()
        {
            if (!this.m_FormatSupported.HasValue)
            {
                this.m_FormatSupported = true;
                foreach (UnityEngine.Object obj2 in base.targets)
                {
                    TrueTypeFontImporter importer = obj2 as TrueTypeFontImporter;
                    if ((importer == null) || !importer.IsFormatSupported())
                    {
                        this.m_FormatSupported = false;
                    }
                }
            }
            if (this.m_FormatSupported == false)
            {
                this.ShowFormatUnsupportedGUI();
            }
            else
            {
                EditorGUILayout.PropertyField(this.m_FontSize, new GUILayoutOption[0]);
                if (this.m_FontSize.intValue < 1)
                {
                    this.m_FontSize.intValue = 1;
                }
                if (this.m_FontSize.intValue > 500)
                {
                    this.m_FontSize.intValue = 500;
                }
                EditorGUILayout.IntPopup(this.m_FontRenderingMode, kRenderingModeStrings, kRenderingModeValues, new GUIContent("Rendering Mode"), new GUILayoutOption[0]);
                EditorGUILayout.IntPopup(this.m_TextureCase, kCharacterStrings, kCharacterValues, new GUIContent("Character"), new GUILayoutOption[0]);
                if (!this.m_TextureCase.hasMultipleDifferentValues)
                {
                    if (this.m_TextureCase.intValue != -2)
                    {
                        if (this.m_TextureCase.intValue == 3)
                        {
                            EditorGUI.BeginChangeCheck();
                            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                            EditorGUILayout.PrefixLabel("Custom Chars");
                            EditorGUI.showMixedValue = this.m_CustomCharacters.hasMultipleDifferentValues;
                            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinHeight(32f) };
                            string source = EditorGUILayout.TextArea(this.m_CustomCharacters.stringValue, GUI.skin.textArea, options);
                            EditorGUI.showMixedValue = false;
                            GUILayout.EndHorizontal();
                            if (EditorGUI.EndChangeCheck())
                            {
                                source = new string(source.Distinct<char>().ToArray<char>());
                                source = source.Replace("\n", string.Empty).Replace("\r", string.Empty);
                                this.m_CustomCharacters.stringValue = source;
                            }
                        }
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(this.m_IncludeFontData, new GUIContent("Incl. Font Data"), new GUILayoutOption[0]);
                        if (base.targets.Length == 1)
                        {
                            EditorGUI.BeginChangeCheck();
                            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                            EditorGUILayout.PrefixLabel("Font Names");
                            GUI.SetNextControlName("fontnames");
                            GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MinHeight(32f) };
                            this.m_FontNamesString = EditorGUILayout.TextArea(this.m_FontNamesString, "TextArea", optionArray2);
                            GUILayout.EndHorizontal();
                            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                            GUILayout.FlexibleSpace();
                            EditorGUI.BeginDisabledGroup(this.m_FontNamesString == this.m_DefaultFontNamesString);
                            if (GUILayout.Button("Reset", "MiniButton", new GUILayoutOption[0]))
                            {
                                GUI.changed = true;
                                if (GUI.GetNameOfFocusedControl() == "fontnames")
                                {
                                    GUIUtility.keyboardControl = 0;
                                }
                                this.m_FontNamesString = this.m_DefaultFontNamesString;
                            }
                            EditorGUI.EndDisabledGroup();
                            GUILayout.EndHorizontal();
                            if (EditorGUI.EndChangeCheck())
                            {
                                this.SetFontNames(this.m_FontNamesString);
                            }
                            this.m_ReferencesExpanded = EditorGUILayout.Foldout(this.m_ReferencesExpanded, "References to other fonts in project");
                            if (this.m_ReferencesExpanded)
                            {
                                EditorGUILayout.HelpBox("These are automatically generated by the inspector if any of the font names you supplied match fonts present in your project, which will then be used as fallbacks for this font.", MessageType.Info);
                                if (this.m_FallbackFontReferencesArraySize.intValue > 0)
                                {
                                    SerializedProperty property = this.m_FallbackFontReferencesArraySize.Copy();
                                    while (property.NextVisible(true) && (property.depth == 1))
                                    {
                                        EditorGUILayout.PropertyField(property, true, new GUILayoutOption[0]);
                                    }
                                }
                                else
                                {
                                    EditorGUI.BeginDisabledGroup(true);
                                    GUILayout.Label("No references to other fonts in project.", new GUILayoutOption[0]);
                                    EditorGUI.EndDisabledGroup();
                                }
                            }
                        }
                    }
                }
                base.ApplyRevertGUI();
            }
        }