예제 #1
0
        public static CompressedVector2 Compress(Vector2 vector2, BoundedRange[] boundedRange)
        {
            CompressedVector2 data = default(CompressedVector2);

                        #if UNITY
            data.x = boundedRange[0].Compress(vector2.x);
            data.y = boundedRange[1].Compress(vector2.y);
                        #else
            data.x = boundedRange[0].Compress(vector2.X);
            data.y = boundedRange[1].Compress(vector2.Y);
                        #endif

            return(data);
        }
예제 #2
0
 public static Vector2 Decompress(CompressedVector2 data, BoundedRange[] boundedRange)
 {
     return(new Vector2(boundedRange[0].Decompress(data.x), boundedRange[1].Decompress(data.y)));
 }