public bool NotifyControlChanged(UiControl control) { if (control == null) { return(false); } TargetControl tc = null; if (control == nameKey?.control) { tc = nameKey; } else if (control == subInspector?.control) { tc = subInspector; } else { return(false); } // Try setting the property/field values on target after reading it from UI control: bool success = false; bool bindingSuccessful = false; try { success = tc.SetValue(accessor, control.RawValue); if (success && tc.IsContentBindingSource) { bindingSuccessful = UiInspector.LoadContentBindingValues(this, tc, accessor.nameKey); } } catch (Exception ex) { Debug.LogError($"[UiControlSubInspector] ERROR! An exception was caught while trying to set a control's value to target member!\nException message: {ex.Message}"); return(false); } // If the bound content was not found or could not be loaded, the key must have been invalid, so reset that: if (!bindingSuccessful) { nameKey.control.SetValue(string.Empty); } // Notify the host that this list or nested object has been changed: return(success && host != null?host.NotifyControlChanged(this) : success); }