Decompiled source of gm Construct v1.3.2

gm_Construct.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
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.RegularExpressions;
using System.Threading;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using JerryComponent;
using JerryLegsIK;
using LuxWater;
using Plawius;
using RootMotion;
using RootMotion.FinalIK;
using RootMotion1.FinalIK;
using SimplestarGame.Mesh;
using SimplestarGame.Splash;
using SimplestarGame.Wave;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;
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);
			}
		}
	}
}
public class FreeCamera : MonoBehaviour
{
	public float thetaSpeed = 250f;

	public float phiSpeed = 120f;

	public float moveSpeed = 10f;

	public float zoomSpeed = 30f;

	public float phiBoundMin = -89f;

	public float phiBoundMax = 89f;

	public bool useMoveBounds = true;

	public float moveBounds = 100f;

	public float rotateSmoothing = 0.5f;

	public float moveSmoothing = 0.7f;

	public float distance = 2f;

	private Vector2 euler;

	private Quaternion targetRot;

	private Vector3 targetLookAt;

	private float targetDist;

	private Vector3 distanceVec = new Vector3(0f, 0f, 0f);

	private Transform target;

	private Rect inputBounds;

	public Rect paramInputBounds = new Rect(0f, 0f, 1f, 1f);

	public bool usePivotPoint = true;

	public Vector3 pivotPoint = new Vector3(0f, 2f, 0f);

	public Transform pivotTransform = null;

