{
var so = serializedObject;
so.Update();
bool needModelUpdate; // Whether the name, model, or inference device changed.
bool behaviorTypeChanged;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(so.FindProperty("m_BehaviorName"));
bool needModelUpdate = EditorGUI.EndChangeCheck();
EditorGUI.BeginChangeCheck(); // global
}
needModelUpdate = EditorGUI.EndChangeCheck();
var brainParamsChanged = EditorGUI.EndChangeCheck();
EditorGUILayout.PropertyField(so.FindProperty("m_Model"), true);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(so.FindProperty("m_InferenceDevice"), true);
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(so.FindProperty("m_BehaviorType"));
var behaviorTypeChanged = EditorGUI.EndChangeCheck();
behaviorTypeChanged = EditorGUI.EndChangeCheck();
EditorGUILayout.PropertyField(so.FindProperty("TeamId"));
EditorGUI.BeginDisabledGroup(Application.isPlaying);
var othersChanged = EditorGUI.EndChangeCheck();
m_RequireReload = needModelUpdate || brainParamsChanged || behaviorTypeChanged || othersChanged;
m_RequireReload = EditorGUI.EndChangeCheck();
UpdateAgent(needModelUpdate, behaviorTypeChanged);
UpdateAgentFromBehaviorParameters(needModelUpdate, behaviorTypeChanged);
void UpdateAgent(bool needModelUpdate, bool behaviorTypeChanged)
void UpdateAgentFromBehaviorParameters(bool needModelUpdate, bool behaviorTypeChanged)
if (Application.isPlaying)