mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-26 04:39:51 -05:00
To be able to display errors as much as possible
This commit is contained in:
@@ -14,6 +14,7 @@ namespace UniVRM10
|
||||
item = new PreviewMaterialItem(material);
|
||||
|
||||
var propNames = new List<string>();
|
||||
var hasError = false;
|
||||
for (int i = 0; i < ShaderUtil.GetPropertyCount(material.shader); ++i)
|
||||
{
|
||||
var propType = ShaderUtil.GetPropertyType(material.shader, i);
|
||||
@@ -27,15 +28,15 @@ namespace UniVRM10
|
||||
if (!PreviewMaterialItem.TryGetBindType(name, out var bindType))
|
||||
{
|
||||
Debug.LogError($"{material.shader.name}.{name} is unsupported property name");
|
||||
item = null;
|
||||
return false;
|
||||
hasError = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Enum.TryParse(propType.ToString(), true, out ShaderPropertyType propertyType))
|
||||
{
|
||||
Debug.LogError($"{material.shader.name}.{propertyType.ToString()} is unsupported property type");
|
||||
item = null;
|
||||
return false;
|
||||
hasError = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
item.PropMap.Add(bindType, new PropItem
|
||||
@@ -53,7 +54,8 @@ namespace UniVRM10
|
||||
}
|
||||
}
|
||||
item.PropNames = propNames.ToArray();
|
||||
return true;
|
||||
|
||||
return !hasError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user