mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Nicify property name in MissingReference validator message
This commit is contained in:
parent
cb787667d7
commit
7d154eb499
@ -16,10 +16,21 @@ namespace TriInspector.Validators
|
||||
serializedProperty.objectReferenceValue == null &&
|
||||
serializedProperty.objectReferenceInstanceIDValue != 0)
|
||||
{
|
||||
return TriValidationResult.Warning($"{propertyValue.Property.DisplayName} is missing");
|
||||
return TriValidationResult.Warning($"{GetName(propertyValue.Property)} is missing");
|
||||
}
|
||||
|
||||
return TriValidationResult.Valid;
|
||||
}
|
||||
|
||||
private static string GetName(TriProperty property)
|
||||
{
|
||||
var name = property.DisplayName;
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
name = property.RawName;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user