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

View File

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