Пример #1
0
    /**
     * \brief	Initilizes the HP textbox on the HUD overlay, and sets up a callback function so that
     *			the HP textbox gets updated every time the player's HP gets decremented.
     * \param	void
     * \return	void
     */
    private void Start()
    {
        HP hp = GetComponent <HP>();

        textBox.text = "Lives: " + hp.hp;
        hp.AddDecrementCallback((hp) => textBox.text = "Lives: " + hp);
    }