Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }