示例#1
0
        public void TestBounds()
        {
            Bounds b = new Bounds(new Vector3(-2, 2, -2), new Vector3(4, 6, 8));

            Assert.That(b.TopLeft(), Is.EqualTo(new Vector3(-4, 5, -2)));
            Assert.That(b.TopCenter(), Is.EqualTo(new Vector3(-2, 5, -2)));
            Assert.That(b.TopRight(), Is.EqualTo(new Vector3(0, 5, -2)));
            Assert.That(b.MiddleLeft(), Is.EqualTo(new Vector3(-4, 2, -2)));
            Assert.That(b.MiddleCenter(), Is.EqualTo(new Vector3(-2, 2, -2)));
            Assert.That(b.MiddleRight(), Is.EqualTo(new Vector3(0, 2, -2)));
            Assert.That(b.BottomLeft(), Is.EqualTo(new Vector3(-4, -1, -2)));
            Assert.That(b.BottomCenter(), Is.EqualTo(new Vector3(-2, -1, -2)));
            Assert.That(b.BottomRight(), Is.EqualTo(new Vector3(0, -1, -2)));
            Assert.That(b.TopLeft(2), Is.EqualTo(new Vector3(-6, 7, -2)));
            Assert.That(b.TopCenter(2), Is.EqualTo(new Vector3(-2, 7, -2)));
            Assert.That(b.TopRight(2), Is.EqualTo(new Vector3(2, 7, -2)));
            Assert.That(b.MiddleLeft(2), Is.EqualTo(new Vector3(-6, 2, -2)));
            Assert.That(b.MiddleCenter(2), Is.EqualTo(new Vector3(-2, 2, -2)));
            Assert.That(b.MiddleRight(2), Is.EqualTo(new Vector3(2, 2, -2)));
            Assert.That(b.BottomLeft(2), Is.EqualTo(new Vector3(-6, -3, -2)));
            Assert.That(b.BottomCenter(2), Is.EqualTo(new Vector3(-2, -3, -2)));
            Assert.That(b.BottomRight(2), Is.EqualTo(new Vector3(2, -3, -2)));
        }
示例#2
0
        public void TestBoundsZero()
        {
            Bounds b = new Bounds();

            Assert.That(b.TopLeft(), Is.EqualTo(Vector3.zero));
            Assert.That(b.TopCenter(), Is.EqualTo(Vector3.zero));
            Assert.That(b.TopRight(), Is.EqualTo(Vector3.zero));
            Assert.That(b.MiddleLeft(), Is.EqualTo(Vector3.zero));
            Assert.That(b.MiddleCenter(), Is.EqualTo(Vector3.zero));
            Assert.That(b.MiddleRight(), Is.EqualTo(Vector3.zero));
            Assert.That(b.BottomLeft(), Is.EqualTo(Vector3.zero));
            Assert.That(b.BottomCenter(), Is.EqualTo(Vector3.zero));
            Assert.That(b.BottomRight(), Is.EqualTo(Vector3.zero));
            Assert.That(b.TopLeft(2), Is.EqualTo(new Vector3(-2, 2, 0)));
            Assert.That(b.TopCenter(2), Is.EqualTo(new Vector3(0, 2, 0)));
            Assert.That(b.TopRight(2), Is.EqualTo(new Vector3(2, 2, 0)));
            Assert.That(b.MiddleLeft(2), Is.EqualTo(new Vector3(-2, 0, 0)));
            Assert.That(b.MiddleCenter(2), Is.EqualTo(new Vector3(0, 0, 0)));
            Assert.That(b.MiddleRight(2), Is.EqualTo(new Vector3(2, 0, 0)));
            Assert.That(b.BottomLeft(2), Is.EqualTo(new Vector3(-2, -2, 0)));
            Assert.That(b.BottomCenter(2), Is.EqualTo(new Vector3(0, -2, 0)));
            Assert.That(b.BottomRight(2), Is.EqualTo(new Vector3(2, -2, 0)));
        }