Merge pull request #77 from kyubuns/patch-1

Fixed SampleScript in the readme
This commit is contained in:
Yoshifumi Kawai 2024-10-07 20:19:33 +09:00 committed by GitHub
commit 81baa40aab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -441,7 +441,7 @@ public class SampleScript : MonoBehaviour
public Button prefab;
public GameObject root;
ObservableRingBuffer<int> collection;
ISynchronizedView<GameObject> view;
ISynchronizedView<int, GameObject> view;
void Start()
{
@ -459,10 +459,10 @@ public class SampleScript : MonoBehaviour
view.ViewChanged += View_ViewChanged;
}
void View_ViewChanged(in SynchronizedViewChangedEventArgs<int, string> eventArgs)
void View_ViewChanged(in SynchronizedViewChangedEventArgs<int, GameObject> eventArgs)
{
// hook remove event
if (NotifyCollectionChangedAction.Remove)
if (eventArgs.Action == NotifyCollectionChangedAction.Remove)
{
GameObject.Destroy(eventArgs.OldItem.View);
}