Decompiled source of ButterflyKnifeOnShop v0.2.0
BepInEx/plugins/MoreKnives/HowToFish.MoreKnives.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; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Logging; using FishNet.Connection; using FishNet.Object; using HarmonyLib; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] namespace HowToFish.MoreKnives; internal static class EmbeddedKnifeMesh { private const string ButterflyResourceName = "HowToFish.MoreKnives.ButterflyV4"; private const string ButterflyIconResourceName = "HowToFish.MoreKnives.ButterflyV4Icon"; private const int CurrentFormatVersion = 2; private const int LegacyFormatVersion = 1; public static bool TryLoadButterfly(List<KnifePart> parts, out KnifeMeshRigMetadata metadata, out string error) { //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) error = null; metadata = null; if (parts == null) { error = "Destination part list is null."; return false; } try { using Stream stream = typeof(EmbeddedKnifeMesh).Assembly.GetManifestResourceStream("HowToFish.MoreKnives.ButterflyV4"); if (stream == null) { error = "Embedded ButterflyV4 mesh resource is missing."; return false; } using BinaryReader binaryReader = new BinaryReader(stream); byte[] array = binaryReader.ReadBytes(4); if (array.Length != 4 || array[0] != 77 || array[1] != 75 || array[2] != 66 || array[3] != 70) { error = "ButterflyV4 mesh header is invalid."; return false; } int num = binaryReader.ReadInt32(); int num2 = binaryReader.ReadInt32(); if ((num != 2 && num != 1) || num2 <= 0 || num2 > 128) { error = "Unsupported ButterflyV4 mesh version or part count (" + num + ", " + num2 + ")."; return false; } metadata = ReadRigMetadata(binaryReader, num); List<KnifePart> list = new List<KnifePart>(num2); bool flag = false; bool flag2 = false; bool flag3 = false; int num3 = 0; int num4 = 0; for (int i = 0; i < num2; i++) { string text = ReadString(binaryReader); string text2 = ReadString(binaryReader); int num5 = binaryReader.ReadInt32(); Vector3 groupPivot = ReadVector3(binaryReader); int num6 = binaryReader.ReadInt32(); int num7 = binaryReader.ReadInt32(); if (num6 <= 0 || num6 > 500000 || num7 <= 0 || num7 > 2000000 || num7 % 3 != 0) { throw new InvalidDataException("Unsafe mesh counts in part " + text + "."); } if (num5 < 0 || num5 > 4) { throw new InvalidDataException("Unknown material ID in part " + text + "."); } Vector3[] array2 = (Vector3[])(object)new Vector3[num6]; Vector3[] array3 = (Vector3[])(object)new Vector3[num6]; int[] array4 = new int[num7]; for (int j = 0; j < num6; j++) { array2[j] = ReadVector3(binaryReader); } for (int k = 0; k < num6; k++) { array3[k] = ReadVector3(binaryReader); } for (int l = 0; l < num7; l++) { int num8 = binaryReader.ReadInt32(); if (num8 < 0 || num8 >= num6) { throw new InvalidDataException("Out-of-range triangle index in part " + text + "."); } array4[l] = num8; } Mesh val = new Mesh(); ((Object)val).name = "Butterfly V4 " + text; ((Object)val).hideFlags = (HideFlags)52; if (num6 > 65535) { val.indexFormat = (IndexFormat)1; } val.vertices = array2; val.normals = array3; val.triangles = array4; val.RecalculateBounds(); val.UploadMeshData(false); list.Add(new KnifePart { Name = text, Mesh = val, Material = (PartMaterial)num5, Position = Vector3.zero, AnimationGroup = text2, GroupPivot = groupPivot }); flag |= text2 == "ButterflyBlade"; flag2 |= text2 == "ButterflyHandleSafe"; flag3 |= text2 == "ButterflyHandleBite"; num3 += num6; num4 += num7 / 3; } if (!flag || !flag2 || !flag3 || stream.Position != stream.Length) { throw new InvalidDataException("ButterflyV4 hierarchy is incomplete or the payload has trailing data."); } parts.AddRange(list); MoreKnivesPlugin.Log.LogInfo((object)("Loaded Blender Butterfly V4: " + list.Count + " parts, " + num3 + " vertices, " + num4 + " triangles, MKBF v" + num + " physical pivots verified.")); return true; } catch (Exception ex) { error = ex.GetType().Name + ": " + ex.Message; metadata = null; return false; } } private static KnifeMeshRigMetadata ReadRigMetadata(BinaryReader reader, int version) { //IL_0020: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (version == 1) { return new KnifeMeshRigMetadata { FormatVersion = 1 }; } KnifeMeshRigMetadata knifeMeshRigMetadata = new KnifeMeshRigMetadata(); knifeMeshRigMetadata.FormatVersion = version; knifeMeshRigMetadata.GripSocketPosition = ReadVector3(reader); knifeMeshRigMetadata.GripSocketEuler = ReadVector3(reader); knifeMeshRigMetadata.CanonicalBasisEuler = ReadVector3(reader); knifeMeshRigMetadata.IntendedScale = reader.ReadSingle(); knifeMeshRigMetadata.MechanicalPivots = new ButterflyPivotDefinition(ReadVector3(reader), ReadVector3(reader), ReadVector3(reader)); if (knifeMeshRigMetadata.IntendedScale <= 0f || knifeMeshRigMetadata.IntendedScale > 1000f) { throw new InvalidDataException("Unsafe MKBF intended scale."); } return knifeMeshRigMetadata; } public static Texture2D LoadButterflyIcon() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown try { using Stream stream = typeof(EmbeddedKnifeMesh).Assembly.GetManifestResourceStream("HowToFish.MoreKnives.ButterflyV4Icon"); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; int num; for (int i = 0; i < array.Length; i += num) { num = stream.Read(array, i, array.Length - i); if (num <= 0) { return null; } } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ((Object)val).name = "More Knives Butterfly V4 Icon"; ((Object)val).hideFlags = (HideFlags)52; ((Texture)val).filterMode = (FilterMode)1; if (!ImageConversion.LoadImage(val, array, true)) { Object.Destroy((Object)(object)val); return null; } return val; } catch (Exception ex) { MoreKnivesPlugin.Log.LogWarning((object)("Could not load Butterfly V4 icon: " + ex.Message)); return null; } } private static string ReadString(BinaryReader reader) { int num = reader.ReadInt32(); if (num < 0 || num > 1024) { throw new InvalidDataException("Unsafe string length in embedded mesh."); } byte[] array = reader.ReadBytes(num); if (array.Length != num) { throw new EndOfStreamException(); } return Encoding.UTF8.GetString(array); } private static Vector3 ReadVector3(BinaryReader reader) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); } } internal sealed class KnifePart { public string Name; public Mesh Mesh; public Vector3 Position = Vector3.zero; public Quaternion Rotation = Quaternion.identity; public Vector3 Scale = Vector3.one; public PartMaterial Material; public string AnimationGroup; public Vector3 GroupPivot; } internal sealed class KnifeAssetSet { public readonly List<KnifePart> Parts = new List<KnifePart>(); public Mesh InventoryMesh; public Material BladeMaterial; public Material EdgeMaterial; public Material GripMaterial; public Material AccentMaterial; public Material DarkMaterial; } internal sealed class KnifeWorldRig { public Transform AttachmentRoot; public Transform GripPose; public Transform InspectRoot; public GameObject ModelRoot; } internal static class KnifeAssets { private static readonly Dictionary<byte, KnifeAssetSet> Cache = new Dictionary<byte, KnifeAssetSet>(); public static void WarmUp() { foreach (KnifeDefinition definition in KnifeCatalog.Definitions) { if (!definition.UsesVanillaModel) { Get(definition); } } } public static KnifeAssetSet Get(KnifeDefinition definition) { if (Cache.TryGetValue(definition.VariantCode, out var value)) { return value; } value = Build(definition); Cache.Add(definition.VariantCode, value); return value; } public static GameObject CreateWorldModel(KnifeDefinition definition, Transform parent, string suffix) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0114: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_0149: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) KnifeAssetSet knifeAssetSet = Get(definition); GameObject val = new GameObject("MoreKnivesModel_" + definition.VariantCode + suffix); ((Object)val).hideFlags = (HideFlags)52; val.transform.SetParent(parent, false); Dictionary<string, Transform> dictionary = CreateAnimationGroups(definition, knifeAssetSet.Parts, val.transform, suffix); foreach (KnifePart part in knifeAssetSet.Parts) { Transform val2 = val.transform; Vector3 val3 = part.Position; if (!string.IsNullOrEmpty(part.AnimationGroup)) { if (!dictionary.TryGetValue(part.AnimationGroup, out var value)) { GameObject val4 = new GameObject(part.AnimationGroup + suffix) { hideFlags = (HideFlags)52 }; val4.transform.SetParent(val.transform, false); val4.transform.localPosition = part.GroupPivot; value = val4.transform; dictionary.Add(part.AnimationGroup, value); } val2 = value; val3 -= part.GroupPivot; } GameObject val5 = new GameObject(part.Name + suffix) { hideFlags = (HideFlags)52 }; val5.transform.SetParent(val2, false); val5.transform.localPosition = val3; val5.transform.localRotation = part.Rotation; val5.transform.localScale = part.Scale; val5.AddComponent<MeshFilter>().sharedMesh = part.Mesh; ((Renderer)val5.AddComponent<MeshRenderer>()).sharedMaterial = GetMaterial(knifeAssetSet, part.Material); } SetLayerRecursively(val, ((Component)parent).gameObject.layer); if (definition.Rig != null) { val.transform.localPosition = -definition.Rig.Model.GripSocketPosition; } return val; } public static KnifeWorldRig CreateAttachmentRig(KnifeDefinition definition, Transform knifeBone, string suffix) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_008a: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_015a: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) if (definition == null || definition.Rig == null || !Object.op_Implicit((Object)(object)knifeBone)) { return null; } GameObject val = new GameObject("MoreKnivesAttachmentRoot"); ((Object)val).hideFlags = (HideFlags)52; val.transform.SetParent(knifeBone, false); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; GameObject val2 = new GameObject("GripPose_" + definition.Shape); ((Object)val2).hideFlags = (HideFlags)52; val2.transform.SetParent(val.transform, false); ApplyGripPose(val2.transform, definition.Rig.RuntimeGripPose); GameObject val3 = new GameObject("InspectRoot"); ((Object)val3).hideFlags = (HideFlags)52; val3.transform.SetParent(val2.transform, false); val3.transform.localPosition = Vector3.zero; val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = Vector3.one; GameObject val4 = CreateWorldModel(definition, val3.transform, suffix); ((Object)val4).name = ((definition.Shape == KnifeShape.Butterfly) ? "ButterflyRoot" : ((Object)val4).name); val4.transform.localPosition = Vector3.zero; val4.transform.localRotation = Quaternion.Euler(definition.Rig.Model.CanonicalBasisEuler); val4.transform.localScale = Vector3.one * definition.Rig.Model.IntendedScale; return new KnifeWorldRig { AttachmentRoot = val.transform, GripPose = val2.transform, InspectRoot = val3.transform, ModelRoot = val4 }; } public static void ApplyGripPose(Transform target, GripPoseDefinition pose) { //IL_000e: 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_001f: 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_0035: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)target) && pose != null) { target.localPosition = pose.Position; target.localRotation = Quaternion.Euler(pose.Euler); target.localScale = Vector3.one * pose.Scale; } } public static bool ValidateCompatibilityMatrix(KnifeDefinition definition, out float maximumError) { //IL_003a: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_005f: 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) //IL_006a: 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_007a: 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_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_008a: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c4: Unknown result type (might be due to invalid IL or missing references) maximumError = float.PositiveInfinity; if (definition == null || definition.Rig == null || definition.Rig.CompatibilityGripPose == null) { return false; } KnifeModelRigDefinition model = definition.Rig.Model; GripPoseDefinition compatibilityGripPose = definition.Rig.CompatibilityGripPose; Matrix4x4 val = Matrix4x4.TRS(compatibilityGripPose.Position, Quaternion.Euler(compatibilityGripPose.Euler), Vector3.one * compatibilityGripPose.Scale) * Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(model.CanonicalBasisEuler), Vector3.one * model.IntendedScale); Matrix4x4 val2 = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(model.CanonicalBasisEuler), Vector3.one * model.IntendedScale) * Matrix4x4.Translate(-model.GripSocketPosition); maximumError = 0f; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { maximumError = Mathf.Max(maximumError, Mathf.Abs(((Matrix4x4)(ref val))[i, j] - ((Matrix4x4)(ref val2))[i, j])); } } return maximumError < 1E-05f; } private static Dictionary<string, Transform> CreateAnimationGroups(KnifeDefinition definition, List<KnifePart> parts, Transform root, string suffix) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0064: 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) Dictionary<string, Transform> dictionary = new Dictionary<string, Transform>(); if (definition.Shape != KnifeShape.Butterfly) { return dictionary; } if (!TryFindGroupPivot(parts, "ButterflyBlade", out var pivot) || !TryFindGroupPivot(parts, "ButterflyHandleSafe", out var pivot2) || !TryFindGroupPivot(parts, "ButterflyHandleBite", out var pivot3)) { return dictionary; } Transform value = CreateGroup(root, "BiteHandlePivot", pivot3); Transform val = CreateGroup(root, "BladePivot", pivot); Transform value2 = CreateGroup(val, "SafeHandlePivot", pivot2 - pivot); dictionary.Add("ButterflyHandleBite", value); dictionary.Add("ButterflyBlade", val); dictionary.Add("ButterflyHandleSafe", value2); return dictionary; } private static Transform CreateGroup(Transform parent, string name, Vector3 localPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_001b: 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) GameObject val = new GameObject(name) { hideFlags = (HideFlags)52 }; val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; return val.transform; } private static bool TryFindGroupPivot(List<KnifePart> parts, string group, out Vector3 pivot) { //IL_0021: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) foreach (KnifePart part in parts) { if (part.AnimationGroup == group) { pivot = part.GroupPivot; return true; } } pivot = Vector3.zero; return false; } public static Material GetBladeMaterial(KnifeDefinition definition) { return Get(definition).BladeMaterial; } private static KnifeAssetSet Build(KnifeDefinition definition) { //IL_0022: 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) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) KnifeAssetSet knifeAssetSet = new KnifeAssetSet(); bool flag = definition.Shape == KnifeShape.Butterfly; knifeAssetSet.BladeMaterial = CreateMaterial(definition.DisplayName + " Blade", definition.BladeColor, flag ? 0.94f : 0.88f, flag ? 0.86f : 0.76f, !flag); knifeAssetSet.EdgeMaterial = CreateMaterial(definition.DisplayName + " Edge", Color.Lerp(definition.BladeColor, Color.white, 0.46f), 0.98f, 0.94f, !flag); knifeAssetSet.GripMaterial = CreateMaterial(definition.DisplayName + " Grip", definition.GripColor, flag ? 0.9f : 0.08f, flag ? 0.78f : 0.28f, !flag); knifeAssetSet.AccentMaterial = CreateMaterial(definition.DisplayName + " Accent", definition.AccentColor, flag ? 0.76f : 0.68f, flag ? 0.82f : 0.58f, !flag); knifeAssetSet.DarkMaterial = CreateMaterial(definition.DisplayName + " Dark Detail", Color.Lerp(definition.GripColor, Color.black, 0.82f), 0.72f, 0.38f, !flag); BuildParts(definition, knifeAssetSet.Parts); knifeAssetSet.InventoryMesh = CombineForInventory(definition, knifeAssetSet.Parts); return knifeAssetSet; } private static void BuildParts(KnifeDefinition definition, List<KnifePart> parts) { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) if (definition.Shape == KnifeShape.Karambit || definition.Shape == KnifeShape.Talon) { BuildCurvedKnife(definition, parts); return; } if (definition.Shape == KnifeShape.DualDaggers) { BuildPushDagger(definition, parts); return; } if (definition.Shape == KnifeShape.Butterfly) { BuildButterfly(definition, parts); return; } if (definition.Shape == KnifeShape.Skeleton) { BuildSkeleton(definition, parts); return; } float bladeWidth = definition.BladeWidth; float lengthScale = definition.LengthScale; Vector2[] input = BladePolygon(definition.Shape, bladeWidth, lengthScale); Add(parts, "Blade", MeshBuilder.ExtrudePolygon(input, 0.035f, definition.DisplayName + " Blade"), PartMaterial.Blade); float num = Mathf.Clamp(bladeWidth * 0.78f, 0.105f, 0.17f); if (definition.Shape == KnifeShape.Paracord) { Add(parts, "ParacordCore", MeshBuilder.Box2D((0f - num) * 0.34f, 0f, num * 0.34f, 0.32f, 0.065f, "Paracord Core"), PartMaterial.Grip); for (int i = 0; i < 5; i++) { float num2 = 0.025f + (float)i * 0.058f; Add(parts, "ParacordWrap" + i, MeshBuilder.Box2D((0f - num) * 0.55f, num2, num * 0.55f, num2 + 0.035f, 0.082f, "Paracord Wrap"), PartMaterial.Accent); } } else { Vector2[] input2 = (Vector2[])(object)new Vector2[6] { new Vector2((0f - num) * 0.48f, 0f), new Vector2(num * 0.48f, 0f), new Vector2(num * 0.56f, 0.06f), new Vector2(num * 0.48f, 0.31f), new Vector2((0f - num) * 0.48f, 0.31f), new Vector2((0f - num) * 0.56f, 0.06f) }; Add(parts, "Grip", MeshBuilder.ExtrudePolygon(input2, 0.075f, definition.DisplayName + " Grip"), PartMaterial.Grip); } AddHandleHardware(definition, parts, num); Add(parts, "Guard", MeshBuilder.Box2D((0f - bladeWidth) * 0.66f, 0.285f, bladeWidth * 0.66f, 0.335f, 0.075f, "Guard"), PartMaterial.Accent); Add(parts, "Pommel", MeshBuilder.Box2D((0f - num) * 0.58f, -0.018f, num * 0.58f, 0.035f, 0.08f, "Pommel"), PartMaterial.Accent); if (definition.Shape == KnifeShape.Bayonet || definition.Shape == KnifeShape.M9Bayonet) { Add(parts, "GuardRing", MeshBuilder.Torus(0.085f, 0.014f, 22, 7, "Guard Ring"), PartMaterial.Edge, new Vector3(bladeWidth * 0.78f, 0.31f, 0.025f)); } if (definition.Shape == KnifeShape.Gut) { Vector2[] input3 = (Vector2[])(object)new Vector2[3] { new Vector2(-0.02f, 0.61f), new Vector2(bladeWidth * 0.73f, 0.69f), new Vector2(bladeWidth * 0.54f, 0.79f) }; Add(parts, "GutHook", MeshBuilder.ExtrudePolygon(input3, 0.04f, "Gut Hook"), PartMaterial.Accent); } else if (definition.Shape == KnifeShape.M9Bayonet || definition.Shape == KnifeShape.Survival) { for (int j = 0; j < 5; j++) { float num3 = 0.47f + (float)j * 0.07f; Vector2[] input4 = (Vector2[])(object)new Vector2[3] { new Vector2((0f - bladeWidth) * 0.5f, num3), new Vector2((0f - bladeWidth) * 0.76f, num3 + 0.035f), new Vector2((0f - bladeWidth) * 0.48f, num3 + 0.065f) }; Add(parts, "Serration" + j, MeshBuilder.ExtrudePolygon(input4, 0.04f, "Serration"), PartMaterial.Accent); } } else if (definition.Shape == KnifeShape.Stiletto) { Add(parts, "CenterRidge", MeshBuilder.Box2D(-0.012f, 0.31f, 0.012f, lengthScale * 0.92f, 0.052f, "Stiletto Ridge"), PartMaterial.Accent); } else if (definition.Shape == KnifeShape.Nomad || definition.Shape == KnifeShape.Huntsman) { Add(parts, "Fuller", MeshBuilder.Box2D((0f - bladeWidth) * 0.18f, 0.42f, bladeWidth * 0.18f, lengthScale * 0.82f, 0.043f, "Blade Fuller"), PartMaterial.Accent); } if (definition.Shape != KnifeShape.Stiletto) { AddBladeFaceDetail(definition, parts, bladeWidth, lengthScale); } } private static void AddHandleHardware(KnifeDefinition definition, List<KnifePart> parts, float gripWidth) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(0.022f, gripWidth * 0.3f); Add(parts, "HandlePanel", MeshBuilder.Box2D((0f - gripWidth) * 0.34f, 0.055f, gripWidth * 0.34f, 0.265f, 0.082f, "Handle Panel"), PartMaterial.Accent, new Vector3(0f, 0f, 0.04f)); Add(parts, "HandlePinTop", MeshBuilder.Torus(0.014f, 0.005f, 14, 6, "Handle Pin"), PartMaterial.Edge, new Vector3(num, 0.245f, 0.048f)); Add(parts, "HandlePinBottom", MeshBuilder.Torus(0.014f, 0.005f, 14, 6, "Handle Pin"), PartMaterial.Edge, new Vector3(0f - num, 0.065f, 0.048f)); for (int i = 0; i < 6; i++) { float num2 = 0.065f + (float)i * 0.036f; Add(parts, "GripRidge" + i, MeshBuilder.Box2D((0f - gripWidth) * 0.47f, num2, gripWidth * 0.47f, num2 + 0.013f, 0.088f, "Grip Ridge"), PartMaterial.Accent, new Vector3(0f, 0f, 0.043f)); } if (definition.Shape == KnifeShape.Bowie || definition.Shape == KnifeShape.Huntsman || definition.Shape == KnifeShape.Classic) { Add(parts, "HandleGroove", MeshBuilder.Box2D((0f - gripWidth) * 0.38f, 0.11f, gripWidth * 0.38f, 0.132f, 0.086f, "Handle Groove"), PartMaterial.Grip, new Vector3(0f, 0f, 0.044f)); } } private static void AddBladeFaceDetail(KnifeDefinition definition, List<KnifePart> parts, float width, float tip) { //IL_0015: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) Vector2[] input = (Vector2[])(object)new Vector2[5] { new Vector2((0f - width) * 0.1f, 0.39f), new Vector2(width * 0.1f, 0.39f), new Vector2(width * 0.065f, tip * 0.79f), new Vector2(0f, tip * 0.91f), new Vector2((0f - width) * 0.065f, tip * 0.79f) }; Add(parts, "BladeFaceGroove", MeshBuilder.ExtrudePolygon(input, 0.01f, "Blade Face Groove"), PartMaterial.Accent, new Vector3(0f, 0f, 0.021f)); if (definition.Shape == KnifeShape.Bayonet || definition.Shape == KnifeShape.M9Bayonet) { Add(parts, "BladeLanyardHole", MeshBuilder.Torus(0.026f, 0.008f, 20, 7, "Blade Lanyard Hole"), PartMaterial.Edge, new Vector3(0f, tip * 0.64f, 0.026f)); } } private static void BuildCurvedKnife(KnifeDefinition definition, List<KnifePart> parts) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0064: 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_007a: 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_0090: 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_012a: Unknown result type (might be due to invalid IL or missing references) if (definition.Shape == KnifeShape.Karambit) { BuildKarambit(parts); return; } Vector2[] centerLine = (Vector2[])(object)new Vector2[6] { new Vector2(0f, 0.29f), new Vector2(0.15f, 0.45f), new Vector2(0.23f, 0.64f), new Vector2(0.19f, 0.83f), new Vector2(0.05f, 1f), new Vector2(-0.1f, 1.06f) }; Add(parts, "CurvedBlade", MeshBuilder.Ribbon(centerLine, definition.BladeWidth * 0.42f, 0.035f, definition.DisplayName + " Blade"), PartMaterial.Blade); Add(parts, "Grip", MeshBuilder.Box2D(-0.075f, 0.03f, 0.075f, 0.32f, 0.075f, "Curved Grip"), PartMaterial.Grip); Add(parts, "FingerRing", MeshBuilder.Torus(0.085f, 0.022f, 20, 7, "Finger Ring"), PartMaterial.Accent, new Vector3(0f, 0.02f, 0f)); Add(parts, "Guard", MeshBuilder.Box2D(-0.105f, 0.285f, 0.105f, 0.335f, 0.075f, "Curved Guard"), PartMaterial.Accent); } private static void BuildKarambit(List<KnifePart> parts) { //IL_0013: 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_0029: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_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_0081: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: 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_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: 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_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0869: Unknown result type (might be due to invalid IL or missing references) //IL_0892: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_092a: Unknown result type (might be due to invalid IL or missing references) Vector2[] centerLine = (Vector2[])(object)new Vector2[10] { new Vector2(0f, 0.3f), new Vector2(-0.055f, 0.4f), new Vector2(-0.135f, 0.52f), new Vector2(-0.245f, 0.64f), new Vector2(-0.385f, 0.73f), new Vector2(-0.535f, 0.77f), new Vector2(-0.675f, 0.74f), new Vector2(-0.785f, 0.67f), new Vector2(-0.865f, 0.56f), new Vector2(-0.915f, 0.44f) }; Add(parts, "KarambitBlade", MeshBuilder.Ribbon(centerLine, 0.118f, 0.052f, "Karambit Blade"), PartMaterial.Blade); Vector2[] centerLine2 = (Vector2[])(object)new Vector2[6] { new Vector2(-0.02f, 0.34f), new Vector2(-0.13f, 0.53f), new Vector2(-0.29f, 0.67f), new Vector2(-0.47f, 0.74f), new Vector2(-0.66f, 0.72f), new Vector2(-0.81f, 0.63f) }; Add(parts, "KarambitSpineHighlight", MeshBuilder.Ribbon(centerLine2, 0.014f, 0.01f, "Karambit Spine Highlight"), PartMaterial.Edge, new Vector3(0f, 0f, 0.033f)); Vector2[] centerLine3 = (Vector2[])(object)new Vector2[7] { new Vector2(-0.025f, 0.38f), new Vector2(-0.12f, 0.51f), new Vector2(-0.25f, 0.62f), new Vector2(-0.4f, 0.69f), new Vector2(-0.56f, 0.71f), new Vector2(-0.7f, 0.67f), new Vector2(-0.8f, 0.59f) }; Add(parts, "KarambitFuller", MeshBuilder.Ribbon(centerLine3, 0.022f, 0.014f, "Karambit Fuller"), PartMaterial.Accent, new Vector3(0f, 0f, 0.034f)); Vector2[] centerLine4 = (Vector2[])(object)new Vector2[8] { new Vector2(-0.025f, 0.31f), new Vector2(-0.11f, 0.43f), new Vector2(-0.22f, 0.56f), new Vector2(-0.36f, 0.66f), new Vector2(-0.52f, 0.71f), new Vector2(-0.68f, 0.69f), new Vector2(-0.81f, 0.61f), new Vector2(-0.89f, 0.5f) }; Add(parts, "KarambitCuttingEdge", MeshBuilder.Ribbon(centerLine4, 0.014f, 0.012f, "Karambit Cutting Edge"), PartMaterial.Edge, new Vector3(0f, 0f, 0.036f)); Vector2[] input = (Vector2[])(object)new Vector2[15] { new Vector2(-0.105f, 0.295f), new Vector2(0.105f, 0.295f), new Vector2(0.125f, 0.255f), new Vector2(0.104f, 0.205f), new Vector2(0.126f, 0.155f), new Vector2(0.106f, 0.105f), new Vector2(0.127f, 0.055f), new Vector2(0.105f, -0.005f), new Vector2(0.067f, -0.06f), new Vector2(-0.064f, -0.06f), new Vector2(-0.108f, -0.005f), new Vector2(-0.092f, 0.055f), new Vector2(-0.112f, 0.105f), new Vector2(-0.094f, 0.16f), new Vector2(-0.114f, 0.215f) }; Add(parts, "KarambitGrip", MeshBuilder.ExtrudePolygon(input, 0.086f, "Karambit Grip"), PartMaterial.Grip); Vector2[] input2 = (Vector2[])(object)new Vector2[13] { new Vector2(-0.084f, 0.265f), new Vector2(0.084f, 0.265f), new Vector2(0.099f, 0.215f), new Vector2(0.081f, 0.165f), new Vector2(0.1f, 0.11f), new Vector2(0.08f, 0.055f), new Vector2(0.094f, 0.015f), new Vector2(0.046f, -0.027f), new Vector2(-0.046f, -0.027f), new Vector2(-0.082f, 0.02f), new Vector2(-0.075f, 0.075f), new Vector2(-0.086f, 0.13f), new Vector2(-0.073f, 0.2f) }; Add(parts, "KarambitScale", MeshBuilder.ExtrudePolygon(input2, 0.014f, "Karambit Scale"), PartMaterial.Accent, new Vector3(0f, 0f, 0.049f)); for (int i = 0; i < 4; i++) { float num = 0.045f + (float)i * 0.053f; Add(parts, "KarambitScaleChannel" + i, MeshBuilder.Box2D(-0.066f, num, 0.066f, num + 0.013f, 0.01f, "Karambit Scale Channel"), PartMaterial.Grip, new Vector3(0f, 0f, 0.059f)); } Add(parts, "KarambitGuard", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[4] { new Vector2(-0.125f, 0.275f), new Vector2(0.125f, 0.275f), new Vector2(0.112f, 0.326f), new Vector2(-0.112f, 0.326f) }, 0.09f, "Karambit Guard"), PartMaterial.Accent); Add(parts, "KarambitRingBridge", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[4] { new Vector2(-0.07f, -0.08f), new Vector2(0.07f, -0.08f), new Vector2(0.062f, 0.03f), new Vector2(-0.062f, 0.03f) }, 0.092f, "Karambit Ring Bridge"), PartMaterial.Grip); Add(parts, "FingerRingOuter", MeshBuilder.Torus(0.104f, 0.02f, 32, 10, "Karambit Finger Ring Outer"), PartMaterial.Edge, new Vector3(0f, -0.112f, 0.02f)); Add(parts, "FingerRingInset", MeshBuilder.Torus(0.082f, 0.009f, 28, 8, "Karambit Finger Ring Inset"), PartMaterial.Accent, new Vector3(0f, -0.112f, 0.042f)); AddFastener(parts, "KarambitPivot", new Vector3(0.055f, 0.257f, 0.061f), 0.018f, 0.008f); AddFastener(parts, "KarambitScalePinA", new Vector3(-0.055f, 0.205f, 0.061f), 0.012f, 0.006f); AddFastener(parts, "KarambitScalePinB", new Vector3(0.055f, 0.07f, 0.061f), 0.012f, 0.006f); AddFastener(parts, "KarambitRingPin", new Vector3(0.046f, -0.055f, 0.061f), 0.01f, 0.005f); for (int j = 0; j < 6; j++) { float num2 = -0.07f + (float)j * 0.028f; Add(parts, "KarambitJimp" + j, MeshBuilder.Box2D(num2, 0.314f, num2 + 0.014f, 0.347f, 0.018f, "Karambit Jimping"), PartMaterial.Accent, new Vector3(0f, 0f, 0.038f)); } } private static void AddFastener(List<KnifePart> parts, string name, Vector3 position, float radius, float tube) { //IL_0028: 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_0064: 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) Add(parts, name + "Head", MeshBuilder.Cylinder(radius, tube * 2.2f, 20, name + " Head"), PartMaterial.Edge, position); Add(parts, name + "Ring", MeshBuilder.Torus(radius, tube, 20, 7, name + " Ring"), PartMaterial.Accent, position + new Vector3(0f, 0f, tube * 1.5f)); } private static void BuildPushDagger(KnifeDefinition definition, List<KnifePart> parts) { //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_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_006a: 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) Vector2[] input = (Vector2[])(object)new Vector2[5] { new Vector2(-0.105f, 0.24f), new Vector2(0.105f, 0.24f), new Vector2(0.075f, 0.57f), new Vector2(0f, 0.72f), new Vector2(-0.075f, 0.57f) }; Add(parts, "DaggerBlade", MeshBuilder.ExtrudePolygon(input, 0.045f, "Dagger Blade"), PartMaterial.Blade); Add(parts, "DaggerGrip", MeshBuilder.Box2D(-0.22f, 0.12f, 0.22f, 0.23f, 0.09f, "Dagger Grip"), PartMaterial.Grip); Add(parts, "DaggerGuard", MeshBuilder.Box2D(-0.135f, 0.225f, 0.135f, 0.275f, 0.085f, "Dagger Guard"), PartMaterial.Accent); } private static void BuildButterfly(KnifeDefinition definition, List<KnifePart> parts) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0057: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00d6: 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_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_0103: 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_011a: 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_0131: 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_0148: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0316: 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_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_080d: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_0a07: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0a21: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a5e: Unknown result type (might be due to invalid IL or missing references) //IL_0a68: Unknown result type (might be due to invalid IL or missing references) if (EmbeddedKnifeMesh.TryLoadButterfly(parts, out var metadata, out var error)) { ValidateRigMetadata(definition, metadata); return; } MoreKnivesPlugin.Log.LogError((object)("The professional Blender Butterfly V4 could not be loaded; using the emergency fallback. " + error)); Vector2[] input = (Vector2[])(object)new Vector2[13] { new Vector2(-0.064f, 0.292f), new Vector2(0.064f, 0.292f), new Vector2(0.078f, 0.405f), new Vector2(0.076f, 0.61f), new Vector2(0.064f, 0.79f), new Vector2(0.042f, 0.95f), new Vector2(0.018f, 1.075f), new Vector2(-0.006f, 1.115f), new Vector2(-0.03f, 1.08f), new Vector2(-0.052f, 0.96f), new Vector2(-0.072f, 0.78f), new Vector2(-0.084f, 0.58f), new Vector2(-0.081f, 0.405f) }; Vector2[] input2 = (Vector2[])(object)new Vector2[7] { new Vector2(-0.02f, 0.375f), new Vector2(0.026f, 0.385f), new Vector2(0.024f, 0.63f), new Vector2(0.012f, 0.82f), new Vector2(-0.002f, 0.96f), new Vector2(-0.016f, 0.82f), new Vector2(-0.026f, 0.62f) }; Vector2[] centerLine = (Vector2[])(object)new Vector2[5] { new Vector2(-0.058f, 0.325f), new Vector2(-0.067f, 0.47f), new Vector2(-0.057f, 0.68f), new Vector2(-0.039f, 0.86f), new Vector2(-0.02f, 1.015f) }; Vector2[] input3 = (Vector2[])(object)new Vector2[8] { new Vector2(-0.145f, -0.075f), new Vector2(-0.024f, -0.075f), new Vector2(-0.017f, 0.16f), new Vector2(-0.022f, 0.255f), new Vector2(-0.037f, 0.305f), new Vector2(-0.127f, 0.305f), new Vector2(-0.143f, 0.255f), new Vector2(-0.151f, 0.14f) }; Vector2[] input4 = (Vector2[])(object)new Vector2[8] { new Vector2(0.024f, -0.075f), new Vector2(0.145f, -0.075f), new Vector2(0.151f, 0.14f), new Vector2(0.143f, 0.255f), new Vector2(0.127f, 0.305f), new Vector2(0.037f, 0.305f), new Vector2(0.022f, 0.255f), new Vector2(0.017f, 0.16f) }; Vector2[] input5 = (Vector2[])(object)new Vector2[6] { new Vector2(-0.126f, -0.035f), new Vector2(-0.043f, -0.035f), new Vector2(-0.037f, 0.18f), new Vector2(-0.047f, 0.267f), new Vector2(-0.117f, 0.267f), new Vector2(-0.131f, 0.18f) }; Vector2[] input6 = (Vector2[])(object)new Vector2[6] { new Vector2(0.043f, -0.035f), new Vector2(0.126f, -0.035f), new Vector2(0.131f, 0.18f), new Vector2(0.117f, 0.267f), new Vector2(0.047f, 0.267f), new Vector2(0.037f, 0.18f) }; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0.3f, 0f); AddGrouped(parts, "ButterflyBlade", MeshBuilder.ExtrudePolygon(input, 0.05f, "Butterfly Blade"), PartMaterial.Blade, Vector3.zero, "ButterflyBlade", val); AddGrouped(parts, "ButterflyBladeFuller", MeshBuilder.ExtrudePolygon(input2, 0.058f, "Butterfly Fuller"), PartMaterial.Accent, new Vector3(0f, 0f, 0.032f), "ButterflyBlade", val); AddGrouped(parts, "ButterflyBladeEdge", MeshBuilder.Ribbon(centerLine, 0.012f, 0.012f, "Butterfly Cutting Edge"), PartMaterial.Edge, new Vector3(0f, 0f, 0.037f), "ButterflyBlade", val); AddGrouped(parts, "ButterflyTang", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[4] { new Vector2(-0.088f, 0.275f), new Vector2(0.088f, 0.275f), new Vector2(0.075f, 0.342f), new Vector2(-0.075f, 0.342f) }, 0.068f, "Butterfly Tang"), PartMaterial.Accent, Vector3.zero, "ButterflyBlade", val); AddGrouped(parts, "ButterflyHinge", MeshBuilder.Torus(0.072f, 0.016f, 28, 9, "Butterfly Hinge"), PartMaterial.Accent, val + new Vector3(0f, 0f, 0.038f), "ButterflyBlade", val); AddGrouped(parts, "ButterflyHingeBolt", MeshBuilder.Cylinder(0.028f, 0.018f, 22, "Butterfly Hinge Bolt"), PartMaterial.Edge, val + new Vector3(0f, 0f, 0.058f), "ButterflyBlade", val); AddGrouped(parts, "ButterflyHandleLeftBody", MeshBuilder.ExtrudePolygon(input3, 0.078f, "Butterfly Left Handle"), PartMaterial.Grip, Vector3.zero, "ButterflyHandleLeft", val); AddGrouped(parts, "ButterflyHandleLeftLiner", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[6] { new Vector2(-0.137f, -0.05f), new Vector2(-0.033f, -0.05f), new Vector2(-0.028f, 0.17f), new Vector2(-0.04f, 0.283f), new Vector2(-0.121f, 0.283f), new Vector2(-0.137f, 0.18f) }, 0.01f, "Butterfly Left Liner"), PartMaterial.Accent, new Vector3(0f, 0f, 0.045f), "ButterflyHandleLeft", val); AddGrouped(parts, "ButterflyHandleLeftScale", MeshBuilder.ExtrudePolygon(input5, 0.016f, "Butterfly Left Scale"), PartMaterial.Grip, new Vector3(0f, 0f, 0.055f), "ButterflyHandleLeft", val); AddGrouped(parts, "ButterflyHandleLeftInset", MeshBuilder.Box2D(-0.116f, 0.025f, -0.052f, 0.225f, 0.012f, "Butterfly Left Channel"), PartMaterial.Accent, new Vector3(0f, 0f, 0.067f), "ButterflyHandleLeft", val); AddGrouped(parts, "ButterflyHandleRightBody", MeshBuilder.ExtrudePolygon(input4, 0.078f, "Butterfly Right Handle"), PartMaterial.Grip, Vector3.zero, "ButterflyHandleRight", val); AddGrouped(parts, "ButterflyHandleRightLiner", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[6] { new Vector2(0.033f, -0.05f), new Vector2(0.137f, -0.05f), new Vector2(0.137f, 0.18f), new Vector2(0.121f, 0.283f), new Vector2(0.04f, 0.283f), new Vector2(0.028f, 0.17f) }, 0.01f, "Butterfly Right Liner"), PartMaterial.Accent, new Vector3(0f, 0f, 0.045f), "ButterflyHandleRight", val); AddGrouped(parts, "ButterflyHandleRightScale", MeshBuilder.ExtrudePolygon(input6, 0.016f, "Butterfly Right Scale"), PartMaterial.Grip, new Vector3(0f, 0f, 0.055f), "ButterflyHandleRight", val); AddGrouped(parts, "ButterflyHandleRightInset", MeshBuilder.Box2D(0.052f, 0.025f, 0.116f, 0.225f, 0.012f, "Butterfly Right Channel"), PartMaterial.Accent, new Vector3(0f, 0f, 0.067f), "ButterflyHandleRight", val); AddButterflyFasteners(parts, "ButterflyHandleLeft", -1f, val); AddButterflyFasteners(parts, "ButterflyHandleRight", 1f, val); AddGrouped(parts, "ButterflyLatch", MeshBuilder.ExtrudePolygon((Vector2[])(object)new Vector2[4] { new Vector2(0.045f, -0.08f), new Vector2(0.112f, -0.08f), new Vector2(0.108f, -0.02f), new Vector2(0.05f, -0.02f) }, 0.066f, "Butterfly Latch"), PartMaterial.Accent, Vector3.zero, "ButterflyHandleRight", val); AddGrouped(parts, "ButterflyLatchPin", MeshBuilder.Cylinder(0.011f, 0.014f, 16, "Butterfly Latch Pin"), PartMaterial.Edge, new Vector3(0.08f, -0.05f, 0.052f), "ButterflyHandleRight", val); } private static void AddButterflyFasteners(List<KnifePart> parts, string group, float side, Vector3 pivot) { //IL_003a: 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_0081: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0113: 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_019d: Unknown result type (might be due to invalid IL or missing references) AddGrouped(parts, group + "PivotBolt", MeshBuilder.Cylinder(0.024f, 0.018f, 20, group + " Pivot Bolt"), PartMaterial.Edge, new Vector3(side * 0.07f, 0.27f, 0.06f), group, pivot); AddGrouped(parts, group + "PivotRing", MeshBuilder.Torus(0.025f, 0.006f, 20, 7, group + " Pivot Ring"), PartMaterial.Accent, new Vector3(side * 0.07f, 0.27f, 0.073f), group, pivot); AddGrouped(parts, group + "StopPin", MeshBuilder.Cylinder(0.012f, 0.014f, 16, group + " Stop Pin"), PartMaterial.Edge, new Vector3(side * 0.08f, 0.01f, 0.061f), group, pivot); AddGrouped(parts, group + "LatchPin", MeshBuilder.Cylinder(0.01f, 0.012f, 16, group + " Latch Pin"), PartMaterial.Edge, new Vector3(side * 0.078f, -0.05f, 0.06f), group, pivot); for (int i = 0; i < 7; i++) { float num = 0.025f + (float)i * 0.034f; AddGrouped(parts, group + "Jimp" + i, MeshBuilder.Box2D((side < 0f) ? (-0.134f) : 0.062f, num, (side < 0f) ? (-0.112f) : 0.134f, num + 0.012f, 0.014f, group + " Jimping"), PartMaterial.Accent, new Vector3(0f, 0f, 0.07f), group, pivot); } } private static void BuildSkeleton(KnifeDefinition definition, List<KnifePart> parts) { //IL_010f: Unknown result type (might be due to invalid IL or missing references) Vector2[] input = BladePolygon(KnifeShape.Skeleton, definition.BladeWidth, definition.LengthScale); Add(parts, "SkeletonBlade", MeshBuilder.ExtrudePolygon(input, 0.035f, "Skeleton Blade"), PartMaterial.Blade); Add(parts, "SkeletonRailLeft", MeshBuilder.Box2D(-0.075f, 0.02f, -0.045f, 0.31f, 0.06f, "Skeleton Rail"), PartMaterial.Grip); Add(parts, "SkeletonRailRight", MeshBuilder.Box2D(0.045f, 0.02f, 0.075f, 0.31f, 0.06f, "Skeleton Rail"), PartMaterial.Grip); for (int i = 0; i < 3; i++) { float num = 0.08f + (float)i * 0.085f; Add(parts, "SkeletonRung" + i, MeshBuilder.Box2D(-0.065f, num, 0.065f, num + 0.022f, 0.058f, "Skeleton Rung"), PartMaterial.Accent); } Add(parts, "SkeletonRing", MeshBuilder.Torus(0.075f, 0.018f, 18, 6, "Skeleton Ring"), PartMaterial.Accent, new Vector3(0f, 0.025f, 0f)); Add(parts, "SkeletonGuard", MeshBuilder.Box2D(-0.115f, 0.285f, 0.115f, 0.335f, 0.07f, "Skeleton Guard"), PartMaterial.Accent); } private static Vector2[] BladePolygon(KnifeShape shape, float width, float tip) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: 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_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_00e2: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01b3: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) switch (shape) { case KnifeShape.M9Bayonet: return (Vector2[])(object)new Vector2[6] { new Vector2((0f - width) * 0.48f, 0.31f), new Vector2(width * 0.48f, 0.31f), new Vector2(width * 0.43f, tip * 0.72f), new Vector2(width * 0.18f, tip * 0.91f), new Vector2((0f - width) * 0.08f, tip), new Vector2((0f - width) * 0.4f, tip * 0.84f) }; case KnifeShape.Flip: case KnifeShape.Navaja: return (Vector2[])(object)new Vector2[5] { new Vector2((0f - width) * 0.45f, 0.3f), new Vector2(width * 0.45f, 0.3f), new Vector2(width * 0.4f, tip * 0.72f), new Vector2(0f, tip), new Vector2((0f - width) * 0.3f, tip * 0.82f) }; case KnifeShape.Gut: case KnifeShape.Falchion: return (Vector2[])(object)new Vector2[6] { new Vector2((0f - width) * 0.5f, 0.3f), new Vector2(width * 0.5f, 0.3f), new Vector2(width * 0.52f, tip * 0.62f), new Vector2(width * 0.3f, tip * 0.88f), new Vector2((0f - width) * 0.08f, tip), new Vector2((0f - width) * 0.46f, tip * 0.76f) }; case KnifeShape.Huntsman: case KnifeShape.Bowie: return (Vector2[])(object)new Vector2[6] { new Vector2((0f - width) * 0.52f, 0.3f), new Vector2(width * 0.52f, 0.3f), new Vector2(width * 0.48f, tip * 0.7f), new Vector2(width * 0.14f, tip * 0.88f), new Vector2((0f - width) * 0.16f, tip), new Vector2((0f - width) * 0.5f, tip * 0.82f) }; case KnifeShape.Stiletto: return (Vector2[])(object)new Vector2[4] { new Vector2((0f - width) * 0.48f, 0.3f), new Vector2(0f, tip), new Vector2(width * 0.48f, 0.3f), new Vector2(0f, 0.36f) }; case KnifeShape.Ursus: case KnifeShape.Survival: case KnifeShape.Nomad: return (Vector2[])(object)new Vector2[5] { new Vector2((0f - width) * 0.5f, 0.3f), new Vector2(width * 0.5f, 0.3f), new Vector2(width * 0.38f, tip * 0.78f), new Vector2(0f, tip), new Vector2((0f - width) * 0.42f, tip * 0.88f) }; default: return (Vector2[])(object)new Vector2[5] { new Vector2((0f - width) * 0.46f, 0.3f), new Vector2(width * 0.46f, 0.3f), new Vector2(width * 0.37f, tip * 0.79f), new Vector2(0f, tip), new Vector2((0f - width) * 0.34f, tip * 0.86f) }; } } private static void Add(List<KnifePart> parts, string name, Mesh mesh, PartMaterial material) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) Add(parts, name, mesh, material, Vector3.zero); } private static void Add(List<KnifePart> parts, string name, Mesh mesh, PartMaterial material, Vector3 position) { //IL_001c: 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) parts.Add(new KnifePart { Name = name, Mesh = mesh, Material = material, Position = position }); } private static void AddGrouped(List<KnifePart> parts, string name, Mesh mesh, PartMaterial material, Vector3 position, string group, Vector3 pivot) { //IL_001c: 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_002c: 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) parts.Add(new KnifePart { Name = name, Mesh = mesh, Material = material, Position = position, AnimationGroup = group, GroupPivot = pivot }); } private static Mesh CombineForInventory(KnifeDefinition definition, List<KnifePart> parts) { //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) //IL_0025: 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_0039: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown CombineInstance[] array = (CombineInstance[])(object)new CombineInstance[parts.Count]; Matrix4x4 val = Matrix4x4.Rotate(Quaternion.Euler(90f, 0f, 0f)); Vector3 val2 = ((definition.Rig == null) ? Vector3.zero : (-definition.Rig.Model.GripSocketPosition)); for (int i = 0; i < parts.Count; i++) { KnifePart knifePart = parts[i]; int num = i; CombineInstance val3 = default(CombineInstance); ((CombineInstance)(ref val3)).mesh = knifePart.Mesh; ((CombineInstance)(ref val3)).transform = val * Matrix4x4.TRS(knifePart.Position + val2, knifePart.Rotation, knifePart.Scale); array[num] = val3; } Mesh val4 = new Mesh { name = "MoreKnives_" + definition.DisplayName.Replace(" ", string.Empty), hideFlags = (HideFlags)52, indexFormat = (IndexFormat)1 }; val4.CombineMeshes(array, true, true, false); val4.RecalculateBounds(); return val4; } private static void ValidateRigMetadata(KnifeDefinition definition, KnifeMeshRigMetadata metadata) { //IL_001a: 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_0060: 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_0085: 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_00aa: 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) if (definition != null && definition.Rig != null && metadata != null) { float num = Vector3.Distance(definition.Rig.Model.GripSocketPosition, metadata.GripSocketPosition); float num2 = Mathf.Abs(definition.Rig.Model.IntendedScale - metadata.IntendedScale); float num3 = ((metadata.MechanicalPivots == null) ? float.PositiveInfinity : Mathf.Max(Vector3.Distance(definition.Rig.Model.MechanicalPivots.Bite, metadata.MechanicalPivots.Bite), Mathf.Max(Vector3.Distance(definition.Rig.Model.MechanicalPivots.Blade, metadata.MechanicalPivots.Blade), Vector3.Distance(definition.Rig.Model.MechanicalPivots.Safe, metadata.MechanicalPivots.Safe)))); if (num > 0.0001f || num2 > 0.0001f || num3 > 0.0001f) { MoreKnivesPlugin.Log.LogWarning((object)("Butterfly MKBF rig metadata differs from the definition: socket=" + num.ToString("F6") + " scale=" + num2.ToString("F6") + " pivots=" + num3.ToString("F6"))); } } } private static Material GetMaterial(KnifeAssetSet assets, PartMaterial partMaterial) { return (Material)(partMaterial switch { PartMaterial.Grip => assets.GripMaterial, PartMaterial.Edge => assets.EdgeMaterial, PartMaterial.Accent => assets.AccentMaterial, PartMaterial.Dark => assets.DarkMaterial, _ => assets.BladeMaterial, }); } private static Material CreateMaterial(string name, Color color, float metallic, float smoothness, bool createNormalMap = true) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0051: 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) Shader val = Shader.Find("Universal Render Pipeline/Lit"); if (!Object.op_Implicit((Object)(object)val)) { val = Shader.Find("Standard"); } Material val2 = new Material(val); ((Object)val2).name = "MoreKnives " + name; ((Object)val2).hideFlags = (HideFlags)52; if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", color); } if (val2.HasProperty("_Color")) { val2.SetColor("_Color", color); } if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", metallic); } if (val2.HasProperty("_Smoothness")) { val2.SetFloat("_Smoothness", smoothness); } if (val2.HasProperty("_Glossiness")) { val2.SetFloat("_Glossiness", smoothness); } if (val2.HasProperty("_ClearCoatMask")) { val2.SetFloat("_ClearCoatMask", (metallic > 0.7f) ? 0.72f : 0.18f); val2.SetFloat("_ClearCoatSmoothness", Mathf.Clamp01(smoothness + 0.08f)); val2.EnableKeyword("_CLEARCOAT"); } Texture2D val3 = CreateSurfaceTexture(name, metallic > 0.5f); if (val2.HasProperty("_BaseMap")) { val2.SetTexture("_BaseMap", (Texture)(object)val3); } if (val2.HasProperty("_MainTex")) { val2.SetTexture("_MainTex", (Texture)(object)val3); } if (createNormalMap && val2.HasProperty("_BumpMap")) { val2.SetTexture("_BumpMap", (Texture)(object)CreateNormalTexture(name, metallic > 0.5f)); val2.EnableKeyword("_NORMALMAP"); } return val2; } private static Texture2D CreateSurfaceTexture(string name, bool metal) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); ((Object)val).name = "MoreKnives Surface " + name; ((Texture)val).wrapMode = (TextureWrapMode)0; ((Texture)val).filterMode = (FilterMode)1; Color32[] array = (Color32[])(object)new Color32[16384]; int hashCode = name.GetHashCode(); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = Mathf.Sin((float)j * 0.73f + (float)i * 0.17f + (float)hashCode * 0.001f) * 0.035f; float num2 = Mathf.Sin((float)j * 4.7f + (float)i * 3.1f + (float)hashCode * 0.0003f) * (metal ? 0.018f : 0.045f); float num3 = Mathf.Clamp01(1f + num + num2); if (!metal) { num3 = Mathf.Lerp(num3, 0.86f, 0.22f); } array[i * 128 + j] = Color32.op_Implicit(new Color(num3, num3, num3, 1f)); } } val.SetPixels32(array); val.Apply(false, true); return val; } private static Texture2D CreateNormalTexture(string name, bool metal) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00e2: 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_00ec: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); ((Object)val).name = "MoreKnives Normal " + name; ((Texture)val).wrapMode = (TextureWrapMode)0; ((Texture)val).filterMode = (FilterMode)1; Color32[] array = (Color32[])(object)new Color32[16384]; int hashCode = name.GetHashCode(); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = Mathf.Sin((float)j * 0.63f + (float)i * 0.29f + (float)hashCode * 0.0011f); float num2 = Mathf.Sin((float)j * 5.1f + (float)i * 3.7f + (float)hashCode * 0.00017f); float num3 = (metal ? 0.018f : 0.03f) * num + (metal ? 0.008f : 0.012f) * num2; array[i * 128 + j] = Color32.op_Implicit(new Color(0.5f + num3, 0.5f - num3, 1f, 1f)); } } val.SetPixels32(array); val.Apply(false, true); return val; } private static void SetLayerRecursively(GameObject gameObject, int layer) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) gameObject.layer = layer; foreach (Transform item in gameObject.transform) { SetLayerRecursively(((Component)item).gameObject, layer); } } } internal static class MeshBuilder { public static Mesh Box2D(float xMin, float yMin, float xMax, float yMax, float thickness, string name) { //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_0018: 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_0026: 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_0034: 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) return ExtrudePolygon((Vector2[])(object)new Vector2[4] { new Vector2(xMin, yMin), new Vector2(xMax, yMin), new Vector2(xMax, yMax), new Vector2(xMin, yMax) }, thickness, name); } public static Mesh Ribbon(Vector2[] centerLine, float halfWidth, float thickness, string name) { //IL_0024: Unknown result type (migh