Esempio n. 1
0
        public void StartPatrolling_NoPoints_ErrorsAndDoesNotStart()
        {
            LogAssert.Expect(LogType.Error, "Tried to patrol without a valid patrol point available!");

            _patrol.StartPatrolling();

            Assert.IsNull(_pathfinding.TargetLocation);
        }
Esempio n. 2
0
        public IEnumerator Patrolling_PatrolCompletes_AfterIdleTimeAssignsNextPoint()
        {
            var closestPoint  = new Vector3(1.0f, 2.0f, 0.0f);
            var furthestPoint = new Vector3(20.0f, 30.0f, 0.0f);

            _patrol.PatrolPoints.Add(furthestPoint);
            _patrol.PatrolPoints.Add(closestPoint);

            _patrol.StartPatrolling();

            _pathfinding.CompleteDelegate();

            yield return(new WaitForSeconds(_patrol.IdleTimeBetweenPoints + 0.1f));

            Assert.AreEqual(_pathfinding.TargetLocation, furthestPoint);
        }