I'm currently developing an app using Unity. I would use the virtual hands to interact with objects/button. I aim to implement a scene where there is an object/button and upon pressing it, another object changes color. I'm wondering how I could achieve this. Any insights or suggestions on how to go about implementing this interaction would be appreciated!
I did some with HTC Vive and Leap motion using Interaction Button (i am looking for something similar)
there are multiple prebuilt toolkits in unity if you want to try that related to buttons and some predefined actions. i guess if you use it and see how it works will help you.
or you can use
GameObject buttonPrecolor;
void MyAwesomeColorCreator()
{
GameObject go = Instantiate(buttonPrecolor);
var button = GetComponent<UnityEngine.UI.Button>();
button.onClick.AddListener(() => FooOnClick());
}
void CuttonOnClick()
{
Debug.Log("color change");
}