From 0cfee1d1f1a2a06c86080f62ce26a3eabe6b5ffd Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 27 Apr 2019 14:59:32 +0200 Subject: Refactoring --- nGJ2019/Assets/Scripts/LevelScrolling.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nGJ2019/Assets/Scripts/LevelScrolling.cs b/nGJ2019/Assets/Scripts/LevelScrolling.cs index 025bf40..0122a69 100644 --- a/nGJ2019/Assets/Scripts/LevelScrolling.cs +++ b/nGJ2019/Assets/Scripts/LevelScrolling.cs @@ -4,7 +4,7 @@ using UnityEngine; public class LevelScrolling : MonoBehaviour { - public int UpdateRate = 1; + public int UpdateRate = -5; public List Obstacles; public Transform Background; @@ -56,14 +56,14 @@ public class LevelScrolling : MonoBehaviour { foreach (var o in Obstacles) { - o.Translate(new Vector2(0.01f * UpdateRate, 0)); + o.Translate(0.01f * UpdateRate, 0, 0); } } private void MoveBackground() { if (Background.position.x > -initialBgPos.x) - Background.Translate(new Vector2(0.01f * UpdateRate, 0)); + Background.Translate(0.01f * UpdateRate, 0, 0); else Background.position = initialBgPos; } } -- cgit v1.2.3