Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Select multiple buttons.

Discussion in 'Scripting' started by antonioperez80, Apr 10, 2021.

  1. antonioperez80

    antonioperez80

    Joined:
    Jun 8, 2017
    Posts:
    40
    Hi there!

    How can I select two buttons or more of the same canvas menu at the same time?

    Thank you!
     
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
    Can you be more specific as to what you mean by "select"? Do you mean hovering? Toggle? What's your use case?
     
  3. antonioperez80

    antonioperez80

    Joined:
    Jun 8, 2017
    Posts:
    40
    Im sorry!
    How can I select multiple buttons at the same time from the same canvas menu with button.select() with code?
     
  4. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
    You cannot. Why do you need to do this?
     
    jasonasaad2 likes this.
  5. jasonasaad2

    jasonasaad2

    Joined:
    Nov 30, 2020
    Posts:
    51
    Where did you get button.select() from anyways, I can't find it on the scripting api.
     
  6. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
  7. Jared_Pitchford

    Jared_Pitchford

    Joined:
    Jul 7, 2018
    Posts:
    3
    You can use disable instead and have the disable color match the select color, and in your script as you select buttons they get disabled and you keep track in your script what has been click or just check which buttons have been disabled.

    Hope this helps.