public void SetData(MObject data) { for (var i = 0; i < _binders.Count; i++) { var serializedBinder = _binders[i]; //var modelMember = _modelMemberToBinderInfo[serializedBinder.FieldName]; if (serializedBinder.BinderInstance == null) { Debug.LogWarningFormat(this, "binder for [{0}] is null", serializedBinder.FieldName); continue; } var value = data[serializedBinder.FieldName]; BinderUtil.SetValueToBinder(value, serializedBinder.BinderInstance); } }
public MObject GetData() { var obj = new MObject(); for (var i = 0; i < _binders.Count; i++) { var serializedBinder = _binders[i]; if (serializedBinder.BinderInstance == null) { Debug.LogWarningFormat(this, "binder for [{0}] is null", serializedBinder.FieldName); continue; } obj.Add(serializedBinder.FieldName, BinderUtil.GetValueFromBinder(serializedBinder.BinderInstance)); } return(obj); }