Decompiled source of Afg OutPost v1.3.0

Afg_OutPost.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using Gamemodes;
using HTC.UnityPlugin.StereoRendering;
using HarmonyLib;
using JerryComponent;
using JerryLegsIK;
using LuxWater;
using NoiseTools;
using OtherLoader;
using Plawius;
using Popcron;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using RootMotion;
using RootMotion.FinalIK;
using RootMotion1.FinalIK;
using SimplestarGame.Mesh;
using SimplestarGame.Splash;
using SimplestarGame.Wave;
using Sodalite;
using Sodalite.Api;
using Sodalite.Utilities;
using Technie.PhysicsCreator.QHull;
using Tenkoku.Core;
using Tenkoku.Effects;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;
using UnityEngine.VR;
using Valve.Newtonsoft.Json;
using Valve.VR;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class AQUAS_BubbleBehaviour : MonoBehaviour
{
	public float averageUpdrift;

	public float waterLevel;

	public GameObject mainCamera;

	public GameObject smallBubble;

	private int smallBubbleCount;

	private int maxSmallBubbleCount;

	private AQUAS_SmallBubbleBehaviour smallBubbleBehaviour;

	private void Start()
	{
		maxSmallBubbleCount = Random.Range(20, 30);
		smallBubbleCount = 0;
		smallBubbleBehaviour = smallBubble.GetComponent<AQUAS_SmallBubbleBehaviour>();
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(Vector3.up * Time.deltaTime * averageUpdrift, (Space)0);
		SmallBubbleSpawner();
		if (mainCamera.transform.position.y > waterLevel || ((Component)this).transform.position.y > waterLevel)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void SmallBubbleSpawner()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		if (smallBubbleCount <= maxSmallBubbleCount)
		{
			smallBubble.transform.localScale = ((Component)this).transform.localScale * Random.Range(0.05f, 0.2f);
			smallBubbleBehaviour.averageUpdrift = averageUpdrift * 0.5f;
			smallBubbleBehaviour.waterLevel = waterLevel;
			smallBubbleBehaviour.mainCamera = mainCamera;
			Object.Instantiate<GameObject>(smallBubble, new Vector3(((Component)this).transform.position.x + Random.Range(-0.1f, 0.1f), ((Component)this).transform.position.y - Random.Range(0.01f, 1f), ((Component)this).transform.position.z + Random.Range(-0.1f, 0.1f)), Quaternion.identity);
			smallBubbleCount++;
		}
	}
}
public class AQUAS_BubbleMorph : MonoBehaviour
{
	private float t = 0f;

	private float t2 = 0f;

	[Space(5f)]
	[Header("Duration of a full morphing cycle")]
	public float tTarget;

	private SkinnedMeshRenderer skinnedMeshRenderer;

	private void Start()
	{
		skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
	}

	private void Update()
	{
		t += Time.deltaTime;
		t2 += Time.deltaTime;
		if (t < tTarget / 2f)
		{
			skinnedMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(0f, 50f, t / (tTarget / 2f)));
			skinnedMeshRenderer.SetBlendShapeWeight(1, Mathf.Lerp(50f, 0f, t / (tTarget / 2f)));
		}
		else if (t >= tTarget / 2f && t < tTarget)
		{
			skinnedMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(50f, 100f, t / tTarget));
			skinnedMeshRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 50f, t / tTarget));
		}
		else if (t >= tTarget && t < tTarget * 1.5f)
		{
			skinnedMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(100f, 50f, t / (tTarget * 1.5f)));
			skinnedMeshRenderer.SetBlendShapeWeight(1, Mathf.Lerp(50f, 100f, t / (tTarget * 1.5f)));
		}
		else if (t >= tTarget * 1.5f && t < tTarget * 2f)
		{
			skinnedMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(50f, 0f, t / (tTarget * 2f)));
			skinnedMeshRenderer.SetBlendShapeWeight(1, Mathf.Lerp(100f, 50f, t / (tTarget * 2f)));
		}
		else
		{
			t = 0f;
		}
	}
}
[AddComponentMenu("AQUAS/Buoyancy")]
[RequireComponent(typeof(Rigidbody))]
public class AQUAS_Buoyancy : MonoBehaviour
{
	public enum debugModes
	{
		none,
		showAffectedFaces,
		showForceRepresentation,
		showReferenceVolume
	}

	public float waterLevel;

	public float waterDensity;

	[Space(5f)]
	public bool useBalanceFactor;

	public Vector3 balanceFactor;

	[Space(20f)]
	[Range(0f, 1f)]
	public float dynamicSurface = 0.3f;

	[Range(1f, 10f)]
	public float bounceFrequency = 3f;

	[Space(5f)]
	[Header("Debugging can be ver performance heavy!")]
	public debugModes debug;

	private Vector3[] vertices;

	private int[] triangles;

	private Mesh mesh;

	private Rigidbody rb;

	private float effWaterDensity;

	private float regWaterDensity;

	private float maxWaterDensity;

	private void Start()
	{
		mesh = ((Component)this).GetComponent<MeshFilter>().mesh;
		vertices = mesh.vertices;
		triangles = mesh.triangles;
		rb = ((Component)this).GetComponent<Rigidbody>();
		regWaterDensity = waterDensity;
		maxWaterDensity = regWaterDensity + regWaterDensity * 0.5f * dynamicSurface;
	}

	private void FixedUpdate()
	{
		if (balanceFactor.x < 0.001f)
		{
			balanceFactor.x = 0.001f;
		}
		if (balanceFactor.y < 0.001f)
		{
			balanceFactor.y = 0.001f;
		}
		if (balanceFactor.z < 0.001f)
		{
			balanceFactor.z = 0.001f;
		}
		AddForce();
	}

	private void Update()
	{
		regWaterDensity = waterDensity;
		maxWaterDensity = regWaterDensity + regWaterDensity * 0.5f * dynamicSurface;
		effWaterDensity = (maxWaterDensity - regWaterDensity) / 2f + regWaterDensity + Mathf.Sin(Time.time * bounceFrequency) * (maxWaterDensity - regWaterDensity) / 2f;
	}

