diff --git a/Assets/Scripts/Units/Player.cs b/Assets/Scripts/Units/Player.cs index 1875a2c..1b61ad8 100644 --- a/Assets/Scripts/Units/Player.cs +++ b/Assets/Scripts/Units/Player.cs @@ -22,13 +22,9 @@ namespace Reset.Units{ } public void Attach(){ - name = "Player"; - name += IsLocalPlayer ? ", Local" : ", Network"; - if (IsLocalPlayer || !UnitIsNetworked()) { // PlayerManager.Player = gameObject; - Debug.Log($"Player is set to {PlayerManager.Player.name}"); PlayerManager.RequestNewController(); GetComponent().AttachCamera(gameObject); } @@ -37,15 +33,20 @@ namespace Reset.Units{ public override void UnitStart(){ base.UnitStart(); + SetPlayerName(); Attach(); ((IKillable)this).IKillableInitialize(); } - protected override void Update(){ - base.Update(); + private void SetPlayerName(){ + name = "Player"; + if (UnitIsNetworked()){ + name += IsLocalPlayer ? ", Local" : ", Network"; + } + } + public override void UnitUpdate(){ GetComponent().DrawHealthDebug(); - Debug.Log(PlayerManager.Player); } public void TakeDamage(DamageSource[] sources){