Add multiplier dmg
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>();
|
||||||
|
|||||||
Reference in New Issue
Block a user