Example #1
0
        public void RemoveWaypointPrev_Removes_next_in_list()
        {
            var secondValue = navMesh.WaypointList.First.Next;

            navMesh.SetNextWaypoint();
            navMesh.RemoveWaypointPrev();
            Assert.AreEqual(secondValue.Value, navMesh.CurrentWaypoint);
        }
Example #2
0
        public void RemoveWaypointPrev_Leaves_current_as_null_when_removing_last_remaining_element()
        {
            var navMesh = new NavMesh2D(new List <Vector2> {
                new Vector2(0, 0)
            });

            navMesh.IsClosedNavMesh = true;
            navMesh.RemoveWaypointPrev();
            Assert.AreEqual(null, navMesh.CurrentWaypoint);
        }