|
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: with these calls: 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...
(comments are locked)
|
|
I am trying to work on a similar thing as far as I can tell so hopefully I can help you. First things first, you need a TUIOStarter prefab with some scripts attached. These scripts are BBTouchManagerStarter (BBIPhoneTouchManager needs to be attached to this on the Event Manager Prefab slot) and for helping with testing, BBCrosshairController. Then just drag the prefab in to your scene. Then on any objects you want to be drag-able, you need some more scripts. You need BBBasicTouchManipulation and BBTouchableButton. Included in the former script is a line which sends a message when the touch is down and another when the touch is up. So to have events on touch down, just create a function called "doTouchDown" in any of the scripts attached to the same object and the same for "doTouchUp" Hope this helps and I did understand your problem correctly and good luck with the rest of it! Matt Right, I've had those scripts in place for some time. There are hundreds of objects in each of my 4 scenes and I'd prefer not to have to manually attach scripts and parameters to each of them. Since my MasterScript already detects for raycasts and determines which gameObject gets hit from a mouseDown event, I'd like to simply iterate the same code for all active touchDowns / touchMoves, and then let my master script determine what is being hit and what needs to be done. I'm trying right now to modify the CrosshairController script to use SendMessage to post positional touch messages to my MasterControl script. Will keep you updated!
Oct 04 '11 at 06:15 PM
AcroYogi
(comments are locked)
|
