Cysharp / ObservableCollections

High performance observable collections and synchronized views, for WPF, Blazor, Unity.
MIT License
461 stars 36 forks source link

Getting old and new index in ChangeKind.Moved #5

Closed slimshader closed 2 years ago

slimshader commented 2 years ago

Hi, components like Vertical/HorizontalLayoutGroup arrange their elements based on relative order of children inside parent GameObjects. This means game objects has to be moved too when it moves in underlying ObservableList. I am not sure tho how to do it when ChangeKind.Moved happened as there are no index parameters.

[Edit] Very sorry for all the edits. lost connection and things got messed up.

neuecc commented 2 years ago

Thank you for trying it. I added in NotifyCollectionChangedEventArgs<T> eventArgs as an argument in 1.1.0. However, this is a very primitive value, and also potentially difficult to handle correctly when batching (Move doesn't have batche, so it's okay).

slimshader commented 2 years ago

Fantastic, thank you, will try it out asap. And thank you for another fantastic library.