How to generate different levels as the player runs forward

Hi I want to create a game like temple run, but really simple I want to have L shaped and T shaped platforms, I have looked at many tutorials but I have failed to create something. I want the platforms (the shapes) to come at random but I want everything to link together. Could some one please tell me, what I would have to do with the code to make it so that the platforms are generating one after the other and not at random positions on the screen. Thank you.

public class SpawnScript : MonoBehaviour {

public GameObject[] obj;
public float spawnMinimum = 2f;
public float spawnMaximum = 4f;

// Use this for initialization
void Start () {
	Spawn ();
}

// Update is called once per frame
void Spawn() {
	Instantiate (obj [Random.Range (0, obj.GetLength (0))], transform.position, Quaternion.identity);
	Invoke ("Spawn", Random.Range (spawnMinimum, spawnMaximum));
}

}

You can instantiate new platforms based on player movement. When player is near an end of platform, create there a new one. You can check player’s position by ball-shaped colliders/triggers. So on trigger enter, create new platform.

Then you have to figure out how to position and rotate the new platforms. By empty objects saying where is the end of the existing platform and put a new platform there, maybe.