mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Add RunValidationIfRequired api
This commit is contained in:
parent
db3d60270a
commit
513a250c64
@ -66,11 +66,7 @@ namespace TriInspector.Editor.Integrations.Odin
|
||||
}
|
||||
|
||||
_propertyTree.Update();
|
||||
|
||||
if (_propertyTree.ValidationRequired)
|
||||
{
|
||||
_propertyTree.RunValidation();
|
||||
}
|
||||
_propertyTree.RunValidationIfRequired();
|
||||
|
||||
_labelOverrideContext.Label = label ?? GUIContent.none;
|
||||
|
||||
|
@ -65,11 +65,7 @@ namespace TriInspector.Editor.Integrations.Odin
|
||||
}
|
||||
|
||||
_propertyTree.Update();
|
||||
|
||||
if (_propertyTree.ValidationRequired)
|
||||
{
|
||||
_propertyTree.RunValidation();
|
||||
}
|
||||
_propertyTree.RunValidationIfRequired();
|
||||
|
||||
using (TriGuiHelper.PushEditorTarget(ValueEntry.SmartValue))
|
||||
{
|
||||
|
@ -94,11 +94,7 @@ namespace TriInspector.Editor.Samples
|
||||
|
||||
_currentSerializedObject.UpdateIfRequiredOrScript();
|
||||
_currentPropertyTree.Update();
|
||||
|
||||
if (_currentPropertyTree.ValidationRequired)
|
||||
{
|
||||
_currentPropertyTree.RunValidation();
|
||||
}
|
||||
_currentPropertyTree.RunValidationIfRequired();
|
||||
|
||||
GUILayout.Space(10);
|
||||
GUILayout.Label("Preview", EditorStyles.boldLabel);
|
||||
|
@ -53,11 +53,7 @@ namespace TriInspector
|
||||
serializedObject.UpdateIfRequiredOrScript();
|
||||
|
||||
_inspector.Update();
|
||||
|
||||
if (_inspector.ValidationRequired)
|
||||
{
|
||||
_inspector.RunValidation();
|
||||
}
|
||||
_inspector.RunValidationIfRequired();
|
||||
|
||||
using (TriGuiHelper.PushEditorTarget(target))
|
||||
{
|
||||
|
@ -40,6 +40,16 @@ namespace TriInspector
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RunValidationIfRequired()
|
||||
{
|
||||
if (!ValidationRequired)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RunValidation();
|
||||
}
|
||||
|
||||
public void RunValidation()
|
||||
{
|
||||
ValidationRequired = false;
|
||||
|
Loading…
Reference in New Issue
Block a user