Beispiel #1
0
        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
                       ));
        }
Beispiel #2
0
 public static Direction4 ToDir4(this Direction2V dir2V) =>
 dir2V == Direction2V.Up ? Direction4.Up : Direction4.Down;
Beispiel #3
0
 public static Vector3 ToVector3(this Direction2V value) =>
 value == Direction2V.Down ? Vector3.down : Vector3.up;
Beispiel #4
0
 public static Vector2 ToVector2(this Direction2V value) =>
 value == Direction2V.Down ? Vector2.down : Vector2.up;
Beispiel #5
0
 public static float ToFloat(this Direction2V value) =>
 value == Direction2V.Down ? -1 : 1;
Beispiel #6
0
 public static Direction2V Flip(this Direction2V value) =>
 value == Direction2V.Down ? Direction2V.Up : Direction2V.Down;