void OnGUI()
{
if (!isLocalPlayer || !InputManager.seeGUI)
return;
// Bars
GUI.DrawTexture((new Rect((Screen.width - this.inventory.Columns * this.inventory.ToolbarSize) / 2, (int)(Screen.height - this.inventory.ToolbarSize * 1.6f), this.inventory.Columns * this.inventory.ToolbarSize, this.inventory.ToolbarSize / 3.5f)), this.lifeBar[Mathf.CeilToInt(this.life * 100 / this.lifeMax)]);
GUI.DrawTexture((new Rect(Screen.width / 1.03f, Screen.height * 0.0125f, Screen.width / 85, Screen.height / 2f)), this.hungerBar[Mathf.CeilToInt(this.hunger * 100 / this.hungerMax)]);
GUI.DrawTexture((new Rect(Screen.width / 1.03f - Screen.width * 0.025f, Screen.height * 0.0125f, Screen.width / 85, Screen.height / 2f)), this.ThirstBar[Mathf.CeilToInt(this.thirst * 100 / this.thirstMax)]);
if (this.life <= 0 && gameObject.GetComponent<BossFight>().MyState == BossFight.State.Outfight)
{
if (GUI.Button(new Rect(5 * Screen.width / 14, Screen.height / 2 - 100, 2 * Screen.width / 7, 100), TextDatabase.Respawn.GetText(), skin.GetStyle("button")))
{
Respawn();
GetComponent<Sound>().PlaySound(AudioClips.Button, 1f);
}
if (GUI.Button(new Rect(5 * Screen.width / 14, Screen.height / 2 + 100, 2 * Screen.width / 7, 100), TextDatabase.Quit.GetText(), skin.GetStyle("button")))
{
Respawn();
GetComponent<Sound>().PlaySound(AudioClips.Button, 1f);
if (isServer)
{
GameObject.Find("Map").GetComponent<Save>().SaveWorld();
GameObject.Find("NetworkManager").GetComponent<NetworkManager>().StopHost();
}
else
GetComponent<Menu>().CmdDisconnect();
}
}
}