Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Ground : MonoBehaviour
- {
- public float scrollSpeed = 0.3f;
- public float tileSizeZ;
- private float[] Scrolling = {
- 0,1,
- 0,2,
- 0,4,
- 0,5,
- 0,6,
- 0,7,
- 0,8,
- 0,9,
- 1.0f
- };
- private Vector3 startPosition;
- void Start ()
- {
- startPosition = transform.position;
- }
- void Update ()
- {
- /*int g = Player.pScore;
- if(g >= 1000){
- g = 0;
- if(Player.Level <= 9) {
- scrollSpeed = Scrolling[Player.Level];
- }else {
- scrollSpeed = 1.3f;
- }
- }*/
- float newPosition = Mathf.Repeat(Time.time * scrollSpeed, tileSizeZ);
- transform.position = startPosition + Vector3.left * newPosition;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement