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(){
|
public void Attach(){
|
||||||
name = "Player";
|
|
||||||
name += IsLocalPlayer ? ", Local" : ", Network";
|
|
||||||
|
|
||||||
if (IsLocalPlayer || !UnitIsNetworked()) { //
|
if (IsLocalPlayer || !UnitIsNetworked()) { //
|
||||||
PlayerManager.Player = gameObject;
|
PlayerManager.Player = gameObject;
|
||||||
|
|
||||||
Debug.Log($"Player is set to {PlayerManager.Player.name}");
|
|
||||||
PlayerManager.RequestNewController();
|
PlayerManager.RequestNewController();
|
||||||
GetComponent<LockOnManager>().AttachCamera(gameObject);
|
GetComponent<LockOnManager>().AttachCamera(gameObject);
|
||||||
}
|
}
|
||||||
@@ -37,15 +33,20 @@ namespace Reset.Units{
|
|||||||
public override void UnitStart(){
|
public override void UnitStart(){
|
||||||
base.UnitStart();
|
base.UnitStart();
|
||||||
|
|
||||||
|
SetPlayerName();
|
||||||
Attach();
|
Attach();
|
||||||
((IKillable)this).IKillableInitialize();
|
((IKillable)this).IKillableInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(){
|
private void SetPlayerName(){
|
||||||
base.Update();
|
name = "Player";
|
||||||
|
if (UnitIsNetworked()){
|
||||||
|
name += IsLocalPlayer ? ", Local" : ", Network";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void UnitUpdate(){
|
||||||
GetComponent<IKillable>().DrawHealthDebug();
|
GetComponent<IKillable>().DrawHealthDebug();
|
||||||
Debug.Log(PlayerManager.Player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TakeDamage(DamageSource[] sources){
|
public void TakeDamage(DamageSource[] sources){
|
||||||
|
|||||||
Reference in New Issue
Block a user