Beispiel #1
0
        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;
        }
Beispiel #2
0
 private void CancelExitGoal()
 {
     Goal.OnDoorClose -= CancelExitGoal;
     _isLeavingLevel   = false;
     _goalPosition     = Goal.GetRandomPositionInside(_rangeRandomGoal);
 }