static Quaternion GetRandomQuaternionNotNormalized()
 {
     return(new Quaternion(
                Random.Range(-1, 1),
                Random.Range(-1, 1),
                Random.Range(-1, 1),
                Random.Range(-1, 1)
                ));
 }
示例#2
0
        public void UnpacksToSaveValue(Vector2 max, Vector2 precision)
        {
            var packer   = new Vector2Packer(max, precision);
            var expected = new Vector2(
                Random.Range(-max.x, -max.x),
                Random.Range(-max.y, -max.y)
                );

            packer.Pack(this.writer, expected);
            Vector2 unpacked = packer.Unpack(this.GetReader());

            Assert.That(unpacked.x, Is.EqualTo(expected.x).Within(precision.x));
            Assert.That(unpacked.y, Is.EqualTo(expected.y).Within(precision.y));
        }
 float GetRandomFloat()
 {
     return(Random.Range(-this.max, this.max));
 }