File tree Expand file tree Collapse file tree 5 files changed +14
-20
lines changed
Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,7 @@ protected override void DrawPropertyLayout(GUIContent label)
6666 }
6767
6868 _propertyTree . Update ( ) ;
69-
70- if ( _propertyTree . ValidationRequired )
71- {
72- _propertyTree . RunValidation ( ) ;
73- }
69+ _propertyTree . RunValidationIfRequired ( ) ;
7470
7571 _labelOverrideContext . Label = label ?? GUIContent . none ;
7672
Original file line number Diff line number Diff line change @@ -65,11 +65,7 @@ protected override void DrawPropertyLayout(GUIContent label)
6565 }
6666
6767 _propertyTree . Update ( ) ;
68-
69- if ( _propertyTree . ValidationRequired )
70- {
71- _propertyTree . RunValidation ( ) ;
72- }
68+ _propertyTree . RunValidationIfRequired ( ) ;
7369
7470 using ( TriGuiHelper . PushEditorTarget ( ValueEntry . SmartValue ) )
7571 {
Original file line number Diff line number Diff line change @@ -94,11 +94,7 @@ private void DrawElement()
9494
9595 _currentSerializedObject . UpdateIfRequiredOrScript ( ) ;
9696 _currentPropertyTree . Update ( ) ;
97-
98- if ( _currentPropertyTree . ValidationRequired )
99- {
100- _currentPropertyTree . RunValidation ( ) ;
101- }
97+ _currentPropertyTree . RunValidationIfRequired ( ) ;
10298
10399 GUILayout . Space ( 10 ) ;
104100 GUILayout . Label ( "Preview" , EditorStyles . boldLabel ) ;
Original file line number Diff line number Diff line change @@ -53,11 +53,7 @@ public override void OnInspectorGUI()
5353 serializedObject . UpdateIfRequiredOrScript ( ) ;
5454
5555 _inspector . Update ( ) ;
56-
57- if ( _inspector . ValidationRequired )
58- {
59- _inspector . RunValidation ( ) ;
60- }
56+ _inspector . RunValidationIfRequired ( ) ;
6157
6258 using ( TriGuiHelper . PushEditorTarget ( target ) )
6359 {
Original file line number Diff line number Diff line change @@ -40,6 +40,16 @@ public virtual bool ApplyChanges()
4040 return false ;
4141 }
4242
43+ public void RunValidationIfRequired ( )
44+ {
45+ if ( ! ValidationRequired )
46+ {
47+ return ;
48+ }
49+
50+ RunValidation ( ) ;
51+ }
52+
4353 public void RunValidation ( )
4454 {
4555 ValidationRequired = false ;
You can’t perform that action at this time.
0 commit comments