I am using the GridObjectCollection
Script from MRTK to display a number of buttons. I am instantiating the buttons dynamically through a script and place them as children of the GridObjectCollection
GameObject. Now you can Update the collection through the UpdateCollection()
function. Everything works as expected except the following case:
If i want to display a set of different buttons in the same GridObjectCollection
, i destroy all children of the collection and instantiate the new buttons as before and call the UpdateCollection()
function. But the collection is not updating properly. The old buttons were destroyed and the new added, but the placement is shifted. If i click the UpdateCollection button in inspector, the collection is correctly updated.
Why UpdateCollection()
is not working as expected after modifying the content of the collection?