Ejemplo n.º 1
0
 void Awake()
 {
     character = transform;
     player = GameObject.FindWithTag ("Player").transform;
     lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();
     enemySight = GameObject.FindGameObjectWithTag("AIattack").GetComponent<EnemySight>();
 }
 void Awake()
 {
     dlps                      = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting> ();
     currentHealth             = startingHealth;
     hud                       = GameObject.FindGameObjectWithTag("UI").GetComponent <HUD> ();
     healthtrasform.fillAmount = currentHealth / startingHealth;
 }
Ejemplo n.º 3
0
    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 <Health>();
        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;

        targetPlayer = GameObject.FindGameObjectWithTag("Player").transform;
        if (targetPlayer == null)
        {
            Debug.Log("Player not found");
            return;
        }
        else
        {
            targetPlayer = GameObject.FindGameObjectWithTag("Player").transform;
        }
    }
Ejemplo n.º 4
0
 void  Awake()
 {
     character          = transform;
     player             = GameObject.FindWithTag("Player").transform;
     lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
     enemySight         = GameObject.FindGameObjectWithTag("AIattack").GetComponent <EnemySight>();
 }
Ejemplo n.º 5
0
    private DoneLastPlayerSighting lastPlayerSighting;                  // Reference to the global last sighting of the player.


    void Awake()
    {
        // Setting up references.
        _renderer          = GetComponent <Renderer>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player);
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
    }
Ejemplo n.º 6
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>();
	}
    void  Awake()
    {
        character = motor.transform;
        player    = GameObject.FindWithTag("Player").transform;
        ai        = transform.parent.GetComponentInChildren <AI> ();

        lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>();
        enemySight         = GetComponent <EnemySight>();
    }
Ejemplo n.º 8
0
    private bool playerDead;                                    // A bool to show if the player is dead or not.


    void Awake()
    {
        // Setting up the references.
        anim               = GetComponent <Animator>();
        playerMovement     = GetComponent <DonePlayerMovement>();
        hash               = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();
        sceneFadeInOut     = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
    }
Ejemplo n.º 9
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>();
    }
Ejemplo n.º 10
0
	private bool playerDead;							// A bool to show if the player is dead or not.
	
	
	void Awake ()
	{
		// Setting up the references.
		anim = GetComponent<Animator>();
		playerMovement = GetComponent<DonePlayerMovement>();
		hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>();
		sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>();
		lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();
	}
Ejemplo n.º 11
0
 void Awake()
 {
     i                  = 0;
     alle               = true;
     light              = GameObject.Find("Directional light");
     rotat              = GameObject.Find("CamArmature");
     col                = GetComponent <SphereCollider>();
     player             = GameObject.FindGameObjectWithTag(DoneTags.player);
     lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
 }
Ejemplo n.º 12
0
    void Start()
    {
        i                  = 0;
        alle               = true;
        col                = GetComponent <SphereCollider>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player);
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();

        // rotat.transform.rotation = ....
    }
Ejemplo n.º 13
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>();
    }
    void Awake()
    {
        character = motor.transform;
        player = GameObject.FindWithTag ("Player").transform;
        ai = transform.parent.GetComponentInChildren<AI> ();
        if (blinkComponents.Length != 0)  // FIX HERE changed from 'if (!blinkComponents.Length)'
        blinkComponents = transform.parent.GetComponentsInChildren<SelfIlluminationBlink> ();

        lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>();
        enemySight = GetComponent<EnemySight>();
    }
Ejemplo n.º 15
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";
    }
    void  Awake()
    {
        character = motor.transform;
        player    = GameObject.FindWithTag("Player").transform;
        ai        = transform.parent.GetComponentInChildren <AI> ();
        if (blinkComponents.Length != 0) // FIX HERE changed from 'if (!blinkComponents.Length)'
        {
            blinkComponents = transform.parent.GetComponentsInChildren <SelfIlluminationBlink> ();
        }

        lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>();
        enemySight         = GetComponent <EnemySight>();
    }
Ejemplo n.º 17
0
    private int wayPointIndex = 0;                              // A counter for the way point array.


    void Awake()
    {
        // Setting up the references.
        HealthPack         = GameObject.FindGameObjectWithTag("HealthPack").transform;
        enemySight         = GetComponent <EnemySight>();
        nav                = GetComponent <UnityEngine.NavMeshAgent>();
        player             = GameObject.FindGameObjectWithTag(Tags.player).transform;
        playerHealth       = player.GetComponent <PlayerHealth>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <DoneLastPlayerSighting>();
        enemyShooting      = GetComponent <EnemyShooting> ();
        for (wayPointIndex = 0; wayPointIndex < 4; wayPointIndex++)
        {
            patrolWayPoints[wayPointIndex] = new Vector3(Random.Range(0, 500), 0, Random.Range(0, 500));
        }
    }
