maint: clean up for gameobject name change in player class
This commit is contained in:
@@ -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<LockOnManager>().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<IKillable>().DrawHealthDebug();
|
||||
Debug.Log(PlayerManager.Player);
|
||||
}
|
||||
|
||||
public void TakeDamage(DamageSource[] sources){
|
||||
|
||||
Reference in New Issue
Block a user