Best practices for syncing lists of gameobjects to lists in UI?

Hello! Unity 5 newbie, experienced programmer, looking for the right way to handle what must be a common use case:

I want to show in my UI a list of networked gameobjects. Those gameobjects are all instances of a specific prefab. What’s the cleanest way to keep my UI list synced to the set of gameobjects as they are spawned and destroyed? I’m specifically looking for ease of maintenance and code reuse.

Basically you need a databinding solution if you want to do this effectively.
Best solution I’ve seen so far is @nventimiglia_1 's Unity MVVM library - GitHub - NVentimiglia/Unity3d-Databinding-Mvvm-Mvc: Unity3d uGUI Observable library for Mvvm / Mvc

Wow, great link, thank you @SimonDarksideJ !

Ive been working in angularjs for the past couple years and was bemoaning my lack of $scope.rows = Rows() :slight_smile:

MVVM doesnt look quite as easy to hookup but it seems like the right way to do it.

@sdebaun I have an ListBinder for binding ‘layout collections’. You can define you datamodel in plain C#, and then the control will automatically instantiate and bind your uGUI prefab to it. If you need any help, just post an issue to my github repo.

https://github.com/NVentimiglia/Unity3d-Foundation