	private void AddForce()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_032a: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_034a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0354: Unknown result type (might be due to invalid IL or missing references)
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0371: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_037f: Unknown result type (might be due to invalid IL or missing references)
		//IL_038f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_0395: Unknown result type (might be due to invalid IL or missing references)
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040b: Unknown result type (might be due to invalid IL or missing references)
		//IL_041b: Unknown result type (might be due to invalid IL or missing references)
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		//IL_042b: Unknown result type (might be due to invalid IL or missing references)
		//IL_042c: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0433: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		//IL_0448: Unknown result type (might be due to invalid IL or missing references)
		//IL_0451: Unknown result type (might be due to invalid IL or missing references)
		//IL_045c: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		//IL_046e: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_0483: Unknown result type (might be due to invalid IL or missing references)
		//IL_0484: Unknown result type (might be due to invalid IL or missing references)
		//IL_0489: Unknown result type (might be due to invalid IL or missing references)
		//IL_0492: Unknown result type (might be due to invalid IL or missing references)
		//IL_0497: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Unknown result type (might be due to invalid IL or missing references)
		//IL_051b: Unknown result type (might be due to invalid IL or missing references)
		//IL_051c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0521: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_0537: Unknown result type (might be due to invalid IL or missing references)
		//IL_053c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0545: Unknown result type (might be due to invalid IL or missing references)
		//IL_0550: Unknown result type (might be due to invalid IL or missing references)
		//IL_0551: Unknown result type (might be due to invalid IL or missing references)
		//IL_0556: Unknown result type (might be due to invalid IL or missing references)
		//IL_056b: Unknown result type (might be due to invalid IL or missing references)
		//IL_056c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0571: Unknown result type (might be due to invalid IL or missing references)
		//IL_057a: Unknown result type (might be due to invalid IL or missing references)
		//IL_057f: Unknown result type (might be due to invalid IL or missing references)
		//IL_058f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0590: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_05df: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0603: Unknown result type (might be due to invalid IL or missing references)
		//IL_0604: Unknown result type (might be due to invalid IL or missing references)
		//IL_0609: Unknown result type (might be due to invalid IL or missing references)
		//IL_061e: Unknown result type (might be due to invalid IL or missing references)
		//IL_061f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0624: Unknown result type (might be due to invalid IL or missing references)
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0638: Unknown result type (might be due to invalid IL or missing references)
		//IL_0639: Unknown result type (might be due to invalid IL or missing references)
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0648: Unknown result type (might be due to invalid IL or missing references)
		//IL_0649: Unknown result type (might be due to invalid IL or missing references)
		//IL_064a: Unknown result type (might be due to invalid IL or missing references)
		//IL_064b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0650: Unknown result type (might be due to invalid IL or missing references)
		//IL_065f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_0665: Unknown result type (might be due to invalid IL or missing references)
		//IL_066e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0673: Unknown result type (might be due to invalid IL or missing references)
		//IL_0683: Unknown result type (might be due to invalid IL or missing references)
		//IL_0684: Unknown result type (might be due to invalid IL or missing references)
		//IL_0689: Unknown result type (might be due to invalid IL or missing references)
		//IL_069e: Unknown result type (might be due to invalid IL or missing references)
		//IL_069f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06be: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06df: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0703: Unknown result type (might be due to invalid IL or missing references)
		//IL_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_0709: Unknown result type (might be due to invalid IL or missing references)
		//IL_071e: Unknown result type (might be due to invalid IL or missing references)
		//IL_071f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0724: Unknown result type (might be due to invalid IL or missing references)
		//IL_072d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0738: Unknown result type (might be due to invalid IL or missing references)
		//IL_0739: Unknown result type (might be due to invalid IL or missing references)
		//IL_073e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0748: Unknown result type (might be due to invalid IL or missing references)
		//IL_0749: Unknown result type (might be due to invalid IL or missing references)
		//IL_074a: Unknown result type (might be due to invalid IL or missing references)
		//IL_074b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0750: Unknown result type (might be due to invalid IL or missing references)
		//IL_075f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0760: Unknown result type (might be due to invalid IL or missing references)
		//IL_0765: Unknown result type (might be due to invalid IL or missing references)
		//IL_076e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0773: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < triangles.Length; i += 3)
		{
			Vector3 val = vertices[triangles[i]];
			Vector3 val2 = vertices[triangles[i + 1]];
			Vector3 val3 = vertices[triangles[i + 2]];
			float num = waterLevel - Center(val, val2, val3).y;
			if (num > 0f && Center(val, val2, val3).y > (Center(val, val2, val3) + Normal(val, val2, val3)).y)
			{
				float num2 = effWaterDensity * Physics.gravity.y * num * Area(val, val2, val3);
				Vector3 val4 = Normal(val, val2, val3);
				float num3 = num2 * ((Vector3)(ref val4)).normalized.y;
				if (useBalanceFactor)
				{
					rb.AddForceAtPosition(new Vector3(0f, num3, 0f), ((Component)this).transform.TransformPoint(new Vector3(((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).x / (balanceFactor.x * ((Component)this).transform.localScale.x * 1000f), ((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).y / (balanceFactor.y * ((Component)this).transform.localScale.x * 1000f), ((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).z / (balanceFactor.z * ((Component)this).transform.localScale.x * 1000f))));
				}
				else
				{
					rb.AddForceAtPosition(new Vector3(0f, num3, 0f), ((Component)this).transform.TransformPoint(new Vector3(((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).x, ((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).y, ((Component)this).transform.InverseTransformPoint(Center(val, val2, val3)).z)));
				}
				if (debug == debugModes.showAffectedFaces)
				{
					Debug.DrawLine(Center(val, val2, val3), Center(val, val2, val3) + Normal(val, val2, val3), Color.white);
				}
				if (debug == debugModes.showForceRepresentation)
				{
					Debug.DrawRay(Center(val, val2, val3), new Vector3(0f, num3, 0f), Color.red);
				}
				if (debug == debugModes.showReferenceVolume)
				{
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val).z), new Vector3(((Component)this).transform.TransformPoint(val2).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val2).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val2).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val2).z), new Vector3(((Component)this).transform.TransformPoint(val3).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val3).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val3).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val3).z), new Vector3(((Component)this).transform.TransformPoint(val).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val).x, waterLevel, ((Component)this).transform.TransformPoint(val).z), new Vector3(((Component)this).transform.TransformPoint(val2).x, waterLevel, ((Component)this).transform.TransformPoint(val2).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val2).x, waterLevel, ((Component)this).transform.TransformPoint(val2).z), new Vector3(((Component)this).transform.TransformPoint(val3).x, waterLevel, ((Component)this).transform.TransformPoint(val3).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val3).x, waterLevel, ((Component)this).transform.TransformPoint(val3).z), new Vector3(((Component)this).transform.TransformPoint(val).x, waterLevel, ((Component)this).transform.TransformPoint(val).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val).x, waterLevel, ((Component)this).transform.TransformPoint(val).z), new Vector3(((Component)this).transform.TransformPoint(val).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val2).x, waterLevel, ((Component)this).transform.TransformPoint(val2).z), new Vector3(((Component)this).transform.TransformPoint(val2).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val2).z), Color.green);
					Debug.DrawLine(new Vector3(((Component)this).transform.TransformPoint(val3).x, waterLevel, ((Component)this).transform.TransformPoint(val3).z), new Vector3(((Component)this).transform.TransformPoint(val3).x, Center(val, val2, val3).y, ((Component)this).transform.TransformPoint(val3).z), Color.green);
				}
			}
		}
	}

	private Vector3 Center(Vector3 p1, Vector3 p2, Vector3 p3)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = (p1 + p2 + p3) / 3f;
		return ((Component)this).transform.TransformPoint(val);
	}

	private Vector3 Normal(Vector3 p1, Vector3 p2, Vector3 p3)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = Vector3.Cross(((Component)this).transform.TransformPoint(p2) - ((Component)this).transform.TransformPoint(p1), ((Component)this).transform.TransformPoint(p3) - ((Component)this).transform.TransformPoint(p1));
		return ((Vector3)(ref val)).normalized;
	}

	private float Area(Vector3 p1, Vector3 p2, Vector3 p3)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		float num = Vector3.Distance(new Vector3(((Component)this).transform.TransformPoint(p1).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p1).z), new Vector3(((Component)this).transform.TransformPoint(p2).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p2).z));
		float num2 = Vector3.Distance(new Vector3(((Component)this).transform.TransformPoint(p3).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p3).z), new Vector3(((Component)this).transform.TransformPoint(p1).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p1).z));
		return num * num2 * Mathf.Sin(Vector3.Angle(new Vector3(((Component)this).transform.TransformPoint(p2).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p2).z) - new Vector3(((Component)this).transform.TransformPoint(p1).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p1).z), new Vector3(((Component)this).transform.TransformPoint(p3).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p3).z) - new Vector3(((Component)this).transform.TransformPoint(p1).x, Center(p1, p2, p3).y, ((Component)this).transform.TransformPoint(p1).z)) * ((float)Math.PI / 180f)) / 2f;
	}
}
[AddComponentMenu("AQUAS/AQUAS Camera")]
[RequireComponent(typeof(Camera))]
public class AQUAS_Camera : MonoBehaviour
{
	private void OnDrawGizmos()
	{
		Set();
	}

	private void Start()
	{
		Set();
	}

	private void Set()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		if ((int)((Component)this).GetComponent<Camera>().depthTextureMode == 0)
		{
			((Component)this).GetComponent<Camera>().depthTextureMode = (DepthTextureMode)1;
		}
	}
}
public class AQUAS_Caustics : MonoBehaviour
{
	public float fps;

	public Texture2D[] frames;

	public float maxCausticDepth;

	private int frameIndex;

	private Projector projector;

	private void Start()
	{
		projector = ((Component)this).GetComponent<Projector>();
		NextFrame();
		((MonoBehaviour)this).InvokeRepeating("NextFrame", 1f / fps, 1f / fps);
		projector.material.SetFloat("_WaterLevel", 0.5f);
		projector.material.SetFloat("_DepthFade", -19f);
	}

	private void Update()
	{
		projector.material.SetFloat("_DepthFade", -19f);
	}

	private void NextFrame()
	{
		projector.material.SetTexture("_Texture", (Texture)(object)frames[frameIndex]);
		frameIndex = (frameIndex + 1) % frames.Length;
	}
}
namespace AQUAS
{
	public class AQUAS_Look : MonoBehaviour
	{
		[Header("Info")]
		private List<float> _rotArrayX = new List<float>();

		private List<float> _rotArrayY = new List<float>();

		private float rotAverageX;

		private float rotAverageY;

		private float mouseDeltaX;

		private float mouseDeltaY;

		[Header("Settings")]
		public bool _isLocked;

		public float _sensitivityX = 1.5f;

		public float _sensitivityY = 1.5f;

		[Tooltip("The more steps, the smoother it will be.")]
		public int _averageFromThisManySteps = 3;

		[Header("References")]
		[Tooltip("Object to be rotated when mouse moves left/right.")]
		public Transform _playerRootT;

		[Tooltip("Object to be rotated when mouse moves up/down.")]
		public Transform _cameraT;

		private void Update()
		{
			MouseLookAveraged();
		}

		private void MouseLookAveraged()
		{
			rotAverageX = 0f;
			rotAverageY = 0f;
			mouseDeltaX = 0f;
			mouseDeltaY = 0f;
			mouseDeltaX += Input.GetAxis("Mouse X") * _sensitivityX;
			mouseDeltaY += Input.GetAxis("Mouse Y") * _sensitivityY;
			_rotArrayX.Add(mouseDeltaX);
			_rotArrayY.Add(mouseDeltaY);
			if (_rotArrayX.Count >= _averageFromThisManySteps)
			{
				_rotArrayX.RemoveAt(0);
			}
			if (_rotArrayY.Count >= _averageFromThisManySteps)
			{
				_rotArrayY.RemoveAt(0);
			}
			for (int i = 0; i < _rotArrayX.Count; i++)
			{
				rotAverageX += _rotArrayX[i];
			}
			for (int j = 0; j < _rotArrayY.Count; j++)
			{
				rotAverageY += _rotArrayY[j];
			}
			rotAverageX /= _rotArrayX.Count;
			rotAverageY /= _rotArrayY.Count;
			_playerRootT.Rotate(0f, rotAverageX, 0f, (Space)0);
			_cameraT.Rotate(0f - rotAverageY, 0f, 0f, (Space)1);
		}
	}
}
[Serializable]
public class AQUAS_Parameters
{
	[Serializable]
	public class UnderWaterParameters
	{
		[Header("The following parameters apply for underwater only!")]
		[Space(5f)]
		public float fogDensity = 0.1f;

		public Color fogColor;

		[Space(5f)]
		[Header("Post Processing Profiles (Must NOT be empty!)")]
		[Space(5f)]
		public PostProcessProfile underwaterProfile;

		public PostProcessProfile defaultProfile;
	}

	[Serializable]
	public class GameObjects
	{
		[Header("Set the game objects required for underwater mode.")]
		[Space(5f)]
		public GameObject mainCamera;

