// состояние безопасности, нормальная скорость перемещения protected virtual IEnumerator Secure() { //FindObjectOfType<PlayerAudioController>().isDanger = false; float time = 0.0f; //Debug.Log("base Secure() started | this is base method from AnimalMotor"); agent.speed = walkSpeed; float randomSec = Random.Range(1.5f, 3.5f); agent.SetDestination(destination = ai.GetWalkPoint()); while (cond == Condition.Secure) { time += Time.deltaTime; if (time >= randomSec) { agent.SetDestination(destination = ai.GetWalkPoint()); time = 0.0f; } if (fow.visibleTargets.Count > 0) { break; } yield return(new WaitForSeconds(0.1f)); } visibleTarget = fow.visibleTargets[0]; //FindObjectOfType<PlayerAudioController>().isDanger = true; ChangeCondition(Condition.Alarm, "Secure", "Alarm"); }