Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
    public void ShakeCam(float trauma, bool additiveTrauma = true)
    {
        if (additiveTrauma)
        {
            shake.AddTrauma(trauma);
        }
        else
        {
            shake.SetTrauma(trauma);
        }

        if (shakeCo == null)
        {
            shakeCo = StartCoroutine(DoShake());
        }
    }
Exemplo n.º 3
0
 void ShakeCamera(float trauma)
 {
     _shakeCountPerFrame++;
     Shake.AddTrauma(trauma / (_dividedOnSameFrame ? _shakeCountPerFrame : 1));
 }