		public GameObject waterLens;

		public GameObject airLens;

		public GameObject bubble;

		[Space(5f)]
		[Header("Set waterplanes array size = number of waterplanes")]
		public List<GameObject> waterPlanes = new List<GameObject>();

		public bool useSquaredPlanes;
	}

	[Serializable]
	public class WetLens
	{
		[Header("Set how long the lens stays wet after diving up.")]
		public float wetTime = 1f;

		[Space(5f)]
		[Header("Set how long the lens needs to dry.")]
		public float dryingTime = 1.5f;

		[Space(5f)]
		public Texture2D[] sprayFrames;

		public Texture2D[] sprayFramesCutout;

		public float rundownSpeed = 72f;
	}

	[Serializable]
	public class CausticSettings
	{
		[Header("The following values are 'Afloat'/'Underwater'")]
		public Vector2 causticIntensity = new Vector2(0.6f, 0.2f);

		public Vector2 causticTiling = new Vector2(300f, 100f);

		public float maxCausticDepth;
	}

	[Serializable]
	public class Audio
	{
		public AudioClip[] sounds;

		[Range(0f, 1f)]
		public float underwaterVolume;

		[Range(0f, 1f)]
		public float surfacingVolume;

		[Range(0f, 1f)]
		public float diveVolume;
	}

	[Serializable]
	public class BubbleSpawnCriteria
	{
		[Header("Spawn Criteria for big bubbles")]
		public int minBubbleCount = 20;

		public int maxBubbleCount = 40;

		[Space(5f)]
		public float maxSpawnDistance = 1f;

		public float averageUpdrift = 3f;

		[Space(5f)]
		public float baseScale = 0.06f;

		public float avgScaleSummand = 0.15f;

		[Space(5f)]
		[Header("Spawn Timer for initial dive")]
		public float minSpawnTimer = 0.005f;

		public float maxSpawnTimer = 0.03f;

		[Space(5f)]
		[Header("Spawn Timer for long dive")]
		public float minSpawnTimerL = 0.1f;

		public float maxSpawnTimerL = 0.5f;
	}
}
[AddComponentMenu("AQUAS/Reflection")]
[ExecuteInEditMode]
public class AQUAS_Reflection : MonoBehaviour
{
	public bool m_DisablePixelLights = true;

	public int m_TextureSize = 256;

	public float m_ClipPlaneOffset = 0.07f;

	public LayerMask m_ReflectLayers = LayerMask.op_Implicit(-1);

	public Hashtable m_ReflectionCameras = new Hashtable();

	public RenderTexture m_ReflectionTexture = null;

	public int m_OldReflectionTextureSize = 0;

	public static bool s_InsideRendering = false;

	public bool ignoreOcclusionCulling;

