Decompiled source of EFT Foods v1.8.0

EFT_Foods.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using ToxicGasFramework;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.PostProcessing;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[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]
namespace JerryComponent
{
	public class Scale16muzzle : MonoBehaviour
	{
		public Suppressor muzzledevice;

		public GameObject muzzleinterface;

		public bool scaled = false;

		public bool magscaled = false;

		public bool clipscaled = false;

		public FVRFireArm firearm;

		public Vector3 scaleoriginal;

		public Vector3 magscaleoriginal;

		public Vector3 clipscaleoriginal;

		public FVRPhysicalObjectSize size;

		private void Start()
		{
		}

		private void Update()
		{
			//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_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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)firearm == (Object)null || (Object)(object)((FVRFireArmAttachment)muzzledevice).curMount == (Object)null || (Object)(object)((FVRFireArmAttachment)muzzledevice).curMount.Parent == (Object)null || (Object)(object)firearm.Magazine == (Object)null || (Object)(object)firearm.Clip == (Object)null)
			{
			}
			if ((Object)(object)firearm != (Object)null && !scaled)
			{
				scaleoriginal = ((Component)firearm).gameObject.transform.localScale;
				size = ((FVRPhysicalObject)firearm).Size;
				scaled = true;
			}
			if ((Object)(object)firearm != (Object)null && !magscaled && (Object)(object)firearm.Magazine != (Object)null)
			{
				magscaleoriginal = ((Component)firearm.Magazine).gameObject.transform.localScale;
				magscaled = true;
			}
			if ((Object)(object)firearm != (Object)null && !clipscaled && (Object)(object)firearm.Clip != (Object)null)
			{
				clipscaleoriginal = ((Component)firearm.Clip).gameObject.transform.localScale;
				clipscaled = true;
			}
			if ((Object)(object)((FVRFireArmAttachment)muzzledevice).curMount != (Object)null && ((FVRFireArmAttachment)muzzledevice).curMount.AttachmentsList.Count > 0)
			{
				firearm = ((Component)((FVRFireArmAttachment)muzzledevice).curMount.Parent).GetComponent<FVRFireArm>();
				if ((Object)(object)firearm.Magazine == (Object)null)
				{
					magscaled = false;
				}
				if ((Object)(object)firearm.Clip == (Object)null)
				{
					clipscaled = false;
				}
				if (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f <= 0f)
				{
					((FVRPhysicalObject)firearm).Size = (FVRPhysicalObjectSize)0;
				}
				if (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f > 0f)
				{
					((FVRPhysicalObject)firearm).Size = size;
				}
				((Component)firearm).gameObject.transform.localScale = scaleoriginal * (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f);
			}
			if ((Object)(object)((FVRFireArmAttachment)muzzledevice).curMount != (Object)null && ((FVRFireArmAttachment)muzzledevice).curMount.AttachmentsList.Count < 1)
			{
				firearm = null;
				scaled = false;
			}
		}
	}
}
public class BottleSmash : MonoBehaviour
{
	[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
	public Color color;

	[SerializeField]
	[HideInInspector]
	private Color cachedColor;

	[SerializeField]
	[HideInInspector]
	private List<ColorBase> registeredComponents;

	public GameObject Cork;

	public GameObject Liquid;

	public GameObject Glass;

	public GameObject Glass_Shattered;

	public GameObject Label;

	public float DespawnTime = 5f;

	public ParticleSystem Effect;

	public GameObject Splat;

	public LayerMask SplatMask;

	public float maxSplatDistance = 5f;

	public float shatterAtSpeed = 2f;

	public bool allowShattering = true;

	public bool onlyAllowShatterOnCollision = true;

	[SerializeField]
	[HideInInspector]
	private Vector3 previousPos;

	[SerializeField]
	[HideInInspector]
	private Vector3 previousVelocity;

	[SerializeField]
	[HideInInspector]
	private Vector3 randomRot;

	[SerializeField]
	[HideInInspector]
	private float _lastHitSpeed = 0f;

	private bool broken = false;

	private float collidedRecently = -1f;

	private void Start()
	{
		//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)
		previousPos = ((Component)this).transform.position;
	}

	public void RandomizeColor()
	{
		//IL_001f: 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)
		color = new Color((float)Random.Range(0, 1), (float)Random.Range(0, 1), (float)Random.Range(0, 1), 1f);
	}

	private void OnCollisionEnter(Collision collision)
	{
		//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)
		Vector3 impulse = collision.impulse;
		_lastHitSpeed = ((Vector3)(ref impulse)).magnitude;
		if (((Component)collision.transform).tag != "Liquid")
		{
			collidedRecently = 0.2f;
		}
	}

	public void AttemptCollision(Collision col)
	{
		OnCollisionEnter(col);
	}

	public void RegisterColorBase(ColorBase cb)
	{
		registeredComponents.Add(cb);
	}

	public void ChangedColor()
	{
		//IL_0002: 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_001a: 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)
		if (!(cachedColor != color))
		{
			return;
		}
		cachedColor = color;
		foreach (ColorBase registeredComponent in registeredComponents)
		{
			registeredComponent.Unify();
		}
	}

	public Vector3 GetRandomRotation()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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)
		return randomRot;
	}

	public void RandomRotation()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//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_0011: 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)
		Vector3 val = Random.insideUnitSphere + Vector3.forward;
		randomRot = ((Vector3)(ref val)).normalized;
	}

	public void Smash()
	{
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: 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_017d: 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_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		broken = true;
		if ((Object)(object)Cork != (Object)null)
		{
			Cork.transform.parent = null;
			Cork.GetComponent<Collider>().enabled = true;
			Cork.GetComponent<Rigidbody>().isKinematic = false;
			Object.Destroy((Object)(object)Cork.gameObject, DespawnTime);
		}
		if ((Object)(object)Liquid != (Object)null)
		{
			float num = 0f;
			Object.Destroy((Object)(object)Liquid.gameObject, num);
		}
		if ((Object)(object)Effect != (Object)null)
		{
			Effect.Play();
			GameObject gameObject = ((Component)Effect).gameObject;
			MainModule main = Effect.main;
			MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
			Object.Destroy((Object)(object)gameObject, ((MinMaxCurve)(ref startLifetime)).constantMax);
		}
		if ((Object)(object)Label != (Object)null)
		{
			Object.Destroy((Object)(object)Label.gameObject);
		}
		if ((Object)(object)Glass != (Object)null)
		{
			Object.Destroy((Object)(object)Glass.gameObject);
		}
		if ((Object)(object)Glass_Shattered != (Object)null)
		{
			Glass_Shattered.SetActive(true);
			Glass_Shattered.transform.parent = null;
			Object.Destroy((Object)(object)Glass_Shattered, DespawnTime);
		}
		RaycastHit val = default(RaycastHit);
		if ((Object)(object)Splat != (Object)null && Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val, maxSplatDistance, LayerMask.op_Implicit(SplatMask)))
		{
			GameObject val2 = Object.Instantiate<GameObject>(Splat);
			val2.transform.position = ((RaycastHit)(ref val)).point;
		}
		Object.Destroy((Object)(object)((Component)((Component)this).transform).gameObject, DespawnTime);
	}

	private void FixedUpdate()
	{
		//IL_001f: 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_002a: 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_0039: 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_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		ChangedColor();
		collidedRecently -= Time.deltaTime;
		Vector3 val = (((Component)this).transform.position - previousPos) / Time.fixedDeltaTime;
		if (((onlyAllowShatterOnCollision && collidedRecently >= 0f) | !onlyAllowShatterOnCollision) && allowShattering && (Vector3.Distance(val, previousVelocity) > shatterAtSpeed || _lastHitSpeed > shatterAtSpeed) && !broken)
		{
			Smash();
		}
		_lastHitSpeed = 0f;
		previousVelocity = val;
		previousPos = ((Component)this).transform.position;
	}
}
public class ColorBase : MonoBehaviour
{
	protected virtual void RegisterWithController()
	{
	}

	public virtual void Unify()
	{
	}
}
public class LiquidColor : ColorBase
{
	public BottleSmash bottleSmash;

	private LiquidVolumeAnimator lva;

	public bool UpdateSurfaceColor = true;

	public bool UpdateColor = true;

	public bool UpdateSurfaceEmission = true;

	public bool UpdateEmission = true;

	private void Start()
	{
		lva = ((Component)this).GetComponent<LiquidVolumeAnimator>();
		if ((Object)(object)bottleSmash == (Object)null)
		{
			bottleSmash = ((Component)this).GetComponentInParent<BottleSmash>();
		}
		RegisterWithController();
	}

	protected override void RegisterWithController()
	{
		bottleSmash.RegisterColorBase(this);
	}

	public override void Unify()
	{
		//IL_0025: 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_0083: 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)
		if (UpdateColor)
		{
			lva.mats[0].SetColor("_Color", bottleSmash.color);
		}
		if (UpdateEmission)
		{
			lva.mats[0].SetColor("_EmissionColor", bottleSmash.color);
		}
		if (UpdateSurfaceColor)
		{
			lva.mats[0].SetColor("_SColor", bottleSmash.color);
		}
		if (UpdateSurfaceEmission)
		{
			lva.mats[0].SetColor("_SEmissionColor", bottleSmash.color);
		}
	}
}
public class PS_Color : ColorBase
{
	public BottleSmash bottleSmash;

	private ParticleSystem ps;

	private void Start()
	{
		ps = ((Component)this).GetComponent<ParticleSystem>();
		if ((Object)(object)bottleSmash == (Object)null)
		{
			bottleSmash = ((Component)this).GetComponentInParent<BottleSmash>();
		}
		RegisterWithController();
	}

	protected override void RegisterWithController()
	{
		bottleSmash.RegisterColorBase(this);
	}

	public override void Unify()
	{
		UpdateValues();
	}

	public void UpdateValues()
	{
		//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_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)
		MainModule main = ps.main;
		((MainModule)(ref main)).startColor = new MinMaxGradient(bottleSmash.color);
	}
}
public class ParticleColor : ColorBase
{
	public enum ColorID
	{
		_TintColor,
		_Color
	}

	public BottleSmash bottleSmash;

	private ParticleSystemRenderer ps;

	public ColorID colorType;

	private void Start()
	{
		ps = ((Component)this).GetComponent<ParticleSystemRenderer>();
		if ((Object)(object)bottleSmash == (Object)null)
		{
			bottleSmash = ((Component)this).GetComponentInParent<BottleSmash>();
		}
		RegisterWithController();
	}

	protected override void RegisterWithController()
	{
		bottleSmash.RegisterColorBase(this);
	}

	public override void Unify()
	{
		//IL_0031: 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)
		switch (colorType)
		{
		case ColorID._TintColor:
			((Renderer)ps).material.SetColor("_TintColor", bottleSmash.color);
			break;
		case ColorID._Color:
			((Renderer)ps).material.SetColor("_Color", bottleSmash.color);
			break;
		}
	}
}
public class ResetColors : MonoBehaviour
{
	public LiquidVolumeAnimator LVA;

	public float timeout = 5f;

	private float tReset;

	public BottleSmash BS;

	public Color Color1;

	public Color Color2;

	private void Start()
	{
		tReset = timeout;
	}

	private void Update()
	{
		//IL_002a: 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_005d: 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_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)
		timeout -= Time.deltaTime;
		if (timeout <= 0f)
		{
			if (BS.color == Color1)
			{
				BS.color = Color2;
			}
			else
			{
				BS.color = Color1;
			}
			LVA.level = 1f;
			timeout = tReset;
		}
	}
}
public class DemoRotation : MonoBehaviour
{
	private BottleSmash BS;

	public float rotSpeed = 30f;

	private void Start()
	{
		BS = ((Component)this).GetComponent<BottleSmash>();
	}

	private void Update()
	{
		//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_000f: 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_0015: 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_002b: 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_0033: 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_004d: 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_0055: 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_008b: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: 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_00ae: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
		Vector3 randomRotation = BS.GetRandomRotation();
		Vector3 normalized = ((Vector3)(ref randomRotation)).normalized;
		if (normalized != Vector3.zero)
		{
			Vector3 randomRotation2 = BS.GetRandomRotation();
			Vector3 normalized2 = ((Vector3)(ref randomRotation2)).normalized;
			Vector3 val = ((Component)BS).transform.up + Vector3.up;
			if (Vector3.Dot(normalized2, ((Vector3)(ref val)).normalized) < 0.98f)
			{
				Transform transform = ((Component)BS).transform;
				Quaternion rotation = ((Component)BS).transform.rotation;
				Vector3 randomRotation3 = BS.GetRandomRotation();
				Vector3 val2 = ((Component)BS).transform.up + Vector3.up;
				transform.rotation = Quaternion.RotateTowards(rotation, Quaternion.LookRotation(randomRotation3, ((Vector3)(ref val2)).normalized), rotSpeed * Time.deltaTime);
			}
		}
	}
}
public class ForceTest : MonoBehaviour
{
	public bool AddForce = false;

