Пример #1
0
        static public Vector2 Map(this Vector2 valA, Vector2 minA, Vector2 maxA, Vector2 minB, Vector2 maxB)
        {
            var v = Vector2.zero;

            v.x = MathR.Map(valA.x, minA.x, maxA.x, minB.x, maxB.x);
            v.y = MathR.Map(valA.y, minA.y, maxA.y, minB.y, maxB.y);
            return(v);
        }
Пример #2
0
 static public Vector2 Normalize(this Vector2 self, Vector2 min, Vector2 max)
 {
     self.x = MathR.Map(self.x, min.x, max.x, 0, 1);
     self.y = MathR.Map(self.y, min.y, max.y, 0, 1);
     return(self);
 }