void GroundCheck() { float offset = 0.01f; Vector2 _groundPosition = new Vector2(_box.bounds.center.x, _box.bounds.center.y - _box.size.y / 2); _isGrounded = PhysicUtil.GroundCheck(_groundPosition, _distanceBtwPoints, _distanceToGnd, _layerToCheck, offset, _debugDraw); }
void WallCheck() { Vector2 pos = new Vector2(_box.bounds.center.x, _box.bounds.center.y); pos.x = _faceDirection < 0 ? pos.x - _box.size.x / 2 : pos.x + _box.size.x / 2; float offset = 0.075f; _isWallDetected = PhysicUtil.ObstacleCheck(pos, _faceDirection < 0, _distanceToObs, _layerToCheck, offset, _debugDraw); }