Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Which Button is Pressed

Started by sidbhati32 1 reply 1.1k views
Original Post
sidbhati32
sidbhati32
Hello,
I am using unity and I am confused on one part
It's like I have three buttons out of which one has to be selected. If I have selected one of the three buttons during runtime and then I want to select the other button. How would Unity know that only one button has to be selected out of the three and unity has to disable the older selected button now?
There must be some function to make unity know that it has to deselect the older option and select the newer one?
I have attached a screen shot along with this.
Thanks

Unity.png

NubDevice
NubDevice

Add listeners to your buttons and in each, deactivate the other two programically. Try starting with this page from the unity scripting api documentation which demonstrates the AddListener method call and custom callback.

Dev careful. Pixel on board.
Buckle up. Everything will be revealed.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.