Hello. Below, the first index of "uvs" which is assigned a value is uvs and the value is Vector2(1.0, 1.0). The Debug.Log below confirms this. However so does not the corresponding value of uvs displayed in the editor, which displays (0.1666667, 0.33333333). At the same time the visual consequence of the code supports the "wrong" editor value and not the value displayed by the Log. Am i doing something wrong?
(The missing declarations for vv, uphi and dtl are done at the start of the original script as float, float and integer respectively. None of the present values are used anywhere else in the script and Ugen() is called from Start(). This is the only custom script in the scene, assigned to an empty object.)
asked May 06 '11 at 02:04 AM
The index you are assigning to, k+dtl+1, in uvs does not use zz in its computation. Therefore every time through your outer loop, you will assign to the same set of indexes. So the (1.0, 1.0) Vector2 that you see in the log is the first value assigned to index 7, from the pass where zz = 0 and k = 0. The (0.1666667, 0.33333333) Vector2 you see in the inspector is the final value assigned to index 7, from the pass where zz = 2 and k = 0.
answered May 06 '11 at 02:32 AM