Author Topic: Keep specific color button after click it  (Read 2494 times)

DIEM

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Keep specific color button after click it
« on: February 14, 2014, 12:57:30 PM »
Hi,
I have a list of buttons and I want to highlighted (with a specific color) the button that was selected from this list.
If another button is selected, the previous button return to normal color and the current selected button gets the specific color.
How can I do this?  ???

Thank you,
Priscila Ariel

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keep specific color button after click it
« Reply #1 on: February 15, 2014, 01:08:59 AM »
Don't use the button script for this. Write your own custom script, something along the lines of:
  1. void OnClick()
  2. {
  3.     UISprite sprite = GetComponent<UISprite>();
  4.     sprite.color = Color.red;
  5. }