Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Baka Skins tuntuntun by kim v1.4.1
k26.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using JigglePhysics; using Microsoft.CodeAnalysis; using ModelReplacement.AvatarBodyUpdater; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("k26")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c8ac6f64f31c37b4f7e30c47f577d4b4d9963846")] [assembly: AssemblyProduct("k26")] [assembly: AssemblyTitle("k26")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ModelReplacement { public abstract class SkinReplacementBase : BodyReplacementBase { protected virtual Dictionary<string, Quaternion>? FirstPersonArmOffsets => null; protected virtual string? SkirtRoots => null; protected override void AddModelScripts() { base.replacementModel.AddComponent<JiggleTeleportGuard>(); base.replacementModel.AddComponent<JiggleSegmentCollision>(); if (SkirtRoots != null && Plugin.skirtFollowsLegs.Value > 0f) { base.replacementModel.AddComponent<SkirtFollowsLegs>().Setup(SkirtRoots, Plugin.skirtFollowsLegs.Value); } } protected override void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) ((BodyReplacementBase)this).Start(); Dictionary<string, Quaternion> firstPersonArmOffsets = FirstPersonArmOffsets; if (firstPersonArmOffsets == null || (Object)(object)base.replacementViewModel == (Object)null) { return; } RotationOffset[] componentsInChildren = base.replacementViewModel.GetComponentsInChildren<RotationOffset>(true); foreach (RotationOffset val in componentsInChildren) { if (firstPersonArmOffsets.TryGetValue(((Object)val).name, out var value)) { val.offset = value; } } } } public class MRKURONEKO_DEFAULT : SkinReplacementBase { protected override string? SkirtRoots => "^Saia_"; protected override GameObject LoadAssetsAndReturnModel() { string text = "kuroneko_default"; return Assets.MainAssetBundle.LoadAsset<GameObject>(text); } } public class MRKURONEKO_SUMMER : SkinReplacementBase { protected override GameObject LoadAssetsAndReturnModel() { string text = "kuroneko_summer"; return Assets.MainAssetBundle.LoadAsset<GameObject>(text); } } public class MRSHALLTEAR : SkinReplacementBase { protected override Dictionary<string, Quaternion>? FirstPersonArmOffsets { get; } = new Dictionary<string, Quaternion> { { "Left arm", new Quaternion(-0.077496834f, 0.7634458f, -0.04130157f, -0.63987446f) }, { "Right arm", new Quaternion(-0.07543336f, -0.034105293f, -0.0055348026f, -0.9965524f) } }; protected override GameObject LoadAssetsAndReturnModel() { string text = "Shalltear"; return Assets.MainAssetBundle.LoadAsset<GameObject>(text); } } public class MROMORI_MARI : SkinReplacementBase { protected override GameObject LoadAssetsAndReturnModel() { string text = "Omori_Mari"; return Assets.MainAssetBundle.LoadAsset<GameObject>(text); } } public class JiggleSegmentCollision : MonoBehaviour { [HarmonyPatch(typeof(JiggleRigBuilder), "UpdateJiggle")] private static class StepPatch { private static void Prefix(JiggleRigBuilder __instance) { stepping = ours.Contains(__instance); } private static void Postfix() { stepping = false; } } [HarmonyPatch(typeof(JiggleBone), "CollisionPass")] private static class CollisionPatch { private static bool Prefix(JiggleBone __instance, JiggleSettingsBase jiggleSettings, List<Collider> colliders, ref Vector3 ___workingPosition, float ___normalizedIndex) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!stepping) { return true; } if (__instance.parent == null) { return false; } float radius = jiggleSettings.GetRadius(___normalizedIndex); if (radius <= 0f) { return false; } Vector3 parent = Working.Invoke(__instance.parent); foreach (Collider collider in colliders) { if ((Object)(object)collider != (Object)null) { ___workingPosition = PushOut(collider, parent, ___workingPosition, radius); } } return false; } } private const float MinLever = 0.25f; private static readonly HashSet<JiggleRigBuilder> ours = new HashSet<JiggleRigBuilder>(); private static readonly FieldRef<JiggleBone, Vector3> Working = AccessTools.FieldRefAccess<JiggleBone, Vector3>("workingPosition"); private static bool stepping; private JiggleRigBuilder[] rigs = (JiggleRigBuilder[])(object)new JiggleRigBuilder[0]; private void Awake() { if (Plugin.clothSegmentCollision.Value) { rigs = ((Component)this).GetComponentsInChildren<JiggleRigBuilder>(true); JiggleRigBuilder[] array = rigs; foreach (JiggleRigBuilder item in array) { ours.Add(item); } } } private void OnDestroy() { JiggleRigBuilder[] array = rigs; foreach (JiggleRigBuilder item in array) { ours.Remove(item); } } private static Vector3 PushOut(Collider c, Vector3 parent, Vector3 p, float radius) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0125: Unknown result type (might be due to invalid IL or missing references) if (!Shape(c, out var a, out var b, out var r)) { return Shortest(c, p, radius); } float num = r + radius; Vector3 val = Closest(a, b, p); Vector3 val2 = p - val; if (((Vector3)(ref val2)).sqrMagnitude < num * num) { p = ((((Vector3)(ref val2)).sqrMagnitude > 1E-12f) ? (val + ((Vector3)(ref val2)).normalized * num) : Shortest(c, p, radius)); } Vector3 val3 = p - parent; float magnitude = ((Vector3)(ref val3)).magnitude; if (magnitude < 1E-06f) { return p; } Nearest(parent, p, a, b, out var s, out var cp, out var cq); Vector3 val4 = cp - cq; float magnitude2 = ((Vector3)(ref val4)).magnitude; if (magnitude2 >= num || s <= 0f) { return p; } Vector3 val5; if (!(magnitude2 > 1E-06f)) { val3 = p - Closest(a, b, p); val5 = ((Vector3)(ref val3)).normalized; } else { val5 = val4 / magnitude2; } Vector3 val6 = val5; p += val6 * Mathf.Min((num - magnitude2) / Mathf.Max(s, 0.25f), magnitude); val3 = p - parent; return parent + ((Vector3)(ref val3)).normalized * magnitude; } private static bool Shape(Collider c, out Vector3 a, out Vector3 b, out float r) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) Vector3 lossyScale = ((Component)c).transform.lossyScale; ((Vector3)(ref lossyScale))..ctor(Mathf.Abs(lossyScale.x), Mathf.Abs(lossyScale.y), Mathf.Abs(lossyScale.z)); SphereCollider val = (SphereCollider)(object)((c is SphereCollider) ? c : null); if (val != null) { a = (b = ((Component)val).transform.TransformPoint(val.center)); r = val.radius * Mathf.Max(new float[3] { lossyScale.x, lossyScale.y, lossyScale.z }); return true; } CapsuleCollider val2 = (CapsuleCollider)(object)((c is CapsuleCollider) ? c : null); if (val2 != null) { int direction = val2.direction; r = val2.radius * Mathf.Max(((Vector3)(ref lossyScale))[(direction + 1) % 3], ((Vector3)(ref lossyScale))[(direction + 2) % 3]); float num = Mathf.Max(val2.height * ((Vector3)(ref lossyScale))[direction] * 0.5f - r, 0f); Vector3 val3 = Vector3.zero; ((Vector3)(ref val3))[direction] = 1f; val3 = ((Component)val2).transform.TransformDirection(val3); Vector3 val4 = ((Component)val2).transform.TransformPoint(val2.center); a = val4 - val3 * num; b = val4 + val3 * num; return true; } a = (b = Vector3.zero); r = 0f; return false; } private static Vector3 Closest(Vector3 a, Vector3 b, Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude < 1E-12f)) { return a + val * Mathf.Clamp01(Vector3.Dot(p - a, val) / sqrMagnitude); } return a; } private static void Nearest(Vector3 p0, Vector3 p1, Vector3 q0, Vector3 q1, out float s, out Vector3 cp, out Vector3 cq) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p1 - p0; Vector3 val2 = q1 - q0; Vector3 val3 = p0 - q0; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; float num = Vector3.Dot(val2, val3); float num2; if (sqrMagnitude2 < 1E-12f) { num2 = 0f; s = ((sqrMagnitude < 1E-12f) ? 0f : Mathf.Clamp01((0f - Vector3.Dot(val, val3)) / sqrMagnitude)); } else { float num3 = Vector3.Dot(val, val3); float num4 = Vector3.Dot(val, val2); float num5 = sqrMagnitude * sqrMagnitude2 - num4 * num4; s = ((num5 > 1E-12f) ? Mathf.Clamp01((num4 * num - num3 * sqrMagnitude2) / num5) : 0f); num2 = (num4 * s + num) / sqrMagnitude2; if (num2 < 0f) { num2 = 0f; s = Mathf.Clamp01((0f - num3) / sqrMagnitude); } else if (num2 > 1f) { num2 = 1f; s = Mathf.Clamp01((num4 - num3) / sqrMagnitude); } } cp = p0 + val * s; cq = q0 + val2 * num2; } private static Vector3 Shortest(Collider c, Vector3 p, float radius) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) SphereCollider val = default(SphereCollider); if (!CachedSphereCollider.TryGet(ref val)) { return p; } val.radius = radius; Vector3 val2 = default(Vector3); float num = default(float); if (!Physics.ComputePenetration((Collider)(object)val, p, Quaternion.identity, c, ((Component)c).transform.position, ((Component)c).transform.rotation, ref val2, ref num)) { return p; } return p + val2 * num; } } [DefaultExecutionOrder(100)] public class JiggleTeleportGuard : MonoBehaviour { private const float JumpMeters = 4f; private JiggleRigBuilder[] rigs = (JiggleRigBuilder[])(object)new JiggleRigBuilder[0]; private Vector3 lastPosition; private bool hasLast; private int resetFrames; private void Start() { rigs = ((Component)this).GetComponentsInChildren<JiggleRigBuilder>(true); } private void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; if (hasLast) { Vector3 val = position - lastPosition; if (((Vector3)(ref val)).sqrMagnitude > 16f) { resetFrames = 2; } } lastPosition = position; hasLast = true; if (resetFrames <= 0) { return; } resetFrames--; JiggleRigBuilder[] array = rigs; foreach (JiggleRigBuilder val2 in array) { if ((Object)(object)val2 != (Object)null) { val2.MatchAnimationInstantly(); } } } } [BepInPlugin("com.kimkjin12.bakaskinskim", "BakaSkinstuntuntun", "1.4.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static ConfigFile config; public static ConfigEntry<bool> enableModelForAllSuits { get; private set; } public static ConfigEntry<bool> enableModelAsDefault { get; private set; } public static ConfigEntry<string> suitNamesToEnableModel { get; private set; } public static ConfigEntry<bool> clothSegmentCollision { get; private set; } public static ConfigEntry<float> skirtFollowsLegs { get; private set; } private static void InitConfig() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown enableModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits"); enableModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered."); suitNamesToEnableModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Model for", "Default,Orange suit", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])"); clothSegmentCollision = config.Bind<bool>("Physics", "Cloth collides along its length", true, "Keep the whole skirt and hair cloth between two physics bones out of the legs and body, not only the bones. Turn off if it misbehaves with another physics mod."); skirtFollowsLegs = config.Bind<float>("Physics", "Skirt follows the legs", 0.5f, new ConfigDescription("How much of each thigh's swing Kuroneko's long dress copies: 0 leaves it to the physics alone, 1 moves it with the thigh.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); } private void Awake() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) config = ((BaseUnityPlugin)this).Config; InitConfig(); Assets.PopulateAssets(); ModelReplacementAPI.RegisterSuitModelReplacement("KuronekoDefault", typeof(MRKURONEKO_DEFAULT)); ModelReplacementAPI.RegisterSuitModelReplacement("KuronekoSummer", typeof(MRKURONEKO_SUMMER)); ModelReplacementAPI.RegisterSuitModelReplacement("Shalltear", typeof(MRSHALLTEAR)); ModelReplacementAPI.RegisterSuitModelReplacement("OmoriMari", typeof(MROMORI_MARI)); new Harmony("com.kimkjin12.bakaskinskim").PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.kimkjin12.bakaskinskim is loaded!"); } } public static class Assets { public static string mainAssetBundleName = "BakaSkinsKim"; public static AssetBundle MainAssetBundle = null; private static string GetAssemblyName() { return Assembly.GetExecutingAssembly().GetName().Name.Replace(" ", "_"); } public static void PopulateAssets() { if ((Object)(object)MainAssetBundle == (Object)null) { Console.WriteLine(GetAssemblyName() + "." + mainAssetBundleName); using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetAssemblyName() + "." + mainAssetBundleName); MainAssetBundle = AssetBundle.LoadFromStream(stream); } } } [DefaultExecutionOrder(110)] public class SkirtFollowsLegs : MonoBehaviour { private class Column { public Transform bone; public Quaternion rest; public Vector3 outward; } [SerializeField] private string roots = ""; [SerializeField] private float amount; private readonly List<Column> columns = new List<Column>(); private Transform? pelvis; private readonly Transform[] thighs = (Transform[])(object)new Transform[2]; private readonly Transform[] knees = (Transform[])(object)new Transform[2]; private readonly Vector3[] restLegs = (Vector3[])(object)new Vector3[2]; private readonly Quaternion[] swings = (Quaternion[])(object)new Quaternion[2]; private readonly Vector3[] towards = (Vector3[])(object)new Vector3[2]; private Vector3 up; public void Setup(string skirtRoots, float share) { roots = skirtRoots; amount = share; Init(); } private void Awake() { if (roots.Length > 0) { Init(); } } private void Init() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) columns.Clear(); pelvis = null; Animator componentInChildren = ((Component)this).GetComponentInChildren<Animator>(true); if ((Object)(object)componentInChildren == (Object)null || amount <= 0f) { return; } Transform boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)0); thighs[0] = componentInChildren.GetBoneTransform((HumanBodyBones)1); thighs[1] = componentInChildren.GetBoneTransform((HumanBodyBones)2); knees[0] = componentInChildren.GetBoneTransform((HumanBodyBones)3); knees[1] = componentInChildren.GetBoneTransform((HumanBodyBones)4); if ((Object)(object)boneTransform == (Object)null || (Object)(object)thighs[0] == (Object)null || (Object)(object)thighs[1] == (Object)null || (Object)(object)knees[0] == (Object)null || (Object)(object)knees[1] == (Object)null) { return; } up = boneTransform.InverseTransformDirection(((Component)this).transform.up); for (int i = 0; i < 2; i++) { Vector3[] array = restLegs; int num = i; Vector3 val = boneTransform.InverseTransformDirection(knees[i].position - thighs[i].position); array[num] = ((Vector3)(ref val)).normalized; } Regex regex = new Regex(roots); JiggleRigBuilder[] componentsInChildren = ((Component)this).GetComponentsInChildren<JiggleRigBuilder>(true); for (int j = 0; j < componentsInChildren.Length; j++) { Transform rootTransform = componentsInChildren[j].GetRootTransform(); if (!((Object)(object)rootTransform == (Object)null) && !((Object)(object)rootTransform.parent == (Object)null) && regex.IsMatch(((Object)rootTransform).name)) { Vector3 val2 = Vector3.ProjectOnPlane(boneTransform.InverseTransformPoint(rootTransform.position), up); if (!(((Vector3)(ref val2)).sqrMagnitude < 1E-12f)) { columns.Add(new Column { bone = rootTransform, rest = rootTransform.localRotation, outward = ((Vector3)(ref val2)).normalized }); } } } pelvis = boneTransform; } private void LateUpdate() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pelvis == (Object)null || (Object)(object)thighs[0] == (Object)null || (Object)(object)thighs[1] == (Object)null || (Object)(object)knees[0] == (Object)null || (Object)(object)knees[1] == (Object)null) { return; } for (int i = 0; i < 2; i++) { swings[i] = Quaternion.FromToRotation(restLegs[i], pelvis.InverseTransformDirection(knees[i].position - thighs[i].position)); Vector3[] array = towards; int num = i; Vector3 val = Vector3.ProjectOnPlane(pelvis.InverseTransformPoint(knees[i].position), up); array[num] = ((Vector3)(ref val)).normalized; } Quaternion rotation = pelvis.rotation; Quaternion val2 = Quaternion.Inverse(rotation); foreach (Column column in columns) { if (!((Object)(object)column.bone == (Object)null)) { Quaternion val3 = Quaternion.identity; for (int j = 0; j < 2; j++) { float num2 = Mathf.Max(0f, Vector3.Dot(column.outward, towards[j])); val3 = Quaternion.Slerp(Quaternion.identity, swings[j], amount * num2 * num2) * val3; } column.bone.rotation = rotation * val3 * val2 * column.bone.parent.rotation * column.rest; } } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }