Decompiled source of Rusk of Rain 2 Railgunner v1.4.2
Rusk Update73.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
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.AddressableAssets; 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 LookoutRusk { [BepInPlugin("com.Pix97.LookoutRusk", "Lookout Rusk", "1.2.1")] public class LookoutRuskPlugin : BaseUnityPlugin { private class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } public class DynamicSkinExtension { private Modification RuskStringLModification; private Modification RuskStringRModification; private Modification RuskTailModification; private Modification RuskEarLModification; private Modification RuskEarRModification; private Modification LookoutRuskStringLModification; private Modification LookoutRuskStringRModification; private Modification LookoutRuskTailModification; private Modification LookoutRuskEarLModification; private Modification LookoutRuskEarRModification; private Modification SunnyStringLModification; private Modification SunnyStringRModification; private Modification SunnyTailModification; private Modification SunnyEarLModification; private Modification SunnyEarRModification; private Modification StarsetStringLModification; private Modification StarsetStringRModification; private Modification StarsetTailModification; private Modification StarsetEarLModification; private Modification StarsetEarRModification; private Modification BoxtankRuskStringLModification; private Modification BoxtankRuskStringRModification; private Modification BoxtankRuskTailModification; private Modification BoxtankRuskEarLModification; private Modification BoxtankRuskEarRModification; private Modification KikoStringLModification; private Modification KikoStringRModification; private Modification KikoTailModification; private Modification KikoEarLModification; private Modification KikoEarRModification; private Modification PinkHAFStringLModification; private Modification PinkHAFStringRModification; private Modification PinkHAFTailModification; private Modification PinkHAFEarLModification; private Modification PinkHAFEarRModification; private Modification OmeletteStringLModification; private Modification OmeletteStringRModification; private Modification OmeletteTailModification; private Modification OmeletteEarLModification; private Modification OmeletteEarRModification; 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() { RailgunnerBodyRuskSkinAddedEvent += onSkinAdded; RailgunnerBodyLookoutRuskSkinAddedEvent += onSkinAdded; RailgunnerBodySunnySkinAddedEvent += onSkinAdded; RailgunnerBodyStarsetSkinAddedEvent += onSkinAdded; RailgunnerBodyBoxtankRuskSkinAddedEvent += onSkinAdded; RailgunnerBodyKikoSkinAddedEvent += onSkinAdded; RailgunnerBodyPinkHAFSkinAddedEvent += onSkinAdded; RailgunnerBodyOmeletteSkinAddedEvent += onSkinAdded; } internal void AfterBodyCatalogInit() { } private void InitializeModifications() { RuskStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_RUSK_NAME", 67, AffectsBaseModel: true, assetBundle); RuskStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_RUSK_NAME", 62, AffectsBaseModel: true, assetBundle); RuskTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_RUSK_NAME", 114, AffectsBaseModel: true, assetBundle); RuskEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_RUSK_NAME", 32, AffectsBaseModel: true, assetBundle); RuskEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_RUSK_NAME", 34, AffectsBaseModel: true, assetBundle); LookoutRuskStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_LOOKOUTRUSK_NAME", 67, AffectsBaseModel: true, assetBundle); LookoutRuskStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_LOOKOUTRUSK_NAME", 62, AffectsBaseModel: true, assetBundle); LookoutRuskTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_LOOKOUTRUSK_NAME", 114, AffectsBaseModel: true, assetBundle); LookoutRuskEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_LOOKOUTRUSK_NAME", 32, AffectsBaseModel: true, assetBundle); LookoutRuskEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_LOOKOUTRUSK_NAME", 34, AffectsBaseModel: true, assetBundle); SunnyStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_SUNNY_NAME", 67, AffectsBaseModel: true, assetBundle); SunnyStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_SUNNY_NAME", 62, AffectsBaseModel: true, assetBundle); SunnyTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_SUNNY_NAME", 114, AffectsBaseModel: true, assetBundle); SunnyEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_SUNNY_NAME", 32, AffectsBaseModel: true, assetBundle); SunnyEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_SUNNY_NAME", 34, AffectsBaseModel: true, assetBundle); StarsetStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_STARSET_NAME", 67, AffectsBaseModel: true, assetBundle); StarsetStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_STARSET_NAME", 62, AffectsBaseModel: true, assetBundle); StarsetTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_STARSET_NAME", 114, AffectsBaseModel: true, assetBundle); StarsetEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_STARSET_NAME", 32, AffectsBaseModel: true, assetBundle); StarsetEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_STARSET_NAME", 34, AffectsBaseModel: true, assetBundle); BoxtankRuskStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_BOXTANKRUSK_NAME", 67, AffectsBaseModel: true, assetBundle); BoxtankRuskStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_BOXTANKRUSK_NAME", 62, AffectsBaseModel: true, assetBundle); BoxtankRuskTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_BOXTANKRUSK_NAME", 114, AffectsBaseModel: true, assetBundle); BoxtankRuskEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_BOXTANKRUSK_NAME", 32, AffectsBaseModel: true, assetBundle); BoxtankRuskEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_BOXTANKRUSK_NAME", 34, AffectsBaseModel: true, assetBundle); KikoStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_KIKO_NAME", 67, AffectsBaseModel: true, assetBundle); KikoStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_KIKO_NAME", 62, AffectsBaseModel: true, assetBundle); KikoTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_KIKO_NAME", 114, AffectsBaseModel: true, assetBundle); KikoEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_KIKO_NAME", 32, AffectsBaseModel: true, assetBundle); KikoEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_KIKO_NAME", 34, AffectsBaseModel: true, assetBundle); PinkHAFStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_PINKHAF_NAME", 67, AffectsBaseModel: true, assetBundle); PinkHAFStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_PINKHAF_NAME", 62, AffectsBaseModel: true, assetBundle); PinkHAFTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_PINKHAF_NAME", 114, AffectsBaseModel: true, assetBundle); PinkHAFEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_PINKHAF_NAME", 32, AffectsBaseModel: true, assetBundle); PinkHAFEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_PINKHAF_NAME", 34, AffectsBaseModel: true, assetBundle); OmeletteStringLModification = new Modification("StringL.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_OMELETTE_NAME", 67, AffectsBaseModel: true, assetBundle); OmeletteStringRModification = new Modification("StringR.prefab", "chest", "RailgunnerBody", "PIX97_SKIN_OMELETTE_NAME", 62, AffectsBaseModel: true, assetBundle); OmeletteTailModification = new Modification("Tail.prefab", "pelvis", "RailgunnerBody", "PIX97_SKIN_OMELETTE_NAME", 114, AffectsBaseModel: true, assetBundle); OmeletteEarLModification = new Modification("EarL.prefab", "head", "RailgunnerBody", "PIX97_SKIN_OMELETTE_NAME", 32, AffectsBaseModel: true, assetBundle); OmeletteEarRModification = new Modification("EarR.prefab", "head", "RailgunnerBody", "PIX97_SKIN_OMELETTE_NAME", 34, 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0363: 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_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: 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_076c: Unknown result type (might be due to invalid IL or missing references) //IL_0780: 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_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: 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_086a: Unknown result type (might be due to invalid IL or missing references) //IL_087e: 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_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0a49: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0ab4: Unknown result type (might be due to invalid IL or missing references) //IL_0ac8: Unknown result type (might be due to invalid IL or missing references) //IL_0adc: Unknown result type (might be due to invalid IL or missing references) //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0b5b: Unknown result type (might be due to invalid IL or missing references) //IL_0bb2: Unknown result type (might be due to invalid IL or missing references) //IL_0bc6: Unknown result type (might be due to invalid IL or missing references) //IL_0bda: Unknown result type (might be due to invalid IL or missing references) //IL_0bfa: Unknown result type (might be due to invalid IL or missing references) //IL_0c62: Unknown result type (might be due to invalid IL or missing references) //IL_0c76: Unknown result type (might be due to invalid IL or missing references) //IL_0c8a: Unknown result type (might be due to invalid IL or missing references) //IL_0caa: Unknown result type (might be due to invalid IL or missing references) //IL_0d12: Unknown result type (might be due to invalid IL or missing references) //IL_0d26: Unknown result type (might be due to invalid IL or missing references) //IL_0d3a: Unknown result type (might be due to invalid IL or missing references) //IL_0d91: Unknown result type (might be due to invalid IL or missing references) //IL_0da5: Unknown result type (might be due to invalid IL or missing references) //IL_0db9: Unknown result type (might be due to invalid IL or missing references) //IL_0e10: Unknown result type (might be due to invalid IL or missing references) //IL_0e24: Unknown result type (might be due to invalid IL or missing references) //IL_0e38: Unknown result type (might be due to invalid IL or missing references) //IL_0e8f: Unknown result type (might be due to invalid IL or missing references) //IL_0ea3: Unknown result type (might be due to invalid IL or missing references) //IL_0eb7: Unknown result type (might be due to invalid IL or missing references) //IL_0ed7: Unknown result type (might be due to invalid IL or missing references) //IL_0f3f: Unknown result type (might be due to invalid IL or missing references) //IL_0f53: Unknown result type (might be due to invalid IL or missing references) //IL_0f67: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0fef: Unknown result type (might be due to invalid IL or missing references) //IL_1003: Unknown result type (might be due to invalid IL or missing references) //IL_1017: Unknown result type (might be due to invalid IL or missing references) //IL_106e: Unknown result type (might be due to invalid IL or missing references) //IL_1082: Unknown result type (might be due to invalid IL or missing references) //IL_1096: Unknown result type (might be due to invalid IL or missing references) //IL_10ed: Unknown result type (might be due to invalid IL or missing references) //IL_1101: Unknown result type (might be due to invalid IL or missing references) //IL_1115: Unknown result type (might be due to invalid IL or missing references) //IL_116c: Unknown result type (might be due to invalid IL or missing references) //IL_1180: Unknown result type (might be due to invalid IL or missing references) //IL_1194: Unknown result type (might be due to invalid IL or missing references) //IL_11b4: Unknown result type (might be due to invalid IL or missing references) //IL_121c: Unknown result type (might be due to invalid IL or missing references) //IL_1230: Unknown result type (might be due to invalid IL or missing references) //IL_1244: Unknown result type (might be due to invalid IL or missing references) //IL_1264: Unknown result type (might be due to invalid IL or missing references) //IL_12cc: Unknown result type (might be due to invalid IL or missing references) //IL_12e0: Unknown result type (might be due to invalid IL or missing references) //IL_12f4: Unknown result type (might be due to invalid IL or missing references) //IL_134b: Unknown result type (might be due to invalid IL or missing references) //IL_135f: Unknown result type (might be due to invalid IL or missing references) //IL_1373: Unknown result type (might be due to invalid IL or missing references) //IL_13ca: Unknown result type (might be due to invalid IL or missing references) //IL_13de: Unknown result type (might be due to invalid IL or missing references) //IL_13f2: Unknown result type (might be due to invalid IL or missing references) //IL_1449: Unknown result type (might be due to invalid IL or missing references) //IL_145d: Unknown result type (might be due to invalid IL or missing references) //IL_1471: Unknown result type (might be due to invalid IL or missing references) //IL_1491: Unknown result type (might be due to invalid IL or missing references) //IL_14f9: Unknown result type (might be due to invalid IL or missing references) //IL_150d: Unknown result type (might be due to invalid IL or missing references) //IL_1521: Unknown result type (might be due to invalid IL or missing references) //IL_1541: Unknown result type (might be due to invalid IL or missing references) //IL_15a9: Unknown result type (might be due to invalid IL or missing references) //IL_15bd: Unknown result type (might be due to invalid IL or missing references) //IL_15d1: Unknown result type (might be due to invalid IL or missing references) //IL_1628: Unknown result type (might be due to invalid IL or missing references) //IL_163c: Unknown result type (might be due to invalid IL or missing references) //IL_1650: Unknown result type (might be due to invalid IL or missing references) //IL_16a7: Unknown result type (might be due to invalid IL or missing references) //IL_16bb: Unknown result type (might be due to invalid IL or missing references) //IL_16cf: Unknown result type (might be due to invalid IL or missing references) RuskStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); RuskStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); RuskTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); RuskEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); RuskEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); LookoutRuskStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); LookoutRuskStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); LookoutRuskTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); LookoutRuskEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); LookoutRuskEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); SunnyStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); SunnyStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); SunnyTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); SunnyEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); SunnyEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); StarsetStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); StarsetStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); StarsetTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); StarsetEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); StarsetEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); BoxtankRuskStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); BoxtankRuskStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); BoxtankRuskTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); BoxtankRuskEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); BoxtankRuskEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); KikoStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); KikoStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); KikoTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); KikoEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); KikoEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); PinkHAFStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); PinkHAFStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); PinkHAFTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); PinkHAFEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); PinkHAFEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); OmeletteStringLModification.dynamicBoneData = new DynamicBoneData("StringL", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); OmeletteStringRModification.dynamicBoneData = new DynamicBoneData("StringR", 0.4f, null, 0f, null, 0f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, -0.01f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)0, new Vector3(0f, 0f, 0f), (Bound)0, 0.14f, 0.5f) }, new List<string>(), (FreezeAxis)0); OmeletteTailModification.dynamicBoneData = new DynamicBoneData("Tail001", 0.17f, null, 0.06f, null, 0f, null, 0f, 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); OmeletteEarLModification.dynamicBoneData = new DynamicBoneData("EarL001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); OmeletteEarRModification.dynamicBoneData = new DynamicBoneData("EarR001", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 1f, 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("PIX97_SKIN_RUSK_NAME", 67, RuskStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_RUSK_NAME", 62, RuskStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_RUSK_NAME", 114, RuskTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_RUSK_NAME", 32, RuskEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_RUSK_NAME", 34, RuskEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_LOOKOUTRUSK_NAME", 67, LookoutRuskStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_LOOKOUTRUSK_NAME", 62, LookoutRuskStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_LOOKOUTRUSK_NAME", 114, LookoutRuskTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_LOOKOUTRUSK_NAME", 32, LookoutRuskEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_LOOKOUTRUSK_NAME", 34, LookoutRuskEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_SUNNY_NAME", 67, SunnyStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_SUNNY_NAME", 62, SunnyStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_SUNNY_NAME", 114, SunnyTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_SUNNY_NAME", 32, SunnyEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_SUNNY_NAME", 34, SunnyEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_STARSET_NAME", 67, StarsetStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_STARSET_NAME", 62, StarsetStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_STARSET_NAME", 114, StarsetTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_STARSET_NAME", 32, StarsetEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_STARSET_NAME", 34, StarsetEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_BOXTANKRUSK_NAME", 67, BoxtankRuskStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_BOXTANKRUSK_NAME", 62, BoxtankRuskStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_BOXTANKRUSK_NAME", 114, BoxtankRuskTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_BOXTANKRUSK_NAME", 32, BoxtankRuskEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_BOXTANKRUSK_NAME", 34, BoxtankRuskEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_KIKO_NAME", 67, KikoStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_KIKO_NAME", 62, KikoStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_KIKO_NAME", 114, KikoTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_KIKO_NAME", 32, KikoEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_KIKO_NAME", 34, KikoEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_PINKHAF_NAME", 67, PinkHAFStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_PINKHAF_NAME", 62, PinkHAFStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_PINKHAF_NAME", 114, PinkHAFTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_PINKHAF_NAME", 32, PinkHAFEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_PINKHAF_NAME", 34, PinkHAFEarRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_OMELETTE_NAME", 67, OmeletteStringLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_OMELETTE_NAME", 62, OmeletteStringRModification); _DynamicSkinManager.AddModification("PIX97_SKIN_OMELETTE_NAME", 114, OmeletteTailModification); _DynamicSkinManager.AddModification("PIX97_SKIN_OMELETTE_NAME", 32, OmeletteEarLModification); _DynamicSkinManager.AddModification("PIX97_SKIN_OMELETTE_NAME", 34, OmeletteEarRModification); } 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 static AssetBundle assetBundle; private static readonly List<Material> materialsWithRoRShader = new List<Material>(); 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; internal static LookoutRuskPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { LookoutRuskPlugin instance = Instance; return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null; } } private static event EventHandler<SkinAddedArgs> RailgunnerBodyRuskSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyLookoutRuskSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyBoxtankRuskSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodySunnySkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyStarsetSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyKikoSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyPinkHAFSkinAddedEvent; private static event EventHandler<SkinAddedArgs> RailgunnerBodyOmeletteSkinAddedEvent; private void Start() { Instance = this; BeforeStart(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("LookoutRusk.pix97lookoutrusk")) { 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)); ReplaceShaders(); 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 ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Rusk/Textures/RorRusk 1.mat", "Assets/Rusk/Textures/RorRusk.mat", "Assets/Rusk/Textures/RorRusk 4.mat", "Assets/Rusk/Textures/RorRusk 2.mat", "Assets/Rusk/Textures/RorRusk 3.mat", "Assets/Rusk/Textures/RorRusk 5.mat", "Assets/Rusk/Textures/RorRusk 6.mat", "Assets/Rusk/Textures/RorRusk 7.mat"); } private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion(); foreach (string text in materialPaths) { Material val = assetBundle.LoadAsset<Material>(text); val.shader = shader; materialsWithRoRShader.Add(val); } } private static void LanguageLoadStrings(Action<Language> orig, Language self) { orig(self); self.SetStringByToken("PIX97_SKIN_RUSK_NAME", "Rusk [Classic]"); self.SetStringByToken("PIX97_SKIN_LOOKOUTRUSK_NAME", "Rusk [Lookout] "); self.SetStringByToken("PIX97_SKIN_BOXTANKRUSK_NAME", "Rusk [Box Tank] "); self.SetStringByToken("PIX97_SKIN_SUNNY_NAME", "Rusk [Sunshine]"); self.SetStringByToken("PIX97_SKIN_STARSET_NAME", "Rusk [Kai]"); self.SetStringByToken("PIX97_SKIN_KIKO_NAME", "Rusk [希子あいし]"); self.SetStringByToken("PIX97_SKIN_PINKHAF_NAME", "Rusk [PINK H.A.F.] "); self.SetStringByToken("PIX97_SKIN_OMELETTE_NAME", "Rusk [PINK H.A.F.] "); } 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)); AddRailgunnerBodyRuskSkin(); AddRailgunnerBodyLookoutRuskSkin(); AddRailgunnerBodyBoxtankRuskSkin(); AddRailgunnerBodySunnySkin(); AddRailgunnerBodyStarsetSkin(); AddRailgunnerBodyKikoSkin(); AddRailgunnerBodyPinkHAFSkin(); AddRailgunnerBodyOmeletteSkin(); HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); AfterBodyCatalogInit(); } private static void RailgunnerBodyRuskSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { LookoutRuskPlugin.RailgunnerBodyRuskSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddRailgunnerBodyRuskSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "Rusk"; 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/Rusk/Textures/Icons/Classic Rusk Icon.png"); }); ((Object)skin).name = text2; skin.nameToken = "PIX97_SKIN_RUSK_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 == "Rusk [Classic] ")); }); TryCatchThrow("Game Object Activations", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) skin.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[10] { new GameObjectActivation { gameObject = ((Component)renderers[9]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[11]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[12]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[16]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[21]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[13]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[14]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[20]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[17]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[10]).gameObject, shouldActivate = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 1.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 1.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunBackpackMesh") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunBackpackScreen") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\mdlRailgunProto.001.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunProto") } }; }); 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; RailgunnerBodyRuskSkinAdded(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 RailgunnerBodyLookoutRuskSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { LookoutRuskPlugin.RailgunnerBodyLookoutRuskSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddRailgunnerBodyLookoutRuskSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "LookoutRusk"; 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/Rusk/Textures/Icons/Lookout Classic.png"); }); ((Object)skin).name = text2; skin.nameToken = "PIX97_SKIN_LOOKOUTRUSK_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 == "Rusk [Lookout] ")); }); TryCatchThrow("Game Object Activations", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) skin.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[10] { new GameObjectActivation { gameObject = ((Component)renderers[9]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[11]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[12]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[13]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[14]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[16]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[17]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[20]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[21]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[10]).gameObject, shouldActivate = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunBackpackMesh") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunBackpackScreen") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\mdlRailgunProto.001.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunProto") } }; }); 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; RailgunnerBodyLookoutRuskSkinAdded(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 RailgunnerBodyBoxtankRuskSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { LookoutRuskPlugin.RailgunnerBodyBoxtankRuskSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddRailgunnerBodyBoxtankRuskSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "BoxtankRusk"; 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/Rusk/Textures/Icons/Boxtank.png"); }); ((Object)skin).name = text2; skin.nameToken = "PIX97_SKIN_BOXTANKRUSK_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 == "Rusk [Box Tank] ")); }); TryCatchThrow("Game Object Activations", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) skin.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[10] { new GameObjectActivation { gameObject = ((Component)renderers[9]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[11]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[12]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[13]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[14]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[16]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[17]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[20]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[21]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[10]).gameObject, shouldActivate = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 4.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 4.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunBackpackMesh") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunBackpackScreen") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\mdlRailgunProto.001.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunProto") } }; }); 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; RailgunnerBodyBoxtankRuskSkinAdded(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 RailgunnerBodySunnySkinAdded(SkinDef skinDef, GameObject bodyPrefab) { LookoutRuskPlugin.RailgunnerBodySunnySkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddRailgunnerBodySunnySkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "Sunny"; 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/Rusk/Textures/Icons/Sunny Icon.png"); }); ((Object)skin).name = text2; skin.nameToken = "PIX97_SKIN_SUNNY_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 == "Rusk [Sunshine] ")); }); TryCatchThrow("Game Object Activations", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) skin.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[10] { new GameObjectActivation { gameObject = ((Component)renderers[9]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[11]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[12]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[13]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[14]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[16]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[17]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[20]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[21]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[10]).gameObject, shouldActivate = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 2.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 2.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunBackpackMesh") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunBackpackScreen") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\mdlRailgunProto.001.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunProto") } }; }); 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; RailgunnerBodySunnySkinAdded(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 RailgunnerBodyStarsetSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { LookoutRuskPlugin.RailgunnerBodyStarsetSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddRailgunnerBodyStarsetSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "Starset"; 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/Rusk/Textures/Icons/Starset.png"); }); ((Object)skin).name = text2; skin.nameToken = "PIX97_SKIN_STARSET_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 == "Rusk [Kai] ")); }); TryCatchThrow("Game Object Activations", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) skin.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[10] { new GameObjectActivation { gameObject = ((Component)renderers[9]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[11]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[12]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[13]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[14]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[16]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[17]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[20]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[21]).gameObject, shouldActivate = false }, new GameObjectActivation { gameObject = ((Component)renderers[10]).gameObject, shouldActivate = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 3.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Rusk/Textures/RorRusk 3.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerBase") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\Rusk Body.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunnerMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunBackpackMesh") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailGunBackpackScreen") }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\LookoutRusk\\Meshes\\mdlRailgunProto.001.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "mdlRailgunProto") } }; }); 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; RailgunnerBodyStarsetSkinAdded(skin, val); } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)(