	public Vector3 force;

	private LiquidVolumeAnimator lva;

	private void Start()
	{
		lva = ((Component)this).GetComponent<LiquidVolumeAnimator>();
	}

	private void Update()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		if (AddForce)
		{
			lva.AddForce(force);
			AddForce = false;
		}
	}
}
public class LiquidAbsorption : MonoBehaviour
{
	public Color currentColor;

	public BottleSmash smashScript;

	public float particleValue = 0.02f;

	public LiquidVolumeAnimator LVA;

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

	private void OnParticleCollision(GameObject other)
	{
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: 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_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)other.transform.parent == (Object)(object)((Component)this).transform.parent)
		{
			return;
		}
		bool flag = false;
		if ((Object)(object)smashScript.Cork == (Object)null)
		{
			flag = true;
		}
		else if (!smashScript.Cork.activeSelf)
		{
			flag = true;
		}
		else if (!smashScript.Cork.GetComponent<Rigidbody>().isKinematic)
		{
			flag = true;
		}
		if (!flag)
		{
			return;
		}
		currentColor = smashScript.color;
		if (LVA.level < 1f - particleValue)
		{
			Color color = other.GetComponentInParent<BottleSmash>().color;
			if (LVA.level <= 1.4E-44f)
			{
				currentColor = color;
			}
			else
			{
				currentColor = Color.Lerp(currentColor, color, particleValue / LVA.level);
			}
			LVA.level += particleValue;
			smashScript.color = currentColor;
		}
	}

	private void Update()
	{
		//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)
		currentColor = smashScript.color;
	}
}
public class LiquidAbsorptionV2 : MonoBehaviour
{
	public Color currentColor;

	public BottleSmash smashScript;

	public MeshLiquidEmission LiquidEmission;

	public LiquidVolumeAnimator LVA;

	private float particleValue = 1f;

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

	private void OnParticleCollision(GameObject other)
	{
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: 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_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)other.transform.parent == (Object)(object)((Component)this).transform.parent)
		{
			return;
		}
		bool flag = false;
		if ((Object)(object)smashScript.Cork == (Object)null)
		{
			flag = true;
		}
		else if (!smashScript.Cork.activeSelf)
		{
			flag = true;
		}
		else if (!smashScript.Cork.GetComponent<Rigidbody>().isKinematic)
		{
			flag = true;
		}
		float num = particleValue * (1f / LiquidEmission.volumeOfParticles);
		if (!flag)
		{
			return;
		}
		currentColor = smashScript.color;
		if (LVA.level < 1f - num)
		{
			Color color = other.GetComponentInParent<BottleSmash>().color;
			if (LVA.level <= 1.4E-44f)
			{
				currentColor = color;
			}
			else
			{
				currentColor = Color.Lerp(currentColor, color, num / LVA.level);
			}
			LVA.level += num;
			smashScript.color = currentColor;
		}
	}

	private void Update()
	{
		//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)
		currentColor = smashScript.color;
	}
}
public class LiquidPool : MonoBehaviour
{
	public float minSize = 0.5f;

	public float maxSize = 1f;

	public float timeToComplete = 0.5f;

	private float randomSize;

	private float currentTime = 0f;

	private bool fadingOut = false;

	private MeshRenderer mr;

	private Material mat;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.localScale = Vector3.zero;
		randomSize = Random.Range(minSize, maxSize);
		mr = ((Component)this).GetComponent<MeshRenderer>();
		mat = ((Renderer)mr).material;
		mat = Object.Instantiate<Material>(mat);
		((Renderer)mr).material = mat;
	}

	private void Update()
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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_0084: 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)
		currentTime += Time.deltaTime * (float)((!fadingOut) ? 1 : (-1));
		if (currentTime >= timeToComplete)
		{
			fadingOut = true;
		}
		if (fadingOut)
		{
			mat.color = new Color(mat.color.r, mat.color.g, mat.color.b, Mathf.Lerp(0f, 1f, currentTime / timeToComplete));
		}
		else
		{
			((Component)this).transform.localScale = Vector3.one * Mathf.Lerp(0f, randomSize, currentTime / timeToComplete);
		}
		if (fadingOut && currentTime <= 0f)
		{
			Object.Destroy((Object)(object)((Component)((Component)this).transform).gameObject);
		}
	}
}
[Serializable]
public class LiquidVolumeAnimator : MonoBehaviour
{
	[HideInInspector]
	[SerializeField]
	public Material[] mats;

	[Range(0f, 1f)]
	[SerializeField]
	public float level = 0.5f;

	private float finalLevel;

	public Vector2 minMaxBounds;

	[HideInInspector]
	[SerializeField]
	private MeshFilter mf;

	[HideInInspector]
	[SerializeField]
	private MeshRenderer mr;

	[HideInInspector]
	[SerializeField]
	private Mesh m;

	public bool DebugAnchor = false;

	public float debugSize = 1f;

	public float _anchorLength = 0.5f;

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

	[HideInInspector]
	[SerializeField]
	private Vector3 anchor;

	[HideInInspector]
	[SerializeField]
	private Vector3 anchorVelocity;

	[HideInInspector]
	[SerializeField]
	private Vector3 transformedPoint;

	[HideInInspector]
	[SerializeField]
	private Vector3 prevTransformedPoint;

	public bool calculateTextureProjection = true;

	public float TextureSize = 1f;

	public float TextureSizeScalar = 1f;

	public AnimationCurve texCurveSize = AnimationCurve.Linear(0f, 1f, 1f, 1f);

	private Quaternion previous;

	private float totalRotation = 0f;

	[HideInInspector]
	[SerializeField]
	private Vector3 TopLeft;

	[HideInInspector]
	[SerializeField]
	private Vector3 TopRight;

	[HideInInspector]
	[SerializeField]
	private Vector3 BottomLeft;

	[HideInInspector]
	[SerializeField]
	private Vector3 BottomRight;

	public Transform ExposedLiquidT;

	public Vector3 GravityDirection = Vector3.down;

	public bool normalizeGravityDirection = true;

	[HideInInspector]
	[SerializeField]
	private Vector3[] verts;

	private int shader_Key_localHeight;

	private int shader_Key_anchor;

	private int shader_Key_point;

	private int shader_Key_level;

	private float prvLevel = -1f;

	private Quaternion prevQ = Quaternion.identity;

	[HideInInspector]
	[SerializeField]
	private Vector3 cPos = Vector3.zero;

	public Vector3 finalAnchor;

	public Vector3 finalPoint;

	[HideInInspector]
	[SerializeField]
	private string[] shaderNames;

