Fix instance value resolvers on array element uses array as target instead of owner

This commit is contained in:
VladV 2022-12-09 19:50:24 +04:00
parent ac647eb85a
commit b969569ae7
5 changed files with 7 additions and 4 deletions

View File

@ -49,7 +49,7 @@ namespace TriInspector.Resolvers
public override void InvokeForTarget(TriProperty property, int targetIndex)
{
var parentValue = property.Parent.GetValue(targetIndex);
var parentValue = property.Owner.GetValue(targetIndex);
try
{

View File

@ -47,7 +47,7 @@ namespace TriInspector.Resolvers
public override T GetValue(TriProperty property, T defaultValue = default)
{
var parentValue = property.Parent.GetValue(0);
var parentValue = property.Owner.GetValue(0);
try
{

View File

@ -49,7 +49,7 @@ namespace TriInspector.Resolvers
public override T GetValue(TriProperty property, T defaultValue = default)
{
var parentValue = property.Parent.GetValue(0);
var parentValue = property.Owner.GetValue(0);
try
{

View File

@ -48,7 +48,7 @@ namespace TriInspector.Resolvers
public override T GetValue(TriProperty property, T defaultValue = default)
{
var parentValue = property.Parent.GetValue(0);
var parentValue = property.Owner.GetValue(0);
try
{

View File

@ -81,6 +81,9 @@ namespace TriInspector
[PublicAPI]
public TriProperty Parent { get; }
[PublicAPI]
public TriProperty Owner => IsArrayElement ? Parent.Owner : Parent;
[PublicAPI]
public bool IsRootProperty => Parent == null;