Example #1
0
            public void Velocity_Not_Zero_For_TargetBounds_Outside_Or_At_Intersection()
            {
                targetBounds.center = maxBounds.size;
                var focusArea = new CameraFollow.FocusArea(size, maxBounds, targetBounds);

                Assert.IsFalse(Vector2EqualityComparer.Instance.Equals(focusArea.velocity, Vector2.zero), "Velocity is not zero");
            }
Example #2
0
            public void Velocity_Equals_Zero_For_TargetBounds_Within()
            {
                targetBounds.center = new Vector2(50, 50);
                var focusArea = new CameraFollow.FocusArea(size, maxBounds, targetBounds);

                Assert.IsTrue(Vector2EqualityComparer.Instance.Equals(focusArea.velocity, Vector2.zero), "Velocity is zero");
            }
Example #3
0
            public void Fully_Within_MaxBounds_Corner_RightTop()
            {
                maxBounds.center = new Vector2(maxBounds.size.x / 2, -maxBounds.size.y / 2);
                var    focusArea = new CameraFollow.FocusArea(size, maxBounds, targetBounds);
                Bounds bounds    = focusArea.bounds;

                Assert.IsTrue(maxBounds.ContainBounds(bounds));
            }
Example #4
0
            public void Velocity_Is_Directed_To_Target_Corner_RightTop()
            {
                targetBounds.center = new Vector2(maxBounds.size.x, -maxBounds.size.y);
                var focusArea = new CameraFollow.FocusArea(size, maxBounds, targetBounds);

                Assert.Positive(focusArea.velocity.x, "Velocity X");
                Assert.Negative(focusArea.velocity.y, "Velocity Y");
            }