Skip to content

Instantly share code, notes, and snippets.

@maco1028
Created May 5, 2017 05:03
Show Gist options
  • Save maco1028/ac5ee98789b741be11e4544440dc9a0d to your computer and use it in GitHub Desktop.
Save maco1028/ac5ee98789b741be11e4544440dc9a0d to your computer and use it in GitHub Desktop.
背景スクロール
using UnityEngine;
using System.Collections;
public class Backscroll : MonoBehaviour
{
void Update () {
transform.Translate (-0.1f, 0, 0);
if (transform.position.x < -13.8f ) {
transform.position = new Vector3 (13.8f, 0, 0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment