UnityEditor.TextureImporterInspector.SpriteGUI C# (CSharp) Method

SpriteGUI() private method

private SpriteGUI ( TextureInspectorGUIElement guiElements ) : void
guiElements TextureInspectorGUIElement
return void
        private void SpriteGUI(TextureInspectorGUIElement guiElements)
        {
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.IntPopup(this.m_SpriteMode, s_Styles.spriteModeOptions, new int[] { 1, 2, 3 }, s_Styles.spriteMode, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                GUIUtility.keyboardControl = 0;
            }
            EditorGUI.indentLevel++;
            this.m_ShowGenericSpriteSettings.target = this.m_SpriteMode.intValue != 0;
            if (EditorGUILayout.BeginFadeGroup(this.m_ShowGenericSpriteSettings.faded))
            {
                EditorGUILayout.PropertyField(this.m_SpritePackingTag, s_Styles.spritePackingTag, new GUILayoutOption[0]);
                EditorGUILayout.PropertyField(this.m_SpritePixelsToUnits, s_Styles.spritePixelsPerUnit, new GUILayoutOption[0]);
                int[] optionValues = new int[2];
                optionValues[1] = 1;
                EditorGUILayout.IntPopup(this.m_SpriteMeshType, s_Styles.spriteMeshTypeOptions, optionValues, s_Styles.spriteMeshType, new GUILayoutOption[0]);
                EditorGUILayout.IntSlider(this.m_SpriteExtrude, 0, 0x20, s_Styles.spriteExtrude, new GUILayoutOption[0]);
                if (this.m_SpriteMode.intValue == 1)
                {
                    EditorGUILayout.Popup(this.m_Alignment, s_Styles.spriteAlignmentOptions, s_Styles.spriteAlignment, new GUILayoutOption[0]);
                    if (this.m_Alignment.intValue == 9)
                    {
                        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                        EditorGUILayout.PropertyField(this.m_SpritePivot, this.m_EmptyContent, new GUILayoutOption[0]);
                        GUILayout.EndHorizontal();
                    }
                }
                using (new EditorGUI.DisabledScope(base.targets.Length != 1))
                {
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Sprite Editor", new GUILayoutOption[0]))
                    {
                        if (this.HasModified())
                        {
                            string message = ("Unapplied import settings for '" + ((TextureImporter) base.target).assetPath + "'.\n") + "Apply and continue to sprite editor or cancel.";
                            if (EditorUtility.DisplayDialog("Unapplied import settings", message, "Apply", "Cancel"))
                            {
                                base.ApplyAndImport();
                                SpriteEditorWindow.GetWindow();
                                GUIUtility.ExitGUI();
                            }
                        }
                        else
                        {
                            SpriteEditorWindow.GetWindow();
                        }
                    }
                    GUILayout.EndHorizontal();
                }
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUI.indentLevel--;
        }