Hi,
I’ve built a complete Unity app that works great for mouse. Now I’m trying to port it to multi-touch using uniTUIO, for use on an actual multi-touch table.
What I’d like to do is to simply replace these calls:
if (Input.GetMouseButtonDown(0)) {}
else if (Input.GetMouseButton(0)) {}
else if (Input.GetMouseButtonUp(0)) {}
with these calls:
if (iPhoneInput.touchCount > 0 && iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Began) {}
else if (iPhoneInput.touchCount > 0 && iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Moved) {}
else if (iPhoneInput.touchCount > 0 && iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Ended) {}
I know this implementation isn’t true multi-touch… that’s the next step. For now, I just want my app to work with TUIO… and specifically uniTUIO, which appears to get mult-touch working by emulating iPhone touch events within its code.
The problem I’m experiencing is that my main script, which is attached to the Main Camera, is not receiving any of the iPhoneInput signals that uniTUIO is purportedly generating.
As a test I attached the uniTUIO supplied BBTouchableButton script to a few game objects, and designated Main Camera as the Notification Object. Sure enough, that properly triggered the doTouchDown() and doTouchUp() functions in my Main Camera script when the afroementioned gameObjects were touched. So uniTUIO is working at SOME level…
just need some guidance on getting the actual iPhoneTouch events to propagate globally…