added null protection
This commit is contained in:
Родитель
5dd5f77496
Коммит
7c2bb5571a
|
@ -6,11 +6,12 @@ namespace UnityEditor.FrameRecorder
|
|||
{
|
||||
public delegate EFieldDisplayState IsFieldAvailableDelegate(SerializedProperty property);
|
||||
|
||||
public IsFieldAvailableDelegate IsFieldAvailableForHost { get; set; }
|
||||
public IsFieldAvailableDelegate isFieldAvailableForHost { get; set; }
|
||||
|
||||
protected virtual void AddProperty(SerializedProperty prop, Action action )
|
||||
{
|
||||
var state = IsFieldAvailableForHost(prop);
|
||||
var state = isFieldAvailableForHost == null ? EFieldDisplayState.Disabled : isFieldAvailableForHost(prop);
|
||||
|
||||
if (state == EFieldDisplayState.Enabled)
|
||||
state = IsFieldAvailable(prop);
|
||||
if (state != EFieldDisplayState.Hidden)
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace UnityEditor.FrameRecorder
|
|||
|
||||
editor = Editor.CreateEditor(m_SettingsObj);
|
||||
if (editor is InputEditor)
|
||||
(editor as InputEditor).IsFieldAvailableForHost = m_Validator;
|
||||
(editor as InputEditor).isFieldAvailableForHost = m_Validator;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче