mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 06:20:17 +00:00
32 lines
886 B
C#
32 lines
886 B
C#
using System.Collections.Generic;
|
|
using SanAndreasUnity.Utilities;
|
|
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;
|
|
|
|
public PushableByDamage PushableByDamage { get; private set; }
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
this.PushableByDamage = this.GetComponentOrThrow<PushableByDamage>();
|
|
this.PushableByDamage.forceMultiplier = PedManager.Instance.ragdollDamageForceWhenDetached;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
_deadBodies.Add(this);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_deadBodies.Remove(this);
|
|
}
|
|
}
|
|
}
|