Example #1
0
    public void CheckWall(Vector2 posWallLeft, Vector2 posWallRight, LayerMask layerWall)
    {
        isWall = RgbChar.velocity.y < 0 && !isGround && (Physics2D.Raycast(posWallRight, Vector2.down, 1f, layerWall).collider != null ||
                                                         Physics2D.Raycast(posWallLeft, Vector2.down, 1f, layerWall).collider != null);

        if (isWall)
        {
            spriteEffect.CancelEffect();
        }
        animChar.SetBool("isWall", isWall);
    }