From 216c4891084090f9b460c3a243b07abf464850d4 Mon Sep 17 00:00:00 2001 From: Naliwe Date: Tue, 25 Oct 2016 21:59:41 +0200 Subject: [PATCH] Update --- Assets/Scenes/Main.unity | Bin 47744 -> 0 bytes Assets/Scripts/GameController.cs | 6 +----- Assets/Scripts/UIController.cs | 11 +++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 7628930..bb67090 100644 Binary files a/Assets/Scenes/Main.unity and b/Assets/Scenes/Main.unity differ diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 758c3ec..9de49cf 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -32,14 +32,10 @@ namespace Assets.Scripts Screen.height, 0)).x; var leftBorder = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0)).x; - if (!(rightBorder > (size.x*mult) - 2)) return; + if (!(rightBorder > (size.x*mult) - 5)) return; BG = (GameObject) Instantiate(BG, new Vector3(size.x + tra.position.x - .5f, tra.position.y, 0), Quaternion.identity); tra = BG.GetComponent(); mult++; - // _ca.Step(rightBorder); - - // DrawMap(leftBorder, rightBorder); - // Debug.Log(_map); } } } \ No newline at end of file diff --git a/Assets/Scripts/UIController.cs b/Assets/Scripts/UIController.cs index 6224982..127122f 100644 --- a/Assets/Scripts/UIController.cs +++ b/Assets/Scripts/UIController.cs @@ -39,8 +39,19 @@ public class UIController : MonoBehaviour NbVials.text = _player.NbVials.ToString(); DisplayBattery(); + HandlePowerUps(); } + private void HandlePowerUps() + { + if (_player.NbVials >= 5) + Vial1.enabled = true; + if (_player.NbVials >= 10) + Vial2.enabled = true; + if (_player.NbVials >= 15) + Vial3.enabled = true; + } + private void DisplayBattery() { Battery.sprite = BatteryImages[_player.Battery/8]; -- libgit2 0.27.0