Hey, so im kind of strugguling with this. I want so whenever i touch a UI element to give him id of the finger which touched the actual UI so i could keep track of its phase. Any ideas? Would really help!
-Thanks!!
-Cheers!
Hey, so im kind of strugguling with this. I want so whenever i touch a UI element to give him id of the finger which touched the actual UI so i could keep track of its phase. Any ideas? Would really help!
-Thanks!!
-Cheers!
if youβre implementing one of the eventsystem interfaces (IPointerClickHandler for example) touchID is
http://docs.unity3d.com/ScriptReference/EventSystems.PointerEventData-pointerId.html
eventdata being the parameter passed into the function
[RequireComponent(typeof(RectTransform), typeof(EventTrigger))]
public class InputListener : MonoBehaviour, IPointerUpHandler {
public void OnPointerUp (PointerEventData eventData) {
//Check that the pressed object can receive the id
if (eventData.pointerPress.GetComponent<YourUIComponent>())
//Send it
eventData.pointerPress.GetComponent<YourUIComponent>().DoSomethingWithPointerID(eventData.pointerID);
}
}