You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens when casting an integer in an array to a float.
For example:
If we have an array of int like this: [0,1,2] where we use it as a vector3. In our code, Json will throw an exception if we cast it like (float)data[0].
My workaround:
I have to do an integer cast then float cast from system. It will work if you do (float)(int)data[0]. However, you need to make sure the type is int or long, otherwise you will lose float precise for other floating point data.
The text was updated successfully, but these errors were encountered:
This happens when casting an integer in an array to a float.
For example:
If we have an array of int like this: [0,1,2] where we use it as a vector3. In our code, Json will throw an exception if we cast it like (float)data[0].
My workaround:
I have to do an integer cast then float cast from system. It will work if you do (float)(int)data[0]. However, you need to make sure the type is int or long, otherwise you will lose float precise for other floating point data.
The text was updated successfully, but these errors were encountered: