// [TypeInfo RVA: 0x0]
public class AIWanderFollow : MonoBehaviour
{
	public string targetTag; // 0x20
	public float followDistance; // 0x28
	public UnityEngine.AudioClip followSound; // 0x30
	public UnityEngine.Transform[] points; // 0x38
	public UnityEngine.AudioSource audioSource; // 0x40
	public float patrolSpeed; // 0x48
	public float followSpeed; // 0x4C
	public float minimumSpeedRequired; // 0x50
	private UnityEngine.AI.NavMeshAgent agent; // 0x58
	private bool isFollowing; // 0x60
	private UnityEngine.Transform currentTarget; // 0x68
	private int destPoint; // 0x70
	private UnityEngine.Vector3 previousPosition; // 0x74
	private float currentSpeed; // 0x80

	// RVA: 0x3233AE4 VA: 0x781891EAE4
	private void Start();
	/*
	 *   int iVar1;
	 *   int iVar2;
	 *   int iVar3;
	 *   undefined *puVar4;
	 *   void *pvVar5;
	 *   void **ppvVar6;
	 *   void *this_00;
	 *   UnityEngine_Vector3 value;
	 *
	 *   puVar4 = PTR_DAT_070c08f8;
	 *   if ((bRam000000000754a955 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_070c08f8);
	 *     bRam000000000754a955 = 1;
	 *   }
	 *   pvVar5 = (void *)func_0x0373df50(this,*(undefined8 *)puVar4);
	 *   ppvVar6 = &this.agent;
	 *   *ppvVar6 = pvVar5;
	 *   func_0x031fdc38(ppvVar6,pvVar5);
	 *   if (this.audioSource != null) {
	 *     UnityEngine.AudioSource.set_clip(this.audioSource,this.followSound);
	 *     if (this.audioSource != null) {
	 *       UnityEngine.AudioSource.set_loop(this.audioSource,true);
	 *       if (*ppvVar6 != null) {
	 *         UnityEngine.AI.NavMeshAgent.set_autoBraking(*ppvVar6,false);
	 *         if (*ppvVar6 != null) {
	 *           UnityEngine.AI.NavMeshAgent.set_speed(*ppvVar6,this.patrolSpeed);
	 *           pvVar5 = this.points;
	 *           if (pvVar5 != null) {
	 *             if (*(long *)((long)pvVar5 + 0x18) == 0) {
	 *               return;
	 *             }
	 *             if ((uint)*(long *)((long)pvVar5 + 0x18) <= (uint)this.destPoint) {
	 *               IL2CPP.ThrowIndexOutOfRangeException();
	 *             }
	 *             pvVar5 = *(void **)((long)pvVar5 + (long)this.destPoint * 8 + 0x20);
	 *             if (pvVar5 != null) {
	 *               this_00 = this.agent;
	 *               value = UnityEngine.Transform.get_position(pvVar5);
	 *               if (this_00 != null) {
	 *                 UnityEngine.AI.NavMeshAgent.set_destination(this_00,value);
	 *                 if (this.points != null) {
	 *                   iVar2 = *(int *)((long)this.points + 0x18);
	 *                   iVar1 = this.destPoint + 1;
	 *                   iVar3 = 0;
	 *                   if (iVar2 != 0) {
	 *                     iVar3 = iVar1 / iVar2;
	 *                   }
	 *                   this.destPoint = iVar1 - iVar3 * iVar2;
	 *                   return;
	 *                 }
	 *               }
	 *             }
	 *           }
	 *           IL2CPP.ThrowNullReferenceException();
	 *         }
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x3233C20 VA: 0x781891EC20
	private void Update();
	/*
	 *   int iVar1;
	 *   int iVar2;
	 *   int iVar3;
	 *   undefined *puVar4;
	 *   bool bVar5;
	 *   ulong uVar6;
	 *   void *in_x2;
	 *   void *this_00;
	 *   void *pvVar7;
	 *   long lVar8;
	 *   float fVar9;
	 *   float fVar10;
	 *   float fVar11;
	 *   float fVar12;
	 *   UnityEngine_Vector3 UVar13;
	 *   UnityEngine_Vector3 UVar14;
	 *   UnityEngine_Vector3 UVar15;
	 *
	 *   puVar4 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   if ((bRam000000000754a956 & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8);
	 *     bRam000000000754a956 = 1;
	 *   }
	 *   AIWanderFollow.FindClosestTargetWithTag(this,this.targetTag);
	 *   pvVar7 = this.currentTarget;
	 *   if (*(int *)(*(long *)puVar4 + 0xe4) == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   uVar6 = UnityEngine.Object.op_Inequality(pvVar7,null);
	 *   if ((uVar6 & 1) != 0) {
	 *     if (this.currentTarget == null) goto LAB_03333ed0;
	 *     bVar5 = UnityEngine.Component.CompareTag(this.currentTarget,this.targetTag);
	 *     if (bVar5) {
	 *       if (this.currentTarget == null) {
	 * LAB_03333ed0:
	 *         IL2CPP.ThrowNullReferenceException();
	 *       }
	 *       UVar13 = UnityEngine.Transform.get_position(this.currentTarget);
	 *       pvVar7 = UnityEngine.Component.get_transform(this);
	 *       if (pvVar7 == null) goto LAB_03333ed0;
	 *       UVar14 = UnityEngine.Transform.get_position(pvVar7);
	 *       if (cRam000000000754a7c9 == '\0') {
	 *         func_0x031fdc8c(typeinfo_ptr_mscorlib_Math_6FC0738);
	 *         cRam000000000754a7c9 = '\x01';
	 *       }
	 *       puVar4 = typeinfo_ptr_mscorlib_Math_6FC0738;
	 *       if (*(int *)(*(long *)typeinfo_ptr_mscorlib_Math_6FC0738 + 0xe4) == 0) {
	 *         func_0x031fde08();
	 *       }
	 *       if (this.currentTarget == null) goto LAB_03333ed0;
	 *       UVar15 = UnityEngine.Transform.get_position(this.currentTarget);
	 *       fVar10 = (this.previousPosition).x;
	 *       fVar11 = (this.previousPosition).y;
	 *       fVar12 = (this.previousPosition).z;
	 *       if (cRam000000000754a89e == '\0') {
	 *         func_0x031fdc8c(typeinfo_ptr_mscorlib_Math_6FC0738);
	 *         cRam000000000754a89e = '\x01';
	 *       }
	 *       fVar10 = UVar15.x - fVar10;
	 *       fVar11 = UVar15.y - fVar11;
	 *       fVar12 = UVar15.z - fVar12;
	 *       if (*(int *)(*(long *)puVar4 + 0xe4) == 0) {
	 *         func_0x031fde08();
	 *       }
	 *       fVar9 = UnityEngine.Time.get_deltaTime();
	 *       this.currentSpeed = SQRT(fVar10 * fVar10 + fVar11 * fVar11 + fVar12 * fVar12) / fVar9;
	 *       if (this.currentTarget == null) goto LAB_03333ed0;
	 *       fVar12 = UVar13.y - UVar14.y;
	 *       fVar10 = UVar13.x - UVar14.x;
	 *       fVar11 = UVar13.z - UVar14.z;
	 *       UVar13 = UnityEngine.Transform.get_position(this.currentTarget);
	 *       fVar9 = this.followDistance;
	 *       (this.previousPosition).x = UVar13.x;
	 *       (this.previousPosition).y = UVar13.y;
	 *       (this.previousPosition).z = UVar13.z;
	 *       if ((SQRT(fVar11 * fVar11 + fVar10 * fVar10 + fVar12 * fVar12) <= fVar9) &&
	 *          (this.minimumSpeedRequired <= this.currentSpeed)) {
	 *         if (this.currentTarget != null) {
	 *           pvVar7 = this.agent;
	 *           UVar13 = UnityEngine.Transform.get_position(this.currentTarget);
	 *           if (pvVar7 != null) {
	 *             UnityEngine.AI.NavMeshAgent.SetDestination(pvVar7,UVar13);
	 *             if (this.agent != null) {
	 *               UnityEngine.AI.NavMeshAgent.set_speed(this.agent,this.followSpeed);
	 *               if (this.isFollowing != false) {
	 *                 return;
	 *               }
	 *               pvVar7 = this.audioSource;
	 *               this.isFollowing = true;
	 *               if (pvVar7 != null) {
	 *                 if ((bRam000000000755d742 & 1) == 0) {
	 *                   func_0x031fdc8c(PTR_DAT_0714e1b0);
	 *                   func_0x031fdc8c(PTR_DAT_070c6e98);
	 *                   bRam000000000755d742 = 1;
	 *                 }
	 *                 if (pvVar7 == null) {
	 *                   UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException(null,*(void **)PTR_DAT_070c6e98);
	 *                   IL2CPP.ThrowNullReferenceException();
	 *                 }
	 *                 lVar8 = *(long *)((long)pvVar7 + 0x10);
	 *                 if (lVar8 == 0) {
	 *                   UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException(pvVar7,*(void **)PTR_DAT_070c6e98);
	 *                 }
	 *                 if (pcRam000000000755d770 == null) {
	 *                   pcRam000000000755d770 = (code *)func_0x031fdc50(&UNK_0138b07d);
	 *                 }
	 *                 (*pcRam000000000755d770)(lVar8,0);
	 *                 return;
	 *               }
	 *             }
	 *           }
	 *         }
	 *         goto LAB_03333ed0;
	 *       }
	 *     }
	 *   }
	 *   if (this.isFollowing != false) {
	 *     this.isFollowing = false;
	 *     if (this.audioSource == null) goto LAB_033340cc;
	 *     UnityEngine.AudioSource.Stop(this.audioSource);
	 *     if (this.agent == null) goto LAB_033340cc;
	 *     UnityEngine.AI.NavMeshAgent.set_speed(this.agent,this.patrolSpeed)
	 *     ;
	 *   }
	 *   if (this.agent == null) {
	 * LAB_033340cc:
	 *     IL2CPP.ThrowNullReferenceException();
	 *   }
	 *   bVar5 = UnityEngine.AI.NavMeshAgent.get_pathPending(this.agent);
	 *   if (!bVar5) {
	 *     if (this.agent == null) goto LAB_033340cc;
	 *     fVar12 = UnityEngine.AI.NavMeshAgent.get_remainingDistance(this.agent);
	 *     if (fVar12 < 0.5) {
	 *       pvVar7 = this.points;
	 *       if (pvVar7 != null) {
	 *         if (*(long *)((long)pvVar7 + 0x18) == 0) {
	 *           return;
	 *         }
	 *         if ((uint)*(long *)((long)pvVar7 + 0x18) <= (uint)this.destPoint) {
	 *           IL2CPP.ThrowIndexOutOfRangeException();
	 *         }
	 *         pvVar7 = *(void **)((long)pvVar7 + (long)this.destPoint * 8 + 0x20);
	 *         if (pvVar7 != null) {
	 *           this_00 = this.agent;
	 *           UVar13 = UnityEngine.Transform.get_position(pvVar7);
	 *           if (this_00 != null) {
	 *             UnityEngine.AI.NavMeshAgent.set_destination(this_00,UVar13);
	 *             if (this.points != null) {
	 *               iVar2 = *(int *)((long)this.points + 0x18);
	 *               iVar1 = this.destPoint + 1;
	 *               iVar3 = 0;
	 *               if (iVar2 != 0) {
	 *                 iVar3 = iVar1 / iVar2;
	 *               }
	 *               this.destPoint = iVar1 - iVar3 * iVar2;
	 *               return;
	 *             }
	 *           }
	 *         }
	 *       }
	 *       IL2CPP.ThrowNullReferenceException();
	 *     }
	 *   }
	 *   return;
	 */
	// RVA: 0x3233ED4 VA: 0x781891EED4
	private void FindClosestTargetWithTag(string tag);
	/*
	 *   uint uVar1;
	 *   undefined *puVar2;
	 *   void *pvVar3;
	 *   void *pvVar4;
	 *   float fVar5;
	 *   void **ppvVar6;
	 *   void *pvVar7;
	 *   void *this_00;
	 *   uint uVar8;
	 *   float fVar9;
	 *   float fVar10;
	 *   float fVar11;
	 *   UnityEngine_Vector3 UVar12;
	 *   UnityEngine_Vector3 UVar13;
	 *
	 *   pvVar3 = UnityEngine.GameObject.FindGameObjectsWithTag(tag);
	 *   puVar2 = typeinfo_ptr_mscorlib_Math_6FC0738;
	 *   if (pvVar3 != null) {
	 *     uVar1 = *(uint *)((long)pvVar3 + 0x18);
	 *     if ((int)uVar1 < 1) {
	 *       pvVar7 = null;
	 *     }
	 *     else {
	 *       uVar8 = 0;
	 *       fVar5 = INFINITY;
	 *       pvVar7 = null;
	 *       do {
	 *         if (uVar1 <= uVar8) {
	 *           IL2CPP.ThrowIndexOutOfRangeException();
	 *         }
	 *         this_00 = *(void **)((long)pvVar3 + (long)(int)uVar8 * 8 + 0x20);
	 *         if ((this_00 == null) ||
	 *            (pvVar4 = UnityEngine.GameObject.get_transform(this_00),
	 *            pvVar4 == null)) goto LAB_03334048;
	 *         UVar12 = UnityEngine.Transform.get_position(pvVar4);
	 *         pvVar4 = UnityEngine.Component.get_transform(this);
	 *         if (pvVar4 == null) goto LAB_03334048;
	 *         UVar13 = UnityEngine.Transform.get_position(pvVar4);
	 *         if (cRam000000000754a7c9 == '\0') {
	 *           func_0x031fdc8c(puVar2);
	 *           cRam000000000754a7c9 = '\x01';
	 *         }
	 *         if (*(int *)(*(long *)puVar2 + 0xe4) == 0) {
	 *           func_0x031fde08();
	 *         }
	 *         fVar9 = UVar12.y - UVar13.y;
	 *         fVar10 = UVar12.x - UVar13.x;
	 *         fVar11 = UVar12.z - UVar13.z;
	 *         fVar9 = SQRT(fVar11 * fVar11 + fVar10 * fVar10 + fVar9 * fVar9);
	 *         if (fVar9 < fVar5) {
	 *           pvVar7 = UnityEngine.GameObject.get_transform(this_00);
	 *           fVar5 = fVar9;
	 *         }
	 *         uVar1 = *(uint *)((long)pvVar3 + 0x18);
	 *         uVar8 = uVar8 + 1;
	 *       } while ((int)uVar8 < (int)uVar1);
	 *     }
	 *     ppvVar6 = &this.currentTarget;
	 *     *ppvVar6 = pvVar7;
	 *     if (iRam00000000077785f0 != 0) {
	 *       func_0x032ed0c0(1L << ((ulong)ppvVar6 >> 0xc & 0x3f),
	 *                       ((ulong)ppvVar6 >> 0x12 & 0x7fff) * 8 + 0x75ac5c8);
	 *     }
	 *     return;
	 *   }
	 * LAB_03334048:
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x3234050 VA: 0x781891F050
	private void StopFollowingAndPatrol();
	/*
	 *   int iVar1;
	 *   int iVar2;
	 *   int iVar3;
	 *   bool bVar4;
	 *   void *pvVar5;
	 *   void *this_00;
	 *   float fVar6;
	 *   UnityEngine_Vector3 value;
	 *
	 *   if (this.isFollowing != false) {
	 *     this.isFollowing = false;
	 *     if (this.audioSource == null) goto LAB_033340cc;
	 *     UnityEngine.AudioSource.Stop(this.audioSource);
	 *     if (this.agent == null) goto LAB_033340cc;
	 *     UnityEngine.AI.NavMeshAgent.set_speed(this.agent,this.patrolSpeed)
	 *     ;
	 *   }
	 *   if (this.agent == null) {
	 * LAB_033340cc:
	 *     IL2CPP.ThrowNullReferenceException();
	 *   }
	 *   bVar4 = UnityEngine.AI.NavMeshAgent.get_pathPending(this.agent);
	 *   if (!bVar4) {
	 *     if (this.agent == null) goto LAB_033340cc;
	 *     fVar6 = UnityEngine.AI.NavMeshAgent.get_remainingDistance(this.agent);
	 *     if (fVar6 < 0.5) {
	 *       pvVar5 = this.points;
	 *       if (pvVar5 != null) {
	 *         if (*(long *)((long)pvVar5 + 0x18) == 0) {
	 *           return;
	 *         }
	 *         if ((uint)*(long *)((long)pvVar5 + 0x18) <= (uint)this.destPoint) {
	 *           IL2CPP.ThrowIndexOutOfRangeException();
	 *         }
	 *         pvVar5 = *(void **)((long)pvVar5 + (long)this.destPoint * 8 + 0x20);
	 *         if (pvVar5 != null) {
	 *           this_00 = this.agent;
	 *           value = UnityEngine.Transform.get_position(pvVar5);
	 *           if (this_00 != null) {
	 *             UnityEngine.AI.NavMeshAgent.set_destination(this_00,value);
	 *             if (this.points != null) {
	 *               iVar2 = *(int *)((long)this.points + 0x18);
	 *               iVar1 = this.destPoint + 1;
	 *               iVar3 = 0;
	 *               if (iVar2 != 0) {
	 *                 iVar3 = iVar1 / iVar2;
	 *               }
	 *               this.destPoint = iVar1 - iVar3 * iVar2;
	 *               return;
	 *             }
	 *           }
	 *         }
	 *       }
	 *       IL2CPP.ThrowNullReferenceException();
	 *     }
	 *   }
	 *   return;
	 */
	// RVA: 0x3233B9C VA: 0x781891EB9C
	private void GotoNextPoint();
	/*
	 *   int iVar1;
	 *   int iVar2;
	 *   int iVar3;
	 *   void *pvVar4;
	 *   void *this_00;
	 *   UnityEngine_Vector3 value;
	 *
	 *   pvVar4 = this.points;
	 *   if (pvVar4 != null) {
	 *     if (*(long *)((long)pvVar4 + 0x18) == 0) {
	 *       return;
	 *     }
	 *     if ((uint)*(long *)((long)pvVar4 + 0x18) <= (uint)this.destPoint) {
	 *       IL2CPP.ThrowIndexOutOfRangeException();
	 *     }
	 *     pvVar4 = *(void **)((long)pvVar4 + (long)this.destPoint * 8 + 0x20);
	 *     if (pvVar4 != null) {
	 *       this_00 = this.agent;
	 *       value = UnityEngine.Transform.get_position(pvVar4);
	 *       if (this_00 != null) {
	 *         UnityEngine.AI.NavMeshAgent.set_destination(this_00,value);
	 *         if (this.points != null) {
	 *           iVar2 = *(int *)((long)this.points + 0x18);
	 *           iVar1 = this.destPoint + 1;
	 *           iVar3 = 0;
	 *           if (iVar2 != 0) {
	 *             iVar3 = iVar1 / iVar2;
	 *           }
	 *           this.destPoint = iVar1 - iVar3 * iVar2;
	 *           return;
	 *         }
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x32340D0 VA: 0x781891F0D0
	public void .ctor();
	/*
	 *   undefined8 uVar1;
	 *   undefined4 uVar2;
	 *   undefined *puVar3;
	 *   undefined8 uVar4;
	 *
	 *   uVar1 = _UNK_0134dd58;
	 *   this.followDistance = 5.0;
	 *   this.minimumSpeedRequired = 2.0;
	 *   uVar4 = _UNK_0134dd58;
	 *   _UNK_0134dd58 = (undefined4)uVar1;
	 *   _UNK_0134dd5c = SUB84(uVar1,4);
	 *   uVar2 = _UNK_0134dd5c;
	 *   this.patrolSpeed = (float)_UNK_0134dd58;
	 *   _UNK_0134dd58 = uVar4;
	 *   puVar3 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   this.followSpeed = (float)uVar2;
	 *   if ((bRam000000000755f76f & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8,0);
	 *     bRam000000000755f76f = 1;
	 *   }
	 *   if (*(int *)(*(long *)puVar3 + 0xe4) == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   return;
	 */
}
