public static Vector2 GetEnd(this Bounds bounds, Direction2H horizontalDir, Direction2V vericalDir) { Vector3 skinWidth = Vector2.one * RaycastHelpers.skinWidth; bounds.extents -= skinWidth; return(new Vector2( horizontalDir == Direction2H.Left ? bounds.min.x : bounds.max.x, vericalDir == Direction2V.Down ? bounds.min.y : bounds.max.y )); }
public static Direction4 ToDir4(this Direction2V dir2V) => dir2V == Direction2V.Up ? Direction4.Up : Direction4.Down;
public static Vector3 ToVector3(this Direction2V value) => value == Direction2V.Down ? Vector3.down : Vector3.up;
public static Vector2 ToVector2(this Direction2V value) => value == Direction2V.Down ? Vector2.down : Vector2.up;
public static float ToFloat(this Direction2V value) => value == Direction2V.Down ? -1 : 1;
public static Direction2V Flip(this Direction2V value) => value == Direction2V.Down ? Direction2V.Up : Direction2V.Down;