This commit is contained in:
RochesterX
2025-03-07 17:30:04 -05:00
parent 2d97a35045
commit 6fda7978f3
3 changed files with 11 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ public class Damageable : MonoBehaviour
private void Damage(GameObject damageSource)
{
if (dying) return;
float actualForce = damageSource.GetComponent<Damageable>().force;
Block blockComponent = GetComponent<Block>();
if (blockComponent != null && blockComponent.blocking)
@@ -95,7 +95,7 @@ public class Damageable : MonoBehaviour
{;
if (GameManager.Instance != null)
{
animator.SetTrigger("die");
animator.SetBool("die", true);
dying = true;
}
}
@@ -103,6 +103,7 @@ public class Damageable : MonoBehaviour
public void HandleDeath()
{
GameManager.Instance.PlayerDied(this);
animator.SetBool("die", false);
dying = false;
}

View File

@@ -24,9 +24,7 @@ public class HealthBarManager : MonoBehaviour
{
GameObject player = kvp.Key;
GameObject healthBar = kvp.Value;
//Vector3 screenPosition = Camera.main.WorldToScreenPoint(player.transform.position);
//screenPosition.y += 15;
//Vector3 worldPosition = Camera.main.ScreenToWorldPoint(screenPosition);
healthBar.GetComponent<TerribleHealthBarScript>().fullHealthColor = GameManager.playerColors[GameManager.players.IndexOf(player)];
healthBar.transform.SetPositionAndRotation(new Vector3(player.transform.position.x, player.transform.position.y + 1.5f, player.transform.position.z), Quaternion.identity);
}
}