	public void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: 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_0068: Expected O, but got Unknown
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: 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_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		Vector3 eulerAngles = ((Component)this).transform.eulerAngles;
		euler.x = eulerAngles.y;
		euler.y = eulerAngles.x;
		euler.y = Mathf.Repeat(euler.y + 180f, 360f) - 180f;
		GameObject val = new GameObject("_FreeCameraTarget");
		((Object)val).hideFlags = (HideFlags)63;
		target = val.transform;
		if (usePivotPoint)
		{
			target.position = pivotPoint;
			Vector3 val2 = ((Component)this).transform.position - target.position;
			targetDist = ((Vector3)(ref val2)).magnitude;
		}
		else if ((Object)(object)pivotTransform != (Object)null)
		{
			usePivotPoint = true;
			Matrix4x4 worldToLocalMatrix = ((Component)this).transform.worldToLocalMatrix;
			Vector3 val3 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(pivotTransform.position);
			val3.x = 0f;
			val3.y = 0f;
			targetDist = val3.z;
			Transform obj = target;
			Matrix4x4 localToWorldMatrix = ((Component)this).transform.localToWorldMatrix;
			obj.position = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(val3);
		}
		else
		{
			target.position = ((Component)this).transform.position + ((Component)this).transform.forward * distance;
			targetDist = distance;
		}
		targetRot = ((Component)this).transform.rotation;
		targetLookAt = target.position;
	}

	public void Update()
	{
		//IL_00a3: 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_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: 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_0360: Unknown result type (might be due to invalid IL or missing references)
		//IL_0365: Unknown result type (might be due to invalid IL or missing references)
		((Rect)(ref inputBounds)).x = (float)((Component)this).GetComponent<Camera>().pixelWidth * ((Rect)(ref paramInputBounds)).x;
		((Rect)(ref inputBounds)).y = (float)((Component)this).GetComponent<Camera>().pixelHeight * ((Rect)(ref paramInputBounds)).y;
		((Rect)(ref inputBounds)).width = (float)((Component)this).GetComponent<Camera>().pixelWidth * ((Rect)(ref paramInputBounds)).width;
		((Rect)(ref inputBounds)).height = (float)((Component)this).GetComponent<Camera>().pixelHeight * ((Rect)(ref paramInputBounds)).height;
		if (!Object.op_Implicit((Object)(object)target) || !((Rect)(ref inputBounds)).Contains(Input.mousePosition))
		{
			return;
		}
		float axis = Input.GetAxis("Mouse X");
		float axis2 = Input.GetAxis("Mouse Y");
		bool flag = Input.GetMouseButton(0) || Input.touchCount == 1;
		bool flag2 = Input.GetMouseButton(1) || Input.touchCount == 2;
		bool flag3 = Input.GetMouseButton(2) || Input.touchCount == 3;
		bool flag4 = Input.touchCount >= 4;
		bool flag5 = flag;
		bool flag6 = flag4 || (flag && (Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303)));
		bool flag7 = flag3 || (flag && (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305)));
		bool flag8 = flag2;
		if (!flag6)
		{
			if (flag7)
			{
				axis = axis * moveSpeed * 0.005f * targetDist;
				axis2 = axis2 * moveSpeed * 0.005f * targetDist;
				targetLookAt -= ((Component)this).transform.up * axis2 + ((Component)this).transform.right * axis;
				if (useMoveBounds)
				{
					targetLookAt.x = Mathf.Clamp(targetLookAt.x, 0f - moveBounds, moveBounds);
					targetLookAt.y = Mathf.Clamp(targetLookAt.y, 0f - moveBounds, moveBounds);
					targetLookAt.z = Mathf.Clamp(targetLookAt.z, 0f - moveBounds, moveBounds);
				}
			}
			else if (flag8)
			{
				axis2 = axis2 * zoomSpeed * 0.005f * targetDist;
				targetDist += axis2;
				targetDist = Mathf.Max(0.1f, targetDist);
			}
			else if (flag5)
			{
				axis = axis * thetaSpeed * 0.02f;
				axis2 = axis2 * phiSpeed * 0.02f;
				ref Vector2 reference = ref euler;
				reference.x += axis;
				ref Vector2 reference2 = ref euler;
				reference2.y -= axis2;
				euler.y = ClampAngle(euler.y, phiBoundMin, phiBoundMax);
				targetRot = Quaternion.Euler(euler.y, euler.x, 0f);
			}
		}
		targetDist -= Input.GetAxis("Mouse ScrollWheel") * zoomSpeed * 0.5f;
		targetDist = Mathf.Max(0.1f, targetDist);
	}

	public void FixedUpdate()
	{
		//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_0045: 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_0061: 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_0093: 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_00a4: 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)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		distance = moveSmoothing * targetDist + (1f - moveSmoothing) * distance;
		((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, targetRot, rotateSmoothing);
		target.position = Vector3.Lerp(target.position, targetLookAt, moveSmoothing);
		distanceVec.z = distance;
		((Component)this).transform.position = target.position - ((Component)this).transform.rotation * distanceVec;
	}

	private static float ClampAngle(float angle, float min, float max)
	{
		if (angle < -360f)
		{
			angle += 360f;
		}
		if (angle > 360f)
		{
			angle -= 360f;
		}
		return Mathf.Clamp(angle, min, max);
	}
}
namespace JerryHands
{
	public class AngryNoob_FingerTracking : MonoBehaviour
	{
		[Header("第24次测试")]
		[Tooltip("请添加五根手指最靠近手腕位置的骨骼,请按照<Thumb - Index - Middle - Ring - Pinky>的顺序添加骨骼位置")]
		public Transform[] _fingers;

		[Tooltip("请添加五根手指的指尖顺序与 'Fingers' 相同 如果没有 请再指尖位置创建一个空物体.")]
		public Transform[] _fingerTips;

		[Space]
		[Tooltip("是否为左手")]
		public bool _LeftHand;

		public bool _handGrap;

		[Space]
		[Tooltip("不要手动添加下面的信息")]
		public List<Vector3[]> _fingers_Origin_V = new List<Vector3[]>();

		public List<Quaternion[]> _finger_Origin_Q = new List<Quaternion[]>();

		public List<Transform[]> _fingerJ = new List<Transform[]>();

		public List<Vector3[]> _finger_Target_V = new List<Vector3[]>();

		public List<Quaternion[]> _finger_Target_Q = new List<Quaternion[]>();

		public List<Transform[]> _finger_Target_J = new List<Transform[]>();

		[Space]
		[Header("测试使用")]
		[Range(0f, 1f)]
		public float _finger_1;

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

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

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

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

