in unity/Assets/PostProcessingV2/Editor/Effects/VignetteEditor.cs [36:77]
public override void OnInspectorGUI()
{
PropertyField(m_Mode);
PropertyField(m_Color);
if (m_Mode.value.intValue == (int)VignetteMode.Classic)
{
PropertyField(m_Center);
PropertyField(m_Intensity);
PropertyField(m_Smoothness);
PropertyField(m_Roundness);
PropertyField(m_Rounded);
}
else
{
PropertyField(m_Mask);
var mask = (target as Vignette).mask.value;
// Checks import settings on the mask
if (mask != null)
{
var importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(mask)) as TextureImporter;
// Fails when using an internal texture as you can't change import settings on
// builtin resources, thus the check for null
if (importer != null)
{
bool valid = importer.anisoLevel == 0
&& importer.mipmapEnabled == false
&& importer.alphaSource == TextureImporterAlphaSource.FromGrayScale
&& importer.textureCompression == TextureImporterCompression.Uncompressed
&& importer.wrapMode == TextureWrapMode.Clamp;
if (!valid)
EditorUtilities.DrawFixMeBox("Invalid mask import settings.", () => SetMaskImportSettings(importer));
}
}
PropertyField(m_Opacity);
}
}