Decompiled source of Neco Survivors v0.9.4

NecoSurvivors.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using MonoMod.RuntimeDetour;
using MonoMod.RuntimeDetour.HookGen;
using RoR2;
using RoR2.ContentManagement;
using RuneFoxMods.DynamicSkins;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace NecoSurvivors
{
	[BepInPlugin("com.Brynzananas.NecoSurvivors", "NecoSurvivors", "0.9.4")]
	public class NecoSurvivorsPlugin : BaseUnityPlugin
	{
		public class DynamicSkinExtension
		{
			private Modification NecoArtificerTail_base_ArtificerModification;

			private Modification NecoCommandoTail_base_CommandoModification;

			private Modification NecoCaptainTail_base_CaptainModification;

			private Modification NecoEngineerTail_base_EngineerModification;

			private Modification NecoHuntressTail_base_Huntress3Modification;

			private Modification NecoLoaderTail_base_LoaderModification;

			private Modification NecoMercenaryTail_base_MercenaryModification;

			private Modification NecoVOidFiendTail_baseModification;

			private Modification NecoRailgunnerTail_base_RailgunnerModification;

			private Modification NecoBanditTail_base_BanditModification;

			private Modification NecoSeekerTail_base_SeekerModification;

			private Modification NecoArtificerOldTail_base_ArtificerModification;

			private Modification NecoBanditOldTail_base_BanditModification;

			private Modification NecoCaptainOldTail_base_CaptainModification;

			private Modification NecoCommandoOldTail_base_CommandoModification;

			private Modification NecoEngineerOldTail_base_EngineerModification;

			private Modification NecoHuntressOldTail_base_Huntress3Modification;

			private Modification NecoLoaderOldTail_base_LoaderModification;

			private Modification NecoMercenaryOldTail_base_MercenaryModification;

			private Modification NecoRailgunnerOldTail_base_RailgunnerModification;

			private Modification NecoSeekerOldTail_base_SeekerModification;

			internal void BeforeStart()
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				_DynamicSkinManager.InstanceLogger = ((BaseUnityPlugin)Instance).Logger;
				new Hook((MethodBase)typeof(SkinDef).GetMethod("Apply"), (Delegate)new Action<Action<SkinDef, GameObject>, SkinDef, GameObject>(_DynamicSkinManager.SkinDefApply)).Apply();
			}

			internal void AfterStart()
			{
				InitializeModifications();
				InitializeDynamicBones();
				AddModificationsToList();
			}

			internal void BeforeBodyCatalogInit()
			{
				MageBodyNecoArtificerSkinAddedEvent += onSkinAdded;
				CommandoBodyNecoCommandoSkinAddedEvent += onSkinAdded;
				CaptainBodyNecoCaptainSkinAddedEvent += onSkinAdded;
				EngiBodyNecoEngineerSkinAddedEvent += onSkinAdded;
				HuntressBodyNecoHuntressSkinAddedEvent += onSkinAdded;
				LoaderBodyNecoLoaderSkinAddedEvent += onSkinAdded;
				MercBodyNecoMercenarySkinAddedEvent += onSkinAdded;
				VoidSurvivorBodyNecoVOidFiendSkinAddedEvent += onSkinAdded;
				RailgunnerBodyNecoRailgunnerSkinAddedEvent += onSkinAdded;
				Bandit2BodyNecoBanditSkinAddedEvent += onSkinAdded;
				SeekerBodyNecoSeekerSkinAddedEvent += onSkinAdded;
				MageBodyNecoArtificerOldSkinAddedEvent += onSkinAdded;
				Bandit2BodyNecoBanditOldSkinAddedEvent += onSkinAdded;
				CaptainBodyNecoCaptainOldSkinAddedEvent += onSkinAdded;
				CommandoBodyNecoCommandoOldSkinAddedEvent += onSkinAdded;
				EngiBodyNecoEngineerOldSkinAddedEvent += onSkinAdded;
				HuntressBodyNecoHuntressOldSkinAddedEvent += onSkinAdded;
				LoaderBodyNecoLoaderOldSkinAddedEvent += onSkinAdded;
				MercBodyNecoMercenaryOldSkinAddedEvent += onSkinAdded;
				RailgunnerBodyNecoRailgunnerOldSkinAddedEvent += onSkinAdded;
				SeekerBodyNecoSeekerOldSkinAddedEvent += onSkinAdded;
			}

			internal void AfterBodyCatalogInit()
			{
			}

			private void InitializeModifications()
			{
				NecoArtificerTail_base_ArtificerModification = new Modification("Tail_base_Artificer.prefab", "pelvis", "MageBody", "BRYNZANANAS_SKIN_NECOARTIFICER_NAME", 93, AffectsBaseModel: true, assetBundle);
				NecoCommandoTail_base_CommandoModification = new Modification("Tail_base_Commando.prefab", "pelvis", "CommandoBody", "BRYNZANANAS_SKIN_NECOCOMMANDO_NAME", 70, AffectsBaseModel: true, assetBundle);
				NecoCaptainTail_base_CaptainModification = new Modification("Tail_base_Captain.prefab", "pelvis", "CaptainBody", "BRYNZANANAS_SKIN_NECOCAPTAIN_NAME", 55, AffectsBaseModel: true, assetBundle);
				NecoEngineerTail_base_EngineerModification = new Modification("Tail_base_Engineer.prefab", "pelvis", "EngiBody", "BRYNZANANAS_SKIN_NECOENGINEER_NAME", 73, AffectsBaseModel: true, assetBundle);
				NecoHuntressTail_base_Huntress3Modification = new Modification("Tail_base_Huntress3.prefab", "pelvis", "HuntressBody", "BRYNZANANAS_SKIN_NECOHUNTRESS_NAME", 48, AffectsBaseModel: true, assetBundle);
				NecoLoaderTail_base_LoaderModification = new Modification("Tail_base_Loader.prefab", "pelvis", "LoaderBody", "BRYNZANANAS_SKIN_NECOLOADER_NAME", 112, AffectsBaseModel: true, assetBundle);
				NecoMercenaryTail_base_MercenaryModification = new Modification("Tail_base_Mercenary.prefab", "pelvis", "MercBody", "BRYNZANANAS_SKIN_NECOMERCENARY_NAME", 73, AffectsBaseModel: true, assetBundle);
				NecoVOidFiendTail_baseModification = new Modification("Tail_base.prefab", "Pelvis", "VoidSurvivorBody", "BRYNZANANAS_SKIN_NECOVOIDFIEND_NAME", 57, AffectsBaseModel: true, assetBundle);
				NecoRailgunnerTail_base_RailgunnerModification = new Modification("Tail_base_Railgunner.prefab", "pelvis", "RailgunnerBody", "BRYNZANANAS_SKIN_NECORAILGUNNER_NAME", 100, AffectsBaseModel: true, assetBundle);
				NecoBanditTail_base_BanditModification = new Modification("Tail_base_Bandit.prefab", "pelvis", "Bandit2Body", "BRYNZANANAS_SKIN_NECOBANDIT_NAME", 71, AffectsBaseModel: true, assetBundle);
				NecoSeekerTail_base_SeekerModification = new Modification("Tail_base_Seeker.prefab", "Hips", "SeekerBody", "BRYNZANANAS_SKIN_NECOSEEKER_NAME", 77, AffectsBaseModel: true, assetBundle);
				NecoArtificerOldTail_base_ArtificerModification = new Modification("Tail_base_Artificer.prefab", "pelvis", "MageBody", "BRYNZANANAS_SKIN_NECOARTIFICEROLD_NAME", 93, AffectsBaseModel: true, assetBundle);
				NecoBanditOldTail_base_BanditModification = new Modification("Tail_base_Bandit.prefab", "pelvis", "Bandit2Body", "BRYNZANANAS_SKIN_NECOBANDITOLD_NAME", 71, AffectsBaseModel: true, assetBundle);
				NecoCaptainOldTail_base_CaptainModification = new Modification("Tail_base_Captain.prefab", "pelvis", "CaptainBody", "BRYNZANANAS_SKIN_NECOCAPTAINOLD_NAME", 55, AffectsBaseModel: true, assetBundle);
				NecoCommandoOldTail_base_CommandoModification = new Modification("Tail_base_Commando.prefab", "pelvis", "CommandoBody", "BRYNZANANAS_SKIN_NECOCOMMANDOOLD_NAME", 70, AffectsBaseModel: true, assetBundle);
				NecoEngineerOldTail_base_EngineerModification = new Modification("Tail_base_Engineer.prefab", "pelvis", "EngiBody", "BRYNZANANAS_SKIN_NECOENGINEEROLD_NAME", 73, AffectsBaseModel: true, assetBundle);
				NecoHuntressOldTail_base_Huntress3Modification = new Modification("Tail_base_Huntress3.prefab", "pelvis", "HuntressBody", "BRYNZANANAS_SKIN_NECOHUNTRESSOLD_NAME", 48, AffectsBaseModel: true, assetBundle);
				NecoLoaderOldTail_base_LoaderModification = new Modification("Tail_base_Loader.prefab", "pelvis", "LoaderBody", "BRYNZANANAS_SKIN_NECOLOADEROLD_NAME", 112, AffectsBaseModel: true, assetBundle);
				NecoMercenaryOldTail_base_MercenaryModification = new Modification("Tail_base_Mercenary.prefab", "pelvis", "MercBody", "BRYNZANANAS_SKIN_NECOMERCENARYOLD_NAME", 73, AffectsBaseModel: true, assetBundle);
				NecoRailgunnerOldTail_base_RailgunnerModification = new Modification("Tail_base_Railgunner.prefab", "pelvis", "RailgunnerBody", "BRYNZANANAS_SKIN_NECORAILGUNNEROLD_NAME", 100, AffectsBaseModel: true, assetBundle);
				NecoSeekerOldTail_base_SeekerModification = new Modification("Tail_base_Seeker.prefab", "Hips", "SeekerBody", "BRYNZANANAS_SKIN_NECOSEEKEROLD_NAME", 77, AffectsBaseModel: true, assetBundle);
			}

			private void InitializeDynamicBones()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_023a: Unknown result type (might be due to invalid IL or missing references)
				//IL_024e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0338: Unknown result type (might be due to invalid IL or missing references)
				//IL_034c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0360: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_03df: Unknown result type (might be due to invalid IL or missing references)
				//IL_0436: Unknown result type (might be due to invalid IL or missing references)
				//IL_044a: Unknown result type (might be due to invalid IL or missing references)
				//IL_045e: Unknown result type (might be due to invalid IL or missing references)
				//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0534: Unknown result type (might be due to invalid IL or missing references)
				//IL_0548: Unknown result type (might be due to invalid IL or missing references)
				//IL_055c: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_05db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0632: Unknown result type (might be due to invalid IL or missing references)
				//IL_0646: Unknown result type (might be due to invalid IL or missing references)
				//IL_065a: Unknown result type (might be due to invalid IL or missing references)
				//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0730: Unknown result type (might be due to invalid IL or missing references)
				//IL_0744: Unknown result type (might be due to invalid IL or missing references)
				//IL_0758: Unknown result type (might be due to invalid IL or missing references)
				//IL_07af: Unknown result type (might be due to invalid IL or missing references)
				//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_082e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0842: Unknown result type (might be due to invalid IL or missing references)
				//IL_0856: Unknown result type (might be due to invalid IL or missing references)
				//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_08c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_08d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_092c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0940: Unknown result type (might be due to invalid IL or missing references)
				//IL_0954: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_09bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a52: Unknown result type (might be due to invalid IL or missing references)
				NecoArtificerTail_base_ArtificerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Artificer", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoCommandoTail_base_CommandoModification.dynamicBoneData = new DynamicBoneData("Tail_base_Commando", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoCaptainTail_base_CaptainModification.dynamicBoneData = new DynamicBoneData("Tail_base_Captain", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoEngineerTail_base_EngineerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Engineer", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoHuntressTail_base_Huntress3Modification.dynamicBoneData = new DynamicBoneData("Tail_base_Huntress3", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoLoaderTail_base_LoaderModification.dynamicBoneData = new DynamicBoneData("Tail_base_Loader", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoMercenaryTail_base_MercenaryModification.dynamicBoneData = new DynamicBoneData("Tail_base_Mercenary", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoVOidFiendTail_baseModification.dynamicBoneData = new DynamicBoneData("Tail_base", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoRailgunnerTail_base_RailgunnerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Railgunner", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoBanditTail_base_BanditModification.dynamicBoneData = new DynamicBoneData("Tail_base_Bandit", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoSeekerTail_base_SeekerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Seeker", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoArtificerOldTail_base_ArtificerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Artificer", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoBanditOldTail_base_BanditModification.dynamicBoneData = new DynamicBoneData("Tail_base_Bandit", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoCaptainOldTail_base_CaptainModification.dynamicBoneData = new DynamicBoneData("Tail_base_Captain", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoCommandoOldTail_base_CommandoModification.dynamicBoneData = new DynamicBoneData("Tail_base_Commando", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoEngineerOldTail_base_EngineerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Engineer", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoHuntressOldTail_base_Huntress3Modification.dynamicBoneData = new DynamicBoneData("Tail_base_Huntress3", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoLoaderOldTail_base_LoaderModification.dynamicBoneData = new DynamicBoneData("Tail_base_Loader", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoMercenaryOldTail_base_MercenaryModification.dynamicBoneData = new DynamicBoneData("Tail_base_Mercenary", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoRailgunnerOldTail_base_RailgunnerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Railgunner", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
				NecoSeekerOldTail_base_SeekerModification.dynamicBoneData = new DynamicBoneData("Tail_base_Seeker", 0.2f, null, 0.05f, null, 0.601f, null, 0.507f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
			}

			private void AddModificationsToList()
			{
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOARTIFICER_NAME", 93, NecoArtificerTail_base_ArtificerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOCOMMANDO_NAME", 70, NecoCommandoTail_base_CommandoModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOCAPTAIN_NAME", 55, NecoCaptainTail_base_CaptainModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOENGINEER_NAME", 73, NecoEngineerTail_base_EngineerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOHUNTRESS_NAME", 48, NecoHuntressTail_base_Huntress3Modification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOLOADER_NAME", 112, NecoLoaderTail_base_LoaderModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOMERCENARY_NAME", 73, NecoMercenaryTail_base_MercenaryModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOVOIDFIEND_NAME", 57, NecoVOidFiendTail_baseModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECORAILGUNNER_NAME", 100, NecoRailgunnerTail_base_RailgunnerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOBANDIT_NAME", 71, NecoBanditTail_base_BanditModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOSEEKER_NAME", 77, NecoSeekerTail_base_SeekerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOARTIFICEROLD_NAME", 93, NecoArtificerOldTail_base_ArtificerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOBANDITOLD_NAME", 71, NecoBanditOldTail_base_BanditModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOCAPTAINOLD_NAME", 55, NecoCaptainOldTail_base_CaptainModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOCOMMANDOOLD_NAME", 70, NecoCommandoOldTail_base_CommandoModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOENGINEEROLD_NAME", 73, NecoEngineerOldTail_base_EngineerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOHUNTRESSOLD_NAME", 48, NecoHuntressOldTail_base_Huntress3Modification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOLOADEROLD_NAME", 112, NecoLoaderOldTail_base_LoaderModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOMERCENARYOLD_NAME", 73, NecoMercenaryOldTail_base_MercenaryModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECORAILGUNNEROLD_NAME", 100, NecoRailgunnerOldTail_base_RailgunnerModification);
				_DynamicSkinManager.AddModification("BRYNZANANAS_SKIN_NECOSEEKEROLD_NAME", 77, NecoSeekerOldTail_base_SeekerModification);
			}

			private static void onSkinAdded(object sender, SkinAddedArgs e)
			{
				_DynamicSkinManager.AddSkinDef(e.skinDef);
			}
		}

		public delegate void VoidDelegate();

		public class SkinAddedArgs : EventArgs
		{
			public SkinDef skinDef { get; }

			public GameObject bodyPrefab { get; }

			public SkinAddedArgs(SkinDef newSkinDef, GameObject newGameObject)
			{
				skinDef = newSkinDef;
				bodyPrefab = newGameObject;
			}
		}

		private class FieldException : Exception
		{
			public FieldException(string message, Exception innerException)
				: base(message, innerException)
			{
			}
		}

		private static DynamicSkinExtension _DynamicSkinExtension = new DynamicSkinExtension();

		private static DynamicSkinManager _DynamicSkinManager = new DynamicSkinManager();

		private static VoidDelegate BeforeStartDelegate;

		private static VoidDelegate AfterStartDelegate;

		private static VoidDelegate BeforeBodyCatalogDelegate;

		private static VoidDelegate AfterBodyCatalogDelegate;

		private static AssetBundle assetBundle;

		internal static NecoSurvivorsPlugin Instance { get; private set; }

		internal static ManualLogSource InstanceLogger
		{
			get
			{
				NecoSurvivorsPlugin instance = Instance;
				return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null;
			}
		}

		private static event EventHandler<SkinAddedArgs> VoidSurvivorBodyNecoVOidFiendSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> LoaderBodyNecoLoaderSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> RailgunnerBodyNecoRailgunnerSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> MageBodyNecoArtificerSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> CaptainBodyNecoCaptainSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> CommandoBodyNecoCommandoSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> EngiBodyNecoEngineerSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> HuntressBodyNecoHuntressSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> MercBodyNecoMercenarySkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> Bandit2BodyNecoBanditSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> SeekerBodyNecoSeekerSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> SeekerBodyNecoSeekerOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> LoaderBodyNecoLoaderOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> RailgunnerBodyNecoRailgunnerOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> MageBodyNecoArtificerOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> CaptainBodyNecoCaptainOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> CommandoBodyNecoCommandoOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> EngiBodyNecoEngineerOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> MercBodyNecoMercenaryOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> Bandit2BodyNecoBanditOldSkinAddedEvent;

		private static event EventHandler<SkinAddedArgs> HuntressBodyNecoHuntressOldSkinAddedEvent;

		private void Start()
		{
			Instance = this;
			BeforeStart();
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("NecoSurvivors.brynzananasnecosurvivors"))
			{
				assetBundle = AssetBundle.LoadFromStream(stream);
			}
			((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit);
			HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings));
			AfterStart();
		}

		private void BeforeStart()
		{
			BeforeStartDelegate = (VoidDelegate)Delegate.Combine(BeforeStartDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeStart));
			BeforeStartDelegate?.Invoke();
		}

		private void AfterStart()
		{
			AfterStartDelegate = (VoidDelegate)Delegate.Combine(AfterStartDelegate, new VoidDelegate(_DynamicSkinExtension.AfterStart));
			AfterStartDelegate?.Invoke();
		}

		private static void BeforeBodyCatalogInit()
		{
			BeforeBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(BeforeBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeBodyCatalogInit));
			BeforeBodyCatalogDelegate?.Invoke();
		}

		private static void AfterBodyCatalogInit()
		{
			AfterBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(AfterBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.AfterBodyCatalogInit));
			AfterBodyCatalogDelegate?.Invoke();
		}

		private static void LanguageLoadStrings(Action<Language> orig, Language self)
		{
			orig(self);
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOVOIDFIEND_NAME", "Neco Void Fiend");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOLOADER_NAME", "Neco Loader");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECORAILGUNNER_NAME", "Neco Railgunner");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOARTIFICER_NAME", "Neco Artificer");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOCAPTAIN_NAME", "Neco Captain");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOCOMMANDO_NAME", "Neco Commando");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOENGINEER_NAME", "Neco Engineer");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOHUNTRESS_NAME", "Neco Huntress");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOMERCENARY_NAME", "Neco Mercenary");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOBANDIT_NAME", "Neco Bandit");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOSEEKER_NAME", "Neco Seeker");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOSEEKEROLD_NAME", "Neco Seeker (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOLOADEROLD_NAME", "Neco Loader (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECORAILGUNNEROLD_NAME", "Neco Railgunner (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOARTIFICEROLD_NAME", "Neco Artificer (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOCAPTAINOLD_NAME", "Neco Captain (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOCOMMANDOOLD_NAME", "Neco Commando (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOENGINEEROLD_NAME", "Neco Engineer (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOMERCENARYOLD_NAME", "Neco Mercenary (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOBANDITOLD_NAME", "Neco Bandit (old)");
			self.SetStringByToken("BRYNZANANAS_SKIN_NECOHUNTRESSOLD_NAME", "Neco Huntress (old)");
		}

		private static void Nothing(Action<SkinDef> orig, SkinDef self)
		{
		}

		private static void BodyCatalogInit()
		{
			BeforeBodyCatalogInit();
			MethodInfo method = typeof(SkinDef).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic);
			HookEndpointManager.Add((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
			AddVoidSurvivorBodyNecoVOidFiendSkin();
			AddLoaderBodyNecoLoaderSkin();
			AddRailgunnerBodyNecoRailgunnerSkin();
			AddMageBodyNecoArtificerSkin();
			AddCaptainBodyNecoCaptainSkin();
			AddCommandoBodyNecoCommandoSkin();
			AddEngiBodyNecoEngineerSkin();
			AddHuntressBodyNecoHuntressSkin();
			AddMercBodyNecoMercenarySkin();
			AddBandit2BodyNecoBanditSkin();
			AddSeekerBodyNecoSeekerSkin();
			AddSeekerBodyNecoSeekerOldSkin();
			AddLoaderBodyNecoLoaderOldSkin();
			AddRailgunnerBodyNecoRailgunnerOldSkin();
			AddMageBodyNecoArtificerOldSkin();
			AddCaptainBodyNecoCaptainOldSkin();
			AddCommandoBodyNecoCommandoOldSkin();
			AddEngiBodyNecoEngineerOldSkin();
			AddMercBodyNecoMercenaryOldSkin();
			AddBandit2BodyNecoBanditOldSkin();
			AddHuntressBodyNecoHuntressOldSkin();
			HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
			AfterBodyCatalogInit();
		}

		private static void VoidSurvivorBodyNecoVOidFiendSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.VoidSurvivorBodyNecoVOidFiendSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddVoidSurvivorBodyNecoVOidFiendSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "VoidSurvivorBody";
			string text2 = "NecoVOidFiend";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/VoidFiendIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOVOIDFIEND_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoVoidFiend"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlVoidSurvivorBody.mesh"),
							renderer = renderers[0]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlVoidSurvivorHead.mesh"),
							renderer = renderers[1]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				VoidSurvivorBodyNecoVOidFiendSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void LoaderBodyNecoLoaderSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.LoaderBodyNecoLoaderSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddLoaderBodyNecoLoaderSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "LoaderBody";
			string text2 = "NecoLoader";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/LoaderIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOLOADER_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoLoader"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\PilotFemaleMesh.001.mesh"),
							renderer = renderers[2]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				LoaderBodyNecoLoaderSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void RailgunnerBodyNecoRailgunnerSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.RailgunnerBodyNecoRailgunnerSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddRailgunnerBodyNecoRailgunnerSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "RailgunnerBody";
			string text2 = "NecoRailgunner";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/RailGunnerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECORAILGUNNER_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoRailgunner"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_007b: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
					//IL_0110: Unknown result type (might be due to invalid IL or missing references)
					//IL_0111: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[5]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunnerBase.mesh"),
							renderer = renderers[2]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunnerMetal.001.mesh"),
							renderer = renderers[3]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailgunBackpackMesh.mesh"),
							renderer = renderers[0]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailgunProto.mesh"),
							renderer = renderers[4]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunBackpackScreen.mesh"),
							renderer = renderers[1]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				RailgunnerBodyNecoRailgunnerSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void MageBodyNecoArtificerSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.MageBodyNecoArtificerSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddMageBodyNecoArtificerSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "MageBody";
			string text2 = "NecoArtificer";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/ArtificerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOARTIFICER_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoArtificer"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\MageMesh.mesh"),
							renderer = renderers[7]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				MageBodyNecoArtificerSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void CaptainBodyNecoCaptainSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.CaptainBodyNecoCaptainSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddCaptainBodyNecoCaptainSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "CaptainBody";
			string text2 = "NecoCaptain";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/CaptainIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOCAPTAIN_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoCaptain"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_007b: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[3]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\Captain.mesh"),
							renderer = renderers[0]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\CaptainHat.mesh"),
							renderer = renderers[1]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\CaptainHead.mesh"),
							renderer = renderers[5]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				CaptainBodyNecoCaptainSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void CommandoBodyNecoCommandoSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.CommandoBodyNecoCommandoSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddCommandoBodyNecoCommandoSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "CommandoBody";
			string text2 = "NecoCommando";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/CommandoICon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOCOMMANDO_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoCommando"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\CommandoMesh.001.mesh"),
							renderer = renderers[6]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				CommandoBodyNecoCommandoSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void EngiBodyNecoEngineerSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.EngiBodyNecoEngineerSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddEngiBodyNecoEngineerSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "EngiBody";
			string text2 = "NecoEngineer";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/EngineerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOENGINEER_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoEngineer"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\EngiMesh.mesh"),
							renderer = renderers[4]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				EngiBodyNecoEngineerSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void HuntressBodyNecoHuntressSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.HuntressBodyNecoHuntressSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddHuntressBodyNecoHuntressSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "HuntressBody";
			string text2 = "NecoHuntress";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/HuntressIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOHUNTRESS_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoHuntress"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0047: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_0073: Unknown result type (might be due to invalid IL or missing references)
					//IL_007c: Unknown result type (might be due to invalid IL or missing references)
					//IL_009a: Unknown result type (might be due to invalid IL or missing references)
					//IL_009b: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[3]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\HuntressMesh.mesh"),
							renderer = renderers[10]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\BowMesh.mesh"),
							renderer = renderers[1]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[11]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				HuntressBodyNecoHuntressSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void MercBodyNecoMercenarySkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.MercBodyNecoMercenarySkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddMercBodyNecoMercenarySkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "MercBody";
			string text2 = "NecoMercenary";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/MercenaryICon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOMERCENARY_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoMercenary"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\MercMesh.mesh"),
							renderer = renderers[7]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				MercBodyNecoMercenarySkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void Bandit2BodyNecoBanditSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.Bandit2BodyNecoBanditSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddBandit2BodyNecoBanditSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "Bandit2Body";
			string text2 = "NecoBandit";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/BanditIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOBANDIT_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoBandit"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\Bandit2BodyMesh.mesh"),
							renderer = renderers[2]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\Bandit2ArmsMesh.mesh"),
							renderer = renderers[1]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				Bandit2BodyNecoBanditSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void SeekerBodyNecoSeekerSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.SeekerBodyNecoSeekerSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddSeekerBodyNecoSeekerSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "SeekerBody";
			string text2 = "NecoSeeker";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/SeekerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOSEEKER_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoSeeker"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\meshSeekerBody.mesh"),
							renderer = renderers[0]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				SeekerBodyNecoSeekerSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void SeekerBodyNecoSeekerOldSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.SeekerBodyNecoSeekerOldSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddSeekerBodyNecoSeekerOldSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "SeekerBody";
			string text2 = "NecoSeekerOld";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/SeekerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOSEEKEROLD_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoSeekerOld"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\meshSeekerBody.001.mesh"),
							renderer = renderers[0]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				SeekerBodyNecoSeekerOldSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void LoaderBodyNecoLoaderOldSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.LoaderBodyNecoLoaderOldSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddLoaderBodyNecoLoaderOldSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "LoaderBody";
			string text2 = "NecoLoaderOld";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/LoaderIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOLOADEROLD_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoLoaderOld"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\PilotFemaleMesh.mesh"),
							renderer = renderers[2]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				LoaderBodyNecoLoaderOldSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void RailgunnerBodyNecoRailgunnerOldSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.RailgunnerBodyNecoRailgunnerOldSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddRailgunnerBodyNecoRailgunnerOldSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "RailgunnerBody";
			string text2 = "NecoRailgunnerOld";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/RailGunnerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECORAILGUNNEROLD_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoRailgunnerOld"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_007b: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
					//IL_0110: Unknown result type (might be due to invalid IL or missing references)
					//IL_0111: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[5]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunnerBase.001.mesh"),
							renderer = renderers[2]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunnerMetal.002.mesh"),
							renderer = renderers[3]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailgunBackpackMesh.001.mesh"),
							renderer = renderers[0]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailgunProto.001.mesh"),
							renderer = renderers[4]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\mdlRailGunBackpackScreen.001.mesh"),
							renderer = renderers[1]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				RailgunnerBodyNecoRailgunnerOldSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void MageBodyNecoArtificerOldSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.MageBodyNecoArtificerOldSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddMageBodyNecoArtificerOldSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "MageBody";
			string text2 = "NecoArtificerOld";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/ArtificerIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOARTIFICEROLD_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoArtificerOld"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
					{
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\NecoSurvivors\\Meshes\\MageMesh.002.mesh"),
							renderer = renderers[7]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
				skinController.skins[skinController.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
				MageBodyNecoArtificerOldSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void CaptainBodyNecoCaptainOldSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			NecoSurvivorsPlugin.CaptainBodyNecoCaptainOldSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddCaptainBodyNecoCaptainOldSkin()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			string text = "CaptainBody";
			string text2 = "NecoCaptainOld";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)skinController))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets/Resources/CaptainIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "BRYNZANANAS_SKIN_NECOCAPTAINOLD_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "NecoCaptainOld"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					skin.rendererInfos = Array.Empty<RendererInfo>();
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references