diff --git a/Scripts/Editor/UIParticleEditor.cs b/Scripts/Editor/UIParticleEditor.cs index cddc0d4..8afa2e9 100644 --- a/Scripts/Editor/UIParticleEditor.cs +++ b/Scripts/Editor/UIParticleEditor.cs @@ -108,9 +108,34 @@ namespace Coffee.UIExtensions } s_ParticleSystems.Clear (); + if (current.maskable && current.material && current.material.shader) + { + var mat = current.material; + var shader = mat.shader; + foreach (var propName in s_MaskablePropertyNames) + { + if (!mat.HasProperty (propName)) + { + EditorGUILayout.HelpBox (string.Format("Shader {0} doesn't have '{1}' property. This graphic is not maskable.", shader.name, propName), MessageType.Warning); + break; + } + } + } + serializedObject.ApplyModifiedProperties (); } + static readonly List s_MaskablePropertyNames = new List () + { + "_Stencil", + "_StencilComp", + "_StencilOp", + "_StencilWriteMask", + "_StencilReadMask", + "_ColorMask", + }; + + class AnimatedProperty { static readonly List s_ActiveNames = new List ();