Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Ground : MonoBehaviour
  5. {
  6. public float scrollSpeed = 0.3f;
  7. public float tileSizeZ;
  8.  
  9. private float[] Scrolling = {
  10. 0,1,
  11. 0,2,
  12. 0,4,
  13. 0,5,
  14. 0,6,
  15. 0,7,
  16. 0,8,
  17. 0,9,
  18. 1.0f
  19. };
  20. private Vector3 startPosition;
  21.  
  22. void Start ()
  23. {
  24. startPosition = transform.position;
  25. }
  26.  
  27. void Update ()
  28. {
  29. /*int g = Player.pScore;
  30. if(g >= 1000){
  31. g = 0;
  32. if(Player.Level <= 9) {
  33. scrollSpeed = Scrolling[Player.Level];
  34. }else {
  35. scrollSpeed = 1.3f;
  36. }
  37. }*/
  38. float newPosition = Mathf.Repeat(Time.time * scrollSpeed, tileSizeZ);
  39. transform.position = startPosition + Vector3.left * newPosition;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement