Exemplo n.º 1
0
    private void Awake()
    {
        chaseState      = new ChaseState(this);
        patrolState     = new PatrolState(this);
        guardState      = new GuardState(this);
        dazedState      = new DazedState(this);
        distractedState = new DistractedState(this);
        searchingState  = new SearchingState(this);
        suspiciousState = new SuspiciousState(this);
        koState         = new KOState(this);
        walkState       = new WalkState(this);

        navMeshAgent = GetComponent <NavMeshAgent>();
    }
Exemplo n.º 2
0
    private void Awake()
    {
        chaseState = new ChaseState(this);
        patrolState = new PatrolState(this);
        guardState = new GuardState(this);
        dazedState = new DazedState(this);
        distractedState = new DistractedState(this);
        searchingState = new SearchingState(this);
        suspiciousState = new SuspiciousState(this);
        koState = new KOState(this);
        walkState = new WalkState(this);
        pointSearchState = new PointSearchState(this);

        navMeshAgent = GetComponent<NavMeshAgent>();
        player = GameObject.FindGameObjectWithTag("Player");
        Path = Pathways[0];
        AIPath CheckpointScript = Path.GetComponent<AIPath>();
        navPoint = CheckpointScript.getPoints()[0];
        currentState = patrolState; //sets the current state
        NoOcclusionLM = 1 << noOcclusionLayer;
        NoOcclusionLM = ~NoOcclusionLM;
    }