My Godot 2d game contains lines that servers as platforms and walls, they are defined as segmentShape2D which contain a start point and an endpoint:
var staticBody2D = new StaticBody2D();
Vector2 a = new Vector2((float)foothold.X1, (float)foothold.Y1);
Vector2 b = new Vector2((float)foothold.X2, (float)foothold.Y2);
Vector2 direction = (b - a).Normalized();
var collisionShape = new CollisionShape2D();
collisionShape.OneWayCollision = true;
var segmentShape = new SegmentShape2D();
segmentShape.A = a;
segmentShape.B = b;
collisionShape.Shape = segmentShape;
staticBody2D.SetMeta("direction", direction.Rotated(Mathf.RadToDeg(90f)));
staticBody2D.SetMeta("layer", layer);
staticBody2D.AddChild(collisionShape);
AddChild(staticBody2D);
For platforms my character behaves normally, it can jump from below to the current platform. But for walls, my character passes through from both left&right sides, as oneWayCollision only detects collision from UP or Downside.

So My question is how to implement a one-way collision wall or slope based on its direction in Godot?