/// <summary> /// Make this listener dispatch a null PropertyChanged whenever another model changes /// </summary> public void Listen(INotifyPropertyChanged source) { if (source == null) { Debug.LogError("Tried to bind a model to a null source model."); } var handle = Owner.Subscribe(() => source.PropertyChanged += OnPropertyChanged, () => source.PropertyChanged -= OnPropertyChanged); Handles.Add(handle); NotifyAny(); }
protected void Subscribe(UnityEvent e, UnityAction action) { UnityEventOwner.Subscribe(e, action); }