	private void OnDrawGizmosSelected()
	{
		//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_002b: 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_0041: 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_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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_0084: 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_0094: 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_009c: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: 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_0105: 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_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: 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_0149: 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_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: 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_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_01d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: 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_0207: 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)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: 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_00ac: 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)
		float num = _anchorLength * Mathf.Max(new float[3]
		{
			((Component)this).transform.lossyScale.x,
			((Component)this).transform.lossyScale.y,
			((Component)this).transform.lossyScale.z
		});
		if (DebugAnchor)
		{
			cPos = ((Component)this).transform.position;
			Vector3 val = cPos - ((Component)this).transform.TransformDirection(Vector3.up) * num;
			if (anchor == Vector3.zero)
			{
				anchor = val;
			}
			CalculateSquare(anchor);
			Vector3 lossyScale = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(val, 0.25f * ((Vector3)(ref lossyScale)).magnitude * 0.1f * debugSize);
			Gizmos.DrawLine(cPos, val);
			Gizmos.color = Color.blue;
			Vector3 val2 = anchor;
			Vector3 lossyScale2 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(val2, 0.25f * ((Vector3)(ref lossyScale2)).magnitude * 0.1f * debugSize);
			Gizmos.color = Color.red;
			Vector3 val3 = cPos;
			Vector3 val4 = val - cPos;
			Vector3 val5 = val3 - ((Vector3)(ref val4)).normalized * finalLevel;
			Vector3 lossyScale3 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(val5, 0.1f * ((Vector3)(ref lossyScale3)).magnitude * 0.01f * debugSize);
			Gizmos.color = Color.yellow;
			Vector3 topLeft = TopLeft;
			Vector3 lossyScale4 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(topLeft, 0.25f * ((Vector3)(ref lossyScale4)).magnitude * 0.01f * debugSize);
			Vector3 topRight = TopRight;
			Vector3 lossyScale5 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(topRight, 0.25f * ((Vector3)(ref lossyScale5)).magnitude * 0.01f * debugSize);
			Vector3 bottomLeft = BottomLeft;
			Vector3 lossyScale6 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(bottomLeft, 0.25f * ((Vector3)(ref lossyScale6)).magnitude * 0.01f * debugSize);
			Vector3 bottomRight = BottomRight;
			Vector3 lossyScale7 = ((Component)this).transform.lossyScale;
			Gizmos.DrawSphere(bottomRight, 0.25f * ((Vector3)(ref lossyScale7)).magnitude * 0.01f * debugSize);
			Gizmos.color = Color.white;
			CalculateSquare(anchor);
		}
	}

	private void CalculateSquare(Vector3 anch)
	{
		//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_001a: 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_0024: 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_0032: 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_003e: 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_0045: 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_004f: 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_005d: 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_0068: 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_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: 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_0091: 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_0098: 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_00a6: 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_00b1: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: 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_00d5: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: 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_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_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: 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_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: 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_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: 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_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: 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_01ab: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
		if (calculateTextureProjection)
		{
			Vector3 val = cPos;
			Vector3 val2 = anch - cPos;
			Vector3 val3 = val - ((Vector3)(ref val2)).normalized * finalLevel;
			Vector3 val4 = cPos;
			Vector3 val5 = anch - cPos;
			Vector3 val6 = val4 - ((Vector3)(ref val5)).normalized * finalLevel - anch;
			Vector3 normalized = ((Vector3)(ref val6)).normalized;
			Vector3 val7 = Quaternion.Euler(0f, totalRotation, 0f) * Vector3.right;
			Vector3 val8 = Vector3.Cross(val7, ((Vector3)(ref normalized)).normalized);
			Vector3 normalized2 = ((Vector3)(ref val8)).normalized;
			Vector3 val9 = Vector3.Cross(normalized2, normalized);
			Vector3 normalized3 = ((Vector3)(ref val9)).normalized;
			Vector3 val10 = Vector3.Cross(normalized3, normalized);
			normalized2 = ((Vector3)(ref val10)).normalized;
			float num = TextureSize * texCurveSize.Evaluate(Mathf.Clamp01(level));
			Vector3 lossyScale = ((Component)this).transform.lossyScale;
			float num2 = num * ((Vector3)(ref lossyScale)).magnitude * 0.001f;
			TopLeft = normalized3 * num2 + normalized2 * num2 + val3;
			TopRight = normalized3 * num2 * -1f + normalized2 * num2 + val3;
			BottomLeft = normalized3 * num2 + normalized2 * num2 * -1f + val3;
			BottomRight = normalized3 * num2 * -1f - normalized2 * num2 + val3;
		}
	}

	private void Start()
	{
		//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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_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_0087: 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_008f: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: 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_00df: 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_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		cPos = ((Component)this).transform.position;
		shader_Key_localHeight = Shader.PropertyToID("_localHeight");
		shader_Key_anchor = Shader.PropertyToID("_anchor");
		shader_Key_point = Shader.PropertyToID("_point");
		shader_Key_level = Shader.PropertyToID("_level");
		prevTransformedPoint = (transformedPoint = ((Component)this).transform.TransformDirection((!normalizeGravityDirection) ? GravityDirection : ((Vector3)(ref GravityDirection)).normalized));
		anchor -= ((!normalizeGravityDirection) ? GravityDirection : ((Vector3)(ref GravityDirection)).normalized) * -1f * Time.deltaTime * (1f - dampening);
		((Vector3)(ref anchor)).Normalize();
		mr = ((Component)this).GetComponent<MeshRenderer>();
		mats = ((Renderer)mr).materials;
		shaderNames = new string[mats.Length];
		for (int i = 0; i < mats.Length; i++)
		{
			mats[i] = Object.Instantiate<Material>(mats[i]);
			shaderNames[i] = ((Object)mats[i].shader).name;
		}
		mf = ((Component)this).GetComponent<MeshFilter>();
		m = mf.sharedMesh;
		verts = (Vector3[])(object)new Vector3[m.vertices.Length];
		verts = m.vertices;
		minMaxBounds.x = (minMaxBounds.y = verts[0].y);
		for (int j = 0; j < verts.Length; j++)
		{
			Vector3 val = ((Component)this).transform.TransformDirection(verts[j]);
			if (val.y > minMaxBounds.y)
			{
				minMaxBounds.y = val.y;
			}
			if (val.y < minMaxBounds.x)
			{
				minMaxBounds.x = val.y;
			}
		}
		ref Vector2 reference = ref minMaxBounds;
		reference.x -= cPos.y;
		ref Vector2 reference2 = ref minMaxBounds;
		reference2.y -= cPos.y;
		for (int k = 0; k < mats.Length; k++)
		{
			mats[k].SetFloat(shader_Key_localHeight, Mathf.Lerp(minMaxBounds.x, minMaxBounds.y, level));
		}
		((Renderer)mr).materials = mats;
	}

