public Transform target;//主角
void Update () {
Vector3 poe = transform.position;
poe.x = target.position.x;
transform.position = poe;//忍者跑酷2D
}