Hello I’m using Boo language.
the Input.touches function is Touch[ ] type.
but, I cannot type like this…
touches as Touch[] = Input.touches
touches[] as Touch = Input.touches
only accept below writing like this??:shock:
for touch as Touch in Input.touches:
Thanks.
but…
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
touches as (Touch) = Input.touches
If that doesn’t work, use this:
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
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.
681173–24479–$TapControl.boo.zip (3.85 KB)