private static MaterialPropertyDrawer GetShaderPropertyDrawer(string attrib, out bool isDecorator)
{
isDecorator = false;
string str = attrib;
string argsText = string.Empty;
Match match = Regex.Match(attrib, @"(\w+)\s*\((.*)\)");
if (match.Success)
{
str = match.Groups[1].Value;
argsText = match.Groups[2].Value.Trim();
}
foreach (Type type in EditorAssemblies.SubclassesOf(typeof(MaterialPropertyDrawer)))
{
if (((type.Name == str) || (type.Name == (str + "Drawer"))) || (((type.Name == ("Material" + str + "Drawer")) || (type.Name == (str + "Decorator"))) || (type.Name == ("Material" + str + "Decorator"))))
{
try
{
isDecorator = type.Name.EndsWith("Decorator");
return CreatePropertyDrawer(type, argsText);
}
catch (Exception)
{
object[] args = new object[] { str, argsText };
Debug.LogWarningFormat("Failed to create material drawer {0} with arguments '{1}'", args);
return null;
}
}
}
return null;
}