Added map and fixed other bugs
This commit is contained in:
@@ -48,6 +48,9 @@ public class PlayerHealth : NetworkBehaviour
|
||||
{
|
||||
if (!isServer) return;
|
||||
if(isDead.Value) return;
|
||||
|
||||
PlayerShield _shield = GetComponent<PlayerShield>();
|
||||
if (_shield != null && _shield.IsShieldUp) return;
|
||||
|
||||
currentHealth.Value = Mathf.Max(0, currentHealth.Value - _damageAmount);
|
||||
}
|
||||
@@ -61,6 +64,7 @@ public class PlayerHealth : NetworkBehaviour
|
||||
{
|
||||
if(!isServer) return;
|
||||
|
||||
GetComponent<PlayerShield>()?.SetShieldState(false);
|
||||
isDead.Value = true;
|
||||
OnDiedClientRpc();
|
||||
}
|
||||
@@ -69,6 +73,7 @@ public class PlayerHealth : NetworkBehaviour
|
||||
{
|
||||
if(!isServer) return;
|
||||
|
||||
GetComponent<PlayerShield>()?.SetShieldState(false);
|
||||
isDead.Value = false;
|
||||
currentHealth.Value = maxHealth;
|
||||
RespawnClientRpc(_spawnPosition);
|
||||
|
||||
Reference in New Issue
Block a user