/// <summary> /// Makes camera shake in respective to the current /// knockback percentage. /// </summary> private void ApplyHitToCamera() { const float maxForce = 5f; var force = Mathf.Clamp(KnockbackPercentage, 0f, maxForce); Shake.AddTrauma(force / maxForce * 10f); }
public void ShakeCam(float trauma, bool additiveTrauma = true) { if (additiveTrauma) { shake.AddTrauma(trauma); } else { shake.SetTrauma(trauma); } if (shakeCo == null) { shakeCo = StartCoroutine(DoShake()); } }
void ShakeCamera(float trauma) { _shakeCountPerFrame++; Shake.AddTrauma(trauma / (_dividedOnSameFrame ? _shakeCountPerFrame : 1)); }