Search Unity

Is there any way to "bind" UI objects to a list?

Discussion in 'UGUI & TextMesh Pro' started by Yukken, Jun 10, 2019.

  1. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    I'm making a turn based RPG where you can see the turn order.I have a list to represent the turn order in my RPG and I don't want to delete and instantiate new UI objects every time I modify the list. The list contains a custom class to hold turn info and there's a prefab with text,image etc that can load that data. I basically just clear the list,destroy every ui element it refers to,instantiate a prefab on a canvas, load the info(such as character name) and parent it to a layout group. Obviously this isn't efficient.

    Is there a better way to do achieve this?