Decompiled source of westvirginia v0.0.1

westvirginia.dll

Decompiled 2 days 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 Atlas;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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]
namespace Whoisjoe545.westvirginia;

[BepInPlugin("Whoisjoe545.westvirginia", "westvirginia", "0.0.1")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("nrgill28.Atlas", "1.0.1")]
public class westvirginiaPlugin : 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(), "Whoisjoe545.westvirginia");
		AtlasPlugin.RegisterScene(Path.Combine(BasePath, "appalachia"));
	}
}
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class TreeMerger : MonoBehaviour
{
	private void Start()
	{
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Expected O, but got Unknown
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		MeshFilter[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshFilter>();
		CombineInstance[] array = (CombineInstance[])(object)new CombineInstance[componentsInChildren.Length];
		int num = 0;
		while (num < componentsInChildren.Length)
		{
			if ((Object)(object)componentsInChildren[num] == (Object)(object)((Component)this).GetComponent<MeshFilter>())
			{
				num++;
				continue;
			}
			((CombineInstance)(ref array[num])).mesh = componentsInChildren[num].sharedMesh;
			((CombineInstance)(ref array[num])).transform = ((Component)componentsInChildren[num]).transform.localToWorldMatrix;
			((Component)componentsInChildren[num]).gameObject.SetActive(false);
			num++;
		}
		((Component)((Component)this).transform).GetComponent<MeshFilter>().mesh = new Mesh();
		((Component)((Component)this).transform).GetComponent<MeshFilter>().mesh.CombineMeshes(array);
		((Component)((Component)this).transform).gameObject.SetActive(true);
	}
}