	public void AddForce(Vector3 force)
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		anchorVelocity += force;
	}

	private void FixedUpdate()
	{
		//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_0026: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: 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_008a: 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_008f: 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_009b: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: 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_00e1: 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_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: 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_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_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: 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_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: 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_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: 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_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0378: Unknown result type (might be due to invalid IL or missing references)
		//IL_037e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Unknown result type (might be due to invalid IL or missing references)
		//IL_038e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: 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_035a: 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_0366: 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_0370: Unknown result type (might be due to invalid IL or missing references)
		//IL_040c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0411: Unknown result type (might be due to invalid IL or missing references)
		//IL_0416: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043c: 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_0447: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0450: Unknown result type (might be due to invalid IL or missing references)
		//IL_045b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		//IL_0465: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b8: 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_04cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d7: 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_04de: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: 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_04fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0501: 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_050d: Unknown result type (might be due to invalid IL or missing references)
		//IL_050f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0516: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_051f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0688: Unknown result type (might be due to invalid IL or missing references)
		//IL_068d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0699: 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_06aa: 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_06b4: 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_06c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06da: 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_06e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0701: Unknown result type (might be due to invalid IL or missing references)
		//IL_070a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_0716: Unknown result type (might be due to invalid IL or missing references)
		//IL_071b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0720: 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_072f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0734: 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_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05de: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0602: Unknown result type (might be due to invalid IL or missing references)
		//IL_061d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0628: 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_0636: Unknown result type (might be due to invalid IL or missing references)
		//IL_0640: 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_0656: Unknown result type (might be due to invalid IL or missing references)
		//IL_0667: Unknown result type (might be due to invalid IL or missing references)
		//IL_066d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0672: Unknown result type (might be due to invalid IL or missing references)
		//IL_0677: Unknown result type (might be due to invalid IL or missing references)
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0802: Unknown result type (might be due to invalid IL or missing references)
		//IL_0779: Unknown result type (might be due to invalid IL or missing references)
		//IL_078e: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
		cPos = ((Component)this).transform.position;
		float num = _anchorLength * Mathf.Max(new float[3]
		{
			((Component)this).transform.lossyScale.x,
			((Component)this).transform.lossyScale.y,
			((Component)this).transform.lossyScale.z
		});
		transformedPoint = ((Component)this).transform.TransformDirection((!normalizeGravityDirection) ? GravityDirection : ((Vector3)(ref GravityDirection)).normalized);
		anchor += anchorVelocity * (1f - dampening);
		Vector3 val = anchor;
		anchor -= ((!normalizeGravityDirection) ? GravityDirection : ((Vector3)(ref GravityDirection)).normalized) * -1f * Time.deltaTime * (1f - dampening);
		float num2 = Vector3.Distance(anchor, cPos);
		if (num2 > num)
		{
			Vector3 val2 = cPos;
			Vector3 val3 = anchor - cPos;
			anchor = val2 + ((Vector3)(ref val3)).normalized * num;
		}
		Vector3 val4 = anchor - val + (transformedPoint - prevTransformedPoint) * -1f * (1f / num) * Time.deltaTime;
		if (val4 == Vector3.zero && prvLevel == level && prevQ == ((Component)this).transform.rotation)
		{
			return;
		}
		anchorVelocity += val4;
		Matrix4x4 localToWorldMatrix = ((Component)this).transform.localToWorldMatrix;
		minMaxBounds.x = (minMaxBounds.y = ((Component)this).transform.TransformPoint(verts[0]).y);
		for (int i = 0; i < verts.Length; i++)
		{
			Vector3 val5 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint(verts[i]);
			if (val5.y > minMaxBounds.y)
			{
				minMaxBounds.y = val5.y;
			}
			if (val5.y < minMaxBounds.x)
			{
				minMaxBounds.x = val5.y;
			}
		}
		ref Vector2 reference = ref minMaxBounds;
		reference.y -= cPos.y;
		ref Vector2 reference2 = ref minMaxBounds;
		reference2.x -= cPos.y;
		finalLevel = Mathf.Lerp(minMaxBounds.x, minMaxBounds.y, level);
		if (level <= 1.4E-44f)
		{
			anchor = Vector3.down * num + cPos;
		}
		Vector3 val6 = cPos;
		Vector3 val7 = anchor - cPos;
		finalPoint = val6 - ((Vector3)(ref val7)).normalized * finalLevel;
		for (int j = 0; j < mats.Length; j++)
		{
			mats[j].SetFloat(shader_Key_localHeight, Mathf.Lerp(minMaxBounds.x - 1.4E-44f, minMaxBounds.y + 1.4E-44f, level));
			mats[j].SetVector(shader_Key_anchor, Vector4.op_Implicit(((Component)this).transform.InverseTransformPoint(anchor)));
			Material obj = mats[j];
			int num3 = shader_Key_point;
			Transform transform = ((Component)this).transform;
			Vector3 val8 = cPos;
			Vector3 val9 = anchor - cPos;
			obj.SetVector(num3, Vector4.op_Implicit(transform.InverseTransformPoint(val8 - ((Vector3)(ref val9)).normalized * finalLevel)));
			mats[j].SetFloat(shader_Key_level, level - float.Epsilon);
		}
		finalAnchor = anchor;
		CalculateSquare(anchor);
		Quaternion val10 = Quaternion.LookRotation(previous * Vector3.right, Vector3.up);
		Vector3 val11 = val10 * Vector3.right;
		Quaternion val12 = Quaternion.LookRotation(((Component)this).transform.rotation * Vector3.right, Vector3.up);
		float num4 = Quaternion.Angle(val10, val12) * (float)((!(Vector3.Dot(val11, val12 * Vector3.forward) < 0f)) ? 1 : (-1));
		float num5 = num4;
		if (Mathf.Abs(num5) > 0.05f)
		{
			totalRotation += num5;
		}
		if (totalRotation > 360f)
		{
			totalRotation -= 360f;
		}
		else if (totalRotation < 0f)
		{
			totalRotation += 360f;
		}
		if ((Object)(object)ExposedLiquidT != (Object)null)
		{
			Transform exposedLiquidT = ExposedLiquidT;
			Vector3 val13 = cPos;
			Vector3 val14 = anchor - cPos;
			exposedLiquidT.position = val13 - ((Vector3)(ref val14)).normalized * finalLevel;
			Transform exposedLiquidT2 = ExposedLiquidT;
			Vector3 val15 = Vector3.one * texCurveSize.Evaluate(Mathf.Clamp01(level));
			Vector3 lossyScale = ((Component)this).transform.lossyScale;
			exposedLiquidT2.localScale = val15 * ((Vector3)(ref lossyScale)).magnitude * 0.001f * TextureSize * TextureSizeScalar;
			Transform exposedLiquidT3 = ExposedLiquidT;
			Vector3 val16 = finalPoint - finalAnchor;
			exposedLiquidT3.up = ((Vector3)(ref val16)).normalized;
		}
		prevTransformedPoint = transformedPoint;
		previous = ((Component)this).transform.rotation;
		Vector4 val17 = Vector4.op_Implicit(((Component)this).transform.InverseTransformPoint(TopLeft));
		Vector4 val18 = Vector4.op_Implicit(((Component)this).transform.InverseTransformPoint(TopRight));
		Vector4 val19 = Vector4.op_Implicit(((Component)this).transform.InverseTransformPoint(BottomLeft));
		Vector4 val20 = Vector4.op_Implicit(((Component)this).transform.InverseTransformPoint(BottomRight));
		Transform transform2 = ((Component)this).transform;
		Vector3 val21 = cPos;
		Vector3 val22 = anchor - cPos;
		Vector4 val23 = Vector4.op_Implicit(transform2.InverseTransformPoint(val21 - ((Vector3)(ref val22)).normalized * finalLevel));
		for (int k = 0; k < mats.Length; k++)
		{
			if (shaderNames[k].Contains("_Texture"))
			{
				mats[k].SetVector("_TL", val17);
				mats[k].SetVector("_TR", val18);
				mats[k].SetVector("_BL", val19);
				mats[k].SetVector("_BR", val20);
				mats[k].SetVector("_CENTER", val23);
			}
		}
		prvLevel = level;
		prevQ = ((Component)this).transform.rotation;
	}
}
public class MeshLiquidEmission : MonoBehaviour
{
	[Serializable]
	private class BVertex
	{
		public Vector3 p;

