Tri-Inspector/Editor/Resolvers/ErrorValueResolver.cs

23 lines
639 B
C#
Raw Normal View History

2022-05-11 12:48:50 -04:00
namespace TriInspector.Resolvers
{
internal class ErrorValueResolver<T> : ValueResolver<T>
{
private readonly string _expression;
public ErrorValueResolver(TriPropertyDefinition propertyDefinition, string expression)
{
_expression = expression;
}
public override bool TryGetErrorString(out string error)
{
error = $"Method '{_expression}' not exists or has wrong signature";
return true;
}
public override T GetValue(TriProperty property, T defaultValue = default)
{
return defaultValue;
}
}
}