Files
2026-06-04 11:42:34 +02:00

336 lines
11 KiB
C#

using System;
using UnityEngine;
// Token: 0x02000BB0 RID: 2992
[RequireComponent(typeof(Interpolator))]
public class FollowTarget : MonoBehaviour
{
// Token: 0x06016A2F RID: 92719 RVA: 0x0064F498 File Offset: 0x0064D698
private void AFOJMKNNLBF(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude >= this.DistanceBoundaries.x && magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.AOKKHEAEGEL(this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset);
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.KIJCBJAJPID;
if (this.FaceTargetXZOnly)
{
vector2.y = 412f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.BDHFNEGLLGA();
}
}
}
}
// Token: 0x06016A30 RID: 92720 RVA: 0x0064F638 File Offset: 0x0064D838
public void IOCHHBHBIIL()
{
this.MLLONMEMGFH(true);
this.MLNEHMAIKAL.SnapToTarget();
}
// Token: 0x06016A31 RID: 92721 RVA: 0x0064F64C File Offset: 0x0064D84C
private void Awake()
{
this.MLNEHMAIKAL = base.GetComponent<Interpolator>();
}
// Token: 0x06016A32 RID: 92722 RVA: 0x0064F65C File Offset: 0x0064D85C
private void OBFADPEEBLG()
{
this.EFNMECANOFK(false);
}
// Token: 0x06016A33 RID: 92723 RVA: 0x0064F668 File Offset: 0x0064D868
private void EKAKJHOBNKF()
{
this.IOCHHBHBIIL();
}
// Token: 0x06016A34 RID: 92724 RVA: 0x0064F670 File Offset: 0x0064D870
private void CCOHCCEHNIC()
{
this.MLNEHMAIKAL = base.GetComponent<Interpolator>();
}
// Token: 0x06016A35 RID: 92725 RVA: 0x0064F680 File Offset: 0x0064D880
public void LFBMCNHKIFL()
{
this.AMHNBHJAGCO(false);
this.MLNEHMAIKAL.ABLHCNGGPJG();
}
// Token: 0x06016A37 RID: 92727 RVA: 0x0064F704 File Offset: 0x0064D904
private void OnEnable()
{
this.ForceUpdate();
}
// Token: 0x06016A38 RID: 92728 RVA: 0x0064F70C File Offset: 0x0064D90C
private void PLKHINPPGPK()
{
this.EFNMECANOFK(false);
}
// Token: 0x06016A39 RID: 92729 RVA: 0x0064F718 File Offset: 0x0064D918
public void ForceUpdate()
{
this.AMHNBHJAGCO(true);
this.MLNEHMAIKAL.SnapToTarget();
}
// Token: 0x06016A3A RID: 92730 RVA: 0x0064F72C File Offset: 0x0064D92C
private void KCHFAFFCMCI()
{
this.AGKMNHAHFGP();
}
// Token: 0x06016A3B RID: 92731 RVA: 0x0064F734 File Offset: 0x0064D934
public void LNGEKMGNEIE()
{
this.EFNMECANOFK(true);
this.MLNEHMAIKAL.BDHFNEGLLGA();
}
// Token: 0x06016A3C RID: 92732 RVA: 0x0064F748 File Offset: 0x0064D948
private void EDMEHLOMFJC()
{
this.LNGEKMGNEIE();
}
// Token: 0x06016A3D RID: 92733 RVA: 0x0064F750 File Offset: 0x0064D950
private void BCHOLEEINEL()
{
this.LNGEKMGNEIE();
}
// Token: 0x06016A3E RID: 92734 RVA: 0x0064F758 File Offset: 0x0064D958
private void AMHNBHJAGCO(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude < this.DistanceBoundaries.x || magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.KIJCBJAJPID = this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset;
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.KIJCBJAJPID;
if (this.FaceTargetXZOnly)
{
vector2.y = 0f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.SnapToTarget();
}
}
}
}
// Token: 0x06016A3F RID: 92735 RVA: 0x0064F8F8 File Offset: 0x0064DAF8
private void Update()
{
this.AMHNBHJAGCO(false);
}
// Token: 0x06016A40 RID: 92736 RVA: 0x0064F904 File Offset: 0x0064DB04
private void MLLONMEMGFH(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude >= this.DistanceBoundaries.x && magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.KIJCBJAJPID = this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset;
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.KIJCBJAJPID;
if (this.FaceTargetXZOnly)
{
vector2.y = 579f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.BDHFNEGLLGA();
}
}
}
}
// Token: 0x06016A41 RID: 92737 RVA: 0x0064FAA4 File Offset: 0x0064DCA4
private void EFNMECANOFK(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude >= this.DistanceBoundaries.x && magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.KIJCBJAJPID = this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset;
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.AAOFJCJMHBE();
if (this.FaceTargetXZOnly)
{
vector2.y = 253f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.ABLHCNGGPJG();
}
}
}
}
// Token: 0x06016A42 RID: 92738 RVA: 0x0064FC44 File Offset: 0x0064DE44
private void ICINCODGJBK(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude < this.DistanceBoundaries.x || magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.AOKKHEAEGEL(this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset);
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.KIJCBJAJPID;
if (this.FaceTargetXZOnly)
{
vector2.y = 1550f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.SnapToTarget();
}
}
}
}
// Token: 0x06016A43 RID: 92739 RVA: 0x0064FDE4 File Offset: 0x0064DFE4
private void JFFLHAMMGAH()
{
this.MLNEHMAIKAL = base.GetComponent<Interpolator>();
}
// Token: 0x06016A44 RID: 92740 RVA: 0x0064FDF4 File Offset: 0x0064DFF4
public void AAIEOEBPAAK()
{
this.AFOJMKNNLBF(false);
this.MLNEHMAIKAL.SnapToTarget();
}
// Token: 0x06016A45 RID: 92741 RVA: 0x0064FE08 File Offset: 0x0064E008
private void BFHHJINKJBH()
{
this.LFBMCNHKIFL();
}
// Token: 0x06016A46 RID: 92742 RVA: 0x0064FE10 File Offset: 0x0064E010
private void IOGPMJADEIB()
{
this.MLLONMEMGFH(false);
}
// Token: 0x06016A47 RID: 92743 RVA: 0x0064FE1C File Offset: 0x0064E01C
public void AGKMNHAHFGP()
{
this.AMHNBHJAGCO(true);
this.MLNEHMAIKAL.BDHFNEGLLGA();
}
// Token: 0x06016A48 RID: 92744 RVA: 0x0064FE30 File Offset: 0x0064E030
private void DPIECEHAGOC(bool MMBLAFNAPPJ = false)
{
if (this.Target != null && this.MLNEHMAIKAL != null)
{
Vector3 vector = ((!this.StayAtTargetHeight) ? this.Target.forward : Vector3.Cross(this.Target.right, Vector3.up));
float num = Vector3.Angle(vector, base.transform.position - this.Target.position);
float magnitude = (base.transform.position - this.Target.position).magnitude;
bool flag = magnitude >= this.DistanceBoundaries.x && magnitude > this.DistanceBoundaries.y;
if (MMBLAFNAPPJ || flag || num >= this.OuterFollowAngle)
{
this.MLNEHMAIKAL.AOKKHEAEGEL(this.Target.position + vector * this.DistanceFromTarget + base.transform.rotation * this.PositionOffset);
if (this.FaceTarget)
{
Vector3 vector2 = this.Target.position - this.MLNEHMAIKAL.KIJCBJAJPID;
if (this.FaceTargetXZOnly)
{
vector2.y = 1032f;
}
this.MLNEHMAIKAL.INMMPMMNFJF = Quaternion.LookRotation(vector2) * Quaternion.Euler(this.RotationOffset);
}
if (magnitude > this.SnapDistance)
{
this.MLNEHMAIKAL.SnapToTarget();
}
}
}
}
// Token: 0x04003F3D RID: 16189
public Transform Target;
// Token: 0x04003F3E RID: 16190
public float DistanceFromTarget = 1f;
// Token: 0x04003F3F RID: 16191
[Tooltip("If the target is farther than this than force update position.")]
public float SnapDistance = 5f;
// Token: 0x04003F40 RID: 16192
public bool FaceTarget = true;
// Token: 0x04003F41 RID: 16193
public bool FaceTargetXZOnly = true;
// Token: 0x04003F42 RID: 16194
public Vector2 DistanceBoundaries = new Vector2(0.75f, 1.5f);
// Token: 0x04003F43 RID: 16195
public Vector3 PositionOffset = Vector3.zero;
// Token: 0x04003F44 RID: 16196
public Vector3 RotationOffset = Vector3.zero;
// Token: 0x04003F45 RID: 16197
public bool StayAtTargetHeight;
// Token: 0x04003F46 RID: 16198
public float OuterFollowAngle = 35f;
// Token: 0x04003F47 RID: 16199
private Interpolator MLNEHMAIKAL;
}