		public Vector3 n;

		public bool b;
	}

	[HideInInspector]
	[SerializeField]
	private MeshFilter r;

	public LiquidVolumeAnimator LVA;

	[HideInInspector]
	[SerializeField]
	private int[] calculatedTriangles;

	[HideInInspector]
	[SerializeField]
	private BVertex[] calculatedVerts;

	public ParticleSystem system;

	private float particlesToEmit = 0f;

	public float emissionSpeed = 0f;

	private Mesh m;

	[HideInInspector]
	[SerializeField]
	private int[] tris;

	[HideInInspector]
	[SerializeField]
	private Vector3[] verts;

	[HideInInspector]
	[SerializeField]
	private Vector3[] norms;

	public bool debug = false;

	public float debugScale = 1f;

	public bool CullNullNormals = false;

	public Rigidbody Cork;

	public float volumeOfParticles = 70f;

	public bool emitting = true;

	public BottleSmash bottleSmash;

	public float angleSpeedScalar = 1f;

	private int CVOB = 0;

	private void Start()
	{
		r = ((Component)this).GetComponent<MeshFilter>();
		m = r.mesh;
		calculatedVerts = new BVertex[m.vertexCount * 6];
		for (int i = 0; i < calculatedVerts.Length; i++)
		{
			calculatedVerts[i] = new BVertex();
		}
		verts = m.vertices;
		tris = m.triangles;
		norms = m.normals;
	}

	private bool LinePlaneIntersection(Vector3 p0, Vector3 p1, Vector3 planePoint, Vector3 planeNormal, out Vector3 coordinate)
	{
		//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_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: 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_001c: 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_0035: 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_003e: 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_0052: 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_0059: 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)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = p1 - p0;
		coordinate = Vector3.zero;
		float num = Vector3.Dot(((Vector3)(ref planeNormal)).normalized, val);
		if (Mathf.Abs(num) > float.Epsilon)
		{
			Vector3 val2 = p0 - planePoint;
			float num2 = Vector3.Dot(((Vector3)(ref planeNormal)).normalized, val2) * -1f / num;
			val *= num2;
			coordinate = p0 + val;
			return true;
		}
		return false;
	}

