Tri-Inspector/Editor/Resolvers/ActionResolver.cs

32 lines
956 B
C#
Raw Normal View History

2022-05-11 07:13:25 -04:00
using JetBrains.Annotations;
namespace TriInspector.Resolvers
{
public abstract class ActionResolver
{
public static ActionResolver Resolve(TriPropertyDefinition propertyDefinition, string method)
{
if (InstanceActionResolver.TryResolve(propertyDefinition, method, out var iar))
{
return iar;
}
return new ErrorActionResolver(propertyDefinition, method);
}
[PublicAPI]
public abstract bool TryGetErrorString(out string error);
[PublicAPI]
public abstract void InvokeForTarget(TriProperty property, int targetIndex);
[PublicAPI]
public void InvokeForAllTargets(TriProperty property)
{
for (var targetIndex = 0; targetIndex < property.PropertyTree.TargetObjects.Length; targetIndex++)
{
InvokeForTarget(property, targetIndex);
}
}
}
}