Hello I'm using Boo language. the Input.touches function is Touch[] type. but, I cannot type like this... Code (csharp): touches as Touch[] = Input.touches Code (csharp): touches[] as Touch = Input.touches only accept below writing like this?? Code (csharp): for touch as Touch in Input.touches:
Thanks. but.. Code (csharp): touches as List = Input.touches BCE0022: Cannot convert '(UnityEngine.Touch)' to 'Boo.Lang.List'. what is wrong?
touches is no list and you can not convert it to one this way, especially not to Boo list, if then you could convert it to System.Collection Lists or System.Collection.Generic List<> (unsure if boo eats generics)
'(UnityEngine.Touch)' says that it's an array of UnityEngine.Touch's. Try Code (csharp): touches as (Touch) = Input.touches If that doesn't work, use this: Code (csharp): import System.Collections.Generic //import this to use the generic list touches as List[of Touch] = List[of Touch]() //this will declare touches as a generic list, then initialize it (The 'List[of Touch]()' part) for eachTouch as Touch in Input.touches: [INDENT]touches.Add(eachTouch)[/INDENT] That will iterate through Input.touches, and add each item as a Touch object to your touches list. This will DEFINITELY work.
Thank you for replying. I converted Penelope sample. I did "touches as (Touch) = Input.touches" but it didn't work, so I'll try "System.Collections.Generic" edition latar
http://unity3d.com/support/documentation/ScriptReference/Input-touches.html There's Boo example code for exactly what you're trying to do. Good luck!
Hi, FlamingHairball I know the document, however I didn't convert. I attached the script. View attachment $TapControl.boo.zip