The reason that code works is because you are lerping. The reason you can lerp is that you are rotating in place. RotateAround also changes position so it doesn't quite work the same. There are two simple solutions.
Determine how much of our rotation to perform each time:
function RotateObject(point : Vector3, axis : Vector3,
rotateAmount : float, rotateTime : float) {
var step : float = 0.0; //non-smoothed
var rate : float = 1.0/rotateTime; //amount to increase non-smooth step by
var smoothStep : float = 0.0; //smooth step this time
var lastStep : float = 0.0; //smooth step last time
while(step < 1.0) { // until we're done
step += Time.deltaTime * rate; //increase the step
smoothStep = Mathf.SmoothStep(0.0, 1.0, step); //get the smooth step
transform.RotateAround(point, axis,
rotateAmount * (smoothStep - lastStep));
lastStep = smoothStep; //store the smooth step
yield;
}
//finish any left-over
if(step > 1.0) transform.RotateAround(point, axis,
rotateAmount * (1.0 - lastStep));
}
Slerp the position and rotation separately:
function RotateObject(point : Vector3, axis : Vector3,
rotateAmount : float, rotateTime : float) {
var rotation = Quaternion.AngleAxis(rotateAmount, axis);
var startPos : Vector3 = transform.position - point;
var endPos : Vector3 = rotation * startPos;
var startRot : Quaternion = transform.rotation;
var step : float = 0.0; //non-smoothed
var smoothStep : float = 0.0; //smoothed
var rate : float = 1.0/rotateTime; //amount to increase non-smooth step by
while(step < 1.0) { // until we're done
step += Time.deltaTime * rate; //increase the step
smoothStep = Mathf.SmoothStep(0.0, 1.0, step);
transform.position = point + Vector3.Slerp(startPos, endPos, smoothStep);
transform.rotation = startRot * Quaternion.Slerp(Quaternion.identity,
rotation, smoothStep);
yield;
}
//finish any left-over
if(step > 1.0) {
transform.position = point + endPos;
transform.rotation = startRot * rotation;
}
}