android - Unity3d BootCamp Tutorial UnityScript Array Order Anomaly in ImageEffectsOrder.js -
i new unity , grabbed bootcamp project , ran within unity 4.1.5f1
windows build without modification
i tried build android , had bunch of errors (mostly variables not being declared)
but have 1 remaining don't understand...
in following code in file imageeffectsorder.js javascript references order method of array sorted[] sorted[i].order
the compiler errors 'order' not member of object.
so i'm little confused why windows build supports member not android. makes me wonder other surprises await when converting platform platform.
but can point me workaround order member? , i'm not quite clear on returning...it seems variable i
should give order.
the order seems intrinsic code, never set value, 'order' it? can't seem find docs on 'member' of array class.
here code:
var sorted : array = new array(); var : int = 0; (var fx : posteffectsbase in getcomponents(posteffectsbase)) { if(fx && fx.enabled) { sorted[i++] = fx; } } while (sorted.length) { var indextouse : int = 0; var ordervalue : int = -1; for(i = 0; < sorted.length; i++) { if(sorted[i].order > ordervalue) { ordervalue = sorted[i].order; indextouse = i; } } ...more code...
i solved it...the problem not array class fx
being assigned sorted[]
array object of class posteffectsbase
.
so actual problem 1 of casting when try use sorted[i].order
i changed reference sorted[i].order
(sorted[i] posteffectsbase).order
, worked.
i have remember this...it seems there lot of these casts have done between platforms.
cheers, ryan
Comments
Post a Comment