I have several textmesh objects I’m trying to layout down the screen. I need equal spacing between them. My problem is that the spacing is not equal between textmeshes. The space is narrow after textmesh’s that have a bigger bounding box. I have searched all day trying to figure out what the heck an “extents” is exactly. The manual and the scripting reference tell me what it equals, but what EXACTLY is it?? The difference from center to a corner? A diagram would be brilliant. Anyways… My code is as follows.
public void DisplayDown (List<HackingTarget> targets, Vector3 origin) {
foreach (HackingTarget target in targets) {
GameObject entry = (GameObject) Instantiate (textMesh, origin, Quaternion.identity);
// Shift instantiation Vector3 down.
Vector3 bottomCorner = tMesh.bounds.center - tMesh.bounds.extents;
Vector3 bottom = new Vector3 (0, bottomCorner.y, 0);
Vector3 down = bottom - new Vector3(0, 1f, 0);
origin += down;
}
}