updated mirror added testofflinescene

This commit is contained in:
DerTyp187
2021-10-25 13:03:25 +02:00
parent 93244c5160
commit 5921e33205
18 changed files with 2551 additions and 14 deletions

View File

@@ -9,16 +9,25 @@ public class Player : NetworkBehaviour
public Team team;
[SerializeField] private const int defaultHp = 100;
public ulong clientId;
private string name;
[SyncVar(hook = nameof(SetName))]
public string username;
[SerializeField] GameObject usernameTextObj;
private int health;
private int kills;
private int deaths;
public void SetName(string newName)
public override void OnStartLocalPlayer()
{
name = newName;
base.OnStartClient();
}
public void SetName(string oldName, string newName)
{
username = newName;
usernameTextObj.GetComponent<TMPro.TextMeshPro>().SetText(username);
}
public string GetName()