Beispiel #1
0
	void Awake ()
	{
		onFire = false;
		announcerAudio = GetComponents<AudioSource> () [1];
		playerAttack = GetComponent<PlayerAttack> ();

		canvas = GameObject.Find ("HUDCanvas");
		//Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);

		inGameHealthUI = canvas.GetComponent<RectTransform> ().Find ("PlayerHealthUI_" + playerAttack.playerNum)
			.GetComponent<InGameHealthUI>();
		inGameHealthUI.playerHealth = this;
		rigid = GetComponent<Rigidbody> ();
		gm = GameObject.Find ("GameManager").GetComponent<GameManager> ();
		uim = GameObject.Find ("GameManager").GetComponent<UI_Manager> ();
		joystickNum = playerAttack.joystickNum;
		damageReduction = 1;
		allgrounds = GameObject.FindGameObjectsWithTag("Island");
		anim = GetComponent <Animation> ();
		playerAudio = GetComponent <AudioSource> ();
		playerMovement = GetComponent <PlayerMovement> ();

		//playerShooting = GetComponentInChildren <PlayerShooting> ();
		currentHealth = startingHealth;
		SetupHealthUI ();
	}
Beispiel #2
0
    void Awake()
    {
        onFire         = false;
        announcerAudio = GetComponents <AudioSource> () [1];
        playerAttack   = GetComponent <PlayerAttack> ();

        canvas = GameObject.Find("HUDCanvas");
        //Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);

        inGameHealthUI = canvas.GetComponent <RectTransform> ().Find("PlayerHealthUI_" + playerAttack.playerNum)
                         .GetComponent <InGameHealthUI>();
        inGameHealthUI.playerHealth = this;
        rigid           = GetComponent <Rigidbody> ();
        gm              = GameObject.Find("GameManager").GetComponent <GameManager> ();
        uim             = GameObject.Find("GameManager").GetComponent <UI_Manager> ();
        joystickNum     = playerAttack.joystickNum;
        damageReduction = 1;
        allgrounds      = GameObject.FindGameObjectsWithTag("Island");
        anim            = GetComponent <Animation> ();
        playerAudio     = GetComponent <AudioSource> ();
        playerMovement  = GetComponent <PlayerMovement> ();

        //playerShooting = GetComponentInChildren <PlayerShooting> ();
        currentHealth = startingHealth;
        SetupHealthUI();
    }