		[SerializeField]
		[HideInInspector]
		public Vector3[] index_OV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] index_TV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] middle_OV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] middle_TV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] ring_OV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] ring_TV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] pinky_OV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] pinky_TV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] thumb_OV;

		[SerializeField]
		[HideInInspector]
		public Vector3[] thumb_TV;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] index_OQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] index_TQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] middle_OQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] middle_TQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] ring_OQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] ring_TQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] pinky_OQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] pinky_TQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] thumb_OQ;

		[SerializeField]
		[HideInInspector]
		public Quaternion[] thumb_TQ;

		[SerializeField]
		[HideInInspector]
		public Transform[] index_FJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] index_TFJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] middle_FJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] middle_TFJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] ring_FJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] ring_TFJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] pinky_FJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] pinky_TFJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] thumb_FJ;

		[SerializeField]
		[HideInInspector]
		public Transform[] thumb_TFJ;

		private FVRViveHand _hand_FVRVH;

		private static int recursiveJudg;

		private static int recursiveJudg_CloseHand;

		private int index_C = 0;

		private int _close_fingerArray = 0;

		private int index = 0;

		private int fingerArray = 0;

		private void Awake()
		{
			Finger_Load();
		}

		private void Start()
		{
			if (_LeftHand)
			{
				_hand_FVRVH = ((Component)((Component)Object.FindObjectOfType<FVRPlayerBody>()).transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
				MonoBehaviour.print((object)((Object)((Component)_hand_FVRVH).gameObject).name);
			}
			else
			{
				_hand_FVRVH = ((Component)((Component)Object.FindObjectOfType<FVRPlayerBody>()).transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
				MonoBehaviour.print((object)((Object)((Component)_hand_FVRVH).gameObject).name);
			}
			_hand_FVRVH.Display_Controller_Quest2.SetActive(false);
			_hand_FVRVH.Display_Controller_RiftS.SetActive(false);
			_hand_FVRVH.Display_Controller_HPR2.SetActive(false);
			_hand_FVRVH.Display_Controller_Cosmos.SetActive(false);
			_hand_FVRVH.Display_Controller_Vive.SetActive(false);
			_hand_FVRVH.Display_Controller_Touch.SetActive(false);
			_hand_FVRVH.Display_Controller_Index.SetActive(false);
			_hand_FVRVH.Display_Controller_WMR.SetActive(false);
		}

		private void LateUpdate()
		{
			FingerTracking_Index();
			if (_hand_FVRVH.Display_Controller_Vive.activeSelf || _hand_FVRVH.Display_Controller_Touch.activeSelf || _hand_FVRVH.Display_Controller_Index.activeSelf || _hand_FVRVH.Display_Controller_WMR.activeSelf)
			{
				_hand_FVRVH.Display_Controller_Vive.SetActive(false);
				_hand_FVRVH.Display_Controller_Touch.SetActive(false);
				_hand_FVRVH.Display_Controller_Index.SetActive(false);
				_hand_FVRVH.Display_Controller_WMR.SetActive(false);
			}
		}

		private void FingerTracking_Index()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Invalid comparison between Unknown and I4
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_0102: 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_018b: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: 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_026f: 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_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: 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_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: 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_062b: 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_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cda: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0708: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e96: 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_0786: Unknown result type (might be due to invalid IL or missing references)
			//IL_079b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07df: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_085d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_089e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b16: Unknown result type (might be due to invalid IL or missing references)
			//IL_09af: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_hand_FVRVH != (Object)null && !_handGrap && (int)_hand_FVRVH.CMode == 3)
			{
				if (_hand_FVRVH.Input.FingerCurl_Index >= 0.005f)
				{
					for (int i = 0; i < _fingerJ[0].Length; i++)
					{
						_fingerJ[0][i].localPosition = Vector3.Lerp(_fingers_Origin_V[0][i], _finger_Target_V[0][i], _hand_FVRVH.Input.FingerCurl_Index);
						_fingerJ[0][i].localRotation = Quaternion.Lerp(_finger_Origin_Q[0][i], _finger_Target_Q[0][i], _hand_FVRVH.Input.FingerCurl_Index);
					}
				}
				if (_hand_FVRVH.Input.FingerCurl_Middle >= 0.005f)
				{
					for (int j = 0; j < _fingerJ[1].Length; j++)
					{
						_fingerJ[1][j].localPosition = Vector3.Lerp(_fingers_Origin_V[1][j], _finger_Target_V[1][j], _hand_FVRVH.Input.FingerCurl_Middle);
						_fingerJ[1][j].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][j], _finger_Target_Q[1][j], _hand_FVRVH.Input.FingerCurl_Middle);
					}
				}
				if (_hand_FVRVH.Input.FingerCurl_Ring >= 0.005f)
				{
					for (int k = 0; k < _fingerJ[2].Length; k++)
					{
						_fingerJ[2][k].localPosition = Vector3.Lerp(_fingers_Origin_V[2][k], _finger_Target_V[2][k], _hand_FVRVH.Input.FingerCurl_Ring);
						_fingerJ[2][k].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][k], _finger_Target_Q[2][k], _hand_FVRVH.Input.FingerCurl_Ring);
					}
				}
				if (_hand_FVRVH.Input.FingerCurl_Pinky >= 0.005f)
				{
					for (int l = 0; l < _fingerJ[3].Length; l++)
					{
						_fingerJ[3][l].localPosition = Vector3.Lerp(_fingers_Origin_V[3][l], _finger_Target_V[3][l], _hand_FVRVH.Input.FingerCurl_Pinky);
						_fingerJ[3][l].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][l], _finger_Target_Q[3][l], _hand_FVRVH.Input.FingerCurl_Pinky);
					}
				}
				if (_hand_FVRVH.Input.FingerCurl_Thumb >= 0.005f)
				{
					for (int m = 0; m < _fingerJ[4].Length; m++)
					{
						_fingerJ[4][m].localPosition = Vector3.Lerp(_fingers_Origin_V[4][m], _finger_Target_V[4][m], _hand_FVRVH.Input.FingerCurl_Thumb);
						_fingerJ[4][m].localRotation = Quaternion.Lerp(_finger_Origin_Q[4][m], _finger_Target_Q[4][m], _hand_FVRVH.Input.FingerCurl_Thumb);
					}
				}
				return;
			}
			if ((Object)(object)_hand_FVRVH != (Object)null && !_handGrap && (int)_hand_FVRVH.CMode == 1)
			{
				float num = 0f;
				if (_hand_FVRVH.Input.TriggerFloat > 0.01f)
				{
					for (int n = 0; n < _fingerJ[0].Length; n++)
					{
						_fingerJ[0][n].localPosition = Vector3.Lerp(_fingers_Origin_V[0][n], _finger_Target_V[0][n], _hand_FVRVH.Input.TriggerFloat);
						_fingerJ[0][n].localRotation = Quaternion.Lerp(_finger_Origin_Q[0][n], _finger_Target_Q[0][n], _hand_FVRVH.Input.TriggerFloat);
					}
				}
				if (_hand_FVRVH.Input.GripPressed)
				{
					for (int num2 = 0; num2 < _fingerJ[1].Length; num2++)
					{
						_fingerJ[1][num2].localPosition = Vector3.Lerp(_fingers_Origin_V[1][num2], _finger_Target_V[1][num2], _hand_FVRVH.Grip_Squeeze.axis);
						_fingerJ[1][num2].localRotation = Quaternion.Lerp(_finger_Origin_Q[1][num2], _finger_Target_Q[1][num2], _hand_FVRVH.Grip_Squeeze.axis);
					}
					for (int num3 = 0; num3 < _fingerJ[2].Length; num3++)
					{
						_fingerJ[2][num3].localPosition = Vector3.Lerp(_fingers_Origin_V[2][num3], _finger_Target_V[2][num3], _hand_FVRVH.Grip_Squeeze.axis);
						_fingerJ[2][num3].localRotation = Quaternion.Lerp(_finger_Origin_Q[2][num3], _finger_Target_Q[2][num3], _hand_FVRVH.Grip_Squeeze.axis);
					}
					for (int num4 = 0; num4 < _fingerJ[3].Length; num4++)
					{
						_fingerJ[3][num4].localPosition = Vector3.Lerp(_fingers_Origin_V[3][num4], _finger_Target_V[3][num4], _hand_FVRVH.Grip_Squeeze.axis);
						_fingerJ[3][num4].localRotation = Quaternion.Lerp(_finger_Origin_Q[3][num4], _finger_Target_Q[3][num4], _hand_FVRVH.Grip_Squeeze.axis);
					}