public void AdjustPosition(Transform childBeingAdjusted, GameObject middle, int middleInt) {
//first determine the depth of the items, so the middle one is always on top.
int childNdx = int.Parse (childBeingAdjusted.name.Split ('_') [0]);
int intDiff = childNdx - middleInt;
float offset = _distanceToStartStacking;
if(childBeingAdjusted == middle.transform) {
childBeingAdjusted.GetComponent<UIWidget>().depth = 0;
} else {
childBeingAdjusted.GetComponent<UIWidget>().depth = Mathf.Abs (intDiff) * -1;
}
//now, get information about how far off the center of the screen the objects are.
ScreenEdgeDetector.instance.UpdateScreenEdgesPersp(Mathf.Abs(middle.transform.position.z - _camera.transform.position.z));
float screenEdge = ScreenEdgeDetector.instance._topLeft.x;
float lengthOfHalfScreen = Mathf.Abs(_camera.transform.position.x - screenEdge);
float percentOffCenter = (childBeingAdjusted.transform.position.x - _camera.transform.position.x)/lengthOfHalfScreen;
//now, adjust the x and z positions.
Vector3 pos = childBeingAdjusted.position;
pos.z = _zOffsetCurve.Evaluate(Mathf.Abs(percentOffCenter)) * _moveBackMult;
//when I comment out this line, the z positioning works fine. but when I put it in, everything breaks.
pos.x = _xOffsetCurve.Evaluate(percentOffCenter) * _moveSidewaysMult;
childBeingAdjusted.transform.position = pos;
}