how did the game developer of 2048 made their tiles to move smoothly ? see the detail question below

I have made the complete copy of 2048 game but i have moved by tiles by teleporting (no smoothness moving of tiles like it was in original game)


I have used the following code for smothness of moving tiles.


//GameManager script
void MoveRight () {
	//some code ..
	AnimateTileMovement (newPosition); // newposition is the position to whihc the tiles is going to move
	//some code which i need to execute (ONLY AFTER MY COMPLETE MOVEMENT OF TILE)
	// BUT AS SOON AS TileMovement return its first null this code execture which is creating a lot of problem , what should i do ?
	//to stop execution these code until the tiles have moved towards its desired newPosition
}

//TilesMovement Script 

public void AnimationTileMovement(Vector3 newPosition) {
	StartCoroutine ("TileMovement", newPosition);

}

IEnumerator TileMovement(Vector3 newPosition) {
	while (transform.position != newPosition) {
		transform.position = Vector3.MoveTowards (transform.position, newPosition, speedTile * Time.deltaTime);
		yield return null;

	}


}

i have been spending
days to achieve this but i am not able to do
how to stop executing the code below StartCoroutine ("TileMovement", newPosition) as the code gets executed at the very first movement when the IEnumerator TileMovement(Vector3 newPosition) yeild it first null ?

I have read this Article and tried also but unable to do so please suggest me what to do


link text

yield return new WaitForEndOfFrame();