Decompiled source of OWLPROJECTILE v1.0.0

doomahreal.ultrakill.owlprojectile/owlprojectile.dll

Decompiled 9 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("SoggyEverything")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SoggyEverything")]
[assembly: AssemblyTitle("SoggyEverything")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SoggyEverything;

[BepInPlugin("doomahreal.ultrakill.owlprojectile", "OWL PROJECTILE", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private static Texture2D s_theTexture;

	private static Sprite s_theSprite;

	private void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("owlprojectile").PatchAll(typeof(Plugin));
		AssetBundle obj = AssetBundle.LoadFromFile(Path.Combine(Assembly.GetExecutingAssembly().Location.Replace("owlprojectile.dll", ""), "owlprojectileassets"));
		s_theTexture = obj.LoadAsset<Texture2D>("owltexture");
		s_theSprite = obj.LoadAsset<Sprite>("owl");
	}

	static Plugin()
	{
	}

	[HarmonyPatch(typeof(Projectile), "Start")]
	[HarmonyPostfix]
	private static void MakeOwl(Projectile __instance)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		((Renderer)((Component)__instance).gameObject.GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)s_theTexture;
		MeshRenderer val = default(MeshRenderer);
		if (((Component)((Component)__instance).transform.GetChild(0)).TryGetComponent<MeshRenderer>(ref val))
		{
			((Renderer)val).material.mainTexture = (Texture)(object)s_theTexture;
			((Renderer)val).material.color = Color.white;
			((Renderer)((Component)__instance).gameObject.GetComponent<MeshRenderer>()).enabled = false;
		}
	}
}