	public void OnWillRenderObject()
	{
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0254: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0287: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0301: Unknown result type (might be due to invalid IL or missing references)
		if (!((Behaviour)this).enabled || !Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>()) || !Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>().sharedMaterial) || !((Component)this).GetComponent<Renderer>().enabled)
		{
			return;
		}
		Camera current = Camera.current;
		if (!Object.op_Implicit((Object)(object)current) || s_InsideRendering)
		{
			return;
		}
		s_InsideRendering = true;
		CreateMirrorObjects(current, out var reflectionCamera);
		Vector3 position = ((Component)this).transform.position;
		Vector3 up = ((Component)this).transform.up;
		int pixelLightCount = QualitySettings.pixelLightCount;
		if (m_DisablePixelLights)
		{
			QualitySettings.pixelLightCount = 0;
		}
		UpdateCameraModes(current, reflectionCamera);
		float num = 0f - Vector3.Dot(up, position) - m_ClipPlaneOffset;
		Vector4 plane = default(Vector4);
		((Vector4)(ref plane))..ctor(up.x, up.y, up.z, num);
		if (ignoreOcclusionCulling)
		{
			reflectionCamera.useOcclusionCulling = false;
		}
		else
		{
			reflectionCamera.useOcclusionCulling = true;
		}
		Matrix4x4 reflectionMat = Matrix4x4.zero;
		CalculateReflectionMatrix(ref reflectionMat, plane);
		Vector3 position2 = ((Component)current).transform.position;
		Vector3 position3 = ((Matrix4x4)(ref reflectionMat)).MultiplyPoint(position2);
		reflectionCamera.worldToCameraMatrix = current.worldToCameraMatrix * reflectionMat;
		Vector4 clipPlane = CameraSpacePlane(reflectionCamera, position, up, 1f);
		Matrix4x4 projection = current.projectionMatrix;
		CalculateObliqueMatrix(ref projection, clipPlane);
		reflectionCamera.projectionMatrix = projection;
		reflectionCamera.cullingMask = -17 & ((LayerMask)(ref m_ReflectLayers)).value;
		reflectionCamera.targetTexture = m_ReflectionTexture;
		GL.invertCulling = true;
		((Component)reflectionCamera).transform.position = position3;
		Vector3 eulerAngles = ((Component)current).transform.eulerAngles;
		((Component)reflectionCamera).transform.eulerAngles = new Vector3(eulerAngles.x * -1f, eulerAngles.y, 0f);
		reflectionCamera.Render();
		((Component)reflectionCamera).transform.position = position2;
		GL.invertCulling = false;
		Material[] sharedMaterials = ((Component)this).GetComponent<Renderer>().sharedMaterials;
		Material[] array = sharedMaterials;
		foreach (Material val in array)
		{
			if (val.HasProperty("_ReflectionTex"))
			{
				val.SetTexture("_ReflectionTex", (Texture)(object)m_ReflectionTexture);
			}
		}
		Matrix4x4 val2 = Matrix4x4.TRS(new Vector3(0.5f, 0.5f, 0.5f), Quaternion.identity, new Vector3(0.5f, 0.5f, 0.5f));
		Vector3 lossyScale = ((Component)this).transform.lossyScale;
		Matrix4x4 val3 = ((Component)this).transform.localToWorldMatrix * Matrix4x4.Scale(new Vector3(1f / lossyScale.x, 1f / lossyScale.y, 1f / lossyScale.z));
		val3 = val2 * current.projectionMatrix * current.worldToCameraMatrix * val3;
		Material[] array2 = sharedMaterials;
		foreach (Material val4 in array2)
		{
			val4.SetMatrix("_ProjMatrix", val3);
		}
		if (m_DisablePixelLights)
		{
			QualitySettings.pixelLightCount = pixelLightCount;
		}
		s_InsideRendering = false;
	}

	private void OnDisable()
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)m_ReflectionTexture))
		{
			Object.DestroyImmediate((Object)(object)m_ReflectionTexture);
			m_ReflectionTexture = null;
		}
		foreach (DictionaryEntry reflectionCamera in m_ReflectionCameras)
		{
			Object.DestroyImmediate((Object)(object)((Component)(Camera)reflectionCamera.Value).gameObject);
		}
		m_ReflectionCameras.Clear();
	}

	public void UpdateCameraModes(Camera src, Camera dest)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Invalid comparison between Unknown and I4
		if ((Object)(object)dest == (Object)null)
		{
			return;
		}
		dest.clearFlags = src.clearFlags;
		dest.backgroundColor = src.backgroundColor;
		if ((int)src.clearFlags == 1)
		{
			Component component = ((Component)src).GetComponent(typeof(Skybox));
			Skybox val = (Skybox)(object)((component is Skybox) ? component : null);
			Component component2 = ((Component)dest).GetComponent(typeof(Skybox));
			Skybox val2 = (Skybox)(object)((component2 is Skybox) ? component2 : null);
			if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.material))
			{
				((Behaviour)val2).enabled = false;
			}
			else
			{
				((Behaviour)val2).enabled = true;
				val2.material = val.material;
			}
		}
		dest.farClipPlane = src.farClipPlane;
		dest.nearClipPlane = src.nearClipPlane;
		dest.orthographic = src.orthographic;
		dest.fieldOfView = src.fieldOfView;
		dest.aspect = src.aspect;
		dest.orthographicSize = src.orthographicSize;
	}

	public void CreateMirrorObjects(Camera currentCamera, out Camera reflectionCamera)
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Expected O, but got Unknown
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Expected O, but got Unknown
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		reflectionCamera = null;
		if (!Object.op_Implicit((Object)(object)m_ReflectionTexture) || m_OldReflectionTextureSize != m_TextureSize)
		{
			if (Object.op_Implicit((Object)(object)m_ReflectionTexture))
			{
				Object.DestroyImmediate((Object)(object)m_ReflectionTexture);
			}
			m_ReflectionTexture = new RenderTexture(m_TextureSize, m_TextureSize, 16);
			((Object)m_ReflectionTexture).name = "__MirrorReflection" + ((Object)this).GetInstanceID();
			m_ReflectionTexture.isPowerOfTwo = true;
			((Object)m_ReflectionTexture).hideFlags = (HideFlags)52;
			m_OldReflectionTextureSize = m_TextureSize;
		}
		object? obj = m_ReflectionCameras[currentCamera];
		reflectionCamera = (Camera)((obj is Camera) ? obj : null);
		if (!Object.op_Implicit((Object)(object)reflectionCamera))
		{
			GameObject val = new GameObject("Mirror Refl Camera id" + ((Object)this).GetInstanceID() + " for " + ((Object)currentCamera).GetInstanceID(), new Type[2]
			{
				typeof(Camera),
				typeof(Skybox)
			});
			reflectionCamera = val.GetComponent<Camera>();
			((Behaviour)reflectionCamera).enabled = false;
			((Component)reflectionCamera).transform.position = ((Component)this).transform.position;
			((Component)reflectionCamera).transform.rotation = ((Component)this).transform.rotation;
			((Component)reflectionCamera).gameObject.AddComponent<FlareLayer>();
			((Object)val).hideFlags = (HideFlags)61;
			m_ReflectionCameras[currentCamera] = reflectionCamera;
		}
	}

	public static float sgn(float a)
	{
		if (a > 0f)
		{
			return 1f;
		}
		if (a < 0f)
		{
			return -1f;
		}
		return 0f;
	}

	public Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = pos + normal * m_ClipPlaneOffset;
		Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix;
		Vector3 val2 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyPoint(val);
		Vector3 val3 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyVector(normal);
		Vector3 val4 = ((Vector3)(ref val3)).normalized * sideSign;
		return new Vector4(val4.x, val4.y, val4.z, 0f - Vector3.Dot(val2, val4));
	}

	public static void CalculateObliqueMatrix(ref Matrix4x4 projection, Vector4 clipPlane)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		Vector4 val = ((Matrix4x4)(ref projection)).inverse * new Vector4(sgn(clipPlane.x), sgn(clipPlane.y), 1f, 1f);
		Vector4 val2 = clipPlane * (2f / Vector4.Dot(clipPlane, val));
		((Matrix4x4)(ref projection))[2] = val2.x - ((Matrix4x4)(ref projection))[3];
		((Matrix4x4)(ref projection))[6] = val2.y - ((Matrix4x4)(ref projection))[7];
		((Matrix4x4)(ref projection))[10] = val2.z - ((Matrix4x4)(ref projection))[11];
		((Matrix4x4)(ref projection))[14] = val2.w - ((Matrix4x4)(ref projection))[15];
	}

	public static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane)
	{
		reflectionMat.m00 = 1f - 2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[0];
		reflectionMat.m01 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[1];
		reflectionMat.m02 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[2];
		reflectionMat.m03 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[0];
		reflectionMat.m10 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[0];
		reflectionMat.m11 = 1f - 2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[1];
		reflectionMat.m12 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[2];
		reflectionMat.m13 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[1];
		reflectionMat.m20 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[0];
		reflectionMat.m21 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[1];
		reflectionMat.m22 = 1f - 2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[2];
		reflectionMat.m23 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[2];
		reflectionMat.m30 = 0f;
		reflectionMat.m31 = 0f;
		reflectionMat.m32 = 0f;
		reflectionMat.m33 = 1f;
	}
}
[ExecuteInEditMode]
[AddComponentMenu("AQUAS/Render Queue Controller")]
public class AQUAS_RenderQueueEditor : MonoBehaviour
{
	public int renderQueueIndex = -1;

	private void Update()
	{
		((Component)this).gameObject.GetComponent<Renderer>().sharedMaterial.renderQueue = renderQueueIndex;
	}
}
namespace AQUAS
{
	public class AQUAS_Screenshotter : MonoBehaviour
	{
		[Header("This script is only for use in the Editor!")]
		[Header("Use F12 to Capture Screenshot")]
		public GameObject camera;

		public int sizeX = 1920;

		public int sizeY = 1080;

		public string folder = "Screenshots";

		public string name = "Screenshot";

		private void Start()
		{
		}

