Improve enemy logic

This commit is contained in:
2023-06-27 15:08:55 +03:00
parent 719002cb7b
commit 84d03a75c5
2 changed files with 15 additions and 5 deletions
+12 -2
View File
@@ -38,8 +38,18 @@ public class Character : MonoBehaviour
{
var leftCheck = CheckBounds(Vector2.left, groundLayer);
var rightCheck = CheckBounds(Vector2.right, groundLayer);
if(leftCheck) { isAllowLeft = false; }
if (rightCheck) { isAllowRight = false; }
if(leftCheck.collider!=null) {
isAllowLeft = false;
}else
{
isAllowLeft = true;
}
if (rightCheck.collider != null) {
isAllowRight = false;
}else
{
isAllowRight = true;
}
isAllowVertical = false;
_isFall = false;