using UnityEngine;
using System.Collections;
public class LayerScript : MonoBehaviour {
public float Speed;
public Transform OtherPiece;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(GameManager.Instance.CurrentGameState == GameState.InGame)
{
if (transform.position.x < -35.5f) {
transform.position = new Vector3(OtherPiece.position.x,this.transform.position.y,0);
} else {
transform.Translate (-1 * Speed * Time.deltaTime, 0, 0);
}
}
}
}