private IEnumerator ChangeGoalCoroutine(PressurePlate pressurePlate) { float timer = Random.Range(0f, maxDelayToWalk); while (timer > 0f) { timer -= Time.deltaTime; yield return(null); } Goal = pressurePlate; _goalPosition = Goal.GetRandomPositionInside(_rangeRandomGoal) + agentOffset; _dirAgentGoal = this.transform.position - _goalPosition; }
private void CancelExitGoal() { Goal.OnDoorClose -= CancelExitGoal; _isLeavingLevel = false; _goalPosition = Goal.GetRandomPositionInside(_rangeRandomGoal); }