Esempio n. 1
0
    private int wayPointIndex;                                          // A counter for the way point array.


    void Awake()
    {
        // Setting up the references.
        enemySight         = GetComponent <DoneEnemySight>();
        nav                = GetComponent <NavMeshAgent>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth       = player.GetComponent <DonePlayerHealth>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
    }
Esempio n. 2
0
	private int wayPointIndex;								// A counter for the way point array.
	
	
	void Awake ()
	{
		// Setting up the references.
		enemySight = GetComponent<DoneEnemySight>();
		nav = GetComponent<NavMeshAgent>();
		player = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
		playerHealth = player.GetComponent<DonePlayerHealth>();
		lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();
	}
Esempio n. 3
0
    void Awake()
    {
        // Setting up the references.
        enemySight         = GetComponent <EnemyZombieSight>();
        nav                = GetComponent <UnityEngine.AI.NavMeshAgent>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth       = player.GetComponent <DonePlayerHealth>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();

        enemyZombieAttack = GetComponentInChildren <EnemyZombieAttack>();
    }
Esempio n. 4
0
    private int wayPointIndex; // A counter for the way point array.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        enemySight = GetComponent<DoneEnemySight>();
        nav = GetComponent<NavMeshAgent>();
        player = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth = player.GetComponent<DonePlayerHealth>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();

        // initializing the current_behavior variable
        current_behavior = "Initializing";
    }
Esempio n. 5
0
    // TEST REMOVE UNLESS CONFIRMED.
    // Collider m_Collider;

    // Start is called before the first frame update
    void Awake()
    {
        //gameObject.GetComponentInParent(typeof(HingeJoint)) as HingeJoint;
        //Animator
        anim = gameObject.GetComponentInParent <Animator>();
        // anim = zombieMain.GetComponent<Animator>();
        player       = GameObject.FindGameObjectWithTag(DoneTags.player);
        playerHealth = player.GetComponent <DonePlayerHealth>();
        hash         = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();

        // TEST REMOVE UNLESS CONFIRMED.
        // m_Collider = GetComponent<Collider>();
    }
Esempio n. 6
0
    private Vector3 previousSighting; // Where the player was sighted last frame.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        nav = GetComponent<NavMeshAgent>();
        col = GetComponent<SphereCollider>();
        anim = GetComponent<Animator>();
        //lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();
        player = GameObject.FindGameObjectWithTag(DoneTags.player);
        playerAnim = player.GetComponent<Animator>();
        playerHealth = player.GetComponent<DonePlayerHealth>();
        hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>();

        // Set the personal sighting and the previous sighting to the reset position.
        personalLastSighting = lastPlayerSighting.resetPosition;
        previousSighting = lastPlayerSighting.resetPosition;
    }
    private Vector3 previousSighting;                           // Where the player was sighted last frame.


    void Awake()
    {
        // Setting up the references.
        nav  = GetComponent <NavMeshAgent>();
        col  = GetComponent <SphereCollider>();
        anim = GetComponent <Animator>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player);
        playerAnim         = player.GetComponent <Animator>();
        playerHealth       = player.GetComponent <DonePlayerHealth>();
        hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();

        // Set the personal sighting and the previous sighting to the reset position.
        personalLastSighting = lastPlayerSighting.resetPosition;
        previousSighting     = lastPlayerSighting.resetPosition;
    }
Esempio n. 8
0
    private float scaledDamage;                                         // Amount of damage that is scaled by the distance from the player.


    void Awake()
    {
        // Setting up the references.
        anim           = GetComponent <Animator>();
        laserShotLine  = GetComponentInChildren <LineRenderer>();
        laserShotLight = laserShotLine.gameObject.GetComponent <Light>();
        col            = GetComponent <SphereCollider>();
        player         = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth   = player.gameObject.GetComponent <DonePlayerHealth>();
        hash           = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();

        // The line renderer and light are off to start.
        laserShotLine.enabled    = false;
        laserShotLight.intensity = 0f;

        // The scaledDamage is the difference between the maximum and the minimum damage.
        scaledDamage = maximumDamage - minimumDamage;
    }
Esempio n. 9
0
    private bool shooting; // A bool to say whether or not the enemy is currently shooting.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();
        laserShotLine = GetComponentInChildren<LineRenderer>();
        laserShotLight = laserShotLine.gameObject.light;
        col = GetComponent<SphereCollider>();
        player = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth = player.gameObject.GetComponent<DonePlayerHealth>();
        hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>();

        // The line renderer and light are off to start.
        laserShotLine.enabled = false;
        laserShotLight.intensity = 0f;

        // The scaledDamage is the difference between the maximum and the minimum damage.
        scaledDamage = maximumDamage - minimumDamage;
    }
Esempio n. 10
0
    void Awake()
    {
        counter = 0;
        incorrect_counter = 0;
        filename = "collision_eval.txt";
        time_stat_file = "time_stats.txt";
        write_once = false;
        self = this.transform;
        self_ai = this.GetComponent<DoneEnemyAI>();
        self_sight = this.GetComponent<DoneEnemySight>();
        player = GameObject.FindGameObjectWithTag(DoneTags.player);
        player_health = player.GetComponent<DonePlayerHealth>();
        animator_hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>();

        GameObject[] enemies = GameObject.FindGameObjectsWithTag(DoneTags.enemy);
        for( int i = 0; i < enemies.Length; i++)
        {
            if ( self.transform == enemies[i].transform)
            {
                enemy_num = i + 1;
            }
        }
    }