		private void Update()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)293))
			{
				RenderTexture val = new RenderTexture(sizeX, sizeY, 24);
				camera.GetComponent<Camera>().targetTexture = val;
				Texture2D val2 = new Texture2D(sizeX, sizeY, (TextureFormat)3, false);
				camera.GetComponent<Camera>().Render();
				RenderTexture.active = val;
				val2.ReadPixels(new Rect(0f, 0f, (float)sizeX, (float)sizeY), 0, 0);
				camera.GetComponent<Camera>().targetTexture = null;
				RenderTexture.active = null;
				Object.DestroyImmediate((Object)(object)val);
				byte[] bytes = val2.EncodeToJPG();
				string path = string.Format("{0}/{1}/{2}_{3}.jpg", Application.dataPath, folder, name, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
				if (!Directory.Exists($"{Application.dataPath}/{folder}"))
				{
					Directory.CreateDirectory($"{Application.dataPath}/{folder}");
				}
				File.WriteAllBytes(path, bytes);
				AssetDatabase.Refresh();
				Debug.Log((object)"Screenshot taken!");
			}
		}
	}
}
public class AQUAS_SmallBubbleBehaviour : MonoBehaviour
{
	public float averageUpdrift;

	public float waterLevel;

	public GameObject mainCamera;

	private float updriftFactor;

	private void Start()
	{
		updriftFactor = Random.Range((0f - averageUpdrift) * 0.75f, averageUpdrift * 0.75f);
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(Vector3.up * Time.deltaTime * (averageUpdrift + updriftFactor), (Space)0);
		if (mainCamera.transform.position.y > waterLevel || ((Component)this).transform.position.y > waterLevel)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
namespace AQUAS
{
	public class AQUAS_Walk : MonoBehaviour
	{
		public float m_moveSpeed = 10f;

		public CharacterController m_controller;

		private void Start()
		{
			if ((Object)(object)m_controller == (Object)null)
			{
				m_controller = ((Component)this).GetComponent<CharacterController>();
			}
		}

		private void Update()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)m_controller != (Object)null && ((Collider)m_controller).enabled)
			{
				Vector3 val = Input.GetAxis("Vertical") * ((Component)this).transform.TransformDirection(Vector3.forward) * m_moveSpeed;
				m_controller.Move(val * Time.deltaTime);
				Vector3 val2 = Input.GetAxis("Horizontal") * ((Component)this).transform.TransformDirection(Vector3.right) * m_moveSpeed;
				m_controller.Move(val2 * Time.deltaTime);
				m_controller.SimpleMove(Physics.gravity);
			}
		}
	}
}
namespace JerryComponent
{
	public class SosigCarrierV5 : MonoBehaviour
	{
		public SphereCollider col;

		public int length = 0;

		public Rigidbody rigid;

		public GameObject hingeDoor;

		public GameObject hingeToggle;

		public List<SosigLink> torso;

		public GameObject[] fakeSosig;

		public Transform enterPoint;

		public Transform[] poses;

		public SosigWeapon[] sosigW1;

		public SosigWeapon[] sosigW2;

		public SosigWeapon[] sosigW3;

		public SosigWeapon[] sosigW4;

		[Header("Spawn Options")]
		[Header("Sosig Options")]
		public SosigEnemyID SosigType;

		public int IFF;

		public bool SpawnActive;

		public SosigOrder SpawnState;

		private void OnTriggerEnter(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == "Sosig_Torso" && ((Component)other).gameObject.GetComponent<SosigLink>().S.E.IFFCode == GM.CurrentPlayerBody.m_playerIFF)
			{
				if (torso.Count < 8)
				{
					torso.Add(((Component)other).gameObject.GetComponent<SosigLink>());
				}
				if (torso.Count < 8)
				{
				}
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == "Sosig_Torso" && ((Component)other).gameObject.GetComponent<SosigLink>().S.E.IFFCode == GM.CurrentPlayerBody.m_playerIFF)
			{
				if (torso.Count >= 0)
				{
					torso.Remove(((Component)other).gameObject.GetComponent<SosigLink>());
				}
				if (torso.Count >= 0)
				{
				}
			}
		}

