Exemplo n.º 1
0
        public static int Compare(Vector2 a, Vector2 b)
        {
            int compare = Floats.Compare(a.x, b.x);

            if (compare == 0)
            {
                compare = Floats.Compare(a.y, b.y);
            }
            return(compare);
        }
Exemplo n.º 2
0
        private void SanityCheck()
        {
            float sum = 0;

            foreach (var weight in m_weights)
            {
                sum += weight;
            }
            if (Floats.Quantize(sum - 1f, 0.00001f) != 0f)
            {
                Debug.LogWarningFormat("Failed WeightedRandom sanity check, total is {0}", sum);
            }
        }
Exemplo n.º 3
0
 public static Vector2 Quantize(Vector2 position, float accuracy)
 {
     return(new Vector2(
                Floats.Quantize(position.x, accuracy),
                Floats.Quantize(position.y, accuracy)));
 }