	private void OnDrawGizmos()
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		if (debug && calculatedVerts != null)
		{
			for (int i = 0; i < calculatedVerts.Length && calculatedVerts[i].b; i++)
			{
				Vector3 val = ((Component)this).transform.TransformPoint(calculatedVerts[i].p);
				Vector3 lossyScale = ((Component)this).transform.lossyScale;
				Gizmos.DrawSphere(val, 0.01f * ((Vector3)(ref lossyScale)).magnitude * debugScale);
			}
		}
	}

	private void SetDual(int under1, int under2, int above, ref Vector3 dir, ref Vector3 lpos, ref int currentVOB, ref Vector3 tmpV)
	{
		//IL_0017: 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_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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: 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_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: 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_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: 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_022c: 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_0261: 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_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: 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_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: 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_02ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: 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_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		calculatedVerts[currentVOB].p = verts[under1];
		calculatedVerts[currentVOB].n = norms[under1];
		calculatedVerts[currentVOB].b = true;
		LinePlaneIntersection(verts[under1], verts[above], lpos, dir * -1f, out tmpV);
		calculatedVerts[currentVOB + 1].p = tmpV;
		BVertex obj = calculatedVerts[currentVOB + 1];
		Vector3 val = norms[under1];
		Vector3 val2 = norms[above];
		Vector3 val3 = tmpV - verts[under1];
		float magnitude = ((Vector3)(ref val3)).magnitude;
		Vector3 val4 = verts[under1] - verts[above];
		obj.n = Vector3.Lerp(val, val2, magnitude / ((Vector3)(ref val4)).magnitude);
		calculatedVerts[currentVOB + 1].b = true;
		calculatedVerts[currentVOB + 2].p = verts[under2];
		calculatedVerts[currentVOB + 2].n = norms[under2];
		calculatedVerts[currentVOB + 2].b = true;
		calculatedVerts[currentVOB + 3].p = verts[under2];
		calculatedVerts[currentVOB + 3].n = norms[under2];
		calculatedVerts[currentVOB + 3].b = true;
		calculatedVerts[currentVOB + 4].p = tmpV;
		calculatedVerts[currentVOB + 4].n = calculatedVerts[currentVOB + 1].n;
		calculatedVerts[currentVOB + 4].b = true;
		LinePlaneIntersection(verts[under2], verts[above], lpos, dir * -1f, out tmpV);
		calculatedVerts[currentVOB + 5].p = tmpV;
		BVertex obj2 = calculatedVerts[currentVOB + 5];
		Vector3 val5 = norms[under2];
		Vector3 val6 = norms[above];
		Vector3 val7 = tmpV - verts[under2];
		float magnitude2 = ((Vector3)(ref val7)).magnitude;
		Vector3 val8 = verts[under2] - verts[above];
		obj2.n = Vector3.Lerp(val5, val6, magnitude2 / ((Vector3)(ref val8)).magnitude);
		calculatedVerts[currentVOB + 5].b = true;
	}

	private void SetDualInverted(int under1, int above1, int above2, ref Vector3 dir, ref Vector3 lpos, ref int currentVOB, ref Vector3 tmpV)
	{
		//IL_0017: 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_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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: 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_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: 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_019c: 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_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: 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_01e7: 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_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: 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)
		calculatedVerts[currentVOB].p = verts[under1];
		calculatedVerts[currentVOB].n = norms[under1];
		calculatedVerts[currentVOB].b = true;
		LinePlaneIntersection(verts[under1], verts[above1], lpos, dir * -1f, out tmpV);
		calculatedVerts[currentVOB + 1].p = tmpV;
		BVertex obj = calculatedVerts[currentVOB + 1];
		Vector3 val = norms[under1];
		Vector3 val2 = norms[above1];
		Vector3 val3 = tmpV - verts[under1];
		float magnitude = ((Vector3)(ref val3)).magnitude;
		Vector3 val4 = verts[under1] - verts[above1];
		obj.n = Vector3.Lerp(val, val2, magnitude / ((Vector3)(ref val4)).magnitude);
		calculatedVerts[currentVOB + 1].b = true;
		LinePlaneIntersection(verts[under1], verts[above2], lpos, dir * -1f, out tmpV);
		calculatedVerts[currentVOB + 2].p = tmpV;
		BVertex obj2 = calculatedVerts[currentVOB + 2];
		Vector3 val5 = norms[under1];
		Vector3 val6 = norms[above2];
		Vector3 val7 = tmpV - verts[under1];
		float magnitude2 = ((Vector3)(ref val7)).magnitude;
		Vector3 val8 = verts[under1] - verts[above2];
		obj2.n = Vector3.Lerp(val5, val6, magnitude2 / ((Vector3)(ref val8)).magnitude);
		calculatedVerts[currentVOB + 2].b = true;
	}

	private void CalculateTrianglesToEmitFrom(int[] tris, Vector3[] verts)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: 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_001c: 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_0024: 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_0042: 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_004b: 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)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_0087: 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_0096: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: 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_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_00b1: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: 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_00cf: 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_00e3: 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_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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: 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_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = LVA.finalAnchor - LVA.finalPoint;
		Vector3 normalized = ((Vector3)(ref val)).normalized;
		Vector3 lpos = ((Component)this).transform.InverseTransformPoint(LVA.finalPoint);
		Vector3 val2 = ((Component)this).transform.InverseTransformDirection(normalized);
		normalized = ((Vector3)(ref val2)).normalized;
		int currentVOB = 0;
		Vector3 tmpV = Vector3.zero;
		for (int i = 2; i < tris.Length; i += 3)
		{
			int num = tris[i - 2];
			int num2 = tris[i - 1];
			int num3 = tris[i];
			Vector3 val3 = verts[num];
			Vector3 val4 = verts[num2];
			Vector3 val5 = verts[num3];
			Vector3 val6 = val3 - lpos;
			bool flag = Vector3.Dot(normalized, val6) >= 0f;
			Vector3 val7 = val4 - lpos;
			bool flag2 = Vector3.Dot(normalized, val7) >= 0f;
			Vector3 val8 = val5 - lpos;
			bool flag3 = Vector3.Dot(normalized, val8) >= 0f;
			if (flag3 && flag2 && flag)
			{
				calculatedVerts[currentVOB].p = val3;
				calculatedVerts[currentVOB].n = norms[num];
				calculatedVerts[currentVOB].b = true;
				calculatedVerts[currentVOB + 1].p = val4;
				calculatedVerts[currentVOB + 1].n = norms[num2];
				calculatedVerts[currentVOB + 1].b = true;
				calculatedVerts[currentVOB + 2].p = val5;
				calculatedVerts[currentVOB + 2].n = norms[num2];
				calculatedVerts[currentVOB + 2].b = true;
				currentVOB += 3;
			}
			else
			{
				if (!flag3 && !flag2 && !flag)
				{
					continue;
				}
				bool flag4 = false;
				if (flag && flag2)
				{
					SetDual(num, num2, num3, ref normalized, ref lpos, ref currentVOB, ref tmpV);
					currentVOB += 6;
					flag4 = true;
				}
				if (flag && flag3)
				{
					SetDual(num, num3, num2, ref normalized, ref lpos, ref currentVOB, ref tmpV);
					currentVOB += 6;
					flag4 = true;
				}
				if (flag2 && flag3)
				{
					SetDual(num3, num2, num, ref normalized, ref lpos, ref currentVOB, ref tmpV);
					currentVOB += 6;
					flag4 = true;
				}
				if (!flag4)
				{
					if (flag)
					{
						SetDualInverted(num, num2, num3, ref normalized, ref lpos, ref currentVOB, ref tmpV);
						currentVOB += 3;
					}
					else if (flag2)
					{
						SetDualInverted(num2, num, num3, ref normalized, ref lpos, ref currentVOB, ref tmpV);
						currentVOB += 3;
					}
					else if (flag3)
					{
						SetDualInverted(num3, num2, num, ref normalized, ref lpos, ref currentVOB, ref tmpV);
						currentVOB += 3;
					}
				}
			}
		}
		if (currentVOB < calculatedVerts.Length)
		{
			calculatedVerts[currentVOB].b = false;
		}
		CVOB = currentVOB;
	}

	private float GetPS_StartSpeed()
	{
		//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_000f: 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_0017: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected I4, but got Unknown
		//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_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_00a7: 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_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_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: 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_003e: 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_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_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_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		MainModule main = system.main;
		MinMaxCurve startSpeed = ((MainModule)(ref main)).startSpeed;
		ParticleSystemCurveMode mode = ((MinMaxCurve)(ref startSpeed)).mode;
		switch ((int)mode)
		{
		case 3:
		{
			MainModule main5 = system.main;
			MinMaxCurve startSpeed5 = ((MainModule)(ref main5)).startSpeed;
			float constantMin = ((MinMaxCurve)(ref startSpeed5)).constantMin;
			MainModule main6 = system.main;
			MinMaxCurve startSpeed6 = ((MainModule)(ref main6)).startSpeed;
			return Random.Range(constantMin, ((MinMaxCurve)(ref startSpeed6)).constantMax);
		}
		case 0:
		{
			MainModule main4 = system.main;
			MinMaxCurve startSpeed4 = ((MainModule)(ref main4)).startSpeed;
			return ((MinMaxCurve)(ref startSpeed4)).constant;
		}
		case 1:
		{
			MainModule main3 = system.main;
			MinMaxCurve startSpeed3 = ((MainModule)(ref main3)).startSpeed;
			return ((MinMaxCurve)(ref startSpeed3)).Evaluate(Random.value);
		}
		case 2:
		{
			MainModule main2 = system.main;
			MinMaxCurve startSpeed2 = ((MainModule)(ref main2)).startSpeed;
			return ((MinMaxCurve)(ref startSpeed2)).Evaluate(Random.value);
		}
		default:
			return 0f;
		}
	}

	private bool EmitFromSubmesh()
	{
		//IL_002a: 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_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: 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)
		//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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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_007d: 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_0089: 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_00a0: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: 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_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: 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_00ef: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: 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_010d: 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_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, CVOB / 3 - 1);
		num *= 3;
		float value = Random.value;
		float value2 = Random.value;
		Vector3 val = Vector3.Lerp(calculatedVerts[num].p, calculatedVerts[num + 1].p, value);
		Vector3 val2 = Vector3.Lerp(calculatedVerts[num].n, calculatedVerts[num + 1].n, value);
		Vector3 normalized = ((Vector3)(ref val2)).normalized;
		val = Vector3.Lerp(val, calculatedVerts[num + 2].p, value2);
		Vector3 val3 = Vector3.Lerp(normalized, calculatedVerts[num + 2].n, value2);
		normalized = ((Vector3)(ref val3)).normalized;
		EmitParams val4 = default(EmitParams);
		float num2 = 1f;
		if ((Object)(object)bottleSmash != (Object)null)
		{
			Vector3 val5 = ((Component)this).transform.TransformDirection(normalized);
			Vector3 normalized2 = ((Vector3)(ref val5)).normalized;
			Vector3 val6 = LVA.finalAnchor - LVA.finalPoint;
			num2 = (1f + Vector3.Dot(((Vector3)(ref val6)).normalized, normalized2)) / 2f;
			((EmitParams)(ref val4)).velocity = normalized2 * GetPS_StartSpeed() * num2 * angleSpeedScalar;
		}
		else
		{
			Vector3 val7 = ((Component)this).transform.TransformDirection(normalized);
			((EmitParams)(ref val4)).velocity = ((Vector3)(ref val7)).normalized * GetPS_StartSpeed();
		}
		((EmitParams)(ref val4)).position = ((Component)this).transform.TransformPoint(val);
		if (((EmitParams)(ref val4)).velocity == Vector3.zero && CullNullNormals)
		{
			return false;
		}
		particlesToEmit -= 1f;
		if ((Object)(object)Cork != (Object)null)
		{
			if (Cork.isKinematic && volumeOfParticles > 0f)
			{
				LVA.level = Mathf.Clamp01((volumeOfParticles * LVA.level - 1f) / volumeOfParticles);
			}
		}
		else if (volumeOfParticles > 0f)
		{
			LVA.level = Mathf.Clamp01((volumeOfParticles * LVA.level - 1f) / volumeOfParticles);
		}
		system.Emit(val4, 1);
		return true;
	}

	private void Update()
	{
		if (!emitting || (Object)(object)Cork != (Object)null || LVA.level <= 0f)
		{
			return;
		}
		CalculateTrianglesToEmitFrom(tris, verts);
		particlesToEmit += emissionSpeed * Time.deltaTime;
		if (calculatedVerts.Length == 0)
		{
			particlesToEmit = 0f;
		}
		else if (!calculatedVerts[0].b)
		{
			particlesToEmit = 0f;
		}
		int num = 10;
		int num2 = num;
		while (particlesToEmit > 0f && (GetPS_StartSpeed() > 0f || !CullNullNormals))
		{
			num2 = ((!EmitFromSubmesh()) ? (num2 - 1) : num);
			if (num2 <= 0)
			{
				break;
			}
		}
	}
}
public class ConveyImpacts : MonoBehaviour
{
	public GhostPhysics _physics;

