Decompiled source of Victor Collete Pepperbox v1.0.1

Victor_Collete_Pepperbox.dll

Decompiled 7 months ago
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using OtherLoader;
using UnityEngine;
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]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

	private void Update()
	{
		if (!(d > 0f))
		{
			return;
		}
		d -= Time.deltaTime;
		if (d <= 0f)
		{
			((Component)this).GetComponent<ParticleSystem>().Stop(true);
			CFX_Demo_Translate component = ((Component)this).gameObject.GetComponent<CFX_Demo_Translate>();
			if ((Object)(object)component != (Object)null)
			{
				((Behaviour)component).enabled = false;
			}
		}
	}
}
public class CFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class CFX_Demo_RotateCamera : MonoBehaviour
{
	public static bool rotating = true;

	public float speed = 30f;

	public Transform rotationCenter;

	private void Update()
	{
		//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)
		if (rotating)
		{
			((Component)this).transform.RotateAround(rotationCenter.position, Vector3.up, speed * Time.deltaTime);
		}
	}
}
public class CFX_Demo_Translate : MonoBehaviour
{
	public float speed = 30f;

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: 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_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

	private void Update()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(axis * speed * Time.deltaTime, (Space)1);
	}
}
public class WFX_Demo : MonoBehaviour
{
	public float cameraSpeed = 10f;

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: 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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = spawnParticle();
			if (!((Object)val2).name.StartsWith("WFX_MF"))
			{
				val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
			}
		}
	}

	public GameObject spawnParticle()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

	private void SetActiveCrossVersions(GameObject obj, bool active)
	{
		obj.SetActive(active);
		for (int i = 0; i < obj.transform.childCount; i++)
		{
			((Component)obj.transform.GetChild(i)).gameObject.SetActive(active);
		}
	}

	private void OnGUI()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: 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)
		//IL_033a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(5f, 20f, (float)(Screen.width - 10), 60f));
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Effect: " + ((Object)ParticleExamples[exampleIndex]).name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevParticle();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextParticle();
		}
		GUILayout.FlexibleSpace();
		GUILayout.Label("Click on the ground to spawn the selected effect", (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.FlexibleSpace();
		if (GUILayout.Button((!rotateCam) ? "Rotate Camera" : "Pause Camera", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }))
		{
			rotateCam = !rotateCam;
		}
		if (GUILayout.Button((!((Component)this).GetComponent<Renderer>().enabled) ? "Show Ground" : "Hide Ground", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }))
		{
			((Component)this).GetComponent<Renderer>().enabled = !((Component)this).GetComponent<Renderer>().enabled;
		}
		if (GUILayout.Button((!slowMo) ? "Slow Motion" : "Normal Speed", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }))
		{
			slowMo = !slowMo;
			if (slowMo)
			{
				Time.timeScale = 0.33f;
			}
			else
			{
				Time.timeScale = 1f;
			}
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Ground texture: " + groundTextureStr, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevTexture();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextTexture();
		}
		GUILayout.EndHorizontal();
		GUILayout.EndArea();
		if (!m4.GetComponent<Renderer>().enabled)
		{
			return;
		}
		GUILayout.BeginArea(new Rect(5f, (float)(Screen.height - 100), (float)(Screen.width - 10), 90f));
		rotate_m4 = GUILayout.Toggle(rotate_m4, "AutoRotate Weapon", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(250f) });
		GUI.enabled = !rotate_m4;
		float x = m4.transform.localEulerAngles.x;
		x = ((!(x > 90f)) ? x : (x - 180f));
		float y = m4.transform.localEulerAngles.y;
		float z = m4.transform.localEulerAngles.z;
		x = GUILayout.HorizontalSlider(x, 0f, 179f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		y = GUILayout.HorizontalSlider(y, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		z = GUILayout.HorizontalSlider(z, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		if (GUI.changed)
		{
			if (x > 90f)
			{
				x += 180f;
			}
			m4.transform.localEulerAngles = new Vector3(x, y, z);
			Debug.Log((object)x);
		}
		GUILayout.EndArea();
	}

	private IEnumerator RandomSpawnsCoroutine()
	{
		while (true)
		{
			GameObject particles = spawnParticle();
			if (orderedSpawns)
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(order, particles.transform.position.y, 0f);
				order -= step;
				if (order < 0f - range)
				{
					order = range;
				}
			}
			else
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(Random.Range(0f - range, range), 0f, Random.Range(0f - range, range)) + new Vector3(0f, particles.transform.position.y, 0f);
			}
			yield return (object)new WaitForSeconds(float.Parse(randomSpawnsDelay));
		}
	}

	private void Update()
	{
		//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_008c: 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)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		if (rotateCam)
		{
			((Component)Camera.main).transform.RotateAround(Vector3.zero, Vector3.up, cameraSpeed * Time.deltaTime);
		}
		if (rotate_m4)
		{
			m4.transform.Rotate(new Vector3(0f, 40f, 0f) * Time.deltaTime, (Space)0);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			((Component)this).GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			((Component)this).GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			((Component)this).GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			((Component)this).GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		showHideStuff();
	}

	private void showHideStuff()
	{
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			SetActiveCrossVersions(walls, active: true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			SetActiveCrossVersions(walls, active: false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_DeleteAfterDelay : MonoBehaviour
{
	public float delay = 1f;

	private void Update()
	{
		delay -= Time.deltaTime;
		if (delay < 0f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class WFX_Demo_New : MonoBehaviour
{
	public Renderer groundRenderer;

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

	private List<GameObject> onScreenParticles = new List<GameObject>();

	private void Awake()
	{
		//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)
		//IL_0078: 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)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

	private void Update()
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: 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_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_0108: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		else if (Input.GetKeyDown((KeyCode)127))
		{
			destroyParticles();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit val = default(RaycastHit);
			if (groundCollider.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
			{
				GameObject val2 = spawnParticle();
				if (!((Object)val2).name.StartsWith("WFX_MF"))
				{
					val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
				}
			}
		}
		float axis = Input.GetAxis("Mouse ScrollWheel");
		if (axis != 0f)
		{
			((Component)Camera.main).transform.Translate(Vector3.forward * ((!(axis < 0f)) ? 1f : (-1f)), (Space)1);
		}
		if (Input.GetMouseButtonDown(2))
		{
			((Component)Camera.main).transform.position = defaultCamPosition;
			((Component)Camera.main).transform.rotation = defaultCamRotation;
		}
	}

	public void OnToggleGround()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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_0068: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

	private void UpdateUI()
	{
		EffectLabel.text = ((Object)ParticleExamples[exampleIndex]).name;
		EffectIndexLabel.text = string.Format("{0}/{1}", (exampleIndex + 1).ToString("00"), ParticleExamples.Length.ToString("00"));
	}

	public GameObject spawnParticle()
	{
		//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_0037: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		val.transform.position = new Vector3(0f, val.transform.position.y, 0f);
		val.SetActive(true);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		ParticleSystem component = val.GetComponent<ParticleSystem>();
		if ((Object)(object)component != (Object)null)
		{
			MainModule main = component.main;
			if (((MainModule)(ref main)).loop)
			{
				((Component)component).gameObject.AddComponent<CFX_AutoStopLoopedEffect>();
				((Component)component).gameObject.AddComponent<CFX_AutoDestructShuriken>();
			}
		}
		onScreenParticles.Add(val);
		return val;
	}

	private IEnumerator CheckForDeletedParticles()
	{
		while (true)
		{
			yield return (object)new WaitForSeconds(5f);
			for (int num = onScreenParticles.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)onScreenParticles[num] == (Object)null)
				{
					onScreenParticles.RemoveAt(num);
				}
			}
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		UpdateUI();
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		UpdateUI();
		showHideStuff();
	}

	private void destroyParticles()
	{
		for (int num = onScreenParticles.Count - 1; num >= 0; num--)
		{
			if ((Object)(object)onScreenParticles[num] != (Object)null)
			{
				Object.Destroy((Object)(object)onScreenParticles[num]);
			}
			onScreenParticles.RemoveAt(num);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			ground.GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			ground.GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			ground.GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			ground.GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void showHideStuff()
	{
		//IL_004d: 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)
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
			((Component)Camera.main).transform.position = new Vector3(-2.482457f, 3.263842f, -0.004924395f);
			((Component)Camera.main).transform.eulerAngles = new Vector3(20f, 90f, 0f);
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			walls.SetActive(true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			walls.SetActive(false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class WFX_Demo_Wall : MonoBehaviour
{
	public WFX_Demo_New demo;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = demo.spawnParticle();
			val2.transform.position = ((RaycastHit)(ref val)).point;
			val2.transform.rotation = Quaternion.FromToRotation(Vector3.forward, ((RaycastHit)(ref val)).normal);
		}
	}
}
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoDestructShuriken : MonoBehaviour
{
	public bool OnlyDeactivate;

	private void OnEnable()
	{
		((MonoBehaviour)this).StartCoroutine("CheckIfAlive");
	}

	private IEnumerator CheckIfAlive()
	{
		do
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (((Component)this).GetComponent<ParticleSystem>().IsAlive(true));
		if (OnlyDeactivate)
		{
			((Component)this).gameObject.SetActive(false);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(Light))]
public class CFX_LightIntensityFade : MonoBehaviour
{
	public float duration = 1f;

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

	private void Start()
	{
		baseIntensity = ((Component)this).GetComponent<Light>().intensity;
	}

	private void OnEnable()
	{
		p_lifetime = 0f;
		p_delay = delay;
		if (delay > 0f)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = false;
		}
	}

	private void Update()
	{
		if (p_delay > 0f)
		{
			p_delay -= Time.deltaTime;
			if (p_delay <= 0f)
			{
				((Behaviour)((Component)this).GetComponent<Light>()).enabled = true;
			}
		}
		else if (p_lifetime / duration < 1f)
		{
			((Component)this).GetComponent<Light>().intensity = Mathf.Lerp(baseIntensity, finalIntensity, p_lifetime / duration);
			p_lifetime += Time.deltaTime;
		}
		else if (autodestruct)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(MeshFilter))]
public class WFX_BulletHoleDecal : MonoBehaviour
{
	private static Vector2[] quadUVs = (Vector2[])(object)new Vector2[4]
	{
		new Vector2(0f, 0f),
		new Vector2(0f, 1f),
		new Vector2(1f, 0f),
		new Vector2(1f, 1f)
	};

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//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)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

	private void OnEnable()
	{
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, (int)(frames.x * frames.y));
		int num2 = (int)((float)num % frames.x);
		int num3 = (int)((float)num / frames.y);
		Vector2[] array = (Vector2[])(object)new Vector2[4];
		for (int i = 0; i < 4; i++)
		{
			array[i].x = (quadUVs[i].x + (float)num2) * (1f / frames.x);
			array[i].y = (quadUVs[i].y + (float)num3) * (1f / frames.y);
		}
		((Component)this).GetComponent<MeshFilter>().mesh.uv = array;
		if (randomRotation)
		{
			((Component)this).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1);
		}
		life = lifetime;
		fadeout = life * (fadeoutpercent / 100f);
		color.a = orgAlpha;
		((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine("holeUpdate");
	}

	private IEnumerator holeUpdate()
	{
		while (life > 0f)
		{
			life -= Time.deltaTime;
			if (life <= fadeout)
			{
				color.a = Mathf.Lerp(0f, orgAlpha, life / fadeout);
				((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
			}
			yield return null;
		}
	}
}
[RequireComponent(typeof(Light))]
public class WFX_LightFlicker : MonoBehaviour
{
	public float time = 0.05f;

	private float timer;

	private void Start()
	{
		timer = time;
		((MonoBehaviour)this).StartCoroutine("Flicker");
	}

	private IEnumerator Flicker()
	{
		while (true)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = !((Behaviour)((Component)this).GetComponent<Light>()).enabled;
			do
			{
				timer -= Time.deltaTime;
				yield return null;
			}
			while (timer > 0f);
			timer = time;
		}
	}
}
[BepInPlugin("Billiam_J_McGoonigan.Victor_Collete_Pepperbox", "Victor_Collete_Pepperbox", "1.0.0")]
[BepInProcess("h3vr.exe")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Victor_Collete_PepperboxPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	private void Awake()
	{
		LoadAssets();
	}

	private void LoadAssets()
	{
		OtherLoader.RegisterDirectLoad(BasePath, "Billiam_J_McGoonigan.Victor_Collete_Pepperbox", "", "", "vcpepper", "");
	}
}