private void CheckPreset(TexImporterSetting.Settings setting)
        {
            switch (setting.PresetSetting)
            {
            case PresetSettings.Texture_Scene:
                setting.TextureType         = TextureImporterType.Default;
                setting.WrapMode            = TextureWrapMode.Repeat;
                setting.MipMapEnable        = true;
                setting.TextureShape        = TextureImporterShape.Texture2D;
                setting.AlphaIsTransparency = false;
                break;

            case PresetSettings.Texture_UI:
                setting.TextureType         = TextureImporterType.Default;
                setting.WrapMode            = TextureWrapMode.Clamp;
                setting.MipMapEnable        = false;
                setting.TextureShape        = TextureImporterShape.Texture2D;
                setting.AlphaIsTransparency = true;
                break;

            case PresetSettings.Sprite_UI:
                setting.TextureType         = TextureImporterType.Sprite;
                setting.WrapMode            = TextureWrapMode.Clamp;
                setting.MipMapEnable        = false;
                setting.TextureShape        = TextureImporterShape.Texture2D;
                setting.AlphaIsTransparency = true;
                break;
            }


            if (setting.AlphaMode != AlphaMode.Auto)
            {
                var hasAlpha = setting.AlphaMode == AlphaMode.Alpha;
                setting.OverrideAndroidFormat = TextureToolUtil.GetFormat(RuntimePlatform.Android, hasAlpha);
                setting.OverrideIOSFormat     = TextureToolUtil.GetFormat(RuntimePlatform.IPhonePlayer, hasAlpha);
                setting.OverridePCFormat      = TextureToolUtil.GetFormat(RuntimePlatform.WindowsPlayer, hasAlpha);
            }
        }
        private void DrawSetting(
            TexImporterSetting.Settings setting,
            bool foldout,
            string header = "Settings"
            )
        {
            if (foldout)
            {
                showMap[setting.GetHashCode()] = EditorGUILayout.Foldout(
                    showMap.GetValueOrDefault(setting.GetHashCode()),
                    header,
                    true
                    );
            }

            if (!foldout || showMap[setting.GetHashCode()])
            {
                EditorGUI.indentLevel++;

                EditorGUILayout.BeginVertical("box");
                setting.PresetSetting = UTGUI.Enum("Preset: ", setting.PresetSetting);

                var haspreset =
                    setting.PresetSetting != PresetSettings.None;
                EditorGUI.BeginDisabledGroup(haspreset);

                setting.TextureType = UTGUI.Enum("TexType: ", setting.TextureType);
                if (setting.TextureType == TextureImporterType.Default)
                {
                    setting.TextureShape = UTGUI.Enum("TexShape: ", setting.TextureShape);
                }

//            setting.AlphaIsTransparency = MaidEditorGUI.Toggle(
//                "Alpha Is Transparency?",
//                setting.AlphaIsTransparency
//            );
                setting.MipMapEnable = UTGUI.Toggle(
                    "MipMap?",
                    setting.MipMapEnable
                    );
                setting.WrapMode = UTGUI.Enum("Wrap", setting.WrapMode);

                if (setting.AlphaMode != AlphaMode.Auto)
                {
                    setting.OverrideAndroidFormat = UTGUI.Enum(
                        "Android",
                        setting.OverrideAndroidFormat
                        );

                    setting.OverrideIOSFormat = UTGUI.Enum(
                        "IOS",
                        setting.OverrideIOSFormat
                        );

                    setting.OverridePCFormat = UTGUI.Enum(
                        "PC",
                        setting.OverridePCFormat
                        );
                }

                EditorGUI.EndDisabledGroup();

                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical("box");

                EditorGUI.BeginDisabledGroup(setting.TextureType != TextureImporterType.Sprite);

                setting.AtlasMode = UTGUI.Enum("AtlasMode: ", setting.AtlasMode);
                if (setting.AtlasMode == AtlasMode.Custom)
                {
                    setting.PackingTag = UTGUI.Text("Atlas: ", setting.PackingTag);
                }

                EditorGUI.EndDisabledGroup();

                setting.ReadWriteEnable = UTGUI.Toggle(
                    "Readable?",
                    setting.ReadWriteEnable
                    );

//                setting.SRGB = MaidEditorGUI.Toggle(
//                    "sRGB?",
//                    setting.SRGB
//                );

                setting.FilterMode = UTGUI.Enum("Filter", setting.FilterMode);
                setting.MaxSize    = UTGUI.Int("MaxSize", setting.MaxSize);
                setting.AlphaMode  = UTGUI.Enum("AlphaMode", setting.AlphaMode);
                setting.NPOTScale  = UTGUI.Enum("NPOT", setting.NPOTScale);
//                setting.Quality = MaidEditorGUI.Enum("Quality", setting.Quality);

                EditorGUILayout.EndVertical();

                EditorGUI.indentLevel--;

                CheckPreset(setting);
            }
        }