diff --git a/README.md b/README.md index 7da0fc5..01eab90 100644 --- a/README.md +++ b/README.md @@ -441,7 +441,7 @@ public class SampleScript : MonoBehaviour public Button prefab; public GameObject root; ObservableRingBuffer collection; - ISynchronizedView view; + ISynchronizedView view; void Start() { @@ -459,10 +459,10 @@ public class SampleScript : MonoBehaviour view.ViewChanged += View_ViewChanged; } - void View_ViewChanged(in SynchronizedViewChangedEventArgs eventArgs) + void View_ViewChanged(in SynchronizedViewChangedEventArgs eventArgs) { // hook remove event - if (NotifyCollectionChangedAction.Remove) + if (eventArgs.Action == NotifyCollectionChangedAction.Remove) { GameObject.Destroy(eventArgs.OldItem.View); }