	private void OnCollisionEnter(Collision collision)
	{
		_physics.SendCollision(collision);
	}
}
public class GhostPhysics : MonoBehaviour
{
	private BottleSmash _smash;

	private Transform _ghost;

	public GameObject _ghostObject;

	public bool _redirectSelection = false;

	[Header("Reference")]
	public Transform _externalTransform;

	private void Start()
	{
		//IL_002f: 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_0065: Unknown result type (might be due to invalid IL or missing references)
		_smash = ((Component)this).GetComponent<BottleSmash>();
		_ghost = Object.Instantiate<GameObject>(_ghostObject).transform;
		_ghost.position = ((Component)this).transform.position;
		_ghost.rotation = ((Component)this).transform.rotation;
		_ghost.localScale = _smash.Glass.transform.localScale;
		_externalTransform = _ghost;
		MeshCollider component = ((Component)_ghost).gameObject.GetComponent<MeshCollider>();
		component.sharedMesh = _smash.Glass.GetComponent<MeshFilter>().sharedMesh;
		((Component)_ghost).GetComponent<ConveyImpacts>()._physics = this;
	}

	private void OnDestroy()
	{
		if ((Object)(object)_ghost != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)_ghost).gameObject);
		}
	}

	public void SendCollision(Collision col)
	{
		if ((Object)(object)_smash != (Object)null)
		{
			_smash.AttemptCollision(col);
		}
	}

	public Transform GetController()
	{
		return _ghost;
	}

	private void Update()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)_ghost != (Object)null)
		{
			((Component)this).transform.position = _ghost.position;
			((Component)this).transform.rotation = _ghost.rotation;
		}
		if (_redirectSelection && (Object)(object)Selection.activeTransform == (Object)(object)((Component)this).transform)
		{
			Selection.activeTransform = _ghost;
		}
	}
}
public class PickUpPotion : MonoBehaviour
{
	private GameObject Obj;

	private Rigidbody rObj;

	private float dist;

	private float d;

	public float offsetValue = 1f;

	private Vector2 beginDist;

	private void Start()
	{
	}

	private void Update()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to inval