Add multiplier dmg

This commit is contained in:
2024-08-10 19:53:06 +02:00
parent 6e0802163e
commit 5104b336ca
2 changed files with 6 additions and 2 deletions

View File

@@ -15,9 +15,11 @@ public class ProcessHitComponent : MonoBehaviour
if (ignored.Contains(source)) return; if (ignored.Contains(source)) return;
Debug.Log("Got hit"); var damage = args.damage.value;
var multiplier = args.hitMultiplier;
var finalDamage = damage * multiplier;
onTakeDamage.Invoke(args.damage.value); onTakeDamage.Invoke((int)finalDamage);
ignored.Add(args.source); ignored.Add(args.source);
} }

View File

@@ -12,6 +12,8 @@ public class RagdollComponent : MonoBehaviour
StartCoroutine(RagdollCoroutine()); StartCoroutine(RagdollCoroutine());
} }
// Needs to be coroutine, because if we modify all rigidbodies at the same time,
// unity play mode crashed in VR
IEnumerator RagdollCoroutine() IEnumerator RagdollCoroutine()
{ {
var animators = GetComponentsInChildren<Animator>(); var animators = GetComponentsInChildren<Animator>();