|
I'm using this script to draw wireframe. Script read from string file, split coordinate and make vector3 array. In desktop mode all ok, but now in iOS give me error: Assets/Script/Wireframe.js(33,23): BCE0050: Operator '-' cannot be used with an expression of type 'Object'. Somebody help me to correct script?
(comments are locked)
|
|
The "Array" type is an untyped collection of arbitrary objects, so although you put floats in, the compiler doesn't know that when you're accessing the elements again. I'm not a Master of UnityScript, since I always use C#, so I don't know what the best alternative is. But your problem should be solved by replacing every "PointsList[..." in your line starting with "Lines.Add" with "(float)PointsList[...", or maybe "float(PointsList[...])". In C# you could do "PointsList[...] as float", but I don't know if that's available in UnityScript. Lines.Add(Vector3(-PointsList[i*3],PointsList[i*3+2],-PointsList[i*3+1]));
Jun 02 '12 at 10:12 PM
benfattino
The best alternative is a generic List; the JS Array class should not be used even in JS.
Jun 02 '12 at 10:36 PM
Eric5h5
(comments are locked)
|

Can you indicate in your script which line is line "33"?