3
3
using UnityEditor . AssetImporters ;
4
4
using static UnityEditor . EditorGUILayout ;
5
5
6
+ /// <summary>
7
+ /// Qoi Importer Editor
8
+ /// </summary>
6
9
[ CustomEditor ( typeof ( QoiImporter ) ) ]
7
10
public class QoiImporterEditor : ScriptedImporterEditor
8
11
{
9
- SerializedProperty _greyscaleToAlpha ;
12
+ // SerializedProperty _greyscaleToAlpha;
10
13
SerializedProperty _alphaIsTransparency ;
11
14
SerializedProperty _mipMapEnabled ;
12
15
SerializedProperty _npotScale ;
13
16
SerializedProperty _sRGBTexture ;
14
- // SerializedProperty _textureFormat;
15
- SerializedProperty _compressionQuality ;
16
- SerializedProperty _crunchedCompressionQuality ;
17
- SerializedProperty _crunchedCompression ;
17
+
18
18
SerializedProperty _textureType ;
19
- // SerializedProperty _linearTexture;
20
- // SerializedProperty _textureShape;
19
+ // SerializedProperty _linearTexture; // Unused ?
21
20
SerializedProperty _wrapMode ;
22
21
SerializedProperty _filterMode ;
23
22
SerializedProperty _anisoLevel ;
24
23
SerializedProperty _maxTextureSize ;
25
- SerializedProperty _dimension ;
26
-
27
- // public bool grayscaleToAlpha;
28
- // public bool alphaIsTransparency;
29
- // // public TextureImporterMipFilter mipmapFilter;
30
- // // public int mipMapBias = 0;
31
- // public bool mipMapEnabled = true;
32
- // public TextureImporterNPOTScale npotScale = TextureImporterNPOTScale.None;
33
- // // public bool isReadable;
34
- // // public bool streamingMipmaps = true;
35
- // // public int streamingMipmapsPriority = 0;
36
- // public bool sRGBTexture = true;
37
- // public TextureFormat textureFormat = TextureFormat.DXT5;
38
- // public TextureCompressionQuality compressionQuality;
39
- // public TextureCompressionQuality crunchedCompressionQuality = TextureCompressionQuality.Best;
40
- // public bool crunchedCompression = false;
41
- // public TextureImporterType textureType = TextureImporterType.Default;
42
- // public bool linearTexture = false;
43
- // public TextureImporterShape textureShape;
44
- // public TextureWrapMode wrapMode;
45
- // public FilterMode filterMode;
46
- // public int anisoLevel = 1;
47
- // public int maxTextureSize = 2048;
48
- // public TextureDimension dimension = TextureDimension.Tex2D;
24
+
25
+ // Compression
26
+ SerializedProperty _compressionQuality ;
27
+ SerializedProperty _crunchedCompression ;
49
28
50
29
private void Initialize ( )
51
30
{
52
- _greyscaleToAlpha = Find ( "grayscaleToAlpha" ) ;
31
+ _textureType = Find ( "textureType" ) ;
32
+ // _greyscaleToAlpha = Find("grayscaleToAlpha");
53
33
_alphaIsTransparency = Find ( "alphaIsTransparency" ) ;
54
34
_mipMapEnabled = Find ( "mipMapEnabled" ) ;
55
35
_npotScale = Find ( "npotScale" ) ;
56
36
_sRGBTexture = Find ( "sRGBTexture" ) ;
57
- // _textureFormat = Find("textureFormat");
58
- _compressionQuality = Find ( "compressionQuality" ) ;
59
- // _crunchedCompressionQuality = Find("crunchedCompressionQuality");
60
- _crunchedCompression = Find ( "crunchedCompression" ) ;
61
- _textureType = Find ( "textureType" ) ;
62
37
// _linearTexture = Find("linearTexture");
63
- // _textureShape = Find("textureShape");
38
+
64
39
_wrapMode = Find ( "wrapMode" ) ;
65
40
_filterMode = Find ( "filterMode" ) ;
66
41
_anisoLevel = Find ( "anisoLevel" ) ;
67
42
_maxTextureSize = Find ( "maxTextureSize" ) ;
68
- // _dimension = Find("dimension");
43
+
44
+ _compressionQuality = Find ( "compressionQuality" ) ;
45
+ _crunchedCompression = Find ( "crunchedCompression" ) ;
46
+
47
+
69
48
}
70
49
71
50
public override void OnInspectorGUI ( )
@@ -75,26 +54,26 @@ public override void OnInspectorGUI()
75
54
PropertyField ( _textureType , new GUIContent ( "Texture Type" ) ) ;
76
55
// PropertyField(_linearTexture, new GUIContent("Linear Texture"));
77
56
78
- GUILayout . Space ( 20 ) ;
79
- PropertyField ( _greyscaleToAlpha , new GUIContent ( "Grayscale to Alpha" ) ) ;
57
+
58
+ // PropertyField(_greyscaleToAlpha, new GUIContent("Grayscale to Alpha"));
80
59
PropertyField ( _alphaIsTransparency , new GUIContent ( "Alpha is Transparency" ) ) ;
81
60
PropertyField ( _mipMapEnabled , new GUIContent ( "Enable MipMaps" ) ) ;
82
- PropertyField ( _npotScale , new GUIContent ( "NPOT Scale" ) ) ;
83
- PropertyField ( _sRGBTexture , new GUIContent ( "sRGB Texture" ) ) ;
84
- // PropertyField(_textureFormat, new GUIContent("Texture Format"));
85
-
61
+ PropertyField ( _npotScale , new GUIContent ( "NPOT Scaling" , "Non Power of Two Scaling" ) ) ;
62
+ PropertyField ( _sRGBTexture , new GUIContent ( "sRGB" , "sRGB Texture" ) ) ;
63
+
86
64
65
+ GUILayout . Space ( 20 ) ;
87
66
// PropertyField(_textureShape, new GUIContent("Texture Shape"));
88
67
PropertyField ( _wrapMode , new GUIContent ( "Wrap Mode" ) ) ;
89
68
PropertyField ( _filterMode , new GUIContent ( "Filter Mode" ) ) ;
90
69
PropertyField ( _anisoLevel , new GUIContent ( "Aniso Level" ) ) ;
91
- PropertyField ( _maxTextureSize , new GUIContent ( "Max Texture Size" ) ) ;
92
- // PropertyField(_dimension, new GUIContent("Dimension"));
70
+ PropertyField ( _maxTextureSize , new GUIContent ( "Max Size" ) ) ;
71
+
93
72
94
73
// [Header("CompressionLevel")]
95
74
GUILayout . Space ( 20 ) ;
96
75
GUILayout . Label ( "Compression" , EditorStyles . boldLabel ) ;
97
- PropertyField ( _compressionQuality , new GUIContent ( "Compression Quality" ) ) ;
76
+ PropertyField ( _compressionQuality , new GUIContent ( "Quality" ) ) ;
98
77
// PropertyField(_crunchedCompressionQuality, new GUIContent("Crunched Compression Quality"));
99
78
PropertyField ( _crunchedCompression , new GUIContent ( "Crunch" ) ) ;
100
79
// HasModified();
0 commit comments