Log in or register to post comments

Enable and Disable Virtual Button

March 4, 2013 - 1:50pm #1

hello,

i have question,  how i can Enable and Disable Virtual Button at Runtime.

Example:

beginning =  button red ( enable),  button blue ( disable),  button yellow ( disable).

when button red pressed = button red ( disable),  button blue ( enable),  button yellow ( disable).

when button blue pressed = button red ( enable),  button blue ( disable),  button yellow ( enable).

 

thanks in advance!

Enable and Disable Virtual Button

July 13, 2018 - 4:35am #5

Yes. We can enable/disable at runtime from Unity C# script.

Answer: https://stackoverflow.com/q/51323819/3185013

Enable and Disable Virtual Button

March 4, 2013 - 4:24pm #4

Disable the Virtual Buttons Menu in the ARCamera's Inspector panel.

Enable and Disable Virtual Button

March 4, 2013 - 4:12pm #3

one more question.,

how i can remove white line(square line)  in virtual button at runtime ?

Enable and Disable Virtual Button

March 4, 2013 - 2:17pm #2

There is a SetEnabled( bool ) method on the VirtualButton class - https://developer.vuforia.com/resources/api/class_virtual_button.htm

But this requires that you deactivate the associated dataset, which you'd have to subsequently reactivate so that the other buttons are enabled.

A less costly and complex approach would be to unregister the event handler for the VB - https://developer.vuforia.com/resources/api/class_virtual_button_behaviour.htm

But the simplest approach may be to handle this button logic in the event handler itself, by storing the name of the last VB that was pressed and responding accordingly for subsequent OnButtonPressed events arising from the VBs. For example after the red button is pressed, you would ignore presses from red and yellow. After the blue button is pressed, then you ignore subjequent blue presses and and only respond to red and yellow presses. If your logic is path dependent, then you could store the history of presses in an array.

Log in or register to post comments