Пример #1
0
    private void PlayerController_Landed(PlayerController.LandEventArgs landEvent)
    {
        // I don't like this dependency, tbh...
        if (_gameCamera == null)
        {
            return;
        }

        if (Mathf.Abs(landEvent.Velocity) > 10f)
        {
            _landEffect           = _gameCamera.AddScreenEffect <ScreenShake>();
            _landEffect.Amplitude = Mathf.Abs(landEvent.Velocity) / 100f;
            _landEffect.Duration  = 0.5f;
            _landEffect.Frequency = 0.01f;
            _landEffect.Activate();
        }
    }