2021-01-05 02:09:45 +00:00
|
|
|
|
using System.Collections.Generic;
|
2021-01-05 17:21:57 +00:00
|
|
|
|
using SanAndreasUnity.Utilities;
|
2021-01-05 02:09:45 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace SanAndreasUnity.Behaviours.Peds
|
|
|
|
|
{
|
|
|
|
|
public class DeadBody : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
private static List<DeadBody> _deadBodies = new List<DeadBody>();
|
|
|
|
|
public static IEnumerable<DeadBody> DeadBodies => _deadBodies;
|
|
|
|
|
public static int NumDeadBodies => _deadBodies.Count;
|
|
|
|
|
|
2021-01-05 17:21:57 +00:00
|
|
|
|
public PushableByDamage PushableByDamage { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
this.PushableByDamage = this.GetComponentOrThrow<PushableByDamage>();
|
|
|
|
|
this.PushableByDamage.forceMultiplier = PedManager.Instance.ragdollDamageForceWhenDetached;
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-05 02:09:45 +00:00
|
|
|
|
private void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
_deadBodies.Add(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnDisable()
|
|
|
|
|
{
|
|
|
|
|
_deadBodies.Remove(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|