Alles alter

This commit is contained in:
juliuse98
2021-11-24 12:54:43 +01:00
parent ad238ac417
commit 6bbe58799d
40 changed files with 2692 additions and 694 deletions

View File

@@ -7,6 +7,10 @@ public class Player : NetworkBehaviour
{
public bool isAlive = true;
public Team team;
[SerializeField]PlayerUIController playerUIController;
[SerializeField] private const int defaultHp = 100;
GameObject GameManager;
GameMaster gameMaster;
@@ -42,11 +46,9 @@ public class Player : NetworkBehaviour
{
if (isLocalPlayer)
{
if (Input.GetKeyDown("n"))
if (Input.GetKeyDown(KeyCode.N))
{
//Debug.Log("Request respawn on local player");
CmdRespawnRequest();
//transform.position = Vector3.zero;
playerUIController.showHit();
}
}
@@ -111,6 +113,7 @@ public class Player : NetworkBehaviour
if (isAlive)
{
ShowHit();
health -= value;
if (health <= 0)
{
@@ -120,6 +123,12 @@ public class Player : NetworkBehaviour
}
}
[ClientRpc]
private void ShowHit()
{
playerUIController.showHit();
}
public void SetHealth(int value)
{
if (isAlive)