UI and enemy movement

This commit is contained in:
2023-07-11 23:07:03 +03:00
parent aa5e5586b2
commit 14a6a06159
81 changed files with 13839 additions and 55 deletions
+4 -2
View File
@@ -58,7 +58,9 @@ public abstract class Character : MonoBehaviour
{
var leftCheck = GetMapElement(Vector2.left);
var rightCheck = GetMapElement(Vector2.right);
//print($"LeftCheck:{leftCheck} right:{rightCheck}");
isAllowLeft = !(leftCheck == MapElementType.Wall || leftCheck == MapElementType.BreakableWall);
isAllowRight = !(rightCheck == MapElementType.Wall || rightCheck == MapElementType.BreakableWall);
@@ -129,7 +131,7 @@ public abstract class Character : MonoBehaviour
if (direction == Vector2.down)
rayStartPoint = new Vector2(_capsuleCollider.bounds.center.x + direction.x / 2, _capsuleCollider.bounds.min.y - 0.1f);
else
rayStartPoint = new Vector2(_capsuleCollider.bounds.center.x, _capsuleCollider.bounds.min.y + 0.05f);
rayStartPoint = new Vector2(_capsuleCollider.bounds.center.x, _capsuleCollider.bounds.min.y + 0.1f);
var boundsSize = new Vector2(_capsuleCollider.bounds.size.x - 0.05f, 0.1f);
var raycastHit = Physics2D.BoxCast(rayStartPoint, boundsSize, 0f, direction, 0.1f, _mapLayer);