1234567891011121314151617181920212223 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class BGMove : MonoBehaviour {
- // Use this for initialization
- void Start () {
-
- }
-
- // Update is called once per frame
- void Update () {
- //背景移动
- // transform.Translate(Vector3.forward*1f*Time.deltaTime);
- // if (this.transform.position.z>=21.6f)
- // {
- // this.transform.position = new Vector3(0,0,0f);
- // }
- //mathf方法背景移动
- transform.position = new Vector3(transform.position.x,transform.position.y,Mathf.Repeat(Time.time,21.6f));
- }
- }
|