I use Vector4s data structures to store all my positional data for my gameObjects, using the W component as a metadata placeholder. Can I easily assign transform.position using the XYZ of a Vec4 while discarding the W?
Here is how I'd like the code to read:
var g_MC : new Vector4[n];
var g_MCgo : new GameObject[n];
g_MCgo[h].transform.position = g_MC[h].Vector3 + Vector3.up;
Here is the only way I can currently get the code to work:
g_MCgo[h].transform.position = Vector3(g_MC[h].x, g_MC[h].y, g_MC[h].z) + Vector3.up;
Any and all elegant help is appreciated.
↧