Decompiled source of DullerBanditCape v1.0.0

plugins/DullerBanditCape.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
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 DullerBanditCape;

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

	public const string MODNAME = "DullerBanditCape";

	public const string VERSION = "1.0.0";

	internal static AssetBundle assetBundle;

	public static PluginInfo pluginInfo { get; private set; }

	internal static string assetBundleDir => Path.Combine(Path.GetDirectoryName(pluginInfo.Location), "DullerBanditCapeAssets".ToLower());

	private void Awake()
	{
		//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)
		pluginInfo = ((BaseUnityPlugin)this).Info;
		assetBundle = AssetBundle.LoadFromFile(assetBundleDir);
		AsyncOperationHandle<Material> val = AssetAsyncReferenceManager<Material>.LoadAsset(new AssetReferenceT<Material>(RoR2_Base_Bandit2.matBandit2AltSkinHallowBody_mat), (AsyncReferenceHandleUnloadType)2);
		val.Completed += delegate(AsyncOperationHandle<Material> x)
		{
			Material result = x.Result;
			result.SetTexture("_MainTex", (Texture)(object)assetBundle.LoadAsset<Texture2D>("texBanditAltSkinDiffuseMergedDull"));
			result.SetTexture("_EmTex", (Texture)(object)assetBundle.LoadAsset<Texture2D>("texBanditAltSkinDiffuseMergedEmissiveDull"));
		};
	}
}