From bdce3e0a08c42d56ddab4dde6498570fd4fd8548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Thu, 8 Aug 2019 23:42:33 +0300 Subject: [PATCH] try --- Assets/Scripts/src/Enemy/RandomMovementEnemy.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/src/Enemy/RandomMovementEnemy.cs b/Assets/Scripts/src/Enemy/RandomMovementEnemy.cs index 57b1fe6..32b9da4 100644 --- a/Assets/Scripts/src/Enemy/RandomMovementEnemy.cs +++ b/Assets/Scripts/src/Enemy/RandomMovementEnemy.cs @@ -1,4 +1,6 @@ -using UnityEngine; +using System; +using src.Helpers; +using UnityEngine; namespace src.Enemy { @@ -17,8 +19,7 @@ namespace src.Enemy var x = pos.x; var y = pos.y; if (gameStateManager.IsGamePaused || gameStateManager.IsPlayerMovementForbidden) { return; } - if (x == Mathf.Floor(x) && - y == Mathf.Floor(y)) + if (Math.Abs(x - Mathf.Floor(x)) < 0.1 && Math.Abs(y - Mathf.Floor(y)) < 0.1) { if (RandomChange()) {