// Update is called once per frame void Update() { if (GameEventManager.game) { if (nextTile == null) { if (!GameEventManager.firstScene) { GameEventManager.EndedScene(); } Vector3 position = player.transform.position; position.y -= startDrop; position.x -= 10; nextPosition = position; nextTile = InstantiateTile(flat[0], nextPosition); for (int i = 0; i < 20; i++) { MakeNewColumn(flat[Random.Range(0, flat.Length)]); } Invoke("MakeNewScene", 4); } else if (Camera.main.WorldToViewportPoint(nextTile.transform.position).x < spawnBuffer) { MakeNewColumn(TileFromDistribution(afterDistributions[nextTile.name])); } } }