Unity Custom Editor Texture Warning

Hi there,

I would like to know how can I display a texture warning according to the texture type. Is it possible to display a warning depending on the selected texture type (Texture, Normal, GUI, etc.) ? How ?

Texture2D t = textureProperty.objectReferenceValue as Texture2D;
t = EditorGUI.ObjectField(rect, t, typeof(Texture2D), false) as Texture2D;
textureProperty.objectReferenceValue = t;
// if the texture is Normal, GUI or whatever, display a warning or anything.

Thanks a lot.

TextureImporter.textureType

TextureImporterType

http://docs.unity3d.com/ScriptReference/TextureImporter.html

TextureImporter.textureType; in if() statement should do the trick.
Haven’t tried it yet.