You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
close #43; Display warning when material does not support Mask
This commit is contained in:
@@ -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<string> s_MaskablePropertyNames = new List<string> ()
|
||||
{
|
||||
"_Stencil",
|
||||
"_StencilComp",
|
||||
"_StencilOp",
|
||||
"_StencilWriteMask",
|
||||
"_StencilReadMask",
|
||||
"_ColorMask",
|
||||
};
|
||||
|
||||
|
||||
class AnimatedProperty
|
||||
{
|
||||
static readonly List<string> s_ActiveNames = new List<string> ();
|
||||
|
||||
Reference in New Issue
Block a user