Search Unity

4.6 - Array / List of Button?

Discussion in 'Immediate Mode GUI (IMGUI)' started by tubbz0r, Oct 14, 2014.

  1. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    I've been fiddling with 4.6 Buttons and trying to have an array of Buttons (4.6) on the Canvas however I do not know how to really go about doing this, would I need to add the script file to Canvas? or maybe attached to a sub-gameobject of Canvas? I just want to be able to display all the Buttons on screen help!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Make a prefab of the button, then instantiate it as many times as you need, using SetParent to make the buttons children of the canvas.

    --Eric