This commit is contained in:
Denis-Cosmin Nutiu 2019-08-08 23:42:33 +03:00
parent d227893699
commit bdce3e0a08

View file

@ -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())
{