Exemplo n.º 1
0
    void Awake()
    {
        nav     = GetComponent <UnityEngine.AI.NavMeshAgent> ();
        aiSight = GetComponent <AISight> ();
        globalLastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <GlobalLastPlayerSighting> ();
        if (team == "Team0")
        {
            enemyTeam = "Team1";
        }
        else
        {
            enemyTeam = "Team0";
        }

        //enemyTeamMembers = GameObject.FindGameObjectsWithTag("GameController").
    }
Exemplo n.º 2
0
    void Awake()
    {
        coroutineRunning = false;
        ballShooter      = GetComponentInChildren <BallShooter> ();
        nav = GetComponent <UnityEngine.AI.NavMeshAgent> ();
        //col = GetComponent<SphereCollider> ();
        anim = GetComponent <Animator>();
        globalLastPlayerSighting = GameObject.FindWithTag("GameController").GetComponent <GlobalLastPlayerSighting>();
        playerHead = GameObject.FindWithTag("MainCamera");         // TODO might need to make more robust when doing multiplayer
        //playerAnim = player.GetComponent<Animator> ();
        //playerHealth = player.GetComponent <PlayerHealth> ();
        hash = GameObject.FindWithTag("GameController").GetComponent <HashIDs> ();

        //personalLastSighting = globalLastPlayerSighting.resetPosition; // reset the position so they don't start the game chasing the player
        //previousSighting = globalLastPlayerSighting.resetPosition;
    }