using D2D.Core;
using D2D.Utilities;
using UnityEngine;
namespace D2D.Cameras
{
///
/// You can extend this class to any other game play shakes.
/// Such as bomb explosion, enemy hit, etc.
///
public class GameplayCameraShaker : CameraShaker
{
[SerializeField] private ShakeProfile _winShake;
[SerializeField] private ShakeProfile _loseShake;
private GameStateMachine _gsm;
private void OnEnable()
{
_gsm = this.FindLazy();
_gsm.On(() => Shake(_winShake));
_gsm.On(() => Shake(_loseShake));
}
}
}