using System;
using Actions;
using UnityEngine;

public class ScreenShakeActions : MonoBehaviour {
    private void Start() {
        ShootAction.OnAnyShoot += ShootAction_OnAnyShoot;
        GrenadeProjectile.OnAnyGrenadeExploded += GrenadeProjectile_OnAnyGrenadeExploded;
        SwordAction.OnAnySwordHit += SwordAction_OnAnySwordHit;
    }

    private void SwordAction_OnAnySwordHit(object sender, EventArgs e) => ScreenShake.Instance.Shake(2f);

    private void GrenadeProjectile_OnAnyGrenadeExploded(object sender, EventArgs e) => ScreenShake.Instance.Shake(5f);

    private void ShootAction_OnAnyShoot(object sender, ShootAction.ShootEventArgs e) => ScreenShake.Instance.Shake();
}