mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
updated mirror added testofflinescene
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user