Ejemplo n.º 18
0
	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;
	}
    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;
    }
Ejemplo n.º 20
0
    void Awake()
    {
        // Setting up the references.
        enemySight         = GetComponent <DoneEnemySight>();
        nav                = GetComponent <NavMeshAgent>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth       = player.GetComponent <Health>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();

        if (bloodPrefab)
        {
            // if (damageEffectTransform == gameObject.transform)
            damageEffectTransform = transform;
            GameObject effect = Spawner.Spawn(bloodPrefab, Vector3.zero, Quaternion.identity);
            effect.transform.parent        = damageEffectTransform;
            effect.transform.localPosition = Vector3.zero;
            damageEffect = effect.GetComponent <ParticleEmitter>();
            Vector2 tempSize = new Vector2(GetComponent <Collider>().bounds.extents.x, GetComponent <Collider>().bounds.extents.z);
            colliderRadiusHeuristic   = tempSize.magnitude * 0.5f;
            damageEffectCenterYOffset = GetComponent <Collider>().bounds.extents.y;
        }
    }
Ejemplo n.º 21
0
    void Awake()
    {
        // Setting up the references.
        enemySight = GetComponent<DoneEnemySight>();
        nav = GetComponent<NavMeshAgent>();
        player = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth = player.GetComponent<Health>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();

        if (bloodPrefab)
        {
           // if (damageEffectTransform == gameObject.transform)
                damageEffectTransform = transform;
            GameObject effect = Spawner.Spawn(bloodPrefab, Vector3.zero, Quaternion.identity);
            effect.transform.parent = damageEffectTransform;
            effect.transform.localPosition = Vector3.zero;
            damageEffect = effect.GetComponent<ParticleEmitter>();
            Vector2 tempSize = new Vector2(GetComponent<Collider>().bounds.extents.x, GetComponent<Collider>().bounds.extents.z);
            colliderRadiusHeuristic = tempSize.magnitude * 0.5f;
            damageEffectCenterYOffset = GetComponent<Collider>().bounds.extents.y;

        }
    }
Ejemplo n.º 22
0
    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("Player");
        //	playerAnim = player.GetComponent<Animator>();
        playerHealth = player.GetComponent<Health>();
        //	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;

        targetPlayer = GameObject.FindGameObjectWithTag("Player").transform;
        if (targetPlayer == null)
        {
            Debug.Log("Player not found");
            return;
        }
        else targetPlayer = GameObject.FindGameObjectWithTag("Player").transform;
    }
Ejemplo n.º 23
0
 void Awake()
 {
     lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>();
     enemySight = GetComponent<EnemySight>();
 }
    private DoneLastPlayerSighting lastPlayerSighting;		// Reference to the global last sighting of the player.

	
	void Awake ()
	{
		// Setting up the references.
		player = GameObject.FindGameObjectWithTag(DoneTags.player);
		lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>();
	}
    // Update is called once per frame

    void Start()
    {
        dlps         = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting> ();
        playerHealth = player.GetComponent <PlayerHealth> ();
        //	enemySight = enemy.GetComponent<EnemySight> ();
    }
Ejemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     player             = GameObject.FindGameObjectWithTag(DoneTags.player);
     lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();
 }
Ejemplo n.º 27
0
 void Awake()
 {
     lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>();
     enemySight         = GetComponent <EnemySight>();
 }
Ejemplo n.º 28
0
    private DoneLastPlayerSighting lastPlayerSighting;                  // Reference to the global last sighting of the player.


    void Awake()
    {
        // Setting up the references.
        player             = GameObject.FindGameObjectWithTag(UnityTags.Player);
        lastPlayerSighting = GameObject.FindGameObjectWithTag(UnityTags.GameController).GetComponent <DoneLastPlayerSighting>();
    }
    void Awake()
    {
        character = motor.transform;
        player = GameObject.FindWithTag ("Player").transform;
        ai = transform.parent.GetComponentInChildren<AI> ();

        lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>();
        enemySight = GetComponent<EnemySight>();
    }