private void OnDamage(OnDamageOptions options)
    {
        // Blood effect
        if (options.drawBlood)
        {
            bloodEffectPoolManager.ActivatePooledObject(options.point, Quaternion.LookRotation(options.normal));
        }

        // Take damage if not friendly fire
        if (GameManager.instance.friendlyFire || options.inflictingPlayer.team != team || options.inflictingPlayer == this)
        {
            health -= options.damage;
            if (isAlive && health <= 0)
            {
                // Die
                isAlive         = false;
                respawnTimeLeft = respawnTime;
                SetRagdoll(true);
                ragdollRigidbodies[0].AddForceAtPosition(options.damageDirection * ragdollDeathImpulse, options.point, ForceMode.Impulse);
            }
        }
    }
Exemplo n.º 2
0
 private void OnDamage(OnDamageOptions options)
 {
     Debug.Log($"Ow! {options.damage} damage.");
 }