예제 #1
0
    /// <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();
    }
예제 #2
0
 protected void Subscribe(UnityEvent e, UnityAction action)
 {
     UnityEventOwner.Subscribe(e, action);
 }