Drop support of Tri-drawn properties in Odin editors

This commit is contained in:
VladV 2023-06-16 19:38:47 +04:00
parent 5dc71785af
commit 4df61db1e1
2 changed files with 16 additions and 6 deletions

View File

@ -3,7 +3,7 @@ using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities.Editor;
using UnityEngine;
#if !TRIINSPECTOR_DISABLE_ODIN_FIELDS_INJECTOR
#if TRIINSPECTOR_ODIN_FIELDS_INJECTOR
namespace TriInspector.Editor.Integrations.Odin
{
@ -43,8 +43,13 @@ namespace TriInspector.Editor.Integrations.Odin
for (var parent = property.Parent; parent != null; parent = parent.Parent)
{
var parentType = parent.ValueEntry.TypeOfValue;
if (TriOdinUtility.IsDrawnByTri(parentType))
var valueEntry = parent.ValueEntry;
if (valueEntry == null)
{
continue;
}
if (TriOdinUtility.IsDrawnByTri(valueEntry.TypeOfValue))
{
return false;
}

View File

@ -3,7 +3,7 @@ using Sirenix.OdinInspector.Editor;
using Sirenix.OdinInspector.Editor.Validation;
using TriInspector.Editor.Integrations.Odin;
#if !TRIINSPECTOR_DISABLE_ODIN_FIELDS_INJECTOR
#if TRIINSPECTOR_ODIN_FIELDS_INJECTOR
[assembly: RegisterValidator(typeof(OdinFieldValidator<>))]
@ -43,8 +43,13 @@ namespace TriInspector.Editor.Integrations.Odin
for (var parent = property.Parent; parent != null; parent = parent.Parent)
{
var parentType = parent.Info.TypeOfValue;
if (TriOdinUtility.IsDrawnByTri(parentType))
var valueEntry = parent.ValueEntry;
if (valueEntry == null)
{
continue;
}
if (TriOdinUtility.IsDrawnByTri(valueEntry.TypeOfValue))
{
return false;
}