(1)BGLoop

Unity/수업내용 2019. 5. 1. 19:03



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class TestBGScrorer : MonoBehaviour
{
    public Transform[] arrGround;
    public float speed = 2f;
 
    private void Update()
    {
        for(int i = 0;  i<this.arrGround.Length;i++)
        {
            this.arrGround[i].Translate(new Vector3(0-0.1f, 0* this.speed);
            if(this.arrGround[i].transform.localPosition.z<=-29.5f)
            {
                this.arrGround[i].transform.localPosition = new Vector3(00, 59f);
            }
        }
    }
}
cs


: