public IEnumerator ShouldWaitXTimeToReevaluateWaderingRoute() { var aiBody = new GameObject("AI"); aiBody.transform.position = new Vector3(0, 0, 0); var brainSettings = new SimpleBrain.Settings() { MinDistanceForChasePlayer = 10f, WanderingReevaluateTime = .5f, WanderingDistance = 2f, MinAttackDistance = 1f }; var simpleBrain = new SimpleBrain(brainSettings, aiBody.transform); simpleBrain.Enabled(); simpleBrain.Update(); var firstTargetPostition = simpleBrain.TargetPosition.Get(); Assert.IsTrue(simpleBrain.IsWandering); AssertHelper.Between(-2f, 2f, firstTargetPostition.x); AssertHelper.Between(-2f, 2f, firstTargetPostition.z); yield return(new WaitForSeconds(0.2f)); simpleBrain.Update(); Assert.IsTrue(simpleBrain.IsWandering); AssertHelper.AreEqual(firstTargetPostition, simpleBrain.TargetPosition.Get()); yield return(new WaitForSeconds(0.4f)); simpleBrain.Update(); Assert.IsTrue(simpleBrain.IsWandering); AssertHelper.AreNotEqual(firstTargetPostition, simpleBrain.TargetPosition.Get()); }