private void BindEvents() { if (m_screenShakeEvent == null) { m_screenShakeEvent = new ScreenShakeEvent(); } m_screenShakeEvent.AddListener(StartScreenShake); }
// ******************************************************************** #endregion // ******************************************************************** // ******************************************************************** #region Private Methods // ******************************************************************** private void OnScreenShakeEvent(ScreenShakeEvent _event) { ApplyScreenShake(_event.magnitude); }
private void OnDisable() { onScreenShake -= Shake; }
public void ShakeScreen(bool instant, float factor = 1f, float time = 1f) { ScreenShakeEvent ssEvent = new ScreenShakeEvent(instant, factor, time); eventQueue.Enqueue(ssEvent); }
void Start() { onScreenShake += Shake; }