Exemple #1
0
        public void RemoveWaypointAt_Leaves_current_as_null_when_removing_last_remaining_element()
        {
            var navMesh = new NavMesh2D(new List <Vector2> {
                new Vector2(0, 0)
            });

            navMesh.RemoveWaypointAt(0);
            Assert.IsFalse(navMesh.CurrentWaypoint.HasValue);
        }
Exemple #2
0
        public void RemoveWaypointAt_Removes_node_at_correct_position()
        {
            int indexToRemove = 2;
            var nextInLine    = navMesh.WaypointList.ElementAt(indexToRemove + 1);

            navMesh.RemoveWaypointAt(indexToRemove);
            Assert.AreEqual(navMesh.WaypointList.ElementAt(indexToRemove), nextInLine);
        }