		private void Update()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0616: Unknown result type (might be due to invalid IL or missing references)
			//IL_061c: Invalid comparison between Unknown and I4
			if (length > 8)
			{
				length = 8;
			}
			if (length < 0)
			{
				length = 0;
			}
			if (hingeDoor.transform.localEulerAngles.x < 45f)
			{
				col.radius = 0.001f;
			}
			if (!(hingeDoor.transform.localEulerAngles.x > 45f))
			{
				return;
			}
			if (hingeToggle.transform.localEulerAngles.x < 45f)
			{
				col.radius = 5f;
				length = torso.Count;
				for (int i = 0; i < torso.Count; i++)
				{
					torso[i].S.BodyState = (SosigBodyState)0;
					torso[i].S.SetCurrentOrder((SosigOrder)7);
					torso[i].S.SetMovementSpeed((SosigMoveSpeed)4);
					torso[i].S.MoveSpeed = (SosigMoveSpeed)4;
					torso[i].S.SetAssaultSpeed((SosigMoveSpeed)4);
					torso[i].S.SetGuardInvestigateDistanceThreshold(0f);
					torso[i].S.CoverSearchRange = 0f;
					torso[i].S.m_assaultPoint = enterPoint.position;
					((Behaviour)torso[i].S.Agent).enabled = true;
					if (Vector3.Distance(((Component)torso[i].S).transform.position, enterPoint.position) < 2f)
					{
						sosigW1[i] = torso[i].S.Hand_Primary.HeldObject;
						sosigW2[i] = torso[i].S.Hand_Secondary.HeldObject;
						sosigW3[i] = torso[i].S.Inventory.Slots[0].HeldObject;
						sosigW4[i] = torso[i].S.Inventory.Slots[1].HeldObject;
						if ((Object)(object)sosigW1[i] == (Object)null)
						{
						}
						if ((Object)(object)sosigW2[i] == (Object)null)
						{
						}
						if ((Object)(object)sosigW3[i] == (Object)null)
						{
						}
						if ((Object)(object)sosigW4[i] == (Object)null)
						{
						}
						if ((Object)(object)sosigW1[i] != (Object)null)
						{
							((Component)sosigW1[i]).gameObject.transform.parent = ((Component)enterPoint).transform;
							((Component)sosigW1[i]).gameObject.SetActive(false);
						}
						if ((Object)(object)sosigW2[i] != (Object)null)
						{
							((Component)sosigW2[i]).gameObject.transform.parent = ((Component)enterPoint).transform;
							((Component)sosigW2[i]).gameObject.SetActive(false);
						}
						if ((Object)(object)sosigW3[i] != (Object)null)
						{
							((Component)sosigW3[i]).gameObject.transform.parent = ((Component)enterPoint).transform;
							((Component)sosigW3[i]).gameObject.SetActive(false);
						}
						if ((Object)(object)sosigW4[i] != (Object)null)
						{
							((Component)sosigW4[i]).gameObject.transform.parent = ((Component)enterPoint).transform;
							((Component)sosigW4[i]).gameObject.SetActive(false);
						}
						((Component)torso[i].S).gameObject.transform.parent = ((Component)enterPoint).transform;
						((Component)torso[i].S.Links[0]).gameObject.transform.parent = ((Component)enterPoint).transform;
						((Component)torso[i].S.Links[1]).gameObject.transform.parent = ((Component)enterPoint).transform;
						((Component)torso[i].S.Links[2]).gameObject.transform.parent = ((Component)enterPoint).transform;
						((Component)torso[i].S.Links[3]).gameObject.transform.parent = ((Component)enterPoint).transform;
						((Component)torso[i].S).gameObject.SetActive(false);
						((Component)torso[i].S.Links[0]).gameObject.SetActive(false);
						((Component)torso[i].S.Links[1]).gameObject.SetActive(false);
						((Component)torso[i].S.Links[2]).gameObject.SetActive(false);
						((Component)torso[i].S.Links[3]).gameObject.SetActive(false);
						((Behaviour)torso[i].S.Agent).enabled = false;
						fakeSosig[i].SetActive(true);
					}
					if ((Object)(object)torso[i] == (Object)null || (int)torso[i].S.BodyState == 3)
					{
						if (torso.Count >= 0)
						{
							torso.Remove(torso[i]);
							fakeSosig[i].SetActive(false);
						}
						if (torso.Count >= 0)
						{
						}
					}
				}
				((MonoBehaviour)this).CancelInvoke("Spawn");
			}
			if (hingeToggle.transform.localEulerAngles.x > 45f)
			{
				col.radius = 0.001f;
				if (length > 0)
				{
					((MonoBehaviour)this).InvokeRepeating("Spawn", 1f, 5f);
				}
				if (length <= 0)
				{
					((MonoBehaviour)this).CancelInvoke("Spawn");
				}
			}
		}

		public void Spawn()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			if (length < 0)
			{
				return;
			}
			SpawnOptions val = new SpawnOptions();
			val.SpawnActivated = SpawnActive;
			val.SpawnState = SpawnState;
			val.IFF = IFF;
			val.SpawnWithFullAmmo = true;
			val.EquipmentMode = (EquipmentSlots)7;
			val.SosigTargetPosition = ((Component)this).transform.position;
			val.SosigTargetRotation = ((Component)this).transform.eulerAngles;
			SpawnOptions val2 = val;
			SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[length]).transform.position, ((Component)poses[length]).transform.rotation);
			length--;
			if ((Object)(object)torso[length] != (Object)null)
			{
				if ((Object)(object)sosigW1[length] != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)sosigW1[length]).gameObject);
				}
				if ((Object)(object)sosigW2[length] != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)sosigW2[length]).gameObject);
				}
				if ((Object)(object)sosigW3[length] != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)sosigW3[length]).gameObject);
				}
				if ((Object)(object)sosigW4[length] != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)sosigW4[length]).gameObject);
				}
				if ((Object)(object)sosigW1[length] == (Object)null)
				{
				}
				if ((Object)(object)sosigW2[length] == (Object)null)
				{
				}
				if ((Object)(object)sosigW3[length] == (Object)null)
				{
				}
				if ((Object)(object)sosigW4[length] == (Object)null)
				{
				}
				Object.Destroy((Object)(object)((Component)torso[length].S.Links[0]).gameObject);
				Object.Destroy((Object)(object)((Component)torso[length].S.Links[1]).gameObject);
				Object.Destroy((Object)(object)((Component)torso[length].S.Links[2]).gameObject);
				Object.Destroy((Object)(object)((Component)torso[length].S.Links[3]).gameObject);
				Object.Destroy((Object)(object)torso[length]);
			}
			torso.Remove(torso[length]);
			fakeSosig[length].SetActive(false);
		}

		private void OnDrawGizmos()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			Gizmos.color = new Color(0.8f, 0.2f, 0.2f, 0.5f);
			Gizmos.DrawSphere(((Component)enterPoint).transform.position, 0.1f);
			Gizmos.DrawLine(((Component)enterPoint).transform.position, ((Component)enterPoint).transform.position + ((Component)enterPoint).transform.forward * 0.25f);
		}
	}
	public class SosigSpawnActive : MonoBehaviour
	{
		public Transform[] poses;

		[Header("Spawn Options")]
		[Header("Sosig Options")]
		public SosigEnemyID SosigType;

		public int IFF;

		public bool SpawnActive;

		public SosigOrder SpawnState;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((Component)other).gameObject).name == "CarrierStuff")
			{
				SpawnOptions val = new SpawnOptions();
				val.SpawnActivated = SpawnActive;
				val.SpawnState = SpawnState;
				val.IFF = IFF;
				val.SpawnWithFullAmmo = true;
				val.EquipmentMode = (EquipmentSlots)7;
				val.SosigTargetPosition = ((Component)this).transform.position;
				val.SosigTargetRotation = ((Component)this).transform.eulerAngles;
				SpawnOptions val2 = val;
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[0]).transform.position, ((Component)poses[0]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[1]).transform.position, ((Component)poses[1]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[2]).transform.position, ((Component)poses[2]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[3]).transform.position, ((Component)poses[3]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[4]).transform.position, ((Component)poses[4]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[5]).transform.position, ((Component)poses[5]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[6]).transform.position, ((Component)poses[6]).transform.rotation);
				SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType], val2, ((Component)poses[7]).transform.position, ((Component)poses[7]).transform.rotation);
			}
		}

		private void Update()
		{
		}
	}
	public class SpawnVehicles : MonoBehaviour
	{
		public GameObject helitoggle;

		public GameObject humveetoggle;

		public FVRObject heli;

		public FVRObject humv;

		public GameObject heliPrefab;

		public GameObject humveePrefab;

		public Transform helispawn;

		public Transform humvspawn;

		public bool isheli = false;

		public bool ishumvee = false;

		private void Update()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)humveePrefab == (Object)null || (Object)(object)heliPrefab == (Object)null)
			{
			}
			if (helitoggle.transform.localEulerAngles.x > 45f && !isheli)
			{
				heliPrefab = Object.Instantiate<GameObject>(((AnvilAsset)heli).GetGameObject(), helispawn.position + Vector3.up * 0.2f, helispawn.rotation);
				isheli = true;
			}
			if (helitoggle.transform.localEulerAngles.x < 45f && isheli)
			{
				Object.Destroy((Object)(object)heliPrefab);
				isheli = false;
			}
			if (humveetoggle.transform.localEulerAngles.x > 45f && !ishumvee)
			{
				Object.Instantiate<GameObject>(((AnvilAsset)humv).GetGameObject(), humvspawn.position + Vector3.up * 0.2f, humvspawn.rotation);
				ishumvee = true;
			}
			if (humveetoggle.transform.localEulerAngles.x < 45f && ishumvee)
			{
				Object.Destroy((Object)(object)humveePrefab);
				ishumvee = false;
			}
		}
	}
	public class DoorHingeDamagable : MonoBehaviour, IFVRDamageable
	{
		public bool oofImDead = false;

		public float MinDamageRequired = 100f;

		public float MaxDamageRequired = 200f;

		private float _damageRequired;

		private float _damageReceived;

		private void Start()
		{
			_damageRequired = Random.Range(MinDamageRequired, MaxDamageRequired);
		}

		public void Damage(Damage dam)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			if ((int)dam.Class == 1 || (int)dam.Class == 2)
			{
				Vector3 val = dam.point + dam.hitNormal * Random.Range(0.002f, 0.008f);
				_damageReceived += dam.Dam_Blunt;
				if (_damageReceived >= _damageRequired)
				{
					oofImDead = true;
				}
			}
		}
	}
	public class DoorScript : MonoBehaviour
	{
		public GameObject dooritself;

		public DoorHingeDamagable hingeupper;

		public DoorHingeDamagable hingelower;

		public DoorHingeDamagable hingelock;

		public GameObject doorhandle;

		public HingeJoint jointhandle;

		public HingeJoint jointDoor;

		public JointLimits open;

		public JointLimits close;

		private void Start()
		{
			((JointLimits)(ref open)).min = 0f;
			((JointLimits)(ref open)).max = 180f;
			((JointLimits)(ref close)).min = 0f;
			((JointLimits)(ref close)).max = 0f;
		}

		private void Update()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)jointDoor == (Object)null)
			{
			}
			if (((Object)(object)jointDoor != (Object)null && !hingeupper.oofImDead) || !hingelower.oofImDead)
			{
				if (!hingelock.oofImDead)
				{
					if (doorhandle.transform.localEulerAngles.y > 20f)
					{
						jointDoor.limits = open;
					}
					else if (doorhandle.transform.localEulerAngles.y < 20f)
					{
						if (dooritself.transform.localEulerAngles.z > 2.5f)
						{
							jointDoor.limits = open;
						}
						else
						{
							jointDoor.limits = close;
						}
					}
				}
				else
				{
					jointhandle.useMotor = false;
					jointDoor.limits = open;
				}
			}
			else if ((Object)(object)jointDoor != (Object)null && hingeupper.oofImDead && hingelower.oofImDead)
			{
				((Joint)jointDoor).breakForce = 0f;
				((Joint)jointDoor).breakTorque = 0f;
			}
		}
	}
	public class Catapult : MonoBehaviour
	{
		public GameObject catbarbase;

		private Vector3 velocity = Vector3.zero;

		public GameObject catapultconnectpoint;

		public GameObject catapultbolt;

		public GameObject catbar;

		public Rigidbody rb;

		public GameObject launchrdy;

		public Transform front;

		public Transform rear;

		public bool oncat = false;

		public float countdown = 5f;

		public bool addforce = false;

		public float forcevalue;

		public string tomcatID;

		private void OnTriggerEnter(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == tomcatID)
			{
				oncat = true;
				addforce = true;
				catbar = ((Component)other).gameObject;
				rb = catbar.GetComponent<Rigidbody>();
			}
		}

		private void Update()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			catbarbase.transform.position = Vector3.SmoothDamp(catbarbase.transform.position, catapultconnectpoint.transform.position, ref velocity, 0.5f, 5000f);
			if ((Object)(object)catbar == (Object)null || (Object)(object)rb == (Object)null)
			{
			}
			if (oncat && (Object)(object)catbar != (Object)null && (Object)(object)rb != (Object)null)
			{
				launchrdy.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				catbar.transform.position = catbarbase.transform.position;
				catbar.transform.eulerAngles = catbarbase.transform.eulerAngles;
				if (countdown >= 0f)
				{
					countdown -= 1f * Time.deltaTime;
				}
				if (countdown < 0f)
				{
					catapultbolt.transform.position = Vector3.MoveTowards(catapultbolt.transform.position, front.position, 50f * Time.deltaTime);
					countdown = 0f;
				}
			}
			if (!oncat)
			{
				countdown = 5f;
				catapultbolt.transform.position = Vector3.MoveTowards(catapultbolt.transform.position, rear.position, 10f * Time.deltaTime);
			}
			if (catapultbolt.transform.localPosition.z > 100f)
			{
				launchrdy.transform.localEulerAngles = new Vector3(0f, 75f, 0f);
				if (addforce)
				{
					rb.AddForce(0f, 0f, forcevalue);
					addforce = false;
				}
				oncat = false;
			}
		}
	}
}
namespace Packer
{
	[RequireComponent(typeof(BoxCollider))]
	public class ItemCatcher : MonoBehaviour
	{
		[Header("Respawn Location")]
		[Tooltip("If empty objects will be attemped to respawn ontop of where they dropped, else they'll respawn at this transform")]
		public Transform respawnLocation;

		[Header("Respawn Ontop")]
		public float castYHeight = 200f;

		public float castFloor = 0f;

		public float respawnOffset = 0.25f;

		private void Start()
		{
		}

		public void RespawnPlayer()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			FVRMovementManager currentMovementManager = GM.CurrentMovementManager;
			Vector3 position = respawnLocation.position;
			Quaternion rotation = respawnLocation.rotation;
			currentMovementManager.TeleportToPoint(position, true, ((Quaternion)(ref rotation)).eulerAngles);
		}

		private void OnCollisionEnter(Collision collision)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (