using UnityEngine;
using System.Collections;

public class SkylineMove : MonoBehaviour {
	public byte r = 255;
	public byte g = 255;
	public byte b = 255;
	// Use this for initialization
	void Start () {
		foreach(Renderer childColor in GetComponentsInChildren<Renderer>()){
			childColor.material.color = new Color32(r, g, b, 1);

		}
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		//i++;
		//if (i == skyDelay){
		//	i = 1;
			Vector3 position = this.transform.position;
			position.x = position.x - 0.15f;
			this.transform.position = position;
			if (position.x < -20){
				SetTransformX(150.0f);
				}
	//	}
	}
	void SetTransformX(float n){
		transform.position = new Vector3(n, transform.position.y, transform.position.z);
	}
}