if ( touch.phase == TouchPhase.Began) {
if (EventSystem.current.currentSelectedGameObject.name == “button”) {
GameObject.Find(“debug”).GetComponent().text =“Button Clicked”;
}
}
I try to detect another UI like RawImage, It dosent work
I would make the samething as “currentSelectedGameObject” do or touch detecting over UI but nothing come out of “RawImage UI”
anyone tell me how Thank you
if you want to make something other than a button work like a button the simplest way is to add a script that implements the IPointerClickHandler interface
http://docs.unity3d.com/ScriptReference/EventSystems.IPointerClickHandler.html
1 Like
Thank you sir
If I playing with touch , do we have function like this ?
you might need to check what input handler is in your scene (StandAloneInputModule, TouchInputModule etc.), but the event system is designed to work independently of the type of input.