Ejemplo n.º 1
0
        private void OnDestroy()
        {
            var method = UnityEventBinder.GetRemoveListener(_srcEventProp.GetValue(_srcView));

            if (d == null || method == null)
            {
                return;
            }

            var p = new object[] { d };

            method.Invoke(_srcEventProp.GetValue(_srcView), p);
        }
Ejemplo n.º 2
0
        public override void UnregisterDataBinding()
        {
            base.UnregisterDataBinding();

            var propInfo             = _dstView.GetType().GetProperty(_dstChangedEventName);
            var removeListenerMethod = UnityEventBinder.GetRemoveListener(propInfo.GetValue(_dstView));

            var p = new object[] { changeDelegate };

            _binder.OnChange -= _connection.DstUpdated;

            removeListenerMethod.Invoke(propInfo.GetValue(_dstView), p);
        }
Ejemplo n.º 3
0
        private void UnbindDstchangedHandler()
        {
            //Debug.Log($"UnBind DstChangedHandler {_gameObject}");

            var owner                = DstTarget.propertyOwner;
            var propInfo             = owner.GetType().GetProperty(DstTarget.eventName);
            var removeListenerMethod = UnityEventBinder.GetRemoveListener(propInfo.GetValue(owner));

            var p = new object[] { changeDelegate };

            _eventBinder.OnChange -= DstUpdated;

            removeListenerMethod.Invoke(propInfo.GetValue(owner), p);
        }
Ejemplo n.º 4
0
        public override void UnregisterDataBinding()
        {
            var method = UnityEventBinder.GetRemoveListener(_srcEventProp.GetValue(SrcView));

            if (d == null || method == null)
            {
                return;
            }

            var p = new object[] { d };

            method.Invoke(_srcEventProp.GetValue(SrcView), p);

            _isEventBound = false;
        }