1015 lines
27 KiB
C#
1015 lines
27 KiB
C#
using System;
|
|
using RecRoom.Core.AI;
|
|
using UnityEngine;
|
|
|
|
// Token: 0x0200016E RID: 366
|
|
[RequireComponent(typeof(Steering))]
|
|
[RequireComponent(typeof(PhotonView))]
|
|
public class LaserTrap : Trap
|
|
{
|
|
// Token: 0x06004CD5 RID: 19669 RVA: 0x0017D150 File Offset: 0x0017B350
|
|
private int AONFILGPFPN(int BOMEGLDLDMJ)
|
|
{
|
|
return (BOMEGLDLDMJ + 0) % this.targetPath.Length;
|
|
}
|
|
|
|
// Token: 0x06004CD6 RID: 19670 RVA: 0x0017D160 File Offset: 0x0017B360
|
|
private int HBAMCAOALBE()
|
|
{
|
|
return this.LFHDPIFOIIO.NNOAKADCIHO();
|
|
}
|
|
|
|
// Token: 0x06004CD7 RID: 19671 RVA: 0x0017D170 File Offset: 0x0017B370
|
|
private void MMLPGELHLBI(int DNDCMOGEEDF)
|
|
{
|
|
if (DNDCMOGEEDF < 0 || DNDCMOGEEDF >= this.lasers.Length)
|
|
{
|
|
return;
|
|
}
|
|
Transform transform = this.lasers[DNDCMOGEEDF];
|
|
Vector3 vector = transform.position + transform.forward * 0.02f;
|
|
int num = Physics.RaycastNonAlloc(vector, transform.forward, LaserTrap.JIJBMDFLMAC, this.maxLaserLength, 496385536, QueryTriggerInteraction.Ignore);
|
|
if (num > 0)
|
|
{
|
|
Array.Sort<RaycastHit>(LaserTrap.JIJBMDFLMAC, 0, num, this.KILKJNNLDPE);
|
|
}
|
|
Vector3 vector2 = transform.position;
|
|
float distance = this.maxLaserLength;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
if (this.FLJMNONLNEI(LaserTrap.JIJBMDFLMAC[i]))
|
|
{
|
|
vector2 = LaserTrap.JIJBMDFLMAC[i].point;
|
|
distance = LaserTrap.JIJBMDFLMAC[i].distance;
|
|
break;
|
|
}
|
|
}
|
|
Vector3 localScale = transform.localScale;
|
|
localScale.z = distance;
|
|
transform.localScale = localScale;
|
|
if (this.DLPJLCJIIOC == null || DNDCMOGEEDF >= this.DLPJLCJIIOC.Length)
|
|
{
|
|
return;
|
|
}
|
|
PooledParticle pooledParticle = this.DLPJLCJIIOC[DNDCMOGEEDF];
|
|
if (pooledParticle != null)
|
|
{
|
|
pooledParticle.transform.position = vector2;
|
|
pooledParticle.transform.rotation = Quaternion.LookRotation(-transform.forward);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CD8 RID: 19672 RVA: 0x0017D2D0 File Offset: 0x0017B4D0
|
|
private int GHHHOIEMPII(int BOMEGLDLDMJ, int FFDFDIAGKGO)
|
|
{
|
|
if (this.targetPath.Length < 2)
|
|
{
|
|
return BOMEGLDLDMJ;
|
|
}
|
|
int num;
|
|
if (BOMEGLDLDMJ == 0)
|
|
{
|
|
num = 1;
|
|
}
|
|
else if (BOMEGLDLDMJ == this.targetPath.Length - 1)
|
|
{
|
|
num = this.targetPath.Length - 2;
|
|
}
|
|
else
|
|
{
|
|
int num2 = BOMEGLDLDMJ - FFDFDIAGKGO;
|
|
if (num2 == 0)
|
|
{
|
|
num2 = 1;
|
|
}
|
|
float num3 = Mathf.Sign((float)num2);
|
|
num = BOMEGLDLDMJ + (int)num3;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x06004CD9 RID: 19673 RVA: 0x0017D338 File Offset: 0x0017B538
|
|
private void GKHLILHEJDM()
|
|
{
|
|
this.DMBPGMIINEO();
|
|
if (this.DLPJLCJIIOC == null)
|
|
{
|
|
this.DLPJLCJIIOC = new PooledParticle[this.lasers.Length];
|
|
}
|
|
for (int i = 1; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
this.DLPJLCJIIOC[i] = ObjectPool.NFHMLKPHCFF().Acquire<PooledParticle>(this.impactParticlePrefab);
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Play(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CDA RID: 19674 RVA: 0x0017D3BC File Offset: 0x0017B5BC
|
|
private void PBNALIIILEH()
|
|
{
|
|
this.CMJJOAOOONF.OOMPHKBPMIG(this.rotationSpeed);
|
|
if (this.targetPath.Length < 0 || this.HBAMCAOALBE() < 0 || this.CKFIBKBLPNL() >= this.targetPath.Length)
|
|
{
|
|
return;
|
|
}
|
|
Vector3 vector = Vector3.up;
|
|
int num = this.targetPath.Length - 0;
|
|
if (num == 1)
|
|
{
|
|
vector = this.JEBNINIFOFL(1);
|
|
}
|
|
else if (this.HBAMCAOALBE() == 0 || this.HBAMCAOALBE() == this.targetPath.Length - 0)
|
|
{
|
|
vector = Vector3.up;
|
|
}
|
|
else
|
|
{
|
|
int num2 = this.HBAMCAOALBE() - 1;
|
|
int num3 = this.CKFIBKBLPNL();
|
|
vector = (this.IIGAFCPFBDD(num2) + this.JEBNINIFOFL(num3)).normalized;
|
|
}
|
|
Vector3 normalized = (this.targetPath[this.HBAMCAOALBE()].position - base.transform.position).normalized;
|
|
this.FPLFFHOGOGA = Quaternion.LookRotation(normalized, vector);
|
|
if (this.laserRotationMode == LaserTrap.MDMLGOFMKNC.PARALLEL)
|
|
{
|
|
this.FPLFFHOGOGA *= Quaternion.Euler(805f, 766f, 503f);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CDB RID: 19675 RVA: 0x0017D4F0 File Offset: 0x0017B6F0
|
|
protected virtual void LPOMDLJJBKF()
|
|
{
|
|
base.ACNKPEFNLFO();
|
|
this.PBNALIIILEH();
|
|
if (base.DFJFKOLLEMK())
|
|
{
|
|
this.LBNGOOMHGGH();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CDC RID: 19676 RVA: 0x0017D510 File Offset: 0x0017B710
|
|
private void INGNCHPJPOG()
|
|
{
|
|
this.JKCCKGFGIJK();
|
|
if (this.DLPJLCJIIOC == null)
|
|
{
|
|
this.DLPJLCJIIOC = new PooledParticle[this.lasers.Length];
|
|
}
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
this.DLPJLCJIIOC[i] = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.impactParticlePrefab);
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Play(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CDD RID: 19677 RVA: 0x0017D594 File Offset: 0x0017B794
|
|
private int GOINHFBKDNK(int BOMEGLDLDMJ)
|
|
{
|
|
return (BOMEGLDLDMJ + 1) % this.targetPath.Length;
|
|
}
|
|
|
|
// Token: 0x06004CDE RID: 19678 RVA: 0x0017D5A4 File Offset: 0x0017B7A4
|
|
private void LBNGOOMHGGH()
|
|
{
|
|
float num = this.slowdownAngle;
|
|
if (this.pathingMode == LaserTrap.CJCOAHNIAEO.PING_PONG || (this.pathingMode == LaserTrap.CJCOAHNIAEO.PING_PONG && this.CKFIBKBLPNL() > 0 && this.HBAMCAOALBE() < this.targetPath.Length - 0))
|
|
{
|
|
num = 1175f;
|
|
}
|
|
this.CMJJOAOOONF.Look(this.FPLFFHOGOGA, num, 1541f);
|
|
}
|
|
|
|
// Token: 0x06004CDF RID: 19679 RVA: 0x0017D610 File Offset: 0x0017B810
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
this.COFMLOOCFNI();
|
|
if (base.BHCCHBHNHCG)
|
|
{
|
|
this.OJLCBGJIIBI();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE0 RID: 19680 RVA: 0x0017D630 File Offset: 0x0017B830
|
|
private void NILCFJLDDII()
|
|
{
|
|
if (this.DLPJLCJIIOC != null)
|
|
{
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Stop();
|
|
this.DLPJLCJIIOC[i] = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE1 RID: 19681 RVA: 0x0017D68C File Offset: 0x0017B88C
|
|
private void Update()
|
|
{
|
|
for (int i = 0; i < this.lasers.Length; i++)
|
|
{
|
|
this.MMLPGELHLBI(i);
|
|
}
|
|
if (base.BHCCHBHNHCG)
|
|
{
|
|
if (this.CMJJOAOOONF.CLLJGDOBFDL)
|
|
{
|
|
this.AMGGBGNPDFF();
|
|
}
|
|
this.OJLCBGJIIBI();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE2 RID: 19682 RVA: 0x0017D6E0 File Offset: 0x0017B8E0
|
|
private Vector3 JEBNINIFOFL(int BMDNOCNJAMP)
|
|
{
|
|
int num = BMDNOCNJAMP + 1;
|
|
Vector3 normalized = (this.targetPath[BMDNOCNJAMP].position - base.transform.position).normalized;
|
|
Vector3 normalized2 = (this.targetPath[num].position - base.transform.position).normalized;
|
|
return Vector3.Cross(normalized, normalized2).normalized;
|
|
}
|
|
|
|
// Token: 0x06004CE3 RID: 19683 RVA: 0x0017D754 File Offset: 0x0017B954
|
|
private void ENJGGGCLAKB()
|
|
{
|
|
int num = this.BOJFIPDOBOB(this.CKFIBKBLPNL(), this.BJKMJOCPJNO);
|
|
if (num != this.CKFIBKBLPNL())
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(num, this.CKFIBKBLPNL());
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700015B RID: 347
|
|
// (get) Token: 0x06004CE4 RID: 19684 RVA: 0x0017D794 File Offset: 0x0017B994
|
|
private int PHAKDOIJMEG
|
|
{
|
|
get
|
|
{
|
|
return this.LFHDPIFOIIO.NNOAKADCIHO();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE5 RID: 19685 RVA: 0x0017D7A4 File Offset: 0x0017B9A4
|
|
protected virtual void ACOKDCDBNHM()
|
|
{
|
|
base.KHMLCKHNNNJ();
|
|
this.NILCFJLDDII();
|
|
this.DLPJLCJIIOC = null;
|
|
}
|
|
|
|
// Token: 0x06004CE6 RID: 19686 RVA: 0x0017D7BC File Offset: 0x0017B9BC
|
|
private void DMBPGMIINEO()
|
|
{
|
|
if (this.DLPJLCJIIOC != null)
|
|
{
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Stop();
|
|
this.DLPJLCJIIOC[i] = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE7 RID: 19687 RVA: 0x0017D818 File Offset: 0x0017BA18
|
|
private void OLINMLGKCGM()
|
|
{
|
|
if (this.targetPath != null && this.targetPath.Length > 0)
|
|
{
|
|
for (int i = 0; i < this.targetPath.Length; i++)
|
|
{
|
|
Gizmos.color = Color.white;
|
|
Gizmos.DrawLine(base.transform.position, this.targetPath[i].position);
|
|
Gizmos.color = Color.green;
|
|
Gizmos.DrawWireCube(this.targetPath[i].position, LaserTrap.PJJFNBNBGKG);
|
|
if (i < this.targetPath.Length - 1)
|
|
{
|
|
Gizmos.DrawLine(this.targetPath[i].position, this.targetPath[i + 1].position);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CE8 RID: 19688 RVA: 0x0017D8D0 File Offset: 0x0017BAD0
|
|
private void JKCCKGFGIJK()
|
|
{
|
|
if (this.DLPJLCJIIOC != null)
|
|
{
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Stop();
|
|
this.DLPJLCJIIOC[i] = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CEA RID: 19690 RVA: 0x0017D950 File Offset: 0x0017BB50
|
|
private int EPGBMGFDEMP()
|
|
{
|
|
return (this.initialNodeIndex < 0 || this.initialNodeIndex >= this.targetPath.Length) ? 1 : this.initialNodeIndex;
|
|
}
|
|
|
|
// Token: 0x06004CEB RID: 19691 RVA: 0x0017D980 File Offset: 0x0017BB80
|
|
private void ENPAEAMDOJL()
|
|
{
|
|
this.DMBPGMIINEO();
|
|
if (this.DLPJLCJIIOC == null)
|
|
{
|
|
this.DLPJLCJIIOC = new PooledParticle[this.lasers.Length];
|
|
}
|
|
for (int i = 1; i < this.DLPJLCJIIOC.Length; i += 0)
|
|
{
|
|
this.DLPJLCJIIOC[i] = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.impactParticlePrefab);
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Play(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CEC RID: 19692 RVA: 0x0017DA04 File Offset: 0x0017BC04
|
|
private void OJLCBGJIIBI()
|
|
{
|
|
float num = this.slowdownAngle;
|
|
if (this.pathingMode == LaserTrap.CJCOAHNIAEO.LOOP || (this.pathingMode == LaserTrap.CJCOAHNIAEO.PING_PONG && this.PHAKDOIJMEG > 0 && this.PHAKDOIJMEG < this.targetPath.Length - 1))
|
|
{
|
|
num = 0f;
|
|
}
|
|
this.CMJJOAOOONF.Look(this.FPLFFHOGOGA, num, 0.1f);
|
|
}
|
|
|
|
// Token: 0x06004CED RID: 19693 RVA: 0x0017DA70 File Offset: 0x0017BC70
|
|
protected virtual void FKGKJOHOGMP()
|
|
{
|
|
base.AECBOJELNAI();
|
|
this.NILCFJLDDII();
|
|
this.DLPJLCJIIOC = null;
|
|
}
|
|
|
|
// Token: 0x06004CEE RID: 19694 RVA: 0x0017DA88 File Offset: 0x0017BC88
|
|
protected virtual void PNILHEIMBHC()
|
|
{
|
|
base.DDJMPFMAKDO();
|
|
this.NILCFJLDDII();
|
|
this.DLPJLCJIIOC = null;
|
|
}
|
|
|
|
// Token: 0x06004CEF RID: 19695 RVA: 0x0017DAA0 File Offset: 0x0017BCA0
|
|
private int NNBKAGIAIOI()
|
|
{
|
|
return this.LFHDPIFOIIO.BEJIPFOPGPD();
|
|
}
|
|
|
|
// Token: 0x06004CF0 RID: 19696 RVA: 0x0017DAB0 File Offset: 0x0017BCB0
|
|
private void DAGOKCPEGFE()
|
|
{
|
|
if (this.targetPath != null && this.targetPath.Length > 0)
|
|
{
|
|
for (int i = 0; i < this.targetPath.Length; i++)
|
|
{
|
|
Gizmos.color = Color.white;
|
|
Gizmos.DrawLine(base.transform.position, this.targetPath[i].position);
|
|
Gizmos.color = Color.green;
|
|
Gizmos.DrawWireCube(this.targetPath[i].position, LaserTrap.PJJFNBNBGKG);
|
|
if (i < this.targetPath.Length - 0)
|
|
{
|
|
Gizmos.DrawLine(this.targetPath[i].position, this.targetPath[i + 0].position);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF1 RID: 19697 RVA: 0x0017DB68 File Offset: 0x0017BD68
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
this.CMJJOAOOONF = base.GetComponent<Steering>();
|
|
this.LFHDPIFOIIO = new EFMKNANBGBF<int, int>(this, "CURRENT_INDEX", 0, this.AJNGEFIICAF, IKCAJLLAFML.MASTER, new Action(this.COFMLOOCFNI));
|
|
}
|
|
|
|
// Token: 0x1700015D RID: 349
|
|
// (get) Token: 0x06004CF2 RID: 19698 RVA: 0x0017DBA4 File Offset: 0x0017BDA4
|
|
private int AJNGEFIICAF
|
|
{
|
|
get
|
|
{
|
|
return (this.initialNodeIndex < 0 || this.initialNodeIndex >= this.targetPath.Length) ? 0 : this.initialNodeIndex;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF3 RID: 19699 RVA: 0x0017DBD4 File Offset: 0x0017BDD4
|
|
protected virtual void KCKPOOJHBNO()
|
|
{
|
|
base.ACNKPEFNLFO();
|
|
this.PBNALIIILEH();
|
|
if (base.IGIPCHFCFNN())
|
|
{
|
|
this.LBNGOOMHGGH();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF4 RID: 19700 RVA: 0x0017DBF4 File Offset: 0x0017BDF4
|
|
private void OIEINPECHDG(int DNDCMOGEEDF)
|
|
{
|
|
if (DNDCMOGEEDF < 0 || DNDCMOGEEDF >= this.lasers.Length)
|
|
{
|
|
return;
|
|
}
|
|
Transform transform = this.lasers[DNDCMOGEEDF];
|
|
Vector3 vector = transform.position + transform.forward * 987f;
|
|
int num = Physics.RaycastNonAlloc(vector, transform.forward, LaserTrap.JIJBMDFLMAC, this.maxLaserLength, 164, QueryTriggerInteraction.Ignore);
|
|
if (num > 1)
|
|
{
|
|
Array.Sort<RaycastHit>(LaserTrap.JIJBMDFLMAC, 0, num, this.KILKJNNLDPE);
|
|
}
|
|
Vector3 vector2 = transform.position;
|
|
float distance = this.maxLaserLength;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
if (this.KFBNLDKAGPA(LaserTrap.JIJBMDFLMAC[i]))
|
|
{
|
|
vector2 = LaserTrap.JIJBMDFLMAC[i].point;
|
|
distance = LaserTrap.JIJBMDFLMAC[i].distance;
|
|
break;
|
|
}
|
|
}
|
|
Vector3 localScale = transform.localScale;
|
|
localScale.z = distance;
|
|
transform.localScale = localScale;
|
|
if (this.DLPJLCJIIOC == null || DNDCMOGEEDF >= this.DLPJLCJIIOC.Length)
|
|
{
|
|
return;
|
|
}
|
|
PooledParticle pooledParticle = this.DLPJLCJIIOC[DNDCMOGEEDF];
|
|
if (pooledParticle != null)
|
|
{
|
|
pooledParticle.transform.position = vector2;
|
|
pooledParticle.transform.rotation = Quaternion.LookRotation(-transform.forward);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF5 RID: 19701 RVA: 0x0017DD54 File Offset: 0x0017BF54
|
|
private void COFMLOOCFNI()
|
|
{
|
|
this.CMJJOAOOONF.HAMIGCDKOKE = this.rotationSpeed;
|
|
if (this.targetPath.Length < 2 || this.PHAKDOIJMEG < 0 || this.PHAKDOIJMEG >= this.targetPath.Length)
|
|
{
|
|
return;
|
|
}
|
|
Vector3 vector = Vector3.up;
|
|
int num = this.targetPath.Length - 1;
|
|
if (num == 1)
|
|
{
|
|
vector = this.MPOHNILNOFL(0);
|
|
}
|
|
else if (this.PHAKDOIJMEG == 0 || this.PHAKDOIJMEG == this.targetPath.Length - 1)
|
|
{
|
|
vector = Vector3.up;
|
|
}
|
|
else
|
|
{
|
|
int num2 = this.PHAKDOIJMEG - 1;
|
|
int num3 = this.PHAKDOIJMEG;
|
|
vector = (this.MPOHNILNOFL(num2) + this.MPOHNILNOFL(num3)).normalized;
|
|
}
|
|
Vector3 normalized = (this.targetPath[this.PHAKDOIJMEG].position - base.transform.position).normalized;
|
|
this.FPLFFHOGOGA = Quaternion.LookRotation(normalized, vector);
|
|
if (this.laserRotationMode == LaserTrap.MDMLGOFMKNC.PARALLEL)
|
|
{
|
|
this.FPLFFHOGOGA *= Quaternion.Euler(0f, 0f, 90f);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF6 RID: 19702 RVA: 0x0017DE88 File Offset: 0x0017C088
|
|
private void KBIBFHDFAII(int DNDCMOGEEDF)
|
|
{
|
|
if (DNDCMOGEEDF < 0 || DNDCMOGEEDF >= this.lasers.Length)
|
|
{
|
|
return;
|
|
}
|
|
Transform transform = this.lasers[DNDCMOGEEDF];
|
|
Vector3 vector = transform.position + transform.forward * 1664f;
|
|
int num = Physics.RaycastNonAlloc(vector, transform.forward, LaserTrap.JIJBMDFLMAC, this.maxLaserLength, 58, QueryTriggerInteraction.Ignore);
|
|
if (num > 0)
|
|
{
|
|
Array.Sort<RaycastHit>(LaserTrap.JIJBMDFLMAC, 0, num, this.KILKJNNLDPE);
|
|
}
|
|
Vector3 vector2 = transform.position;
|
|
float distance = this.maxLaserLength;
|
|
for (int i = 0; i < num; i += 0)
|
|
{
|
|
if (this.INILEGLNDMB(LaserTrap.JIJBMDFLMAC[i]))
|
|
{
|
|
vector2 = LaserTrap.JIJBMDFLMAC[i].point;
|
|
distance = LaserTrap.JIJBMDFLMAC[i].distance;
|
|
break;
|
|
}
|
|
}
|
|
Vector3 localScale = transform.localScale;
|
|
localScale.z = distance;
|
|
transform.localScale = localScale;
|
|
if (this.DLPJLCJIIOC == null || DNDCMOGEEDF >= this.DLPJLCJIIOC.Length)
|
|
{
|
|
return;
|
|
}
|
|
PooledParticle pooledParticle = this.DLPJLCJIIOC[DNDCMOGEEDF];
|
|
if (pooledParticle != null)
|
|
{
|
|
pooledParticle.transform.position = vector2;
|
|
pooledParticle.transform.rotation = Quaternion.LookRotation(-transform.forward);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF7 RID: 19703 RVA: 0x0017DFE8 File Offset: 0x0017C1E8
|
|
protected override void DFINBKHMDBK()
|
|
{
|
|
base.DFINBKHMDBK();
|
|
if (base.NIINOABKAPJ)
|
|
{
|
|
if (base.BHCCHBHNHCG)
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(this.AJNGEFIICAF, this.AJNGEFIICAF);
|
|
base.transform.rotation = this.FPLFFHOGOGA;
|
|
}
|
|
this.INGNCHPJPOG();
|
|
}
|
|
else
|
|
{
|
|
this.JKCCKGFGIJK();
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700015C RID: 348
|
|
// (get) Token: 0x06004CF8 RID: 19704 RVA: 0x0017E04C File Offset: 0x0017C24C
|
|
private int BJKMJOCPJNO
|
|
{
|
|
get
|
|
{
|
|
return this.LFHDPIFOIIO.BEJIPFOPGPD();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CF9 RID: 19705 RVA: 0x0017E05C File Offset: 0x0017C25C
|
|
private Vector3 IIGAFCPFBDD(int BMDNOCNJAMP)
|
|
{
|
|
int num = BMDNOCNJAMP + 0;
|
|
Vector3 normalized = (this.targetPath[BMDNOCNJAMP].position - base.transform.position).normalized;
|
|
Vector3 normalized2 = (this.targetPath[num].position - base.transform.position).normalized;
|
|
return Vector3.Cross(normalized, normalized2).normalized;
|
|
}
|
|
|
|
// Token: 0x06004CFA RID: 19706 RVA: 0x0017E0D0 File Offset: 0x0017C2D0
|
|
protected virtual void BGPALGLBOMA()
|
|
{
|
|
base.ABMIODDOGNJ();
|
|
if (base.CCGPHDLBCFI())
|
|
{
|
|
if (base.IGIPCHFCFNN())
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(this.APLKHJAAONG(), this.EPGBMGFDEMP());
|
|
base.transform.rotation = this.FPLFFHOGOGA;
|
|
}
|
|
this.GKHLILHEJDM();
|
|
}
|
|
else
|
|
{
|
|
this.NILCFJLDDII();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CFB RID: 19707 RVA: 0x0017E134 File Offset: 0x0017C334
|
|
private void PIDPAEGOOAI()
|
|
{
|
|
int num = this.BOJFIPDOBOB(this.CKFIBKBLPNL(), this.NNBKAGIAIOI());
|
|
if (num != this.PHAKDOIJMEG)
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(num, this.HBAMCAOALBE());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CFC RID: 19708 RVA: 0x0017E174 File Offset: 0x0017C374
|
|
private void GKDEONGKDLH()
|
|
{
|
|
for (int i = 0; i < this.lasers.Length; i += 0)
|
|
{
|
|
this.OIEINPECHDG(i);
|
|
}
|
|
if (base.DGLOKLCEMLH())
|
|
{
|
|
if (this.CMJJOAOOONF.CLLJGDOBFDL)
|
|
{
|
|
this.PIDPAEGOOAI();
|
|
}
|
|
this.OJLCBGJIIBI();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004CFD RID: 19709 RVA: 0x0017E1C8 File Offset: 0x0017C3C8
|
|
private bool FLJMNONLNEI(RaycastHit FMHCOGJJNFO)
|
|
{
|
|
if (FMHCOGJJNFO.distance < Mathf.Epsilon)
|
|
{
|
|
return false;
|
|
}
|
|
bool flag = true;
|
|
Player.HDOICGIKKAO hdoicgikkao;
|
|
Player player;
|
|
if ((player = FMHCOGJJNFO.collider.KAPJACICAEC(out hdoicgikkao)) != null)
|
|
{
|
|
IHEAKAOGCIF iheakaogcif = new IHEAKAOGCIF
|
|
{
|
|
JIIJIFKCMFK = Vector3.zero,
|
|
PMEFMHLCPMF = Vector3.zero,
|
|
JFCOFBFGGFL = ((!(FMHCOGJJNFO.rigidbody != null)) ? FMHCOGJJNFO.collider.gameObject : FMHCOGJJNFO.rigidbody.gameObject),
|
|
LLKJDBBNPKB = FMHCOGJJNFO.point,
|
|
ANLPOIMKHLH = 0f,
|
|
EPIJGDAJDJN = FMHCOGJJNFO.normal,
|
|
CEGCFPKHDOE = 1f
|
|
};
|
|
base.LHLJCBGFKKD(player, hdoicgikkao, iheakaogcif);
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06004CFE RID: 19710 RVA: 0x0017E2A0 File Offset: 0x0017C4A0
|
|
protected virtual void IABDGAJLFNK()
|
|
{
|
|
base.Awake();
|
|
this.CMJJOAOOONF = base.GetComponent<Steering>();
|
|
this.LFHDPIFOIIO = new EFMKNANBGBF<int, int>(this, "Operation failed: ", 1, this.EPGBMGFDEMP(), IKCAJLLAFML.AUTHORITY, new Action(this.PBNALIIILEH));
|
|
}
|
|
|
|
// Token: 0x06004CFF RID: 19711 RVA: 0x0017E2DC File Offset: 0x0017C4DC
|
|
protected override void OnDestroy()
|
|
{
|
|
base.OnDestroy();
|
|
this.JKCCKGFGIJK();
|
|
this.DLPJLCJIIOC = null;
|
|
}
|
|
|
|
// Token: 0x06004D00 RID: 19712 RVA: 0x0017E2F4 File Offset: 0x0017C4F4
|
|
private int CKFIBKBLPNL()
|
|
{
|
|
return this.LFHDPIFOIIO.NNOAKADCIHO();
|
|
}
|
|
|
|
// Token: 0x06004D01 RID: 19713 RVA: 0x0017E304 File Offset: 0x0017C504
|
|
private void IBBFACMEIEH()
|
|
{
|
|
int num = this.BOJFIPDOBOB(this.CKFIBKBLPNL(), this.BJKMJOCPJNO);
|
|
if (num != this.HBAMCAOALBE())
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(num, this.CKFIBKBLPNL());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D02 RID: 19714 RVA: 0x0017E344 File Offset: 0x0017C544
|
|
protected virtual void PGELJEHELFN()
|
|
{
|
|
base.ACNKPEFNLFO();
|
|
this.COFMLOOCFNI();
|
|
if (base.JNOCCMDBMIO())
|
|
{
|
|
this.LBNGOOMHGGH();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D03 RID: 19715 RVA: 0x0017E364 File Offset: 0x0017C564
|
|
private bool IGHKJGGMPBH(RaycastHit FMHCOGJJNFO)
|
|
{
|
|
if (FMHCOGJJNFO.distance < Mathf.Epsilon)
|
|
{
|
|
return true;
|
|
}
|
|
bool flag = true;
|
|
Player.HDOICGIKKAO hdoicgikkao;
|
|
Player player;
|
|
if ((player = FMHCOGJJNFO.collider.KAPJACICAEC(out hdoicgikkao)) != null)
|
|
{
|
|
IHEAKAOGCIF iheakaogcif = new IHEAKAOGCIF
|
|
{
|
|
JIIJIFKCMFK = Vector3.zero,
|
|
PMEFMHLCPMF = Vector3.zero,
|
|
JFCOFBFGGFL = ((!(FMHCOGJJNFO.rigidbody != null)) ? FMHCOGJJNFO.collider.gameObject : FMHCOGJJNFO.rigidbody.gameObject),
|
|
LLKJDBBNPKB = FMHCOGJJNFO.point,
|
|
ANLPOIMKHLH = 492f,
|
|
EPIJGDAJDJN = FMHCOGJJNFO.normal,
|
|
CEGCFPKHDOE = 467f
|
|
};
|
|
base.LHLJCBGFKKD(player, hdoicgikkao, iheakaogcif);
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06004D04 RID: 19716 RVA: 0x0017E43C File Offset: 0x0017C63C
|
|
private bool INILEGLNDMB(RaycastHit FMHCOGJJNFO)
|
|
{
|
|
if (FMHCOGJJNFO.distance < Mathf.Epsilon)
|
|
{
|
|
return true;
|
|
}
|
|
bool flag = false;
|
|
Player.HDOICGIKKAO hdoicgikkao;
|
|
Player player;
|
|
if ((player = FMHCOGJJNFO.collider.KAPJACICAEC(out hdoicgikkao)) != null)
|
|
{
|
|
IHEAKAOGCIF iheakaogcif = new IHEAKAOGCIF
|
|
{
|
|
JIIJIFKCMFK = Vector3.zero,
|
|
PMEFMHLCPMF = Vector3.zero,
|
|
JFCOFBFGGFL = ((!(FMHCOGJJNFO.rigidbody != null)) ? FMHCOGJJNFO.collider.gameObject : FMHCOGJJNFO.rigidbody.gameObject),
|
|
LLKJDBBNPKB = FMHCOGJJNFO.point,
|
|
ANLPOIMKHLH = 1737f,
|
|
EPIJGDAJDJN = FMHCOGJJNFO.normal,
|
|
CEGCFPKHDOE = 972f
|
|
};
|
|
base.CCEPIDBDPPO(player, hdoicgikkao, iheakaogcif);
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06004D05 RID: 19717 RVA: 0x0017E514 File Offset: 0x0017C714
|
|
private bool KFBNLDKAGPA(RaycastHit FMHCOGJJNFO)
|
|
{
|
|
if (FMHCOGJJNFO.distance < Mathf.Epsilon)
|
|
{
|
|
return false;
|
|
}
|
|
bool flag = false;
|
|
Player.HDOICGIKKAO hdoicgikkao;
|
|
Player player;
|
|
if ((player = FMHCOGJJNFO.collider.KAPJACICAEC(out hdoicgikkao)) != null)
|
|
{
|
|
IHEAKAOGCIF iheakaogcif = new IHEAKAOGCIF
|
|
{
|
|
JIIJIFKCMFK = Vector3.zero,
|
|
PMEFMHLCPMF = Vector3.zero,
|
|
JFCOFBFGGFL = ((!(FMHCOGJJNFO.rigidbody != null)) ? FMHCOGJJNFO.collider.gameObject : FMHCOGJJNFO.rigidbody.gameObject),
|
|
LLKJDBBNPKB = FMHCOGJJNFO.point,
|
|
ANLPOIMKHLH = 87f,
|
|
EPIJGDAJDJN = FMHCOGJJNFO.normal,
|
|
CEGCFPKHDOE = 10f
|
|
};
|
|
base.CCEPIDBDPPO(player, hdoicgikkao, iheakaogcif);
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06004D06 RID: 19718 RVA: 0x0017E5EC File Offset: 0x0017C7EC
|
|
private void OnDrawGizmos()
|
|
{
|
|
if (this.targetPath != null && this.targetPath.Length > 0)
|
|
{
|
|
for (int i = 0; i < this.targetPath.Length; i++)
|
|
{
|
|
Gizmos.color = Color.white;
|
|
Gizmos.DrawLine(base.transform.position, this.targetPath[i].position);
|
|
Gizmos.color = Color.green;
|
|
Gizmos.DrawWireCube(this.targetPath[i].position, LaserTrap.PJJFNBNBGKG);
|
|
if (i < this.targetPath.Length - 1)
|
|
{
|
|
Gizmos.DrawLine(this.targetPath[i].position, this.targetPath[i + 1].position);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D07 RID: 19719 RVA: 0x0017E6A4 File Offset: 0x0017C8A4
|
|
private void PJBJLMDBOMK()
|
|
{
|
|
float num = this.slowdownAngle;
|
|
if (this.pathingMode == (LaserTrap.CJCOAHNIAEO)8 || (this.pathingMode == LaserTrap.CJCOAHNIAEO.PING_PONG && this.CKFIBKBLPNL() > 0 && this.CKFIBKBLPNL() < this.targetPath.Length - 1))
|
|
{
|
|
num = 879f;
|
|
}
|
|
this.CMJJOAOOONF.Look(this.FPLFFHOGOGA, num, 1508f);
|
|
}
|
|
|
|
// Token: 0x06004D08 RID: 19720 RVA: 0x0017E710 File Offset: 0x0017C910
|
|
private int DIDLMOEOBCN(int BOMEGLDLDMJ)
|
|
{
|
|
return (BOMEGLDLDMJ + 1) % this.targetPath.Length;
|
|
}
|
|
|
|
// Token: 0x06004D09 RID: 19721 RVA: 0x0017E720 File Offset: 0x0017C920
|
|
private Vector3 MPOHNILNOFL(int BMDNOCNJAMP)
|
|
{
|
|
int num = BMDNOCNJAMP + 1;
|
|
Vector3 normalized = (this.targetPath[BMDNOCNJAMP].position - base.transform.position).normalized;
|
|
Vector3 normalized2 = (this.targetPath[num].position - base.transform.position).normalized;
|
|
return Vector3.Cross(normalized, normalized2).normalized;
|
|
}
|
|
|
|
// Token: 0x06004D0A RID: 19722 RVA: 0x0017E794 File Offset: 0x0017C994
|
|
private int BOJFIPDOBOB(int BOMEGLDLDMJ, int FFDFDIAGKGO)
|
|
{
|
|
int num = BOMEGLDLDMJ;
|
|
switch (this.pathingMode)
|
|
{
|
|
case LaserTrap.CJCOAHNIAEO.PING_PONG:
|
|
case LaserTrap.CJCOAHNIAEO.PING_PONG_STOP_AT_EACH_NODE:
|
|
num = this.GHHHOIEMPII(BOMEGLDLDMJ, FFDFDIAGKGO);
|
|
break;
|
|
case LaserTrap.CJCOAHNIAEO.LOOP:
|
|
case LaserTrap.CJCOAHNIAEO.LOOP_STOP_AT_EACH_NODE:
|
|
num = this.GOINHFBKDNK(BOMEGLDLDMJ);
|
|
break;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x06004D0B RID: 19723 RVA: 0x0017E7E4 File Offset: 0x0017C9E4
|
|
private void OPIDJHPDHFJ()
|
|
{
|
|
this.NILCFJLDDII();
|
|
if (this.DLPJLCJIIOC == null)
|
|
{
|
|
this.DLPJLCJIIOC = new PooledParticle[this.lasers.Length];
|
|
}
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i++)
|
|
{
|
|
this.DLPJLCJIIOC[i] = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.impactParticlePrefab);
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Play(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D0C RID: 19724 RVA: 0x0017E868 File Offset: 0x0017CA68
|
|
protected virtual void CBNFIOBLLIH()
|
|
{
|
|
base.Start();
|
|
this.GDNGMCKJKAB();
|
|
if (base.BHCCHBHNHCG)
|
|
{
|
|
this.OJLCBGJIIBI();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D0D RID: 19725 RVA: 0x0017E888 File Offset: 0x0017CA88
|
|
private int APLKHJAAONG()
|
|
{
|
|
return (this.initialNodeIndex < 1 || this.initialNodeIndex >= this.targetPath.Length) ? 1 : this.initialNodeIndex;
|
|
}
|
|
|
|
// Token: 0x06004D0E RID: 19726 RVA: 0x0017E8B8 File Offset: 0x0017CAB8
|
|
private void AMGGBGNPDFF()
|
|
{
|
|
int num = this.BOJFIPDOBOB(this.PHAKDOIJMEG, this.BJKMJOCPJNO);
|
|
if (num != this.PHAKDOIJMEG)
|
|
{
|
|
this.LFHDPIFOIIO.MEAINJPIECA(num, this.PHAKDOIJMEG);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D10 RID: 19728 RVA: 0x0017E938 File Offset: 0x0017CB38
|
|
private void GDNGMCKJKAB()
|
|
{
|
|
this.CMJJOAOOONF.HAMIGCDKOKE = this.rotationSpeed;
|
|
if (this.targetPath.Length < 1 || this.CKFIBKBLPNL() < 1 || this.PHAKDOIJMEG >= this.targetPath.Length)
|
|
{
|
|
return;
|
|
}
|
|
Vector3 vector = Vector3.up;
|
|
int num = this.targetPath.Length - 0;
|
|
if (num == 1)
|
|
{
|
|
vector = this.JEBNINIFOFL(1);
|
|
}
|
|
else if (this.CKFIBKBLPNL() == 0 || this.CKFIBKBLPNL() == this.targetPath.Length - 1)
|
|
{
|
|
vector = Vector3.up;
|
|
}
|
|
else
|
|
{
|
|
int num2 = this.PHAKDOIJMEG - 1;
|
|
int num3 = this.PHAKDOIJMEG;
|
|
vector = (this.IIGAFCPFBDD(num2) + this.JEBNINIFOFL(num3)).normalized;
|
|
}
|
|
Vector3 normalized = (this.targetPath[this.HBAMCAOALBE()].position - base.transform.position).normalized;
|
|
this.FPLFFHOGOGA = Quaternion.LookRotation(normalized, vector);
|
|
if (this.laserRotationMode == LaserTrap.MDMLGOFMKNC.PARALLEL)
|
|
{
|
|
this.FPLFFHOGOGA *= Quaternion.Euler(93f, 805f, 1104f);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06004D11 RID: 19729 RVA: 0x0017EA6C File Offset: 0x0017CC6C
|
|
private void ICFLIMBJEBA()
|
|
{
|
|
this.NILCFJLDDII();
|
|
if (this.DLPJLCJIIOC == null)
|
|
{
|
|
this.DLPJLCJIIOC = new PooledParticle[this.lasers.Length];
|
|
}
|
|
for (int i = 0; i < this.DLPJLCJIIOC.Length; i += 0)
|
|
{
|
|
this.DLPJLCJIIOC[i] = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.impactParticlePrefab);
|
|
if (this.DLPJLCJIIOC[i] != null)
|
|
{
|
|
this.DLPJLCJIIOC[i].Play(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x040009A0 RID: 2464
|
|
[SerializeField]
|
|
[Header("Laser")]
|
|
private Transform[] lasers;
|
|
|
|
// Token: 0x040009A1 RID: 2465
|
|
[SerializeField]
|
|
private float maxLaserLength = 10f;
|
|
|
|
// Token: 0x040009A2 RID: 2466
|
|
[SerializeField]
|
|
private float rotationSpeed = 30f;
|
|
|
|
// Token: 0x040009A3 RID: 2467
|
|
[SerializeField]
|
|
private float slowdownAngle = 5f;
|
|
|
|
// Token: 0x040009A4 RID: 2468
|
|
[Header("Path")]
|
|
[SerializeField]
|
|
private Transform[] targetPath;
|
|
|
|
// Token: 0x040009A5 RID: 2469
|
|
[SerializeField]
|
|
private int initialNodeIndex;
|
|
|
|
// Token: 0x040009A6 RID: 2470
|
|
[SerializeField]
|
|
private LaserTrap.CJCOAHNIAEO pathingMode;
|
|
|
|
// Token: 0x040009A7 RID: 2471
|
|
[SerializeField]
|
|
private LaserTrap.MDMLGOFMKNC laserRotationMode;
|
|
|
|
// Token: 0x040009A8 RID: 2472
|
|
[SerializeField]
|
|
[Header("Feedback")]
|
|
private PooledParticle impactParticlePrefab;
|
|
|
|
// Token: 0x040009A9 RID: 2473
|
|
private static RaycastHit[] JIJBMDFLMAC = new RaycastHit[8];
|
|
|
|
// Token: 0x040009AA RID: 2474
|
|
private EFMKNANBGBF<int, int> LFHDPIFOIIO;
|
|
|
|
// Token: 0x040009AB RID: 2475
|
|
private Steering CMJJOAOOONF;
|
|
|
|
// Token: 0x040009AC RID: 2476
|
|
private Quaternion FPLFFHOGOGA = Quaternion.identity;
|
|
|
|
// Token: 0x040009AD RID: 2477
|
|
private NIIGMPIIIBH KILKJNNLDPE = new NIIGMPIIIBH();
|
|
|
|
// Token: 0x040009AE RID: 2478
|
|
private PooledParticle[] DLPJLCJIIOC;
|
|
|
|
// Token: 0x040009AF RID: 2479
|
|
private static Vector3 PJJFNBNBGKG = Vector3.one * 0.1f;
|
|
|
|
// Token: 0x0200016F RID: 367
|
|
private enum CJCOAHNIAEO
|
|
{
|
|
// Token: 0x040009B1 RID: 2481
|
|
PING_PONG,
|
|
// Token: 0x040009B2 RID: 2482
|
|
PING_PONG_STOP_AT_EACH_NODE,
|
|
// Token: 0x040009B3 RID: 2483
|
|
LOOP,
|
|
// Token: 0x040009B4 RID: 2484
|
|
LOOP_STOP_AT_EACH_NODE
|
|
}
|
|
|
|
// Token: 0x02000170 RID: 368
|
|
private enum MDMLGOFMKNC
|
|
{
|
|
// Token: 0x040009B6 RID: 2486
|
|
PARALLEL,
|
|
// Token: 0x040009B7 RID: 2487
|
|
PERPENDICULAR
|
|
}
|
|
}
|