Decompiled source of Fazertron v1.0.2

Fazertron.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[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]
[ExecuteInEditMode]
public class HolographicSight : MonoBehaviour
{
	public Transform VirtualQuad;

	public float Scale = 1f;

	public bool SizeCompensation = true;

	private MaterialPropertyBlock m_block;

	private void OnEnable()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		m_block = new MaterialPropertyBlock();
		((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block);
	}

	private void OnWillRenderObject()
	{
		//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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = ((Component)this).transform.InverseTransformPoint(((Component)VirtualQuad).transform.position);
		m_block.SetVector("_Offset", Vector4.op_Implicit(val));
		m_block.SetFloat("_Scale", Scale);
		m_block.SetFloat("_SizeCompensation", (!SizeCompensation) ? 0f : 1f);
		((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block);
	}
}
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace iqsbasiczz.Fazertron
{
	[BepInPlugin("iqsbasiczz.Fazertron", "Fazertron", "1.0.2")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class FazertronPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			LoadAssets();
		}

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "iqsbasiczz.Fazertron");
			OtherLoader.RegisterDirectLoad(BasePath, "iqsbasiczz.Fazertron", "", "", "fazertron", "");
		}
	}
}