Search Unity

Unity UI Which is the lightest UI object between Button, Dropdown and Input Field?

Discussion in 'UGUI & TextMesh Pro' started by Redden44, Aug 22, 2019.

  1. Redden44

    Redden44

    Joined:
    Nov 15, 2014
    Posts:
    159
    Hello, I need to create a menu containing up to 400 slots (20x20), each slot contains a number that the player can edit and I'm wondering which UI object I should use for this task. Platform is PC and it's a menu I would like to build at runtime and that I probably have to destroy/build each time the player opens it.
    Honestly I don't even know if spawning 400 UI prefabs is a problem at all, maybe I'm worrying for nothing. Anyway anyone can tell me which solution is lighter please? Thanks!

    1- A text to display the number and a button to click that increases the number and resets it when it goes beyond the maximum value.

    2- A text to display the number and 2 buttons, one to increase the number and one to decrease it. I like it more than the first solution, it's less clunky, but I have to spawn twice the number of buttons..in the worst case is 400 texts + 800 buttons.

    3- A dropdown; this is probably the easiest solution, but is it lighter than the buttons?

    4- An input field; this is probably the most annoying solution because I have to validate the input and again is it lighter or heavier than the buttons or the dropdown?

    Thanks!