fixed the issue with pausing while respawning:

This commit is contained in:
Melbyj1125
2022-04-12 22:40:25 -05:00
parent 7d9e78891f
commit 7f4e2173ad
8 changed files with 68 additions and 22 deletions

View File

@@ -18,6 +18,7 @@ public class Pitfall : NetworkBehaviour
private void OnTriggerEnter(Collider other) {
if (cooldown == false && other.transform.gameObject.tag == "PlayerTrigger" && other.gameObject.transform.root.gameObject.GetComponent<NetworkObject>().OwnerClientId == NetworkManager.Singleton.LocalClientId) {
other.transform.root.GetComponentInChildren<PlayerStats>().IsRespawning = true;
RespawnPlayerServerRPC(other.gameObject.transform.root.gameObject.GetComponent<NetworkObject>().OwnerClientId);
cooldown = true;
StartCoroutine(CoolItDown());
@@ -135,6 +136,7 @@ public class Pitfall : NetworkBehaviour
character.GetComponentInChildren<AerialStateManager>().enabled = true;
character.GetComponentInChildren<OffenseStateManager>().enabled = true;
character.GetComponentInChildren<CoolDown>().populatePlayerCanvas();
character.GetComponentInChildren<PlayerStats>().IsRespawning = false;
}
}

View File

@@ -29,7 +29,7 @@ public class SlowTerrain : NetworkBehaviour
foreach (GameObject player in players) {
if (player.GetComponent<NetworkObject>().OwnerClientId == playerID) {
player.GetComponentInChildren<PlayerStats>().ApplySlimeBody();
player.GetComponentInChildren<PlayerStats>().ApplySuperSlow();
}
}
}
@@ -57,7 +57,7 @@ public class SlowTerrain : NetworkBehaviour
foreach (GameObject player in players) {
if (player.GetComponent<NetworkObject>().OwnerClientId == playerID) {
player.GetComponentInChildren<PlayerStats>().ClearSlimeBody();
player.GetComponentInChildren<PlayerStats>().ClearSuperSlow();
}
}
}