using UnityEngine;
using System.Collections;
public class CsGround : MonoBehaviour {
public float speed; //이동속도
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//왼쪽방향으로 speed만큼 이동합니다.
transform.Translate (Vector2.left * speed * Time.deltaTime);
//x좌표가 -12.8보다 작아지면....
if(transform.position.x < -12.8f)
{
//위치를 0, 0 으로 이동합니다.
transform.position = new Vector2(0,0);
}
}
}