コード例 #1
0
 public AIIdleState(AIAgent agent)
 {
     _agent           = agent;
     _FOV             = agent.GetComponent <FieldOfView>();
     _soundPerception = agent.GetComponentInChildren <SoundPerception>();
     _defaultPosition = agent.transform.position;
 }
コード例 #2
0
    public PatrolState(AIAgent agent, PatrolRoute route, float movementSpeed, float waitDuration)
    {
        _agent           = agent;
        _route           = route;
        _navAgent        = _agent.GetComponent <NavMeshAgent>();
        _fov             = _agent.GetComponent <FieldOfView>();
        _soundPerception = _agent.GetComponentInChildren <SoundPerception>();

        _waitDuration   = waitDuration;
        _navAgent.speed = movementSpeed;
    }