//private int lives;
    void  Awake()
    {
        //enabled = false;
        if (damagePrefab)
        {
            if (damageEffectTransform == null)
            {
                damageEffectTransform = transform;
            }
            GameObject effect = Spawner.Spawn(damagePrefab, 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;
        }
        if (scorchMarkPrefab)
        {
            scorchMark = GameObject.Instantiate(scorchMarkPrefab, Vector3.zero, Quaternion.identity) as GameObject;
            scorchMark.SetActive(false);
        }
        sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>();
        gameTheme1     = GameObject.FindGameObjectWithTag("AlarmSound").GetComponent <AudioSource>();
        Debug.Log(gameTheme1.name);
        gameTheme2       = GameObject.FindGameObjectWithTag("GameController").GetComponent <AudioSource>();
        sirenGameObjects = GameObject.FindGameObjectsWithTag(DoneTags.siren);

        // if (gameTheme != null) Debug.Log("music found");

        scoreController = GameObject.FindGameObjectWithTag("Player").GetComponent <SpawnAtCheckpoint>();
        checkLives      = false;
        playerLives     = GameObject.FindGameObjectWithTag("PlayerLives").GetComponent <PlayerLives>();
        //  lives = playerLives.lives;
    }
	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>();
	}
Beispiel #3
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>();
    }
Beispiel #4
0
    void Awake()
    {
        score          = 0;
        checkpoint     = transform;
        playerHealth   = gameObject.GetComponent <Health>();
        sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>();

        playerLives = GameObject.FindGameObjectWithTag("PlayerLives").GetComponent <PlayerLives>();
    }
    void Awake()
    {
        score = 0;
          checkpoint = transform;
          playerHealth = gameObject.GetComponent<Health>();
          sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>();

          playerLives = GameObject.FindGameObjectWithTag("PlayerLives").GetComponent<PlayerLives>();
    }
    private float timer;                                        // Timer to determine when the lift moves and when the level ends.


    void Awake()
    {
        // Setting up references.
        player            = GameObject.FindGameObjectWithTag(DoneTags.player);
        playerAnim        = player.GetComponent <Animator>();
        hash              = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();
        camMovement       = Camera.main.gameObject.GetComponent <DoneCameraMovement>();
        sceneFadeInOut    = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>();
        liftDoorsTracking = GetComponent <DoneLiftDoorsTracking>();
    }
	private float timer;								// Timer to determine when the lift moves and when the level ends.
	
	
	void Awake ()
	{
		// Setting up references.
		player = GameObject.FindGameObjectWithTag(DoneTags.player);
		playerAnim = player.GetComponent<Animator>();
		hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>();
		camMovement = Camera.main.gameObject.GetComponent<DoneCameraMovement>();
		sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>();
		liftDoorsTracking = GetComponent<DoneLiftDoorsTracking>();
	}
    //private int lives;
    void Awake()
    {
        //enabled = false;
        if (damagePrefab) {
        if (damageEffectTransform == null)
            damageEffectTransform = transform;
        GameObject effect = Spawner.Spawn (damagePrefab, 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;

        }
        if (scorchMarkPrefab) {
        scorchMark = GameObject.Instantiate(scorchMarkPrefab, Vector3.zero, Quaternion.identity) as GameObject;
        scorchMark.SetActive (false);
        }
        sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>();
        gameTheme1 = GameObject.FindGameObjectWithTag("AlarmSound").GetComponent<AudioSource>();
        Debug.Log(gameTheme1.name);
        gameTheme2 = GameObject.FindGameObjectWithTag("GameController").GetComponent<AudioSource>();
           sirenGameObjects = GameObject.FindGameObjectsWithTag(DoneTags.siren);

           // if (gameTheme != null) Debug.Log("music found");

           scoreController = GameObject.FindGameObjectWithTag("Player").GetComponent<SpawnAtCheckpoint>();
           checkLives = false;
           playerLives = GameObject.FindGameObjectWithTag("PlayerLives").GetComponent<PlayerLives>();
         //  lives = playerLives.lives;
    }