Decompiled source of VileCenserGlowup v1.0.1

plugins/VileCenserGlowup/VileCenserGlowup.dll

Decompiled 2 hours ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using RoR2;
using RoR2.ContentManagement;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace VileCenserGlowup;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Bobot.VileCenserGlowup", "Vile Censer Glowup", "1.0.0")]
public class VileCenserGlowupMain : BaseUnityPlugin
{
	public const string GUID = "com.Bobot.VileCenserGlowup";

	public const string MODNAME = "Vile Censer Glowup";

	public const string VERSION = "1.0.0";

	private static AssetBundle assetBundle { get; set; }

	private void Awake()
	{
		//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_0066: 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)
		assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "VileCenserGlowupAssets"));
		AsyncOperationHandle<Material> val = AssetAsyncReferenceManager<Material>.LoadAsset(new AssetReferenceT<Material>(RoR2_DLC4_VileCenser.matVileCenser_mat), (AsyncReferenceHandleUnloadType)2);
		val.Completed += delegate(AsyncOperationHandle<Material> x)
		{
			Material result = x.Result;
			result.SetTexture("_MainTex", (Texture)(object)assetBundle.LoadAsset<Texture2D>("texVileCenser_Diffuse"));
			result.SetTexture("_NormalTex", (Texture)(object)assetBundle.LoadAsset<Texture2D>("texVileCenser_Normal"));
			result.SetFloat("_SpecularStrength", 0.748f);
			result.SetFloat("_SpecularExponent", 5.26f);
		};
		AsyncOperationHandle<ItemDef> val2 = AssetAsyncReferenceManager<ItemDef>.LoadAsset(new AssetReferenceT<ItemDef>(RoR2_DLC4_VileCenser.VileCenser_asset), (AsyncReferenceHandleUnloadType)2);
		val2.Completed += delegate(AsyncOperationHandle<ItemDef> x)
		{
			x.Result.pickupIconSpriteReference = null;
			x.Result.pickupIconSprite = assetBundle.LoadAsset<Sprite>("texVileCenserIconNew");
		};
	}
}