my HEAD hurts and the SFX is TOO LOUD

This commit is contained in:
Sylvia 2026-04-26 21:49:57 -07:00
parent a3321d361c
commit d4ebf0ca61
41 changed files with 1465 additions and 123 deletions

View file

@ -6,6 +6,7 @@ public class Entity : MonoBehaviour
[Header("Identification")]
public string entityName;
public SpriteRenderer sprite;
public AudioSource entityAS;
[Header("Flags")]
public bool stalled;
public bool invincible;
@ -20,6 +21,10 @@ public class Entity : MonoBehaviour
protected Vector2 moveDirection;
public float speed;
public float speedMultiplier = 1f;
[Header("FX")]
[SerializeField] private EntityDeathSFX deathObject;
[SerializeField] private AudioClip deathSound;
[SerializeField] private float deathVolume = 1;
protected void FlipSprite(Vector2 lookDirection)
{
@ -47,6 +52,8 @@ public class Entity : MonoBehaviour
health -= damage;
if (health < 0)
{
EntityDeathSFX newSFX = Instantiate(deathObject, transform.position, transform.rotation);
newSFX.PlaySFX(deathSound, deathVolume);
OnKillEffects();
}
}