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); }
public static Vector2 Decompress(CompressedVector2 data, BoundedRange[] boundedRange) { return(new Vector2(boundedRange[0].Decompress(data.x), boundedRange[1].Decompress(data.y))); }