using System; using System.Collections.Generic; namespace UnityAtoms { internal class ObservableUnsubscriber : IDisposable { private List> _observers; private IObserver _observer; public ObservableUnsubscriber(List> observers, IObserver observer) { this._observers = observers; this._observer = observer; } public void Dispose() { if (_observer != null && _observers.Contains(_observer)) { _observers.Remove(_observer); } } } }