321 lines
9.1 KiB
C#
321 lines
9.1 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace RecRoom.Core.AI
|
|
{
|
|
// Token: 0x02000198 RID: 408
|
|
[RequireComponent(typeof(Collider))]
|
|
public class RagdollPiece : MonoBehaviour
|
|
{
|
|
// Token: 0x06005285 RID: 21125 RVA: 0x00194E08 File Offset: 0x00193008
|
|
public void StartRagdoll(Vector3 FNDMBKLFMBM, Vector3 PCKCMEMBEPF, float JJBCNDADPPN)
|
|
{
|
|
this.OALAKGPJDDL = true;
|
|
Vector3 vector = global::UnityEngine.Random.onUnitSphere * JJBCNDADPPN * 57.29578f;
|
|
Vector3 vector2 = (base.transform.position - PCKCMEMBEPF).normalized * JJBCNDADPPN;
|
|
Vector3 vector3 = FNDMBKLFMBM + vector2;
|
|
base.gameObject.layer = 27;
|
|
base.transform.SetParent(null, true);
|
|
this.CINAFOGLFIB.enabled = true;
|
|
if (this.IJFBNEGJIEI == null)
|
|
{
|
|
this.IJFBNEGJIEI = base.gameObject.AddComponent<Rigidbody>();
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
this.IJFBNEGJIEI.isKinematic = false;
|
|
this.IJFBNEGJIEI.angularDrag = 0f;
|
|
this.IJFBNEGJIEI.drag = 0f;
|
|
this.IJFBNEGJIEI.velocity = vector3;
|
|
this.IJFBNEGJIEI.angularVelocity = vector;
|
|
this.IJFBNEGJIEI.useGravity = !RagdollPiece.LIMODECOAPF;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06005286 RID: 21126 RVA: 0x00194F0C File Offset: 0x0019310C
|
|
private void LEJIGKBFDEG(bool NOBAPCOKFIL)
|
|
{
|
|
this.BJLOFCIHPBG = NOBAPCOKFIL;
|
|
base.enabled = this.BJLOFCIHPBG && RagdollPiece.LIMODECOAPF;
|
|
}
|
|
|
|
// Token: 0x06005287 RID: 21127 RVA: 0x00194F30 File Offset: 0x00193130
|
|
public void HDMEOIJFJLM(Vector3 FNDMBKLFMBM, Vector3 PCKCMEMBEPF, float JJBCNDADPPN)
|
|
{
|
|
this.LEJIGKBFDEG(false);
|
|
Vector3 vector = global::UnityEngine.Random.onUnitSphere * JJBCNDADPPN * 1408f;
|
|
Vector3 vector2 = (base.transform.position - PCKCMEMBEPF).normalized * JJBCNDADPPN;
|
|
Vector3 vector3 = FNDMBKLFMBM + vector2;
|
|
base.gameObject.layer = -62;
|
|
base.transform.SetParent(null, false);
|
|
this.CINAFOGLFIB.enabled = false;
|
|
if (this.IJFBNEGJIEI == null)
|
|
{
|
|
this.IJFBNEGJIEI = base.gameObject.AddComponent<Rigidbody>();
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
this.IJFBNEGJIEI.isKinematic = false;
|
|
this.IJFBNEGJIEI.angularDrag = 207f;
|
|
this.IJFBNEGJIEI.drag = 1537f;
|
|
this.IJFBNEGJIEI.velocity = vector3;
|
|
this.IJFBNEGJIEI.angularVelocity = vector;
|
|
this.IJFBNEGJIEI.useGravity = RagdollPiece.LIMODECOAPF;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06005288 RID: 21128 RVA: 0x00195034 File Offset: 0x00193234
|
|
public static void EHBIFJLMJPN()
|
|
{
|
|
RagdollPiece.LIMODECOAPF = false;
|
|
RagdollPiece.HOFHOLGJENM = Physics.gravity;
|
|
}
|
|
|
|
// Token: 0x06005289 RID: 21129 RVA: 0x00195048 File Offset: 0x00193248
|
|
private void EMAFJPOFNPB()
|
|
{
|
|
if (this.OALAKGPJDDL && RagdollPiece.LIMODECOAPF)
|
|
{
|
|
this.IJFBNEGJIEI.AddForce(RagdollPiece.HOFHOLGJENM);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600528A RID: 21130 RVA: 0x00195070 File Offset: 0x00193270
|
|
private void KGLGEGHCONM()
|
|
{
|
|
if (this.KGKBONNGDAL() && RagdollPiece.LIMODECOAPF)
|
|
{
|
|
this.IJFBNEGJIEI.AddForce(RagdollPiece.HOFHOLGJENM);
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000188 RID: 392
|
|
// (get) Token: 0x06005290 RID: 21136 RVA: 0x0019525C File Offset: 0x0019345C
|
|
// (set) Token: 0x0600528B RID: 21131 RVA: 0x00195098 File Offset: 0x00193298
|
|
private bool OALAKGPJDDL
|
|
{
|
|
get
|
|
{
|
|
return this.BJLOFCIHPBG;
|
|
}
|
|
set
|
|
{
|
|
this.BJLOFCIHPBG = value;
|
|
base.enabled = this.BJLOFCIHPBG && RagdollPiece.LIMODECOAPF;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600528C RID: 21132 RVA: 0x001950BC File Offset: 0x001932BC
|
|
public void HCJEEPNBLNJ()
|
|
{
|
|
if (this.KGKBONNGDAL())
|
|
{
|
|
if (RagdollPiece.AnimateOut)
|
|
{
|
|
AnimateInOutManager.DGHBOJJIJFH(this.CINAFOGLFIB.bounds);
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
global::UnityEngine.Object.Destroy(this.IJFBNEGJIEI);
|
|
this.IJFBNEGJIEI = null;
|
|
}
|
|
if (this.disableColliderWhenNotRagdolling)
|
|
{
|
|
this.CINAFOGLFIB.enabled = false;
|
|
}
|
|
base.transform.SetParent(this.CNGOCFABIFK, false);
|
|
this.OALAKGPJDDL = false;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600528D RID: 21133 RVA: 0x00195144 File Offset: 0x00193344
|
|
private bool KGKBONNGDAL()
|
|
{
|
|
return this.BJLOFCIHPBG;
|
|
}
|
|
|
|
// Token: 0x0600528E RID: 21134 RVA: 0x0019514C File Offset: 0x0019334C
|
|
public void CCODBICNCCN()
|
|
{
|
|
if (this.KGKBONNGDAL())
|
|
{
|
|
if (RagdollPiece.AnimateOut)
|
|
{
|
|
AnimateInOutManager.LEHGECMGLNC(this.CINAFOGLFIB.bounds);
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
global::UnityEngine.Object.Destroy(this.IJFBNEGJIEI);
|
|
this.IJFBNEGJIEI = null;
|
|
}
|
|
if (this.disableColliderWhenNotRagdolling)
|
|
{
|
|
this.CINAFOGLFIB.enabled = true;
|
|
}
|
|
base.transform.SetParent(this.CNGOCFABIFK, false);
|
|
this.LNOHFIHCNCL(true);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600528F RID: 21135 RVA: 0x001951D4 File Offset: 0x001933D4
|
|
public void StopRagdoll()
|
|
{
|
|
if (this.OALAKGPJDDL)
|
|
{
|
|
if (RagdollPiece.AnimateOut)
|
|
{
|
|
AnimateInOutManager.PlayOneOff(this.CINAFOGLFIB.bounds);
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
global::UnityEngine.Object.Destroy(this.IJFBNEGJIEI);
|
|
this.IJFBNEGJIEI = null;
|
|
}
|
|
if (this.disableColliderWhenNotRagdolling)
|
|
{
|
|
this.CINAFOGLFIB.enabled = false;
|
|
}
|
|
base.transform.SetParent(this.CNGOCFABIFK, true);
|
|
this.OALAKGPJDDL = false;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06005291 RID: 21137 RVA: 0x00195264 File Offset: 0x00193464
|
|
public static void PHBDMBICKNJ()
|
|
{
|
|
RagdollPiece.LIMODECOAPF = false;
|
|
RagdollPiece.HOFHOLGJENM = Physics.gravity;
|
|
}
|
|
|
|
// Token: 0x06005292 RID: 21138 RVA: 0x00195278 File Offset: 0x00193478
|
|
private void LNOHFIHCNCL(bool NOBAPCOKFIL)
|
|
{
|
|
this.BJLOFCIHPBG = NOBAPCOKFIL;
|
|
base.enabled = !this.BJLOFCIHPBG || RagdollPiece.LIMODECOAPF;
|
|
}
|
|
|
|
// Token: 0x06005293 RID: 21139 RVA: 0x0019529C File Offset: 0x0019349C
|
|
public static void UseDefaultGravity()
|
|
{
|
|
RagdollPiece.LIMODECOAPF = false;
|
|
RagdollPiece.HOFHOLGJENM = Physics.gravity;
|
|
}
|
|
|
|
// Token: 0x06005294 RID: 21140 RVA: 0x001952B0 File Offset: 0x001934B0
|
|
private void FixedUpdate()
|
|
{
|
|
if (this.OALAKGPJDDL && RagdollPiece.LIMODECOAPF)
|
|
{
|
|
this.IJFBNEGJIEI.AddForce(RagdollPiece.HOFHOLGJENM);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06005295 RID: 21141 RVA: 0x001952D8 File Offset: 0x001934D8
|
|
private void OFOPHGFIAJM()
|
|
{
|
|
this.CNGOCFABIFK = base.transform.parent;
|
|
this.CINAFOGLFIB = base.GetComponent<Collider>();
|
|
if (this.disableColliderWhenNotRagdolling)
|
|
{
|
|
this.CINAFOGLFIB.enabled = true;
|
|
}
|
|
base.enabled = false;
|
|
}
|
|
|
|
// Token: 0x06005296 RID: 21142 RVA: 0x00195318 File Offset: 0x00193518
|
|
public void KLGBJCHGAOC(Vector3 FNDMBKLFMBM, Vector3 PCKCMEMBEPF, float JJBCNDADPPN)
|
|
{
|
|
this.LNOHFIHCNCL(false);
|
|
Vector3 vector = global::UnityEngine.Random.onUnitSphere * JJBCNDADPPN * 340f;
|
|
Vector3 vector2 = (base.transform.position - PCKCMEMBEPF).normalized * JJBCNDADPPN;
|
|
Vector3 vector3 = FNDMBKLFMBM + vector2;
|
|
base.gameObject.layer = 32;
|
|
base.transform.SetParent(null, true);
|
|
this.CINAFOGLFIB.enabled = true;
|
|
if (this.IJFBNEGJIEI == null)
|
|
{
|
|
this.IJFBNEGJIEI = base.gameObject.AddComponent<Rigidbody>();
|
|
}
|
|
if (this.IJFBNEGJIEI != null)
|
|
{
|
|
this.IJFBNEGJIEI.isKinematic = false;
|
|
this.IJFBNEGJIEI.angularDrag = 631f;
|
|
this.IJFBNEGJIEI.drag = 703f;
|
|
this.IJFBNEGJIEI.velocity = vector3;
|
|
this.IJFBNEGJIEI.angularVelocity = vector;
|
|
this.IJFBNEGJIEI.useGravity = RagdollPiece.LIMODECOAPF;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06005297 RID: 21143 RVA: 0x0019541C File Offset: 0x0019361C
|
|
public static void CALAFOAJHHO(Vector3 HOFHOLGJENM)
|
|
{
|
|
RagdollPiece.LIMODECOAPF = true;
|
|
RagdollPiece.HOFHOLGJENM = HOFHOLGJENM;
|
|
}
|
|
|
|
// Token: 0x0600529A RID: 21146 RVA: 0x0019544C File Offset: 0x0019364C
|
|
private void OKFIHHIBIPG()
|
|
{
|
|
if (this.KGKBONNGDAL() && RagdollPiece.LIMODECOAPF)
|
|
{
|
|
this.IJFBNEGJIEI.AddForce(RagdollPiece.HOFHOLGJENM);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600529B RID: 21147 RVA: 0x00195474 File Offset: 0x00193674
|
|
private void Awake()
|
|
{
|
|
this.CNGOCFABIFK = base.transform.parent;
|
|
this.CINAFOGLFIB = base.GetComponent<Collider>();
|
|
if (this.disableColliderWhenNotRagdolling)
|
|
{
|
|
this.CINAFOGLFIB.enabled = false;
|
|
}
|
|
base.enabled = false;
|
|
}
|
|
|
|
// Token: 0x0600529C RID: 21148 RVA: 0x001954B4 File Offset: 0x001936B4
|
|
public static void UseCustomGravity(Vector3 HOFHOLGJENM)
|
|
{
|
|
RagdollPiece.LIMODECOAPF = true;
|
|
RagdollPiece.HOFHOLGJENM = HOFHOLGJENM;
|
|
}
|
|
|
|
// Token: 0x0600529D RID: 21149 RVA: 0x001954C4 File Offset: 0x001936C4
|
|
private void GBCCNDBJLDI()
|
|
{
|
|
if (this.KGKBONNGDAL() && RagdollPiece.LIMODECOAPF)
|
|
{
|
|
this.IJFBNEGJIEI.AddForce(RagdollPiece.HOFHOLGJENM);
|
|
}
|
|
}
|
|
|
|
// Token: 0x04000A84 RID: 2692
|
|
[SerializeField]
|
|
[Tooltip("Only mark colliders as disable when not ragdolling if the colliders are exclusively used for ragdolling.")]
|
|
private bool disableColliderWhenNotRagdolling;
|
|
|
|
// Token: 0x04000A85 RID: 2693
|
|
private Collider CINAFOGLFIB;
|
|
|
|
// Token: 0x04000A86 RID: 2694
|
|
private Rigidbody IJFBNEGJIEI;
|
|
|
|
// Token: 0x04000A87 RID: 2695
|
|
private Transform CNGOCFABIFK;
|
|
|
|
// Token: 0x04000A88 RID: 2696
|
|
private bool BJLOFCIHPBG;
|
|
|
|
// Token: 0x04000A89 RID: 2697
|
|
public static bool AnimateOut = false;
|
|
|
|
// Token: 0x04000A8A RID: 2698
|
|
private static bool LIMODECOAPF = false;
|
|
|
|
// Token: 0x04000A8B RID: 2699
|
|
private static Vector3 HOFHOLGJENM = Physics.gravity;
|
|
}
|
|
}
|