using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using R2API.Networking; using R2API.Networking.Interfaces; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Navigation; using RoR2.Stats; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ScorchedVoxels")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.20.69.0")] [assembly: AssemblyInformationalVersion("0.20.69")] [assembly: AssemblyProduct("ScorchedVoxels")] [assembly: AssemblyTitle("ScorchedVoxels")] [assembly: AssemblyVersion("0.20.69.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ScorchedVoxels { internal enum BgCat : byte { Plain, Pattern, Pride, Flag } internal static class BackgroundSystem { internal struct Def { public string name; public BgCat cat; public Action paint; } private const int TexW = 128; private const int TexH = 192; private const float AR = 1.5f; private static readonly Dictionary cache = new Dictionary(); public static readonly Def[] Table = BuildTable(); public static bool IsFree(int idx) { if (idx >= 0 && idx < Table.Length) { return Table[idx].cat != BgCat.Pattern; } return false; } public static bool IsOwned(string profileKey, int idx) { if (idx < 0 || idx >= Table.Length) { return false; } if (IsFree(idx)) { return true; } IReadOnlyList readOnlyList = UserLifetimeStats.UnlockedBackgrounds(profileKey); for (int i = 0; i < readOnlyList.Count; i++) { if (readOnlyList[i] == idx) { return true; } } return false; } public static int CurrentBackground(NetworkUser nu) { return CurrentForProfile(UserLifetimeStats.ProfileKey(nu)); } public static int CurrentForProfile(string key) { if (key == null) { return 0; } int chosenBackground = UserLifetimeStats.GetChosenBackground(key); if (chosenBackground >= 0 && IsOwned(key, chosenBackground)) { return chosenBackground; } IReadOnlyList readOnlyList = UserLifetimeStats.UnlockedBackgrounds(key); if (readOnlyList.Count <= 0) { return 0; } return readOnlyList[readOnlyList.Count - 1]; } public static int UnlockRandomPattern(NetworkUser nu, Random rng) { string text = UserLifetimeStats.ProfileKey(nu); if (text == null) { return -1; } List list = new List(); for (int i = 0; i < Table.Length; i++) { if (Table[i].cat == BgCat.Pattern && !IsOwned(text, i)) { list.Add(i); } } if (list.Count == 0) { return -1; } int num = list[rng.Next(list.Count)]; UserLifetimeStats.AddBackground(text, num); return num; } public static int PatternCount() { int num = 0; Def[] table = Table; for (int i = 0; i < table.Length; i++) { if (table[i].cat == BgCat.Pattern) { num++; } } return num; } public static Texture2D GetTexture(int idx) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (idx <= 0 || idx >= Table.Length) { return null; } if (cache.TryGetValue(idx, out var value) && (Object)(object)value != (Object)null) { return value; } Color32[] array = (Color32[])(object)new Color32[24576]; Table[idx].paint(array, 128, 192); value = new Texture2D(128, 192, (TextureFormat)4, false); ((Texture)value).wrapMode = (TextureWrapMode)1; ((Texture)value).filterMode = (FilterMode)1; value.SetPixels32(array); value.Apply(false, true); cache[idx] = value; return value; } private static Color32 C(uint rgb) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new Color32((byte)(rgb >> 16), (byte)(rgb >> 8), (byte)rgb, byte.MaxValue); } private static void Set(Color32[] px, int W, int H, int x, int yTop, Color32 c) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) px[(H - 1 - yTop) * W + x] = c; } private static void Fill(Color32[] px, int W, int H, Color32 c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < px.Length; i++) { px[i] = c; } } private static void HStripesW(Color32[] px, int W, int H, uint[] cols, float[] w) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) float num = 0f; foreach (float num2 in w) { num += num2; } Color32[] array = (Color32[])(object)new Color32[cols.Length]; for (int j = 0; j < cols.Length; j++) { array[j] = C(cols[j]); } for (int k = 0; k < H; k++) { float num3 = ((float)k + 0.5f) / (float)H * num; int num4 = 0; for (float num5 = w[0]; num3 > num5; num5 += w[++num4]) { if (num4 >= cols.Length - 1) { break; } } for (int l = 0; l < W; l++) { Set(px, W, H, l, k, array[num4]); } } } private static void HStripes(Color32[] px, int W, int H, params uint[] cols) { float[] array = new float[cols.Length]; for (int i = 0; i < array.Length; i++) { array[i] = 1f; } HStripesW(px, W, H, cols, array); } private static void VStripesW(Color32[] px, int W, int H, uint[] cols, float[] w) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) float num = 0f; foreach (float num2 in w) { num += num2; } Color32[] array = (Color32[])(object)new Color32[cols.Length]; for (int j = 0; j < cols.Length; j++) { array[j] = C(cols[j]); } for (int k = 0; k < W; k++) { float num3 = ((float)k + 0.5f) / (float)W * num; int num4 = 0; for (float num5 = w[0]; num3 > num5; num5 += w[++num4]) { if (num4 >= cols.Length - 1) { break; } } for (int l = 0; l < H; l++) { Set(px, W, H, k, l, array[num4]); } } } private static void VStripes(Color32[] px, int W, int H, params uint[] cols) { float[] array = new float[cols.Length]; for (int i = 0; i < array.Length; i++) { array[i] = 1f; } VStripesW(px, W, H, cols, array); } private static void Band(Color32[] px, int W, int H, float u0, float v0, float u1, float v1, Color32 c) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(0, Mathf.FloorToInt(u0 * (float)W)); int num2 = Mathf.Min(W, Mathf.CeilToInt(u1 * (float)W)); int num3 = Mathf.Max(0, Mathf.FloorToInt(v0 * (float)H)); int num4 = Mathf.Min(H, Mathf.CeilToInt(v1 * (float)H)); for (int i = num3; i < num4; i++) { for (int j = num; j < num2; j++) { Set(px, W, H, j, i, c); } } } private static void Disc(Color32[] px, int W, int H, float cu, float cv, float r, Color32 c) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) float num = cv * 1.5f; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num2 = ((float)j + 0.5f) / (float)W; float num3 = ((float)i + 0.5f) / (float)H * 1.5f; if ((num2 - cu) * (num2 - cu) + (num3 - num) * (num3 - num) <= r * r) { Set(px, W, H, j, i, c); } } } } private static void Ring(Color32[] px, int W, int H, float cu, float cv, float r, float t, Color32 c) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) float num = cv * 1.5f; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num2 = ((float)j + 0.5f) / (float)W; float num3 = ((float)i + 0.5f) / (float)H * 1.5f; float num4 = Mathf.Sqrt((num2 - cu) * (num2 - cu) + (num3 - num) * (num3 - num)); if (num4 <= r && num4 >= r - t) { Set(px, W, H, j, i, c); } } } } private static void Crescent(Color32[] px, int W, int H, float cu, float cv, float r, float cutDu, float cutR, Color32 c) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) float num = cv * 1.5f; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num2 = ((float)j + 0.5f) / (float)W; float num3 = ((float)i + 0.5f) / (float)H * 1.5f; bool num4 = (num2 - cu) * (num2 - cu) + (num3 - num) * (num3 - num) <= r * r; float num5 = num2 - (cu + cutDu); bool flag = num5 * num5 + (num3 - num) * (num3 - num) <= cutR * cutR; if (num4 && !flag) { Set(px, W, H, j, i, c); } } } } private static void Star(Color32[] px, int W, int H, float cu, float cv, float r, float rot, Color32 c) { //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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) float num = cv * 1.5f; Vector2[] array = (Vector2[])(object)new Vector2[10]; for (int i = 0; i < 10; i++) { float num2 = ((i % 2 == 0) ? r : (r * 0.42f)); float num3 = (-90f + rot + (float)i * 36f) * (MathF.PI / 180f); array[i] = new Vector2(cu + num2 * Mathf.Cos(num3), num + num2 * Mathf.Sin(num3)); } int num4 = Mathf.Max(0, Mathf.FloorToInt((cu - r) * (float)W)); int num5 = Mathf.Min(W, Mathf.CeilToInt((cu + r) * (float)W)); int num6 = Mathf.Max(0, Mathf.FloorToInt((num - r) / 1.5f * (float)H)); int num7 = Mathf.Min(H, Mathf.CeilToInt((num + r) / 1.5f * (float)H)); Vector2 p = default(Vector2); for (int j = num6; j < num7; j++) { for (int k = num4; k < num5; k++) { ((Vector2)(ref p))..ctor(((float)k + 0.5f) / (float)W, ((float)j + 0.5f) / (float)H * 1.5f); if (InPoly(array, p)) { Set(px, W, H, k, j, c); } } } } private static bool InPoly(Vector2[] poly, Vector2 p) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0058: Unknown result type (might be due to invalid IL or missing references) bool flag = false; int num = 0; int num2 = poly.Length - 1; while (num < poly.Length) { if (poly[num].y > p.y != poly[num2].y > p.y && p.x < (poly[num2].x - poly[num].x) * (p.y - poly[num].y) / (poly[num2].y - poly[num].y) + poly[num].x) { flag = !flag; } num2 = num++; } return flag; } private static void Tri(Color32[] px, int W, int H, Vector2 a, Vector2 b, Vector2 c3, Color32 c) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { Vector2 p = new Vector2(((float)j + 0.5f) / (float)W, ((float)i + 0.5f) / (float)H); float num = Sign(p, a, b); float num2 = Sign(p, b, c3); float num3 = Sign(p, c3, a); bool flag = num < 0f || num2 < 0f || num3 < 0f; bool flag2 = num > 0f || num2 > 0f || num3 > 0f; if (!(flag && flag2)) { Set(px, W, H, j, i, c); } } } static float Sign(Vector2 val, Vector2 q, Vector2 s) { //IL_0000: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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) //IL_0028: 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) return (val.x - s.x) * (q.y - s.y) - (q.x - s.x) * (val.y - s.y); } } private static void NordicCross(Color32[] px, int W, int H, float t, Color32 c) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) Band(px, W, H, 0.38f - t * 0.5f, 0f, 0.38f + t * 0.5f, 1f, c); Band(px, W, H, 0f, 0.5f - t * 0.5f / 1.5f, 1f, 0.5f + t * 0.5f / 1.5f, c); } private static void DiagStripes(Color32[] px, int W, int H, int periodPx, Color32 a, Color32 b) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { Set(px, W, H, j, i, ((j + i) / periodPx % 2 == 0) ? a : b); } } } private static void Checker(Color32[] px, int W, int H, int cols, Color32 a, Color32 b) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) int num = W / cols; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { Set(px, W, H, j, i, ((j / num + i / num) % 2 == 0) ? a : b); } } } private static void BlockNoise(Color32[] px, int W, int H, int seed, int cols, uint[] palette) { //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(seed); int num = W / cols; int num2 = H / num + 1; Color32[] array = (Color32[])(object)new Color32[palette.Length]; for (int i = 0; i < palette.Length; i++) { array[i] = C(palette[i]); } Color32[,] array2 = new Color32[cols + 1, num2 + 1]; for (int j = 0; j <= num2; j++) { for (int k = 0; k <= cols; k++) { array2[k, j] = array[random.Next(array.Length)]; } } for (int l = 0; l < H; l++) { for (int m = 0; m < W; m++) { Set(px, W, H, m, l, array2[Mathf.Min(m / num, cols), Mathf.Min(l / num, num2)]); } } } private static void SpeckleDiscs(Color32[] px, int W, int H, int seed, int count, float rMin, float rMax, uint[] palette) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(seed); for (int i = 0; i < count; i++) { float cu = (float)random.NextDouble(); float cv = (float)random.NextDouble(); float r = Mathf.Lerp(rMin, rMax, (float)random.NextDouble()); Disc(px, W, H, cu, cv, r, C(palette[random.Next(palette.Length)])); } } private static void VGrad(Color32[] px, int W, int H, uint top, uint bottom) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0040: Unknown result type (might be due to invalid IL or missing references) Color val = Color32.op_Implicit(C(top)); Color val2 = Color32.op_Implicit(C(bottom)); for (int i = 0; i < H; i++) { Color32 c = Color32.op_Implicit(Color.Lerp(val, val2, ((float)i + 0.5f) / (float)H)); for (int j = 0; j < W; j++) { Set(px, W, H, j, i, c); } } } private static void DotGrid(Color32[] px, int W, int H, int nx, float r, Color32 c) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) float num = 1f / (float)nx; int num2 = Mathf.RoundToInt(1.5f / num); for (int i = 0; i <= num2; i++) { for (int j = 0; j <= nx; j++) { float num3 = ((i % 2 == 0) ? 0f : (num * 0.5f)); Disc(px, W, H, (float)j * num + num3, (float)i * num / 1.5f, r, c); } } } private static void UnionJack(Color32[] px, int W, int H) { //IL_0008: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(74089u)); float num = Mathf.Sqrt(3.25f); for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num2 = ((float)j + 0.5f) / (float)W; float num3 = ((float)i + 0.5f) / (float)H * 1.5f; float num4 = Mathf.Abs(num2 * 1.5f - num3) / num; float num5 = Mathf.Abs(1.5f - num2 * 1.5f - num3) / num; if (num4 < 0.1f || num5 < 0.1f) { Set(px, W, H, j, i, Color32.op_Implicit(Color.white)); } if (num4 < 0.045f || num5 < 0.045f) { Set(px, W, H, j, i, C(13111342u)); } } } Band(px, W, H, 0.345f, 0f, 0.655f, 1f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.39666668f, 1f, 0.60333335f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.41f, 0f, 0.59000003f, 1f, C(13111342u)); Band(px, W, H, 0f, 0.44f, 1f, 0.56f, C(13111342u)); } private static Def[] BuildTable() { List t = new List(); P("Plain", BgCat.Plain, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(1250072u)); }); P("Hazard Stripes", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) DiagStripes(px, W, H, 22, C(15235584u), C(1710618u)); }); P("Voxel Grid", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) Fill(px, W, H, C(1316380u)); for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (j % 16 == 0 || i % 16 == 0) { Set(px, W, H, j, i, C(2764346u)); } } } Random random = new Random(4242); for (int k = 0; k < 9; k++) { int num = random.Next(W / 16); int num2 = random.Next(H / 16); Band(px, W, H, (float)num * 16f / (float)W, (float)num2 * 16f / (float)H, ((float)num * 16f + 15f) / (float)W, ((float)num2 * 16f + 15f) / (float)H, (k % 3 == 0) ? C(11754258u) : C(4008472u)); } }); P("Forest Camo", BgCat.Pattern, delegate(Color32[] px, int W, int H) { BlockNoise(px, W, H, 1337, 10, new uint[4] { 3885615u, 5727805u, 2765603u, 7240530u }); }); P("Desert Camo", BgCat.Pattern, delegate(Color32[] px, int W, int H) { BlockNoise(px, W, H, 7331, 10, new uint[4] { 12759680u, 10914404u, 9074001u, 14076323u }); }); P("Ember Field", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(1511951u)); SpeckleDiscs(px, W, H, 99, 90, 0.004f, 0.016f, new uint[4] { 16738816u, 16756736u, 12729122u, 5579281u }); }); P("Gold Vein", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(2365970u)); SpeckleDiscs(px, W, H, 512, 120, 0.003f, 0.01f, new uint[3] { 16763187u, 12092939u, 3812380u }); SpeckleDiscs(px, W, H, 513, 8, 0.014f, 0.024f, new uint[1] { 16763187u }); }); P("Starfield", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(658452u)); SpeckleDiscs(px, W, H, 2001, 110, 0.002f, 0.007f, new uint[3] { 16777215u, 12571903u, 8952251u }); SpeckleDiscs(px, W, H, 2002, 6, 0.01f, 0.015f, new uint[1] { 16777215u }); }); P("Boiler Plate", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(3817284u)); DotGrid(px, W, H, 6, 0.018f, C(2303530u)); }); P("Banana Peel", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(16768830u)); SpeckleDiscs(px, W, H, 777, 26, 0.008f, 0.03f, new uint[3] { 8016416u, 10251046u, 6044950u }); }); P("Bubblegum", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(16751297u)); DotGrid(px, W, H, 5, 0.035f, C(16769518u)); }); P("Sunset", BgCat.Pattern, delegate(Color32[] px, int W, int H) { VGrad(px, W, H, 16747586u, 6106764u); }); P("The Abyss", BgCat.Pattern, delegate(Color32[] px, int W, int H) { VGrad(px, W, H, 1347995u, 399936u); }); P("Checkerboard", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Checker(px, W, H, 6, C(2303275u), C(3816774u)); }); P("Moonscape", BgCat.Pattern, delegate(Color32[] px, int W, int H) { //IL_0008: 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_0083: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(7238008u)); Random random = new Random(31415); for (int i = 0; i < 14; i++) { float num = (float)random.NextDouble(); float num2 = (float)random.NextDouble(); float num3 = Mathf.Lerp(0.02f, 0.09f, (float)random.NextDouble()); Disc(px, W, H, num, num2, num3, C(5593183u)); Disc(px, W, H, num - num3 * 0.15f, num2 - num3 * 0.1f, num3 * 0.72f, C(4737874u)); } }); P("Rainbow Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 14942979u, 16747520u, 16772352u, 32806u, 2375822u, 7547266u); }); P("Progress Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) //IL_0065: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 14942979u, 16747520u, 16772352u, 32806u, 2375822u, 7547266u); Tri(px, W, H, new Vector2(0f, -0.1f), new Vector2(0.62f, 0.5f), new Vector2(0f, 1.1f), Color32.op_Implicit(Color.white)); Tri(px, W, H, new Vector2(0f, 0.02f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0.98f), C(16230584u)); Tri(px, W, H, new Vector2(0f, 0.14f), new Vector2(0.38f, 0.5f), new Vector2(0f, 0.86f), C(5623292u)); Tri(px, W, H, new Vector2(0f, 0.26f), new Vector2(0.26f, 0.5f), new Vector2(0f, 0.74f), C(9721110u)); Tri(px, W, H, new Vector2(0f, 0.38f), new Vector2(0.14f, 0.5f), new Vector2(0f, 0.62f), C(1052688u)); }); P("Trans Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 5623292u, 16230584u, 16777215u, 16230584u, 5623292u); }); P("Bi Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[3] { 14025328u, 10178454u, 14504u }, new float[3] { 2f, 1f, 2f }); }); P("Pan Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16720268u, 16766976u, 2208255u); }); P("Nonbinary Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16577588u, 16777215u, 10246609u, 2894892u); }); P("Lesbian Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13970688u, 16751190u, 16777215u, 13853348u, 10682978u); }); P("Gay Men Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 494960u, 2543274u, 16777215u, 8105442u, 4004472u); }); P("Ace Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 1052688u, 10724259u, 16777215u, 8388736u); }); P("Aro Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 4040002u, 10998649u, 16777215u, 11119017u, 1052688u); }); P("Genderfluid Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16741794u, 16777215u, 12458198u, 1052688u, 3358397u); }); P("Genderqueer Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 11894492u, 16777215u, 4882723u); }); P("Agender Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 1052688u, 12171705u, 16777215u, 12121219u, 16777215u, 12171705u, 1052688u); }); P("Intersex Pride", BgCat.Pride, delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(16766976u)); Ring(px, W, H, 0.5f, 0.5f, 0.2f, 0.055f, C(7930538u)); }); AddFlags(t); return t.ToArray(); void P(string name, BgCat cat, Action paint) { t.Add(new Def { name = name, cat = cat, paint = paint }); } } private static void PaintUnionJackCanton(Color32[] px, int W, int H) { //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) //IL_007d: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.RoundToInt(0.5f * (float)W); int num2 = Mathf.RoundToInt(0.34f * (float)H); for (int i = 0; i < num2; i++) { for (int j = 0; j < num; j++) { float num3 = ((float)j + 0.5f) / (float)num; float num4 = ((float)i + 0.5f) / (float)num2; Color32 c = C(74089u); float num5 = Mathf.Abs(num3 - num4); float num6 = Mathf.Abs(1f - num3 - num4); if (num5 < 0.16f || num6 < 0.16f) { c = Color32.op_Implicit(Color.white); } if (num5 < 0.07f || num6 < 0.07f) { c = C(13111342u); } if (Mathf.Abs(num3 - 0.5f) < 0.17f || Mathf.Abs(num4 - 0.5f) < 0.17f) { c = Color32.op_Implicit(Color.white); } if (Mathf.Abs(num3 - 0.5f) < 0.1f || Mathf.Abs(num4 - 0.5f) < 0.1f) { c = C(13111342u); } Set(px, W, H, j, i, c); } } } private static void DiagBand(Color32[] px, int W, int H, bool rising, float off, float halfW, Color32 c) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sqrt(3.25f); for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num2 = ((float)j + 0.5f) / (float)W; float num3 = ((float)i + 0.5f) / (float)H * 1.5f; float num4 = (rising ? (num3 - 1.5f * (1f - num2)) : (num3 - 1.5f * num2)) / num; if (num4 >= off - halfW && num4 <= off + halfW) { Set(px, W, H, j, i, c); } } } } private static void Sun(Color32[] px, int W, int H, float cu, float cv, float rDisc, float rRay, int n, Color32 c, float rot = 0f) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0092: Unknown result type (might be due to invalid IL or missing references) float cq = cv * 1.5f; float num = MathF.PI * 11f / 20f / (float)n; for (int i = 0; i < n; i++) { float num2 = rot * (MathF.PI / 180f) + (float)i * 2f * MathF.PI / (float)n; Tri(px, W, H, P(num2, rDisc + rRay), P(num2 - num, rDisc * 0.85f), P(num2 + num, rDisc * 0.85f), c); } Disc(px, W, H, cu, cv, rDisc, c); Vector2 P(float ang, float r) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) return new Vector2(cu + r * Mathf.Cos(ang), (cq + r * Mathf.Sin(ang)) / 1.5f); } } private static void Quad(Color32[] px, int W, int H, Vector2 a, Vector2 b, Vector2 c4, Vector2 d, Color32 c) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) Tri(px, W, H, a, b, c4, c); Tri(px, W, H, a, c4, d, c); } private static void Rhomb(Color32[] px, int W, int H, float cu, float cv, float ru, float rv, Color32 c) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, new Vector2(cu - ru, cv), new Vector2(cu, cv - rv), new Vector2(cu + ru, cv), c); Tri(px, W, H, new Vector2(cu - ru, cv), new Vector2(cu, cv + rv), new Vector2(cu + ru, cv), c); } private static void ZigzagHoist(Color32[] px, int W, int H, float bandW, int teeth, float amp, Color32 c) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < H; i++) { float num = Mathf.PingPong(((float)i + 0.5f) / (float)H * (float)teeth * 2f, 1f); int num2 = Mathf.Min(W, Mathf.RoundToInt((bandW + amp * (num * 2f - 1f)) * (float)W)); for (int j = 0; j < num2; j++) { Set(px, W, H, j, i, c); } } } private static void CrossAt(Color32[] px, int W, int H, float cu, float cv, float arm, float thick, Color32 c) { //IL_0021: 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) Band(px, W, H, cu - arm, cv - thick / 1.5f, cu + arm, cv + thick / 1.5f, c); Band(px, W, H, cu - thick, cv - arm / 1.5f, cu + thick, cv + arm / 1.5f, c); } private static void AddFlags(List t) { P("Afghanistan", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 1052688u, 13836305u, 31286u); Disc(px, W, H, 0.5f, 0.5f, 0.07f, Color32.op_Implicit(Color.white)); }); P("Albania", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00cd: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(14949920u)); Tri(px, W, H, V(0.18f, 0.34f), V(0.48f, 0.48f), V(0.18f, 0.62f), C(1052688u)); Tri(px, W, H, V(0.82f, 0.34f), V(0.52f, 0.48f), V(0.82f, 0.62f), C(1052688u)); Band(px, W, H, 0.46f, 0.3f, 0.54f, 0.66f, C(1052688u)); Disc(px, W, H, 0.5f, 0.285f, 0.035f, C(1052688u)); }); P("Algeria", delegate(Color32[] px, int W, int H) { //IL_003f: 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) VStripes(px, W, H, 25139u, 16777215u); Crescent(px, W, H, 0.49f, 0.5f, 0.13f, 0.05f, 0.11f, C(13766708u)); Star(px, W, H, 0.575f, 0.5f, 0.05f, 90f, C(13766708u)); }); P("Andorra", delegate(Color32[] px, int W, int H) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) VStripesW(px, W, H, new uint[3] { 1050271u, 16702720u, 13959218u }, new float[3] { 1f, 1.2f, 1f }); Disc(px, W, H, 0.5f, 0.5f, 0.05f, C(13087615u)); }); P("Angola", delegate(Color32[] px, int W, int H) { //IL_003a: 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) HStripes(px, W, H, 13371695u, 1052688u); Ring(px, W, H, 0.5f, 0.47f, 0.1f, 0.028f, C(16763648u)); Star(px, W, H, 0.5f, 0.53f, 0.05f, 0f, C(16763648u)); }); P("Antigua & Barbuda", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: 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_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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) Fill(px, W, H, C(13504806u)); Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0.5f, 1f), C(1052688u)); Sun(px, W, H, 0.5f, 0.22f, 0.055f, 0.045f, 9, C(16568598u)); Tri(px, W, H, V(0.15f, 0.3f), V(0.85f, 0.3f), V(0.5f, 1f), C(29382u)); Tri(px, W, H, V(0.24f, 0.48f), V(0.76f, 0.48f), V(0.5f, 1f), Color32.op_Implicit(Color.white)); }); P("Argentina", delegate(Color32[] px, int W, int H) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 7122148u, 16777215u, 7122148u); Disc(px, W, H, 0.5f, 0.5f, 0.085f, C(16758812u)); }); P("Armenia", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 14221330u, 13216u, 15902720u); }); P("Australia", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ec: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(74089u)); Star(px, W, H, 0.28f, 0.72f, 0.1f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.72f, 0.32f, 0.055f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.8f, 0.55f, 0.055f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.63f, 0.6f, 0.045f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.74f, 0.8f, 0.055f, 0f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0f, 0.5f, 0.34f, C(74089u)); PaintUnionJackCanton(px, W, H); }); P("Austria", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 15676224u, 16777215u, 15676224u); }); P("Azerbaijan", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0060: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 37564u, 14942251u, 44902u); Crescent(px, W, H, 0.46f, 0.5f, 0.1f, 0.035f, 0.085f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.575f, 0.5f, 0.045f, 90f, Color32.op_Implicit(Color.white)); }); P("Bahamas", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) HStripes(px, W, H, 30603u, 16762668u, 30603u); Tri(px, W, H, V(0f, 0f), V(0.42f, 0.5f), V(0f, 1f), C(1052688u)); }); P("Bahrain", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(13504806u)); ZigzagHoist(px, W, H, 0.32f, 5, 0.06f, Color32.op_Implicit(Color.white)); }); P("Bangladesh", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(27214u)); Disc(px, W, H, 0.45f, 0.5f, 0.16f, C(16001601u)); }); P("Barbados", delegate(Color32[] px, int W, int H) { //IL_0035: 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_0081: 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_00a7: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 9855u, 16762662u, 9855u); Band(px, W, H, 0.475f, 0.4f, 0.525f, 0.62f, C(1052688u)); Band(px, W, H, 0.405f, 0.44f, 0.44f, 0.54f, C(1052688u)); Band(px, W, H, 0.56f, 0.44f, 0.595f, 0.54f, C(1052688u)); Tri(px, W, H, V(0.405f, 0.44f), V(0.44f, 0.44f), V(0.4225f, 0.38f), C(1052688u)); Tri(px, W, H, V(0.56f, 0.44f), V(0.595f, 0.44f), V(0.5775f, 0.38f), C(1052688u)); Tri(px, W, H, V(0.475f, 0.4f), V(0.525f, 0.4f), V(0.5f, 0.34f), C(1052688u)); }); P("Belarus", delegate(Color32[] px, int W, int H) { //IL_004b: 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_0083: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[2] { 13506336u, 31792u }, new float[2] { 2f, 1f }); Band(px, W, H, 0f, 0f, 0.12f, 1f, Color32.op_Implicit(Color.white)); for (int i = 0; i < 9; i++) { Rhomb(px, W, H, 0.06f, 0.055f + (float)i * 0.111f, 0.045f, 0.04f, C(13506336u)); } }); P("Belgium", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 1052688u, 16636452u, 15676224u); }); P("Belize", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(16263u)); Band(px, W, H, 0f, 0f, 1f, 0.08f, C(13504806u)); Band(px, W, H, 0f, 0.92f, 1f, 1f, C(13504806u)); Disc(px, W, H, 0.5f, 0.5f, 0.165f, Color32.op_Implicit(Color.white)); Ring(px, W, H, 0.5f, 0.5f, 0.165f, 0.025f, C(2659328u)); Disc(px, W, H, 0.5f, 0.5f, 0.045f, C(2659328u)); }); P("Benin", delegate(Color32[] px, int W, int H) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) Band(px, W, H, 0f, 0f, 1f, 0.5f, C(16568598u)); Band(px, W, H, 0f, 0.5f, 1f, 1f, C(15208749u)); Band(px, W, H, 0f, 0f, 0.4f, 1f, C(34641u)); }); P("Bhutan", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_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_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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(16766240u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(16731666u)); Disc(px, W, H, 0.34f, 0.64f, 0.045f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.45f, 0.55f, 0.055f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.56f, 0.46f, 0.045f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.66f, 0.38f, 0.055f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.76f, 0.3f, 0.04f, Color32.op_Implicit(Color.white)); }); P("Bolivia", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13970206u, 16376576u, 31028u); }); P("Bosnia & Herzegovina", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: 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) Fill(px, W, H, C(5257u)); Tri(px, W, H, V(0.3f, 0.08f), V(0.88f, 0.08f), V(0.88f, 0.72f), C(16698112u)); for (int i = 0; i < 5; i++) { Star(px, W, H, 0.24f + (float)i * 0.13f, 0.11f + (float)i * 0.145f, 0.045f, 0f, Color32.op_Implicit(Color.white)); } }); P("Botswana", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(7711451u)); Band(px, W, H, 0f, 0.41f, 1f, 0.59f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.445f, 1f, 0.555f, C(1052688u)); }); P("Brazil", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0066: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(38713u)); for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num = ((float)j + 0.5f) / (float)W; float num2 = ((float)i + 0.5f) / (float)H; if (Mathf.Abs(num - 0.5f) / 0.44f + Mathf.Abs(num2 - 0.5f) / 0.36f <= 1f) { Set(px, W, H, j, i, C(16702720u)); } } } Disc(px, W, H, 0.5f, 0.5f, 0.185f, C(74089u)); }); P("Brunei", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0042: 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_0089: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(16244759u)); DiagBand(px, W, H, rising: false, -0.06f, 0.1f, Color32.op_Implicit(Color.white)); DiagBand(px, W, H, rising: false, 0.075f, 0.045f, C(1052688u)); Disc(px, W, H, 0.5f, 0.5f, 0.075f, C(13570342u)); Band(px, W, H, 0.48f, 0.36f, 0.52f, 0.64f, C(13570342u)); }); P("Bulgaria", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16777215u, 38510u, 14034450u); }); P("Burkina Faso", delegate(Color32[] px, int W, int H) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 15674157u, 40521u); Star(px, W, H, 0.5f, 0.5f, 0.09f, 0f, C(16568598u)); }); P("Burundi", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(2012474u)); Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0.5f, 0.5f), C(13504806u)); Tri(px, W, H, V(0f, 1f), V(1f, 1f), V(0.5f, 0.5f), C(13504806u)); DiagBand(px, W, H, rising: true, 0f, 0.045f, Color32.op_Implicit(Color.white)); DiagBand(px, W, H, rising: false, 0f, 0.045f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.14f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.5f, 0.42f, 0.035f, 0f, C(13504806u)); Star(px, W, H, 0.44f, 0.55f, 0.035f, 0f, C(13504806u)); Star(px, W, H, 0.56f, 0.55f, 0.035f, 0f, C(13504806u)); }); P("Cabo Verde", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00d3: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(14483u)); Band(px, W, H, 0f, 0.55f, 1f, 0.61f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.61f, 1f, 0.67f, C(13574183u)); Band(px, W, H, 0f, 0.67f, 1f, 0.73f, Color32.op_Implicit(Color.white)); for (int i = 0; i < 10; i++) { float num = (float)i * MathF.PI * 2f / 10f; Star(px, W, H, 0.42f + 0.1f * Mathf.Cos(num), 0.64f + 1f / 15f * Mathf.Sin(num), 0.022f, 0f, C(16240918u)); } }); P("Cambodia", delegate(Color32[] px, int W, int H) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 208545u, 14680101u, 208545u }, new float[3] { 1f, 2f, 1f }); Band(px, W, H, 0.36f, 0.52f, 0.64f, 0.56f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.4f, 0.44f, 0.6f, 0.52f, Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0.38f, 0.44f), V(0.46f, 0.44f), V(0.42f, 0.35f), Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0.45f, 0.42f), V(0.55f, 0.42f), V(0.5f, 0.31f), Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0.54f, 0.44f), V(0.62f, 0.44f), V(0.58f, 0.35f), Color32.op_Implicit(Color.white)); }); P("Cameroon", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 31326u, 13504806u, 16568598u); Star(px, W, H, 0.5f, 0.5f, 0.07f, 0f, C(16568598u)); }); P("Canada", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) VStripesW(px, W, H, new uint[3] { 14157345u, 16777215u, 14157345u }, new float[3] { 1f, 2f, 1f }); Star(px, W, H, 0.5f, 0.47f, 0.16f, 0f, C(14157345u)); Band(px, W, H, 0.485f, 0.56f, 0.515f, 0.66f, C(14157345u)); }); P("Central African Republic", delegate(Color32[] px, int W, int H) { //IL_0035: 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) HStripes(px, W, H, 12418u, 16777215u, 2660136u, 16764416u); Band(px, W, H, 0.42f, 0f, 0.58f, 1f, C(13766708u)); Star(px, W, H, 0.13f, 0.11f, 0.05f, 0f, C(16764416u)); }); P("Chad", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 9828u, 16698112u, 12979248u); }); P("Chile", delegate(Color32[] px, int W, int H) { //IL_003a: 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_0060: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 14297372u); Band(px, W, H, 0f, 0f, 0.36f, 0.5f, C(12960u)); Star(px, W, H, 0.18f, 0.25f, 0.09f, 0f, Color32.op_Implicit(Color.white)); }); P("China", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00a0: 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) Fill(px, W, H, C(15604773u)); Star(px, W, H, 0.22f, 0.2f, 0.13f, 0f, C(16776960u)); Star(px, W, H, 0.42f, 0.08f, 0.045f, 20f, C(16776960u)); Star(px, W, H, 0.48f, 0.17f, 0.045f, 45f, C(16776960u)); Star(px, W, H, 0.48f, 0.28f, 0.045f, 0f, C(16776960u)); Star(px, W, H, 0.42f, 0.36f, 0.045f, -20f, C(16776960u)); }); P("Colombia", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[3] { 16568598u, 14483u, 13504806u }, new float[3] { 2f, 1f, 1f }); }); P("Comoros", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_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_00a2: 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) HStripes(px, W, H, 16762398u, 16777215u, 13504806u, 3831236u); Tri(px, W, H, V(0f, 0f), V(0.5f, 0.5f), V(0f, 1f), C(2334278u)); Crescent(px, W, H, 0.14f, 0.5f, 0.09f, 0.03f, 0.075f, Color32.op_Implicit(Color.white)); for (int i = 0; i < 4; i++) { Disc(px, W, H, 0.24f, 0.35f + (float)i * 0.1f, 0.014f, Color32.op_Implicit(Color.white)); } }); P("Congo", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0091: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(38211u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(14427167u)); DiagBand(px, W, H, rising: true, 0f, 0.1f, C(16506442u)); }); P("Cook Islands", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0061: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(8283u)); for (int i = 0; i < 15; i++) { float num = (float)i * MathF.PI * 2f / 15f; Star(px, W, H, 0.62f + 0.16f * Mathf.Cos(num), 0.6f + 0.10666666f * Mathf.Sin(num), 0.022f, 0f, Color32.op_Implicit(Color.white)); } PaintUnionJackCanton(px, W, H); }); P("Costa Rica", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[5] { 11135u, 16777215u, 13504806u, 16777215u, 11135u }, new float[5] { 1f, 1f, 2f, 1f, 1f }); }); P("Côte d'Ivoire", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 16744960u, 16777215u, 39492u); }); P("Croatia", delegate(Color32[] px, int W, int H) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16711680u, 16777215u, 1513366u); for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { Band(px, W, H, 0.375f + (float)j * 0.05f, 0.38f + (float)i * 0.06f, 0.375f + (float)(j + 1) * 0.05f, 0.38f + (float)(i + 1) * 0.06f, ((j + i) % 2 == 0) ? C(16711680u) : Color32.op_Implicit(Color.white)); } } }); P("Cuba", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006f: 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) HStripes(px, W, H, 10895u, 16777215u, 10895u, 16777215u, 10895u); Tri(px, W, H, V(0f, 0f), V(0.55f, 0.5f), V(0f, 1f), C(13571115u)); Star(px, W, H, 0.18f, 0.5f, 0.07f, 0f, Color32.op_Implicit(Color.white)); }); P("Cyprus", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00ce: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.42f, 0.42f, 0.055f, C(13989888u)); Disc(px, W, H, 0.52f, 0.4f, 0.05f, C(13989888u)); Disc(px, W, H, 0.6f, 0.44f, 0.032f, C(13989888u)); Disc(px, W, H, 0.44f, 0.57f, 0.02f, C(5135153u)); Disc(px, W, H, 0.5f, 0.59f, 0.02f, C(5135153u)); Disc(px, W, H, 0.56f, 0.57f, 0.02f, C(5135153u)); }); P("Czechia", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0053: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 14095386u); Tri(px, W, H, V(0f, 0f), V(0.5f, 0.5f), V(0f, 1f), C(1131902u)); }); P("DR Congo", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0042: 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) Fill(px, W, H, C(32767u)); DiagBand(px, W, H, rising: true, 0f, 0.11f, C(16242200u)); DiagBand(px, W, H, rising: true, 0f, 0.075f, C(13504545u)); Star(px, W, H, 0.16f, 0.13f, 0.08f, 0f, C(16242200u)); }); P("Denmark", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(13111342u)); NordicCross(px, W, H, 0.14f, Color32.op_Implicit(Color.white)); }); P("Djibouti", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) //IL_0053: 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) HStripes(px, W, H, 6992615u, 1223979u); Tri(px, W, H, V(0f, 0f), V(0.55f, 0.5f), V(0f, 1f), Color32.op_Implicit(Color.white)); Star(px, W, H, 0.18f, 0.5f, 0.06f, 0f, C(14095386u)); }); P("Dominica", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00a0: 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_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) //IL_010d: 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) Fill(px, W, H, C(27455u)); Band(px, W, H, 0f, 0.44f, 1f, 0.48f, C(16568598u)); Band(px, W, H, 0f, 0.48f, 1f, 0.52f, C(1052688u)); Band(px, W, H, 0f, 0.52f, 1f, 0.56f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.44f, 0f, 0.48f, 1f, C(16568598u)); Band(px, W, H, 0.48f, 0f, 0.52f, 1f, C(1052688u)); Band(px, W, H, 0.52f, 0f, 0.56f, 1f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.1f, C(13900848u)); Disc(px, W, H, 0.5f, 0.5f, 0.035f, C(27455u)); }); P("Dominican Republic", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0f, 0.44f, 0.44f, C(11618u)); Band(px, W, H, 0.56f, 0f, 1f, 0.44f, C(13504806u)); Band(px, W, H, 0f, 0.56f, 0.44f, 1f, C(13504806u)); Band(px, W, H, 0.56f, 0.56f, 1f, 1f, C(11618u)); Disc(px, W, H, 0.5f, 0.5f, 0.035f, C(27455u)); }); P("Ecuador", delegate(Color32[] px, int W, int H) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 16768256u, 216738u, 15539236u }, new float[3] { 2f, 1f, 1f }); Disc(px, W, H, 0.5f, 0.5f, 0.06f, C(9202239u)); }); P("Egypt", delegate(Color32[] px, int W, int H) { //IL_0030: 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_0056: 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_006f: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 13504806u, 16777215u, 1052688u); Disc(px, W, H, 0.5f, 0.47f, 0.045f, C(12620544u)); Tri(px, W, H, V(0.46f, 0.5f), V(0.54f, 0.5f), V(0.5f, 0.58f), C(12620544u)); }); P("El Salvador", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0065: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 1001391u, 16777215u, 1001391u); Tri(px, W, H, V(0.43f, 0.44f), V(0.57f, 0.44f), V(0.5f, 0.57f), C(13149184u)); Tri(px, W, H, V(0.455f, 0.46f), V(0.545f, 0.46f), V(0.5f, 0.545f), Color32.op_Implicit(Color.white)); }); P("Equatorial Guinea", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006f: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 4102656u, 16777215u, 14885144u); Tri(px, W, H, V(0f, 0f), V(0.4f, 0.5f), V(0f, 1f), C(29646u)); Disc(px, W, H, 0.62f, 0.5f, 0.035f, C(10266268u)); }); P("Eritrea", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0053: 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_009a: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 1223979u, 4295133u); Tri(px, W, H, V(0f, 0f), V(1f, 0.5f), V(0f, 1f), C(15336503u)); Ring(px, W, H, 0.24f, 0.5f, 0.07f, 0.02f, C(16762662u)); Disc(px, W, H, 0.24f, 0.5f, 0.02f, C(16762662u)); }); P("Estonia", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 29390u, 1052688u, 16777215u); }); P("Eswatini", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00ca: 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_00eb: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 4087481u, 16767232u, 11602956u, 16767232u, 4087481u }, new float[5] { 3f, 1f, 5f, 1f, 3f }); Band(px, W, H, 0.2f, 0.49f, 0.8f, 0.51f, C(10709803u)); Disc(px, W, H, 0.42f, 0.5f, 0.075f, C(1052688u)); Disc(px, W, H, 0.58f, 0.5f, 0.075f, C(1052688u)); Disc(px, W, H, 0.5f, 0.5f, 0.085f, C(1052688u)); Disc(px, W, H, 0.44f, 0.5f, 0.055f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.53f, 0.5f, 0.04f, Color32.op_Implicit(Color.white)); }); P("Ethiopia", delegate(Color32[] px, int W, int H) { //IL_0030: 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_007c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 493872u, 16571657u, 14291482u); Disc(px, W, H, 0.5f, 0.5f, 0.13f, C(1001391u)); Star(px, W, H, 0.5f, 0.5f, 0.1f, 0f, C(16571657u)); Star(px, W, H, 0.5f, 0.5f, 0.055f, 0f, C(1001391u)); }); P("Fiji", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00a0: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(6864869u)); Band(px, W, H, 0.6f, 0.52f, 0.82f, 0.78f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.6f, 0.52f, 0.82f, 0.58f, C(13766708u)); Band(px, W, H, 0.695f, 0.58f, 0.725f, 0.78f, C(13766708u)); Band(px, W, H, 0.6f, 0.655f, 0.82f, 0.685f, C(13766708u)); PaintUnionJackCanton(px, W, H); }); P("Finland", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); NordicCross(px, W, H, 0.16f, C(12140u)); }); P("France", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 21924u, 16777215u, 15679797u); }); P("Gabon", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 40544u, 16568598u, 3831236u); }); P("Gambia", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[5] { 13504806u, 16777215u, 793740u, 16777215u, 3831592u }, new float[5] { 6f, 1f, 4f, 1f, 6f }); }); P("Georgia", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00ec: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.44f, 0f, 0.56f, 1f, C(16711680u)); Band(px, W, H, 0f, 0.46f, 1f, 0.54f, C(16711680u)); CrossAt(px, W, H, 0.22f, 0.22f, 0.05f, 0.018f, C(16711680u)); CrossAt(px, W, H, 0.78f, 0.22f, 0.05f, 0.018f, C(16711680u)); CrossAt(px, W, H, 0.22f, 0.78f, 0.05f, 0.018f, C(16711680u)); CrossAt(px, W, H, 0.78f, 0.78f, 0.05f, 0.018f, C(16711680u)); }); P("Germany", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 1052688u, 14483456u, 16764416u); }); P("Ghana", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 15676224u, 16765184u, 38713u); Star(px, W, H, 0.5f, 0.5f, 0.1f, 0f, C(1052688u)); }); P("Greece", delegate(Color32[] px, int W, int H) { //IL_0036: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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) HStripes(px, W, H, 876207u, 16777215u, 876207u, 16777215u, 876207u, 16777215u, 876207u, 16777215u, 876207u); Band(px, W, H, 0f, 0f, 0.37f, 0.37f, C(876207u)); Band(px, W, H, 0.145f, 0f, 0.225f, 0.37f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.145f, 0.37f, 0.225f, Color32.op_Implicit(Color.white)); }); P("Grenada", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0171: 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_01bd: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(13504806u)); Tri(px, W, H, V(0.09f, 0.09f), V(0.91f, 0.09f), V(0.5f, 0.5f), C(16568598u)); Tri(px, W, H, V(0.09f, 0.91f), V(0.91f, 0.91f), V(0.5f, 0.5f), C(16568598u)); Tri(px, W, H, V(0.09f, 0.09f), V(0.5f, 0.5f), V(0.09f, 0.91f), C(31326u)); Tri(px, W, H, V(0.91f, 0.09f), V(0.5f, 0.5f), V(0.91f, 0.91f), C(31326u)); Disc(px, W, H, 0.5f, 0.5f, 0.075f, C(13504806u)); Star(px, W, H, 0.5f, 0.5f, 0.055f, 0f, C(16568598u)); Star(px, W, H, 0.3f, 0.045f, 0.03f, 0f, C(16568598u)); Star(px, W, H, 0.5f, 0.045f, 0.03f, 0f, C(16568598u)); Star(px, W, H, 0.7f, 0.045f, 0.03f, 0f, C(16568598u)); Star(px, W, H, 0.3f, 0.955f, 0.03f, 0f, C(16568598u)); Star(px, W, H, 0.5f, 0.955f, 0.03f, 0f, C(16568598u)); Star(px, W, H, 0.7f, 0.955f, 0.03f, 0f, C(16568598u)); }); P("Guatemala", delegate(Color32[] px, int W, int H) { //IL_0035: 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) VStripes(px, W, H, 4822992u, 16777215u, 4822992u); Ring(px, W, H, 0.5f, 0.5f, 0.07f, 0.015f, C(1089102u)); Disc(px, W, H, 0.5f, 0.5f, 0.03f, C(9214808u)); }); P("Guinea", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 13504806u, 16568598u, 37984u); }); P("Guinea-Bissau", delegate(Color32[] px, int W, int H) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_008e: Unknown result type (might be due to invalid IL or missing references) Band(px, W, H, 0.35f, 0f, 1f, 0.5f, C(16568598u)); Band(px, W, H, 0.35f, 0.5f, 1f, 1f, C(40521u)); Band(px, W, H, 0f, 0f, 0.35f, 1f, C(13504806u)); Star(px, W, H, 0.175f, 0.5f, 0.07f, 0f, C(1052688u)); }); P("Guyana", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0042: 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_005e: 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_007c: 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_009d: 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_00bb: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(40521u)); Tri(px, W, H, V(0f, 0.02f), V(0.98f, 0.5f), V(0f, 0.98f), Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0f, 0.06f), V(0.9f, 0.5f), V(0f, 0.94f), C(16568598u)); Tri(px, W, H, V(0f, 0.14f), V(0.55f, 0.5f), V(0f, 0.86f), C(1052688u)); Tri(px, W, H, V(0f, 0.2f), V(0.47f, 0.5f), V(0f, 0.8f), C(13504806u)); }); P("Haiti", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) HStripes(px, W, H, 8351u, 13766708u); Band(px, W, H, 0.42f, 0.42f, 0.58f, 0.58f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.032f, C(92694u)); }); P("Honduras", delegate(Color32[] px, int W, int H) { //IL_0035: 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_0081: 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_00cd: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 29647u, 16777215u, 29647u); Star(px, W, H, 0.35f, 0.42f, 0.032f, 0f, C(29647u)); Star(px, W, H, 0.65f, 0.42f, 0.032f, 0f, C(29647u)); Star(px, W, H, 0.5f, 0.5f, 0.032f, 0f, C(29647u)); Star(px, W, H, 0.35f, 0.58f, 0.032f, 0f, C(29647u)); Star(px, W, H, 0.65f, 0.58f, 0.032f, 0f, C(29647u)); }); P("Hungary", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13510969u, 16777215u, 4681808u); }); P("Iceland", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0036: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(152220u)); NordicCross(px, W, H, 0.16f, Color32.op_Implicit(Color.white)); NordicCross(px, W, H, 0.08f, C(14425653u)); }); P("India", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16750899u, 16777215u, 1280008u); Ring(px, W, H, 0.5f, 0.5f, 0.105f, 0.028f, C(128u)); }); P("Indonesia", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13504806u, 16777215u); }); P("Iran", delegate(Color32[] px, int W, int H) { //IL_0030: 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) HStripes(px, W, H, 2334528u, 16777215u, 14286848u); Disc(px, W, H, 0.5f, 0.5f, 0.05f, C(14286848u)); Band(px, W, H, 0.485f, 0.42f, 0.515f, 0.58f, C(14286848u)); }); P("Iraq", delegate(Color32[] px, int W, int H) { //IL_0030: 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_0072: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 13504806u, 16777215u, 1052688u); Disc(px, W, H, 0.38f, 0.5f, 0.028f, C(31293u)); Disc(px, W, H, 0.5f, 0.49f, 0.028f, C(31293u)); Disc(px, W, H, 0.62f, 0.5f, 0.028f, C(31293u)); }); P("Ireland", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 1481570u, 16777215u, 16746558u); }); P("Israel", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_006b: 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_0089: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d2: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.12f, 1f, 0.22f, C(14520u)); Band(px, W, H, 0f, 0.78f, 1f, 0.88f, C(14520u)); Tri(px, W, H, V(0.5f, 0.32f), V(0.35f, 0.5f), V(0.65f, 0.5f), C(14520u)); Tri(px, W, H, V(0.5f, 0.62f), V(0.35f, 0.44f), V(0.65f, 0.44f), C(14520u)); }); P("Italy", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 35909u, 16777215u, 13443370u); }); P("Jamaica", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0.5f, 0.5f), C(39738u)); Tri(px, W, H, V(0f, 1f), V(1f, 1f), V(0.5f, 0.5f), C(39738u)); Tri(px, W, H, V(0f, 0f), V(0.5f, 0.5f), V(0f, 1f), C(1052688u)); Tri(px, W, H, V(1f, 0f), V(0.5f, 0.5f), V(1f, 1f), C(1052688u)); DiagBand(px, W, H, rising: true, 0f, 0.05f, C(16699648u)); DiagBand(px, W, H, rising: false, 0f, 0.05f, C(16699648u)); }); P("Japan", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.19f, C(12320813u)); }); P("Jordan", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006f: 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) HStripes(px, W, H, 1052688u, 16777215u, 31293u); Tri(px, W, H, V(0f, 0f), V(0.45f, 0.5f), V(0f, 1f), C(13504806u)); Star(px, W, H, 0.15f, 0.5f, 0.035f, 0f, Color32.op_Implicit(Color.white)); }); P("Kazakhstan", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(45002u)); Band(px, W, H, 0.02f, 0f, 0.1f, 1f, C(16696588u)); for (int i = 0; i < 8; i++) { Rhomb(px, W, H, 0.06f, 0.06f + (float)i * 0.125f, 0.032f, 0.035f, C(45002u)); } Sun(px, W, H, 0.55f, 0.4f, 0.09f, 0.05f, 16, C(16696588u)); Quad(px, W, H, V(0.35f, 0.62f), V(0.55f, 0.58f), V(0.75f, 0.62f), V(0.55f, 0.66f), C(16696588u)); }); P("Kenya", delegate(Color32[] px, int W, int H) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 1052688u, 16777215u, 12255232u, 16777215u, 26112u }, new float[5] { 6f, 1f, 6f, 1f, 6f }); Band(px, W, H, 0.49f, 0.22f, 0.51f, 0.78f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.085f, C(12255232u)); Ring(px, W, H, 0.5f, 0.5f, 0.085f, 0.018f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.035f, C(1052688u)); }); P("Kiribati", delegate(Color32[] px, int W, int H) { //IL_001c: 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_0060: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) Band(px, W, H, 0f, 0f, 1f, 0.55f, C(15154733u)); Sun(px, W, H, 0.5f, 0.42f, 0.08f, 0.05f, 12, C(16697162u)); Tri(px, W, H, V(0.36f, 0.21f), V(0.5f, 0.15f), V(0.64f, 0.21f), C(16697162u)); for (int i = 0; i < 6; i++) { Band(px, W, H, 0f, 0.55f + (float)i * 0.075f, 1f, 0.55f + (float)(i + 1) * 0.075f, (i % 2 == 0) ? C(23196u) : Color32.op_Implicit(Color.white)); } }); P("Kosovo", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004a: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(2378405u)); Disc(px, W, H, 0.5f, 0.56f, 0.09f, C(13674064u)); Disc(px, W, H, 0.43f, 0.61f, 0.05f, C(13674064u)); Disc(px, W, H, 0.57f, 0.61f, 0.05f, C(13674064u)); for (int i = 0; i < 6; i++) { Star(px, W, H, 0.29f + (float)i * 0.084f, (i < 3) ? (0.33f - (float)i * 0.028f) : (0.252f + (float)(i - 3) * 0.028f), 0.028f, 0f, Color32.op_Implicit(Color.white)); } }); P("Kuwait", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_005d: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 31293u, 16777215u, 13504806u); Quad(px, W, H, V(0f, 0f), V(0.32f, 0.25f), V(0.32f, 0.75f), V(0f, 1f), C(1052688u)); }); P("Kyrgyzstan", delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(15208749u)); Sun(px, W, H, 0.5f, 0.5f, 0.1f, 0.05f, 20, C(16772864u)); Ring(px, W, H, 0.5f, 0.5f, 0.055f, 0.014f, C(15208749u)); Band(px, W, H, 0.45f, 0.487f, 0.55f, 0.513f, C(15208749u)); Band(px, W, H, 0.487f, 0.467f, 0.513f, 0.533f, C(15208749u)); }); P("Laos", delegate(Color32[] px, int W, int H) { //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) HStripesW(px, W, H, new uint[3] { 13504806u, 10344u, 13504806u }, new float[3] { 1f, 2f, 1f }); Disc(px, W, H, 0.5f, 0.5f, 0.11f, Color32.op_Implicit(Color.white)); }); P("Latvia", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[3] { 10367033u, 16777215u, 10367033u }, new float[3] { 2f, 1f, 2f }); }); P("Lebanon", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0085: 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_00ab: 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_00c4: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 15603231u, 16777215u, 15603231u }, new float[3] { 1f, 2f, 1f }); Band(px, W, H, 0.485f, 0.54f, 0.515f, 0.62f, C(8014627u)); Tri(px, W, H, V(0.38f, 0.56f), V(0.62f, 0.56f), V(0.5f, 0.42f), C(42577u)); Tri(px, W, H, V(0.41f, 0.48f), V(0.59f, 0.48f), V(0.5f, 0.35f), C(42577u)); }); P("Lesotho", delegate(Color32[] px, int W, int H) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0085: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 8351u, 16777215u, 38211u }, new float[3] { 3f, 4f, 3f }); Tri(px, W, H, V(0.42f, 0.55f), V(0.58f, 0.55f), V(0.5f, 0.38f), C(1052688u)); Band(px, W, H, 0.38f, 0.55f, 0.62f, 0.575f, C(1052688u)); }); P("Liberia", delegate(Color32[] px, int W, int H) { //IL_0036: 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_005c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 12519984u, 16777215u, 12519984u, 16777215u, 12519984u, 16777215u, 12519984u, 16777215u, 12519984u, 16777215u, 12519984u); Band(px, W, H, 0f, 0f, 0.45f, 0.32f, C(10344u)); Star(px, W, H, 0.225f, 0.16f, 0.09f, 0f, Color32.op_Implicit(Color.white)); }); P("Libya", delegate(Color32[] px, int W, int H) { //IL_0046: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 15138835u, 1052688u, 2334278u }, new float[3] { 1f, 2f, 1f }); Crescent(px, W, H, 0.45f, 0.5f, 0.09f, 0.03f, 0.075f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.56f, 0.5f, 0.04f, 90f, Color32.op_Implicit(Color.white)); }); P("Liechtenstein", delegate(Color32[] px, int W, int H) { //IL_003a: 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_0060: 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_0079: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 11135u, 13504806u); Band(px, W, H, 0.1f, 0.14f, 0.26f, 0.2f, C(16767037u)); Tri(px, W, H, V(0.1f, 0.14f), V(0.14f, 0.14f), V(0.12f, 0.1f), C(16767037u)); Tri(px, W, H, V(0.16f, 0.14f), V(0.2f, 0.14f), V(0.18f, 0.09f), C(16767037u)); Tri(px, W, H, V(0.22f, 0.14f), V(0.26f, 0.14f), V(0.24f, 0.1f), C(16767037u)); }); P("Lithuania", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16627987u, 27204u, 12658477u); }); P("Luxembourg", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 15340573u, 16777215u, 5352922u); }); P("Madagascar", delegate(Color32[] px, int W, int H) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0068: Unknown result type (might be due to invalid IL or missing references) Band(px, W, H, 0.33f, 0f, 1f, 0.5f, C(16530738u)); Band(px, W, H, 0.33f, 0.5f, 1f, 1f, C(32314u)); Band(px, W, H, 0f, 0f, 0.33f, 1f, Color32.op_Implicit(Color.white)); }); P("Malawi", delegate(Color32[] px, int W, int H) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 1052688u, 13504806u, 3382837u); Sun(px, W, H, 0.5f, 0.335f, 0.09f, 0.06f, 9, C(13504806u)); Band(px, W, H, 0f, 0.336f, 1f, 0.667f, C(13504806u)); }); P("Malaysia", delegate(Color32[] px, int W, int H) { //IL_0035: 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_0086: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 13369345u, 16777215u, 13369345u, 16777215u, 13369345u, 16777215u, 13369345u); Band(px, W, H, 0f, 0f, 0.5f, 0.3f, C(65638u)); Crescent(px, W, H, 0.17f, 0.15f, 0.08f, 0.03f, 0.065f, C(16763904u)); Star(px, W, H, 0.33f, 0.15f, 0.055f, 0f, C(16763904u)); }); P("Maldives", delegate(Color32[] px, int W, int H) { //IL_0008: 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_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) Fill(px, W, H, C(13766708u)); Band(px, W, H, 0.2f, 0.25f, 0.8f, 0.75f, C(32314u)); Crescent(px, W, H, 0.52f, 0.5f, 0.1f, 0.045f, 0.085f, Color32.op_Implicit(Color.white)); }); P("Mali", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 1357114u, 16568598u, 13504806u); }); P("Malta", delegate(Color32[] px, int W, int H) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 16777215u, 13571115u); CrossAt(px, W, H, 0.12f, 0.11f, 0.045f, 0.016f, C(10329500u)); }); P("Marshall Islands", delegate(Color32[] px, int W, int H) { //IL_0008: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0068: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(14483u)); DiagBand(px, W, H, rising: true, -0.05f, 0.05f, C(14513408u)); DiagBand(px, W, H, rising: true, 0.05f, 0.05f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.28f, 0.2f, 0.1f, 0f, Color32.op_Implicit(Color.white)); }); P("Mauritania", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(43356u)); Band(px, W, H, 0f, 0f, 1f, 0.12f, C(13638687u)); Band(px, W, H, 0f, 0.88f, 1f, 1f, C(13638687u)); Disc(px, W, H, 0.5f, 0.52f, 0.14f, C(16766720u)); Disc(px, W, H, 0.5f, 0.44f, 0.13f, C(43356u)); Star(px, W, H, 0.5f, 0.4f, 0.05f, 0f, C(16766720u)); }); P("Mauritius", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 15345721u, 1712237u, 16766208u, 42321u); }); P("Mexico", delegate(Color32[] px, int W, int H) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 25409u, 16777215u, 13111342u); Disc(px, W, H, 0.5f, 0.5f, 0.055f, C(9202239u)); }); P("Micronesia", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(7713501u)); Star(px, W, H, 0.5f, 0.25f, 0.05f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.5f, 0.75f, 0.05f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.28f, 0.5f, 0.05f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.72f, 0.5f, 0.05f, 0f, Color32.op_Implicit(Color.white)); }); P("Moldova", delegate(Color32[] px, int W, int H) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 18094u, 16765440u, 13371695u); Disc(px, W, H, 0.5f, 0.5f, 0.05f, C(9202239u)); }); P("Monaco", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13504806u, 16777215u); }); P("Mongolia", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006f: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 12855087u, 86423u, 12855087u); Tri(px, W, H, V(0.145f, 0.35f), V(0.19f, 0.35f), V(0.167f, 0.29f), C(16371458u)); Disc(px, W, H, 0.167f, 0.4f, 0.03f, C(16371458u)); Band(px, W, H, 0.13f, 0.445f, 0.205f, 0.465f, C(16371458u)); Disc(px, W, H, 0.167f, 0.51f, 0.026f, C(16371458u)); Band(px, W, H, 0.13f, 0.555f, 0.205f, 0.575f, C(16371458u)); Band(px, W, H, 0.126f, 0.44f, 0.14f, 0.58f, C(16371458u)); Band(px, W, H, 0.194f, 0.44f, 0.208f, 0.58f, C(16371458u)); }); P("Montenegro", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_007a: 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_0093: 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_00b9: 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_00d2: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(13872699u)); Band(px, W, H, 0.025f, 0.025f, 0.975f, 0.975f, C(12845832u)); Star(px, W, H, 0.5f, 0.42f, 0.07f, 0f, C(13872699u)); Tri(px, W, H, V(0.36f, 0.5f), V(0.5f, 0.44f), V(0.5f, 0.56f), C(13872699u)); Tri(px, W, H, V(0.64f, 0.5f), V(0.5f, 0.44f), V(0.5f, 0.56f), C(13872699u)); }); P("Morocco", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(12658477u)); Star(px, W, H, 0.5f, 0.5f, 0.11f, 0f, C(25139u)); Star(px, W, H, 0.5f, 0.505f, 0.05f, 0f, C(12658477u)); }); P("Mozambique", delegate(Color32[] px, int W, int H) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0085: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 38457u, 16777215u, 1052688u, 16777215u, 16572672u }, new float[5] { 5f, 1f, 5f, 1f, 5f }); Tri(px, W, H, V(0f, 0f), V(0.48f, 0.5f), V(0f, 1f), C(14942251u)); Star(px, W, H, 0.16f, 0.5f, 0.07f, 0f, C(16572672u)); }); P("Myanmar", delegate(Color32[] px, int W, int H) { //IL_0030: 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) HStripes(px, W, H, 16698112u, 3453491u, 15345721u); Star(px, W, H, 0.5f, 0.5f, 0.14f, 0f, Color32.op_Implicit(Color.white)); }); P("Namibia", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(13696u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(38211u)); DiagBand(px, W, H, rising: true, 0f, 0.1f, Color32.op_Implicit(Color.white)); DiagBand(px, W, H, rising: true, 0f, 0.075f, C(13766708u)); Sun(px, W, H, 0.2f, 0.15f, 0.05f, 0.035f, 12, C(16764416u)); }); P("Nauru", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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) Fill(px, W, H, C(11135u)); Band(px, W, H, 0f, 0.48f, 1f, 0.52f, C(16762398u)); Star(px, W, H, 0.25f, 0.66f, 0.06f, 0f, Color32.op_Implicit(Color.white)); }); P("Nepal", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(1250072u)); Tri(px, W, H, V(0.14f, 0.03f), V(0.8f, 0.29f), V(0.14f, 0.55f), C(14483u)); Tri(px, W, H, V(0.17f, 0.08f), V(0.72f, 0.29f), V(0.17f, 0.5f), C(14423100u)); Tri(px, W, H, V(0.14f, 0.44f), V(0.86f, 0.72f), V(0.14f, 1f), C(14483u)); Tri(px, W, H, V(0.17f, 0.5f), V(0.78f, 0.72f), V(0.17f, 0.94f), C(14423100u)); Disc(px, W, H, 0.33f, 0.3f, 0.045f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.33f, 0.266f, 0.042f, C(14423100u)); Sun(px, W, H, 0.33f, 0.73f, 0.032f, 0.022f, 12, Color32.op_Implicit(Color.white)); }); P("Netherlands", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 11410472u, 16777215u, 2180747u); }); P("New Zealand", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00a0: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(74089u)); Star(px, W, H, 0.72f, 0.34f, 0.05f, 0f, C(13374507u)); Star(px, W, H, 0.8f, 0.55f, 0.05f, 0f, C(13374507u)); Star(px, W, H, 0.64f, 0.58f, 0.045f, 0f, C(13374507u)); Star(px, W, H, 0.72f, 0.78f, 0.05f, 0f, C(13374507u)); PaintUnionJackCanton(px, W, H); }); P("Nicaragua", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0065: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 26566u, 16777215u, 26566u); Tri(px, W, H, V(0.43f, 0.44f), V(0.57f, 0.44f), V(0.5f, 0.57f), C(13149184u)); Tri(px, W, H, V(0.455f, 0.46f), V(0.545f, 0.46f), V(0.5f, 0.545f), Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.48f, 0.018f, C(26566u)); }); P("Niger", delegate(Color32[] px, int W, int H) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 14701062u, 16777215u, 897067u); Disc(px, W, H, 0.5f, 0.5f, 0.075f, C(14701062u)); }); P("Nigeria", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 34641u, 16777215u, 34641u); }); P("Niue", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_00c9: 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) Fill(px, W, H, C(16702720u)); PaintUnionJackCanton(px, W, H); Disc(px, W, H, 0.25f, 0.17f, 0.045f, C(16702720u)); Star(px, W, H, 0.25f, 0.17f, 0.032f, 0f, C(74089u)); Star(px, W, H, 0.25f, 0.055f, 0.02f, 0f, C(16702720u)); Star(px, W, H, 0.25f, 0.285f, 0.02f, 0f, C(16702720u)); Star(px, W, H, 0.1f, 0.17f, 0.02f, 0f, C(16702720u)); Star(px, W, H, 0.4f, 0.17f, 0.02f, 0f, C(16702720u)); }); P("North Korea", delegate(Color32[] px, int W, int H) { //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_0067: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 151458u, 16777215u, 15539239u, 16777215u, 151458u }, new float[5] { 6f, 1f, 11f, 1f, 6f }); Disc(px, W, H, 0.32f, 0.5f, 0.1f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.32f, 0.5f, 0.078f, 0f, C(15539239u)); }); P("North Macedonia", delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(13762560u)); Sun(px, W, H, 0.5f, 0.5f, 0.09f, 0.6f, 8, C(16769674u)); }); P("Norway", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0036: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(12192815u)); NordicCross(px, W, H, 0.16f, Color32.op_Implicit(Color.white)); NordicCross(px, W, H, 0.08f, C(8283u)); }); P("Oman", delegate(Color32[] px, int W, int H) { //IL_0035: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 14358043u, 32768u); Band(px, W, H, 0f, 0f, 0.28f, 1f, C(14358043u)); Disc(px, W, H, 0.14f, 0.1f, 0.03f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.13f, 0.12f, 0.15f, 0.24f, Color32.op_Implicit(Color.white)); }); P("Pakistan", delegate(Color32[] px, int W, int H) { //IL_0008: 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_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_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) Fill(px, W, H, C(82204u)); Band(px, W, H, 0f, 0f, 0.25f, 1f, Color32.op_Implicit(Color.white)); Crescent(px, W, H, 0.58f, 0.48f, 0.15f, 0.05f, 0.13f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.71f, 0.35f, 0.06f, 20f, Color32.op_Implicit(Color.white)); }); P("Palau", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(4894166u)); Disc(px, W, H, 0.45f, 0.5f, 0.15f, C(16768512u)); }); P("Palestine", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) HStripes(px, W, H, 1052688u, 16777215u, 38710u); Tri(px, W, H, V(0f, 0f), V(0.45f, 0.5f), V(0f, 1f), C(15608373u)); }); P("Panama", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.5f, 0f, 1f, 0.5f, C(13766708u)); Band(px, W, H, 0f, 0.5f, 0.5f, 1f, C(21139u)); Star(px, W, H, 0.25f, 0.25f, 0.07f, 0f, C(21139u)); Star(px, W, H, 0.75f, 0.75f, 0.07f, 0f, C(13766708u)); }); P("Papua New Guinea", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0095: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(1f, 1f), C(13504806u)); Tri(px, W, H, V(0f, 0f), V(1f, 1f), V(0f, 1f), C(1052688u)); Disc(px, W, H, 0.68f, 0.26f, 0.05f, C(16763653u)); Tri(px, W, H, V(0.58f, 0.22f), V(0.78f, 0.14f), V(0.68f, 0.28f), C(16763653u)); Star(px, W, H, 0.25f, 0.52f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.33f, 0.63f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.25f, 0.76f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.17f, 0.63f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.28f, 0.67f, 0.022f, 0f, Color32.op_Implicit(Color.white)); }); P("Paraguay", delegate(Color32[] px, int W, int H) { //IL_0035: 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) HStripes(px, W, H, 13970206u, 16777215u, 14504u); Ring(px, W, H, 0.5f, 0.5f, 0.07f, 0.015f, C(39738u)); Star(px, W, H, 0.5f, 0.5f, 0.035f, 0f, C(16761358u)); }); P("Peru", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 14225443u, 16777215u, 14225443u); }); P("Philippines", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) //IL_0053: 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) HStripes(px, W, H, 14504u, 13504806u); Tri(px, W, H, V(0f, 0f), V(0.5f, 0.5f), V(0f, 1f), Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.15f, 0.5f, 0.07f, C(16568598u)); }); P("Poland", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16777215u, 14423100u); }); P("Portugal", delegate(Color32[] px, int W, int H) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) VStripesW(px, W, H, new uint[2] { 289336u, 14297372u }, new float[2] { 2f, 3f }); Disc(px, W, H, 0.4f, 0.5f, 0.11f, C(16771328u)); Disc(px, W, H, 0.4f, 0.5f, 0.062f, C(14297372u)); }); P("Qatar", delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(9247549u)); ZigzagHoist(px, W, H, 0.3f, 9, 0.045f, Color32.op_Implicit(Color.white)); }); P("Romania", delegate(Color32[] px, int W, int H) { VStripes(px, W, H, 11135u, 16568598u, 13504806u); }); P("Russia", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 16777215u, 14758u, 13970206u); }); P("Rwanda", delegate(Color32[] px, int W, int H) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 41438u, 16437761u, 2121789u }, new float[3] { 2f, 1f, 1f }); Sun(px, W, H, 0.78f, 0.14f, 0.05f, 0.035f, 12, C(15056385u)); }); P("Saint Kitts & Nevis", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00fa: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(40521u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(13504806u)); DiagBand(px, W, H, rising: true, 0f, 0.14f, C(16568598u)); DiagBand(px, W, H, rising: true, 0f, 0.1f, C(1052688u)); Star(px, W, H, 0.37f, 0.56f, 0.05f, 20f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.63f, 0.44f, 0.05f, 20f, Color32.op_Implicit(Color.white)); }); P("Saint Lucia", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0042: 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_005e: 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_007c: 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_009d: 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_00bb: 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) Fill(px, W, H, C(6737151u)); Tri(px, W, H, V(0.28f, 0.78f), V(0.72f, 0.78f), V(0.5f, 0.22f), Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0.32f, 0.78f), V(0.68f, 0.78f), V(0.5f, 0.28f), C(1052688u)); Tri(px, W, H, V(0.28f, 0.78f), V(0.72f, 0.78f), V(0.5f, 0.5f), C(16568598u)); }); P("Saint Vincent", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) VStripesW(px, W, H, new uint[3] { 29382u, 16568598u, 40544u }, new float[3] { 1f, 2f, 1f }); Rhomb(px, W, H, 0.41f, 0.45f, 0.05f, 0.055f, C(40544u)); Rhomb(px, W, H, 0.59f, 0.45f, 0.05f, 0.055f, C(40544u)); Rhomb(px, W, H, 0.5f, 0.57f, 0.05f, 0.055f, C(40544u)); }); P("Samoa", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_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) Fill(px, W, H, C(13504806u)); Band(px, W, H, 0f, 0f, 0.5f, 0.34f, C(11135u)); Star(px, W, H, 0.25f, 0.08f, 0.035f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.32f, 0.15f, 0.035f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.25f, 0.24f, 0.035f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.17f, 0.16f, 0.035f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.28f, 0.19f, 0.024f, 0f, Color32.op_Implicit(Color.white)); }); P("San Marino", delegate(Color32[] px, int W, int H) { //IL_003a: 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) HStripes(px, W, H, 16777215u, 6207204u); Ring(px, W, H, 0.5f, 0.5f, 0.07f, 0.015f, C(1089102u)); Disc(px, W, H, 0.5f, 0.5f, 0.035f, C(15188318u)); }); P("São Tomé & Príncipe", delegate(Color32[] px, int W, int H) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0085: 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) HStripesW(px, W, H, new uint[3] { 1223979u, 16764416u, 1223979u }, new float[3] { 1f, 2f, 1f }); Tri(px, W, H, V(0f, 0f), V(0.3f, 0.5f), V(0f, 1f), C(13766708u)); Star(px, W, H, 0.53f, 0.5f, 0.05f, 0f, C(1052688u)); Star(px, W, H, 0.75f, 0.5f, 0.05f, 0f, C(1052688u)); }); P("Saudi Arabia", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_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) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0138: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(27701u)); Band(px, W, H, 0.2f, 0.345f, 0.34f, 0.375f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.38f, 0.335f, 0.52f, 0.375f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.56f, 0.345f, 0.66f, 0.375f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.7f, 0.335f, 0.8f, 0.375f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.26f, 0.42f, 0.44f, 0.45f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.5f, 0.41f, 0.74f, 0.45f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.2f, 0.575f, 0.76f, 0.605f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.76f, 0.565f, 0.8f, 0.615f, Color32.op_Implicit(Color.white)); }); P("Senegal", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 34111u, 16641858u, 14883619u); Star(px, W, H, 0.5f, 0.5f, 0.07f, 0f, C(34111u)); }); P("Serbia", delegate(Color32[] px, int W, int H) { //IL_0035: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 12990012u, 802934u, 16777215u); Band(px, W, H, 0.32f, 0.4f, 0.44f, 0.6f, C(12990012u)); CrossAt(px, W, H, 0.38f, 0.5f, 0.045f, 0.014f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.38f, 0.375f, 0.025f, C(15579438u)); }); P("Seychelles", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0109: 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_0127: 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) Tri(px, W, H, V(0f, 1f), V(0f, 0f), V(0.33f, 0f), C(16263u)); Tri(px, W, H, V(0f, 1f), V(0.33f, 0f), V(0.66f, 0f), C(16570454u)); Tri(px, W, H, V(0f, 1f), V(0.66f, 0f), V(1f, 0f), C(14034984u)); Tri(px, W, H, V(0f, 1f), V(1f, 0f), V(1f, 0.5f), Color32.op_Implicit(Color.white)); Tri(px, W, H, V(0f, 1f), V(1f, 0.5f), V(1f, 1f), C(31293u)); }); P("Sierra Leone", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 2012474u, 16777215u, 29382u); }); P("Singapore", delegate(Color32[] px, int W, int H) { //IL_003a: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 15676224u, 16777215u); Crescent(px, W, H, 0.2f, 0.25f, 0.1f, 0.035f, 0.085f, Color32.op_Implicit(Color.white)); for (int i = 0; i < 5; i++) { float num = (-90f + (float)i * 72f) * (MathF.PI / 180f); Star(px, W, H, 0.34f + 0.045f * Mathf.Cos(num), 0.25f + 0.030000001f * Mathf.Sin(num), 0.018f, 0f, Color32.op_Implicit(Color.white)); } }); P("Slovakia", delegate(Color32[] px, int W, int H) { //IL_0035: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00c8: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 741026u, 15604773u); Band(px, W, H, 0.22f, 0.38f, 0.38f, 0.62f, C(15604773u)); Band(px, W, H, 0.29f, 0.42f, 0.31f, 0.56f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.25f, 0.45f, 0.35f, 0.475f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.26f, 0.505f, 0.34f, 0.53f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.3f, 0.6f, 0.032f, C(741026u)); }); P("Slovenia", delegate(Color32[] px, int W, int H) { //IL_0035: 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_005b: 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_0074: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 23972u, 15539236u); Band(px, W, H, 0.19f, 0.15f, 0.31f, 0.37f, C(23972u)); Tri(px, W, H, V(0.2f, 0.32f), V(0.25f, 0.22f), V(0.3f, 0.32f), Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.22f, 0.185f, 0.011f, C(16768256u)); Disc(px, W, H, 0.28f, 0.185f, 0.011f, C(16768256u)); Disc(px, W, H, 0.25f, 0.165f, 0.011f, C(16768256u)); }); P("Solomon Islands", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0091: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(20922u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(2186035u)); DiagBand(px, W, H, rising: true, 0f, 0.05f, C(16568598u)); Star(px, W, H, 0.13f, 0.1f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.29f, 0.1f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.21f, 0.185f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.13f, 0.27f, 0.032f, 0f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.29f, 0.27f, 0.032f, 0f, Color32.op_Implicit(Color.white)); }); P("Somalia", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(4295133u)); Star(px, W, H, 0.5f, 0.5f, 0.13f, 0f, Color32.op_Implicit(Color.white)); }); P("South Africa", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0077: 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_0095: 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_00b6: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 14695473u, 5257u); Band(px, W, H, 0f, 0.4f, 1f, 0.6f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0f, 0.44f, 1f, 0.56f, C(30537u)); Tri(px, W, H, V(-0.02f, -0.05f), V(0.42f, 0.5f), V(-0.02f, 1.05f), C(16758812u)); Tri(px, W, H, V(-0.02f, 0.1f), V(0.3f, 0.5f), V(-0.02f, 0.9f), C(1052688u)); }); P("South Korea", delegate(Color32[] px, int W, int H) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.5f, 0.17f, C(13446714u)); for (int i = H / 2; i < H; i++) { for (int j = 0; j < W; j++) { float num = ((float)j + 0.5f) / (float)W; float num2 = ((float)i + 0.5f) / (float)H * 1.5f; if ((num - 0.5f) * (num - 0.5f) + (num2 - 0.75f) * (num2 - 0.75f) <= 0.028900001f) { Set(px, W, H, j, i, C(18336u)); } } } }); P("South Sudan", delegate(Color32[] px, int W, int H) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0085: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 1052688u, 16777215u, 14291482u, 16777215u, 493872u }, new float[5] { 4f, 1f, 4f, 1f, 4f }); Tri(px, W, H, V(0f, 0f), V(0.4f, 0.5f), V(0f, 1f), C(1001391u)); Star(px, W, H, 0.13f, 0.5f, 0.055f, 0f, C(16571657u)); }); P("Spain", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[3] { 11146523u, 15843072u, 11146523u }, new float[3] { 1f, 2f, 1f }); }); P("Sri Lanka", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(16758528u)); Band(px, W, H, 0.05f, 0.07f, 0.95f, 0.93f, C(9246010u)); Band(px, W, H, 0.05f, 0.07f, 0.2f, 0.93f, C(27455u)); Band(px, W, H, 0.2f, 0.07f, 0.35f, 0.93f, C(16741120u)); Disc(px, W, H, 0.64f, 0.5f, 0.08f, C(16758528u)); Band(px, W, H, 0.56f, 0.3f, 0.585f, 0.62f, C(16758528u)); Disc(px, W, H, 0.43f, 0.13f, 0.028f, C(16758528u)); Disc(px, W, H, 0.89f, 0.13f, 0.028f, C(16758528u)); Disc(px, W, H, 0.43f, 0.87f, 0.028f, C(16758528u)); Disc(px, W, H, 0.89f, 0.87f, 0.028f, C(16758528u)); }); P("Sudan", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) HStripes(px, W, H, 13766708u, 16777215u, 1052688u); Tri(px, W, H, V(0f, 0f), V(0.38f, 0.5f), V(0f, 1f), C(29225u)); }); P("Suriname", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[5] { 3636799u, 16777215u, 11799085u, 16777215u, 3636799u }, new float[5] { 2f, 1f, 4f, 1f, 2f }); Star(px, W, H, 0.5f, 0.5f, 0.09f, 0f, C(15517725u)); }); P("Sweden", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(27303u)); NordicCross(px, W, H, 0.14f, C(16698370u)); }); P("Switzerland", delegate(Color32[] px, int W, int H) { //IL_0008: 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_004f: 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) Fill(px, W, H, C(14297372u)); Band(px, W, H, 0.435f, 11f / 30f, 0.565f, 19f / 30f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.3f, 0.45666668f, 0.7f, 0.54333335f, Color32.op_Implicit(Color.white)); }); P("Syria", delegate(Color32[] px, int W, int H) { //IL_0035: 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_0081: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 31293u, 16777215u, 1052688u); Star(px, W, H, 0.28f, 0.5f, 0.04f, 0f, C(13504806u)); Star(px, W, H, 0.5f, 0.5f, 0.04f, 0f, C(13504806u)); Star(px, W, H, 0.72f, 0.5f, 0.04f, 0f, C(13504806u)); }); P("Taiwan", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0051: 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) Fill(px, W, H, C(16646144u)); Band(px, W, H, 0f, 0f, 0.5f, 0.34f, C(149u)); Sun(px, W, H, 0.25f, 0.17f, 0.05f, 0.045f, 12, Color32.op_Implicit(Color.white)); }); P("Tajikistan", delegate(Color32[] px, int W, int H) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0085: 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_00ab: 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_00c4: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0150: Unknown result type (might be due to invalid IL or missing references) HStripesW(px, W, H, new uint[3] { 13369344u, 16777215u, 26112u }, new float[3] { 2f, 3f, 2f }); Band(px, W, H, 0.42f, 0.52f, 0.58f, 0.545f, C(16302848u)); Tri(px, W, H, V(0.43f, 0.52f), V(0.47f, 0.52f), V(0.45f, 0.475f), C(16302848u)); Tri(px, W, H, V(0.48f, 0.52f), V(0.52f, 0.52f), V(0.5f, 0.47f), C(16302848u)); Tri(px, W, H, V(0.53f, 0.52f), V(0.57f, 0.52f), V(0.55f, 0.475f), C(16302848u)); for (int i = 0; i < 7; i++) { Star(px, W, H, 0.35f + (float)i * 0.05f, 0.42f - Mathf.Sin((float)i / 6f * MathF.PI) * 0.025f, 0.016f, 0f, C(16302848u)); } }); P("Tanzania", delegate(Color32[] px, int W, int H) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Tri(px, W, H, V(0f, 0f), V(1f, 0f), V(0f, 1f), C(2012474u)); Tri(px, W, H, V(1f, 0f), V(1f, 1f), V(0f, 1f), C(41949u)); DiagBand(px, W, H, rising: true, 0f, 0.13f, C(16568598u)); DiagBand(px, W, H, rising: true, 0f, 0.095f, C(1052688u)); }); P("Thailand", delegate(Color32[] px, int W, int H) { HStripesW(px, W, H, new uint[5] { 10819889u, 16777215u, 2959946u, 16777215u, 10819889u }, new float[5] { 1f, 1f, 2f, 1f, 1f }); }); P("Timor-Leste", delegate(Color32[] px, int W, int H) { //IL_0008: 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_002e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) Fill(px, W, H, C(14427167u)); Tri(px, W, H, V(0f, 0f), V(0.55f, 0.5f), V(0f, 1f), C(16762662u)); Tri(px, W, H, V(0f, 0.14f), V(0.38f, 0.5f), V(0f, 0.86f), C(1052688u)); Star(px, W, H, 0.14f, 0.5f, 0.06f, 15f, Color32.op_Implicit(Color.white)); }); P("Togo", delegate(Color32[] px, int W, int H) { //IL_0035: 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_005b: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 27214u, 16764416u, 27214u, 16764416u, 27214u); Band(px, W, H, 0f, 0f, 0.42f, 0.6f, C(13766708u)); Star(px, W, H, 0.21f, 0.3f, 0.1f, 0f, Color32.op_Implicit(Color.white)); }); P("Tonga", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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) Fill(px, W, H, C(12648448u)); Band(px, W, H, 0f, 0f, 0.4f, 0.34f, Color32.op_Implicit(Color.white)); Band(px, W, H, 0.16f, 0.06f, 0.24f, 0.28f, C(12648448u)); Band(px, W, H, 0.08f, 0.13f, 0.32f, 0.21f, C(12648448u)); }); P("Trinidad & Tobago", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0042: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(14680064u)); DiagBand(px, W, H, rising: false, 0f, 0.115f, Color32.op_Implicit(Color.white)); DiagBand(px, W, H, rising: false, 0f, 0.085f, C(1052688u)); }); P("Tunisia", delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_007a: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(15138835u)); Disc(px, W, H, 0.5f, 0.5f, 0.15f, Color32.op_Implicit(Color.white)); Crescent(px, W, H, 0.49f, 0.5f, 0.11f, 0.04f, 0.095f, C(15138835u)); Star(px, W, H, 0.555f, 0.5f, 0.05f, 90f, C(15138835u)); }); P("Turkey", delegate(Color32[] px, int W, int H) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //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) Fill(px, W, H, C(14879255u)); Crescent(px, W, H, 0.42f, 0.5f, 0.16f, 0.05f, 0.13f, Color32.op_Implicit(Color.white)); Star(px, W, H, 0.62f, 0.5f, 0.07f, 90f, Color32.op_Implicit(Color.white)); }); P("Turkmenistan", delegate(Color32[] px, int W, int H) { //IL_0008: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00d2: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(33853u)); Band(px, W, H, 0.08f, 0f, 0.24f, 1f, C(13772336u)); for (int i = 0; i < 5; i++) { Rhomb(px, W, H, 0.16f, 0.1f + (float)i * 0.2f, 0.055f, 0.055f, Color32.op_Implicit(Color.white)); } Crescent(px, W, H, 0.52f, 0.2f, 0.07f, 0.025f, 0.06f, Color32.op_Implicit(Color.white)); for (int j = 0; j < 5; j++) { Star(px, W, H, 0.64f + (float)(j % 2) * 0.08f, 0.12f + (float)j * 0.05f, 0.02f, 0f, Color32.op_Implicit(Color.white)); } }); P("Tuvalu", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_00a0: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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) //IL_015e: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(6730472u)); Star(px, W, H, 0.62f, 0.3f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.76f, 0.24f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.88f, 0.33f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.66f, 0.48f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.8f, 0.5f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.9f, 0.58f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.62f, 0.66f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.75f, 0.7f, 0.035f, 0f, C(16764416u)); Star(px, W, H, 0.87f, 0.78f, 0.035f, 0f, C(16764416u)); PaintUnionJackCanton(px, W, H); }); P("Uganda", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) HStripes(px, W, H, 1052688u, 16571396u, 14221312u, 1052688u, 16571396u, 14221312u); Disc(px, W, H, 0.5f, 0.5f, 0.11f, Color32.op_Implicit(Color.white)); Disc(px, W, H, 0.5f, 0.52f, 0.05f, C(10266268u)); Disc(px, W, H, 0.5f, 0.44f, 0.018f, C(14221312u)); }); P("Ukraine", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 22455u, 16766720u); }); P("United Arab Emirates", delegate(Color32[] px, int W, int H) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 29487u, 16777215u, 1052688u); Band(px, W, H, 0f, 0f, 0.3f, 1f, C(16711680u)); }); P("United Kingdom", UnionJack); P("United States", delegate(Color32[] px, int W, int H) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 11674164u, 16777215u, 11674164u, 16777215u, 11674164u, 16777215u, 11674164u, 16777215u, 11674164u, 16777215u, 11674164u, 16777215u, 11674164u); Band(px, W, H, 0f, 0f, 0.46f, 0.53846157f, C(3947374u)); for (int i = 0; i < 5; i++) { for (int j = 0; j < 4; j++) { Disc(px, W, H, 0.06f + (float)j * 0.11f + (float)(i % 2) * 0.055f, 0.055f + (float)i * 0.095f, 0.014f, Color32.op_Implicit(Color.white)); } } }); P("Uruguay", delegate(Color32[] px, int W, int H) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 16777215u, 14504u, 16777215u, 14504u, 16777215u, 14504u, 16777215u, 14504u, 16777215u); Band(px, W, H, 0f, 0f, 0.5f, 4f / 9f, Color32.op_Implicit(Color.white)); Sun(px, W, H, 0.25f, 0.22f, 0.08f, 0.05f, 16, C(16568598u)); }); P("Uzbekistan", delegate(Color32[] px, int W, int H) { //IL_0046: 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_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) HStripesW(px, W, H, new uint[5] { 39349u, 13504806u, 16777215u, 13504806u, 2012474u }, new float[5] { 8f, 1f, 8f, 1f, 8f }); Crescent(px, W, H, 0.15f, 0.14f, 0.07f, 0.025f, 0.06f, Color32.op_Implicit(Color.white)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3 + i; j++) { Disc(px, W, H, 0.52f - (float)j * 0.07f, 0.06f + (float)i * 0.075f, 0.016f, Color32.op_Implicit(Color.white)); } } }); P("Vanuatu", delegate(Color32[] px, int W, int H) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_007f: 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_009d: 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_00b6: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) Band(px, W, H, 0f, 0f, 1f, 0.5f, C(13766708u)); Band(px, W, H, 0f, 0.5f, 1f, 1f, C(38211u)); Band(px, W, H, 0.3f, 0.46f, 1f, 0.54f, C(16633362u)); Quad(px, W, H, V(0f, 0f), V(0.44f, 0.44f), V(0.44f, 0.54f), V(0f, 0.1f), C(16633362u)); Quad(px, W, H, V(0f, 1f), V(0.44f, 0.56f), V(0.44f, 0.46f), V(0f, 0.9f), C(16633362u)); Tri(px, W, H, V(0f, 0.1f), V(0.38f, 0.5f), V(0f, 0.9f), C(1052688u)); }); P("Vatican City", delegate(Color32[] px, int W, int H) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) VStripes(px, W, H, 16769024u, 16777215u); Quad(px, W, H, V(0.66f, 0.4f), V(0.84f, 0.58f), V(0.82f, 0.61f), V(0.64f, 0.43f), C(10329500u)); Quad(px, W, H, V(0.84f, 0.4f), V(0.66f, 0.58f), V(0.68f, 0.61f), V(0.86f, 0.43f), C(12620544u)); Disc(px, W, H, 0.75f, 0.37f, 0.035f, C(13766708u)); }); P("Venezuela", delegate(Color32[] px, int W, int H) { //IL_0063: 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) HStripes(px, W, H, 16763904u, 9341u, 13571115u); for (int i = 0; i < 8; i++) { float num = (200f - (float)i * 28.5f) * (MathF.PI / 180f); Star(px, W, H, 0.5f + 0.14f * Mathf.Cos(num), 0.5f - 7f / 75f * Mathf.Sin(num), 0.022f, 0f, Color32.op_Implicit(Color.white)); } }); P("Vietnam", delegate(Color32[] px, int W, int H) { //IL_0008: 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) Fill(px, W, H, C(14296349u)); Star(px, W, H, 0.5f, 0.5f, 0.16f, 0f, C(16776960u)); }); P("Yemen", delegate(Color32[] px, int W, int H) { HStripes(px, W, H, 13504806u, 16777215u, 1052688u); }); P("Zambia", delegate(Color32[] px, int W, int H) { //IL_0008: 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_0054: 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_009b: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) Fill(px, W, H, C(1673728u)); Band(px, W, H, 0.55f, 0.55f, 0.7f, 1f, C(14557200u)); Band(px, W, H, 0.7f, 0.55f, 0.85f, 1f, C(1052688u)); Band(px, W, H, 0.85f, 0.55f, 1f, 1f, C(15695104u)); Disc(px, W, H, 0.775f, 0.4f, 0.05f, C(15695104u)); Tri(px, W, H, V(0.67f, 0.38f), V(0.88f, 0.31f), V(0.775f, 0.44f), C(15695104u)); }); P("Zimbabwe", delegate(Color32[] px, int W, int H) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0065: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) HStripes(px, W, H, 3248648u, 16765440u, 14557200u, 1052688u, 14557200u, 16765440u, 3248648u); Tri(px, W, H, V(0f, -0.02f), V(0.42f, 0.5f), V(0f, 1.02f), C(1052688u)); Tri(px, W, H, V(0f, 0.03f), V(0.38f, 0.5f), V(0f, 0.97f), Color32.op_Implicit(Color.white)); Star(px, W, H, 0.13f, 0.5f, 0.07f, 0f, C(14557200u)); Disc(px, W, H, 0.13f, 0.5f, 0.028f, C(16765440u)); }); void P(string name, Action paint) { t.Add(new Def { name = name, cat = BgCat.Flag, paint = paint }); } static Vector2 V(float u, float v) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new Vector2(u, v); } } } internal static class BundleMeshCore { internal sealed class MeshBlob { public string name; public int vertexCount; public int subMeshCount; public float[] positions; public float[] uv0; public float[] uv1; public byte[] colors; public int[][] subTris; } private sealed class TypeTree { public int classId; public Node[] nodes; } internal struct Node { public string type; public string name; public int level; public uint metaFlags; } private sealed class Reader { public readonly byte[] Data; public int Pos; public bool BigEndian; public Reader(byte[] data, bool bigEndian) { Data = data; BigEndian = bigEndian; } public void Skip(int n) { Pos += n; } public void Align(int a) { int num = Pos % a; if (num != 0) { Pos += a - num; } } public byte U8() { return Data[Pos++]; } public ushort U16() { ushort result = (BigEndian ? ((ushort)((Data[Pos] << 8) | Data[Pos + 1])) : ((ushort)(Data[Pos] | (Data[Pos + 1] << 8)))); Pos += 2; return result; } public short I16() { return (short)U16(); } public uint U32() { int result = (BigEndian ? ((Data[Pos] << 24) | (Data[Pos + 1] << 16) | (Data[Pos + 2] << 8) | Data[Pos + 3]) : (Data[Pos] | (Data[Pos + 1] << 8) | (Data[Pos + 2] << 16) | (Data[Pos + 3] << 24))); Pos += 4; return (uint)result; } public int I32() { return (int)U32(); } public ulong U64() { ulong num; ulong num2; if (BigEndian) { num = U32(); num2 = U32(); } else { num2 = U32(); num = U32(); } return (num << 32) | num2; } public float F32() { if (!BigEndian) { float result = BitConverter.ToSingle(Data, Pos); Pos += 4; return result; } byte[] value = new byte[4] { Data[Pos + 3], Data[Pos + 2], Data[Pos + 1], Data[Pos] }; Pos += 4; return BitConverter.ToSingle(value, 0); } public double F64() { if (!BigEndian) { double result = BitConverter.ToDouble(Data, Pos); Pos += 8; return result; } byte[] array = new byte[8]; for (int i = 0; i < 8; i++) { array[i] = Data[Pos + 7 - i]; } Pos += 8; return BitConverter.ToDouble(array, 0); } public string CString() { int num = Array.IndexOf(Data, (byte)0, Pos); string result = Encoding.UTF8.GetString(Data, Pos, num - Pos); Pos = num + 1; return result; } } public static Action Debug = null; private static readonly byte[] CommonStrings = Encoding.UTF8.GetBytes("AABB\0AnimationClip\0AnimationCurve\0AnimationState\0Array\0Base\0BitField\0bitset\0bool\0char\0ColorRGBA\0Component\0data\0deque\0double\0dynamic_array\0FastPropertyName\0first\0float\0Font\0GameObject\0Generic Mono\0GradientNEW\0GUID\0GUIStyle\0int\0list\0long long\0map\0Matrix4x4f\0MdFour\0MonoBehaviour\0MonoScript\0m_ByteSize\0m_Curve\0m_EditorClassIdentifier\0m_EditorHideFlags\0m_Enabled\0m_ExtensionPtr\0m_GameObject\0m_Index\0m_IsArray\0m_IsStatic\0m_MetaFlag\0m_Name\0m_ObjectHideFlags\0m_PrefabInternal\0m_PrefabParentObject\0m_Script\0m_StaticEditorFlags\0m_Type\0m_Version\0Object\0pair\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0PPtr\0Prefab\0Quaternionf\0Rectf\0RectInt\0RectOffset\0second\0set\0short\0size\0SInt16\0SInt32\0SInt64\0SInt8\0staticvector\0string\0TextAsset\0TextMesh\0Texture\0Texture2D\0Transform\0TypelessData\0UInt16\0UInt32\0UInt64\0UInt8\0unsigned int\0unsigned long long\0unsigned short\0vector\0Vector2f\0Vector3f\0Vector4f\0m_ScriptingClassIdentifier\0Gradient\0Type*\0int2_storage\0int3_storage\0BoundsInt\0m_CorrespondingSourceObject\0m_PrefabInstance\0m_PrefabAsset\0FileSize\0Hash128\0RenderingLayerMask\0fixed_array\0EntityId\0"); public static List LoadMeshes(string bundlePath, HashSet names) { List result = new List(); Dictionary dictionary = ReadBundleNodes(File.ReadAllBytes(bundlePath)); Dictionary dictionary2 = new Dictionary(StringComparer.OrdinalIgnoreCase); foreach (KeyValuePair item in dictionary) { if (item.Key.EndsWith(".resS", StringComparison.OrdinalIgnoreCase) || item.Key.EndsWith(".resource", StringComparison.OrdinalIgnoreCase)) { dictionary2[item.Key] = item.Value; } } foreach (KeyValuePair item2 in dictionary) { Debug?.Invoke($"node '{item2.Key}' {item2.Value.Length} bytes"); if (!dictionary2.ContainsKey(item2.Key) && item2.Value.Length >= 48) { try { ReadSerializedMeshes(item2.Value, names, dictionary2, result); } catch (NotSupportedException) { throw; } catch (Exception ex2) { Debug?.Invoke(" node '" + item2.Key + "' not read as serialized file: " + ex2.GetType().Name + ": " + ex2.Message); } } } return result; } private static Dictionary ReadBundleNodes(byte[] file) { Reader reader = new Reader(file, bigEndian: true); string text = reader.CString(); if (text != "UnityFS") { throw new NotSupportedException("bundle signature '" + text + "'"); } uint num = reader.U32(); if (num < 6 || num > 8) { throw new NotSupportedException($"bundle format {num}"); } reader.CString(); reader.CString(); reader.U64(); int num2 = (int)reader.U32(); int uncompressedSize = (int)reader.U32(); uint num3 = reader.U32(); uint compression = num3 & 0x3F; if (num >= 7) { reader.Align(16); } byte[] data; if ((num3 & 0x80) != 0) { data = Decompress(file, file.Length - num2, num2, uncompressedSize, compression); } else { data = Decompress(file, reader.Pos, num2, uncompressedSize, compression); reader.Pos += num2; } if ((num3 & 0x200) != 0) { reader.Align(16); } Reader reader2 = new Reader(data, bigEndian: true); reader2.Skip(16); int num4 = (int)reader2.U32(); int[] array = new int[num4]; int[] array2 = new int[num4]; ushort[] array3 = new ushort[num4]; long num5 = 0L; for (int i = 0; i < num4; i++) { array[i] = (int)reader2.U32(); array2[i] = (int)reader2.U32(); array3[i] = reader2.U16(); num5 += array[i]; } int num6 = (int)reader2.U32(); long[] array4 = new long[num6]; long[] array5 = new long[num6]; string[] array6 = new string[num6]; for (int j = 0; j < num6; j++) { array4[j] = (long)reader2.U64(); array5[j] = (long)reader2.U64(); reader2.U32(); array6[j] = reader2.CString(); } byte[] array7 = new byte[num5]; int num7 = reader.Pos; int num8 = 0; for (int k = 0; k < num4; k++) { uint num9 = (uint)(array3[k] & 0x3F); switch (num9) { case 0u: Buffer.BlockCopy(file, num7, array7, num8, array2[k]); break; case 2u: case 3u: Lz4Decompress(file, num7, array2[k], array7, num8, array[k]); break; default: throw new NotSupportedException($"block compression {num9}"); } num7 += array2[k]; num8 += array[k]; } Dictionary dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); for (int l = 0; l < num6; l++) { byte[] array8 = new byte[array5[l]]; Buffer.BlockCopy(array7, (int)array4[l], array8, 0, (int)array5[l]); dictionary[array6[l]] = array8; } return dictionary; } private static byte[] Decompress(byte[] src, int offset, int compressedSize, int uncompressedSize, uint compression) { byte[] array = new byte[uncompressedSize]; switch (compression) { case 0u: Buffer.BlockCopy(src, offset, array, 0, uncompressedSize); break; case 2u: case 3u: Lz4Decompress(src, offset, compressedSize, array, 0, uncompressedSize); break; default: throw new NotSupportedException($"bundle compression {compression}"); } return array; } private static void Lz4Decompress(byte[] src, int srcOff, int srcLen, byte[] dst, int dstOff, int dstLen) { int num = srcOff; int num2 = srcOff + srcLen; int num3 = dstOff; int num4 = dstOff + dstLen; while (num < num2 && num3 < num4) { byte b = src[num++]; int num5 = b >> 4; if (num5 == 15) { byte b2; do { b2 = src[num++]; num5 += b2; } while (b2 == byte.MaxValue); } Buffer.BlockCopy(src, num, dst, num3, num5); num += num5; num3 += num5; if (num >= num2) { break; } int num6 = src[num] | (src[num + 1] << 8); num += 2; int num7 = b & 0xF; if (num7 == 15) { byte b3; do { b3 = src[num++]; num7 += b3; } while (b3 == byte.MaxValue); } num7 += 4; int num8 = num3 - num6; for (int i = 0; i < num7; i++) { dst[num3 + i] = dst[num8 + i]; } num3 += num7; } if (num3 != num4) { throw new InvalidDataException($"LZ4 short output ({num3 - dstOff}/{dstLen})"); } } private static void ReadSerializedMeshes(byte[] file, HashSet names, Dictionary resources, List result) { Reader reader = new Reader(file, bigEndian: true); reader.U32(); uint num = reader.U32(); uint num2 = reader.U32(); long num3 = reader.U32(); if (num2 < 17 || num2 > 22) { throw new InvalidDataException($"serialized version {num2}"); } if (num != 0 && num2 < 22 && num != file.Length) { throw new InvalidDataException("file size mismatch"); } byte b = reader.U8(); reader.Skip(3); if (num2 >= 22) { reader.U32(); ulong num4 = reader.U64(); num3 = (long)reader.U64(); reader.U64(); if (num4 != (ulong)file.Length) { throw new InvalidDataException("file size mismatch"); } } reader.BigEndian = b != 0; reader.CString(); reader.U32(); if (reader.U8() == 0) { throw new NotSupportedException("type trees stripped from bundle"); } int num5 = (int)reader.U32(); TypeTree[] array = new TypeTree[num5]; for (int i = 0; i < num5; i++) { array[i] = ReadType(reader, num2); } int num6 = reader.I32(); Debug?.Invoke($" serialized v{num2} types={num5} objects={num6}"); int num7 = 0; for (int j = 0; j < num6; j++) { reader.Align(4); reader.U64(); long num8 = (long)((num2 >= 22) ? reader.U64() : reader.U32()); reader.U32(); int num9 = reader.I32(); TypeTree typeTree = array[num9]; if (typeTree.classId != 43) { continue; } num7++; Reader reader2 = new Reader(file, reader.BigEndian) { Pos = (int)(num3 + num8) }; int num10 = (int)reader2.U32(); if (num10 < 0 || num10 > 512) { continue; } string text = Encoding.UTF8.GetString(file, reader2.Pos, num10); Debug?.Invoke(" mesh object '" + text + "'"); if (names.Contains(text)) { reader2.Pos = (int)(num3 + num8); int nextSibling; MeshBlob meshBlob = DecodeMesh((Dictionary)ReadValue(reader2, typeTree.nodes, 0, out nextSibling), resources); if (meshBlob != null) { result.Add(meshBlob); } } } } private static TypeTree ReadType(Reader r, uint version) { TypeTree typeTree = new TypeTree { classId = r.I32() }; r.U8(); r.I16(); if (typeTree.classId == 114) { r.Skip(16); } r.Skip(16); int num = (int)r.U32(); int num2 = (int)r.U32(); int num3 = ((version >= 19) ? 32 : 24); int num4 = r.Pos + num * num3; Node[] array = new Node[num]; for (int i = 0; i < num; i++) { r.U16(); int level = r.U8(); r.U8(); uint offset = r.U32(); uint offset2 = r.U32(); r.I32(); r.I32(); uint metaFlags = r.U32(); if (version >= 19) { r.U64(); } array[i] = new Node { type = ResolveString(r.Data, num4, num2, offset), name = ResolveString(r.Data, num4, num2, offset2), level = level, metaFlags = metaFlags }; } r.Pos = num4 + num2; if (version >= 21) { int num5 = (int)r.U32(); r.Skip(num5 * 4); } typeTree.nodes = array; return typeTree; } private static string ResolveString(byte[] data, int tableStart, int tableSize, uint offset) { if ((offset & 0x80000000u) != 0) { int num = (int)(offset & 0x7FFFFFFF); if (num >= CommonStrings.Length) { return num.ToString(); } int num2 = Array.IndexOf(CommonStrings, (byte)0, num); return Encoding.UTF8.GetString(CommonStrings, num, num2 - num); } int num3 = tableStart + (int)offset; int num4 = Array.IndexOf(data, (byte)0, num3, tableSize - (int)offset); return Encoding.UTF8.GetString(data, num3, num4 - num3); } private static object ReadValue(Reader r, Node[] nodes, int i, out int nextSibling) { Node node = nodes[i]; int j; for (j = i + 1; j < nodes.Length && nodes[j].level > node.level; j++) { } nextSibling = j; object result; switch (node.type) { case "bool": result = r.U8() != 0; break; case "SInt8": result = (sbyte)r.U8(); break; case "char": case "UInt8": result = r.U8(); break; case "short": case "SInt16": result = r.I16(); break; case "UInt16": case "unsigned short": result = r.U16(); break; case "SInt32": case "int": result = r.I32(); break; case "Type*": case "UInt32": case "unsigned int": result = r.U32(); break; case "SInt64": case "long long": result = (long)r.U64(); break; case "UInt64": case "unsigned long long": case "FileSize": result = r.U64(); break; case "float": result = r.F32(); break; case "double": result = r.F64(); break; case "string": { int num5 = (int)r.U32(); result = Encoding.UTF8.GetString(r.Data, r.Pos, num5); r.Skip(num5); r.Align(4); break; } case "TypelessData": { int num6 = (int)r.U32(); byte[] array2 = new byte[num6]; Buffer.BlockCopy(r.Data, r.Pos, array2, 0, num6); r.Skip(num6); result = array2; break; } default: if (i + 1 < j && nodes[i + 1].type == "Array") { int num = i + 1; int num2 = num + 1 + 1; int num3 = r.I32(); if (nodes[num2].type == "UInt8" || nodes[num2].type == "char") { byte[] array = new byte[num3]; Buffer.BlockCopy(r.Data, r.Pos, array, 0, num3); r.Skip(num3); result = array; } else { List list = new List(num3); for (int k = 0; k < num3; k++) { list.Add(ReadValue(r, nodes, num2, out var _)); } result = list; } if ((nodes[num].metaFlags & 0x4000) != 0) { r.Align(4); } } else { Dictionary dictionary = new Dictionary(); int num4 = i + 1; while (num4 < j) { dictionary[nodes[num4].name] = ReadValue(r, nodes, num4, out var nextSibling3); num4 = nextSibling3; } result = dictionary; } break; } if ((node.metaFlags & 0x4000) != 0) { r.Align(4); } return result; } private static MeshBlob DecodeMesh(Dictionary m, Dictionary resources) { if (Convert.ToByte(m["m_MeshCompression"]) != 0) { throw new NotSupportedException("compressed mesh data"); } Dictionary obj = (Dictionary)m["m_VertexData"]; int num = Convert.ToInt32(obj["m_VertexCount"]); List list = (List)obj["m_Channels"]; byte[] array = (byte[])obj["m_DataSize"]; if ((array == null || array.Length == 0) && m.TryGetValue("m_StreamData", out var value)) { Dictionary obj2 = (Dictionary)value; long num2 = Convert.ToInt64(obj2["offset"]); int num3 = Convert.ToInt32(obj2["size"]); string text = (string)obj2["path"]; if (num3 > 0) { string text2 = text.Substring(text.LastIndexOf('/') + 1); byte[] array2 = null; foreach (KeyValuePair resource in resources) { if (resource.Key.EndsWith(text2, StringComparison.OrdinalIgnoreCase)) { array2 = resource.Value; break; } } if (array2 == null) { throw new InvalidDataException("resource '" + text2 + "' not in bundle"); } array = new byte[num3]; Buffer.BlockCopy(array2, (int)num2, array, 0, num3); } } if (array == null || array.Length == 0) { throw new InvalidDataException("no vertex data"); } int num4 = 0; (int, int, int, int)[] array3 = new(int, int, int, int)[list.Count]; for (int i = 0; i < list.Count; i++) { Dictionary dictionary = (Dictionary)list[i]; array3[i] = (Convert.ToInt32(dictionary["stream"]), Convert.ToInt32(dictionary["offset"]), Convert.ToInt32(dictionary["format"]), Convert.ToInt32(dictionary["dimension"]) & 0xF); if (array3[i].Item4 > 0 && array3[i].Item1 + 1 > num4) { num4 = array3[i].Item1 + 1; } } int[] array4 = new int[num4]; for (int j = 0; j < array3.Length; j++) { if (array3[j].Item4 > 0) { int num5 = array3[j].Item2 + array3[j].Item4 * SerializedFormatSize(array3[j].Item3); if (num5 > array4[array3[j].Item1]) { array4[array3[j].Item1] = num5; } } } int[] array5 = new int[num4]; int num6 = 0; for (int k = 0; k < num4; k++) { array5[k] = num6; num6 += num * array4[k]; num6 = (num6 + 15) & -16; } MeshBlob meshBlob = new MeshBlob { vertexCount = num, name = (string)m["m_Name"] }; meshBlob.positions = DecodeChannel(array, array3, array4, array5, 0, num, 3); if (array3.Length > 4 && array3[4].Item4 >= 2) { meshBlob.uv0 = DecodeChannel(array, array3, array4, array5, 4, num, 2); } if (array3.Length > 5 && array3[5].Item4 >= 2) { meshBlob.uv1 = DecodeChannel(array, array3, array4, array5, 5, num, 2); } if (array3.Length > 3 && array3[3].Item4 >= 4) { float[] array6 = DecodeChannel(array, array3, array4, array5, 3, num, 4); if (array6 != null) { meshBlob.colors = new byte[num * 4]; for (int l = 0; l < num * 4; l++) { meshBlob.colors[l] = (byte)Math.Max(0, Math.Min(255, (int)Math.Round(array6[l] * 255f))); } } } if (meshBlob.positions == null) { throw new InvalidDataException("no position channel"); } byte[] value2 = (byte[])m["m_IndexBuffer"]; bool flag = Convert.ToInt32(m["m_IndexFormat"]) == 0; List list2 = (List)m["m_SubMeshes"]; meshBlob.subMeshCount = list2.Count; meshBlob.subTris = new int[list2.Count][]; for (int n = 0; n < list2.Count; n++) { Dictionary obj3 = (Dictionary)list2[n]; int num7 = Convert.ToInt32(obj3["topology"]); if (num7 != 0) { throw new NotSupportedException($"submesh topology {num7}"); } long num8 = Convert.ToInt64(obj3["firstByte"]); int num9 = Convert.ToInt32(obj3["indexCount"]); object value3; int num10 = (obj3.TryGetValue("baseVertex", out value3) ? Convert.ToInt32(value3) : 0); int[] array7 = new int[num9]; for (int num11 = 0; num11 < num9; num11++) { int num12 = (int)(flag ? BitConverter.ToUInt16(value2, (int)num8 + num11 * 2) : BitConverter.ToUInt32(value2, (int)num8 + num11 * 4)); array7[num11] = num12 + num10; } meshBlob.subTris[n] = array7; } return meshBlob; } private static float[] DecodeChannel(byte[] data, (int stream, int offset, int format, int dim)[] chan, int[] strides, int[] streamOffsets, int channelIndex, int vertexCount, int comps) { if (channelIndex >= chan.Length) { return null; } (int, int, int, int) tuple = chan[channelIndex]; if (tuple.Item4 == 0) { return null; } int num = strides[tuple.Item1]; int num2 = streamOffsets[tuple.Item1] + tuple.Item2; int num3 = SerializedFormatSize(tuple.Item3); float[] array = new float[vertexCount * comps]; for (int i = 0; i < vertexCount; i++) { int num4 = num2 + i * num; for (int j = 0; j < comps; j++) { array[i * comps + j] = SerializedComponent(data, num4 + j * num3, tuple.Item3); } } return array; } private static int SerializedFormatSize(int fmt) { switch (fmt) { case 0: return 4; case 1: case 4: case 5: return 2; case 2: case 3: return 1; default: throw new NotSupportedException($"vertex format {fmt}"); } } private static float SerializedComponent(byte[] data, int off, int fmt) { return fmt switch { 0 => BitConverter.ToSingle(data, off), 1 => HalfToFloat(BitConverter.ToUInt16(data, off)), 2 => (float)(int)data[off] / 255f, 3 => Math.Max((float)(sbyte)data[off] / 127f, -1f), 4 => (float)(int)BitConverter.ToUInt16(data, off) / 65535f, 5 => Math.Max((float)(short)BitConverter.ToUInt16(data, off) / 32767f, -1f), _ => throw new NotSupportedException($"vertex format {fmt}"), }; } private static float HalfToFloat(ushort h) { int num = (h >> 15) & 1; int num2 = (h >> 10) & 0x1F; int num3 = h & 0x3FF; float num4 = num2 switch { 0 => (float)num3 * 0.0009765625f * 6.1035156E-05f, 31 => (num3 == 0) ? float.PositiveInfinity : float.NaN, _ => (1f + (float)num3 * 0.0009765625f) * Pow2(num2 - 15), }; if (num != 1) { return num4; } return 0f - num4; } private static float Pow2(int e) { return (float)Math.Pow(2.0, e); } } internal static class CarveStats { private static readonly Dictionary runTotal = new Dictionary(); private static readonly Dictionary stage = new Dictionary(); private static readonly Dictionary lastStage = new Dictionary(); public static void Add(uint userNetId, float m3) { if (userNetId != 0 && !(m3 <= 0f)) { runTotal.TryGetValue(userNetId, out var value); runTotal[userNetId] = value + m3; stage.TryGetValue(userNetId, out var value2); stage[userNetId] = value2 + m3; } } public static float GetRun(uint userNetId) { if (!runTotal.TryGetValue(userNetId, out var value)) { return 0f; } return value; } public static float GetLastStage(uint userNetId) { if (!lastStage.TryGetValue(userNetId, out var value)) { return 0f; } return value; } public static void OnStageAdvance() { lastStage.Clear(); foreach (KeyValuePair item in stage) { lastStage[item.Key] = item.Value; } stage.Clear(); } public static void ResetRun() { runTotal.Clear(); stage.Clear(); lastStage.Clear(); } } internal class RosterEntry { public uint userNetId; public bool ready; public byte progress; public uint kills; public ulong damage; public ulong gold; public float m3Stage; public float m3Run; public double m3Ever; public int title = -1; public bool titleNew; public int bg; } internal static class LoadingRoster { public static readonly List Entries = new List(); public static bool AllReady; public static float LastSyncTime; public static RosterEntry Find(uint userNetId) { for (int i = 0; i < Entries.Count; i++) { if (Entries[i].userNetId == userNetId) { return Entries[i]; } } return null; } public static void Clear() { Entries.Clear(); AllReady = false; LastSyncTime = 0f; } } internal static class DebrisSystem { private class Piece { public GameObject go; public Transform tf; public MeshFilter mf; public MeshRenderer mr; public Vector3 vel; public Vector3 spinAxis; public float spinDeg; public float dieAt; public float baseScale; public float killY; public bool bounced; } private const int VariantCount = 8; private const float Gravity = 19f; private const float LifeMin = 3.4f; private const float LifeMax = 5f; private const float ShrinkTail = 0.9f; private static int worldMask = -1; private static Mesh[] variants; private static readonly List active = new List(); private static readonly Stack pool = new Stack(); private static GameObject root; private static readonly Random rng = new Random(1584860190); public static void SpawnBurst(Vector3 center, float r, Material mat, float m3) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_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) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_0184: 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) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: 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_01e2: Unknown result type (might be due to invalid IL or missing references) if (!ScorchedVoxelsPlugin.DebrisEnabled.Value || (Object)(object)mat == (Object)null) { return; } EnsureVariants(); if ((Object)(object)root == (Object)null) { root = new GameObject("ScorchedVoxelsDebris"); pool.Clear(); active.Clear(); } int value = ScorchedVoxelsPlugin.DebrisMaxPieces.Value; int num = Mathf.Clamp(2 + Mathf.RoundToInt(m3 * 0.5f), 3, 10); float time = Time.time; if (worldMask < 0) { worldMask = 1 << LayerIndex.world.intVal; } for (int i = 0; i < num; i++) { if (active.Count >= value) { Recycle(0); } Piece piece = ((pool.Count > 0) ? pool.Pop() : CreatePiece()); Vector3 val = RandomInUnitSphere() * (0.45f * r); Vector3 val2 = val + Vector3.up * (0.5f * r); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num2 = Mathf.Clamp(r * 0.35f, 0.6f, 1.6f); piece.baseScale = ((i == 0 && num >= 5) ? (r * 0.5f) : (r * Range(0.16f, 0.34f))); float num3 = Mathf.InverseLerp(r * 0.16f, r * 0.5f, piece.baseScale); float num4 = Mathf.Lerp(1.3f, 0.55f, num3); piece.vel = (normalized * (Range(3.5f, 8.5f) * num2) + Vector3.up * Range(1.5f, 3.5f)) * num4; val2 = RandomInUnitSphere(); piece.spinAxis = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref piece.spinAxis)).sqrMagnitude < 0.01f) { piece.spinAxis = Vector3.up; } piece.spinDeg = Range(90f, 420f) * Mathf.Lerp(1.2f, 0.6f, num3); piece.dieAt = time + Range(3.4f, 5f); piece.killY = center.y - 250f; piece.bounced = false; piece.tf.position = center + val; piece.tf.rotation = Quaternion.Euler(Range(0f, 360f), Range(0f, 360f), Range(0f, 360f)); piece.tf.localScale = Vector3.one * piece.baseScale; piece.mf.sharedMesh = variants[rng.Next(8)]; ((Renderer)piece.mr).sharedMaterial = mat; piece.go.SetActive(true); active.Add(piece); } } public static void Tick() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_010d: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) if (active.Count == 0) { return; } float deltaTime = Time.deltaTime; if (deltaTime <= 0f) { return; } float time = Time.time; RaycastHit val2 = default(RaycastHit); for (int num = active.Count - 1; num >= 0; num--) { Piece piece = active[num]; if ((Object)(object)piece.go == (Object)null) { active.RemoveAt(num); continue; } float num2 = piece.dieAt - time; Vector3 position = piece.tf.position; if (num2 <= 0f || position.y < piece.killY) { Recycle(num); continue; } piece.vel.y -= 19f * deltaTime; Vector3 val = piece.vel * deltaTime; if (!piece.bounced) { float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 1E-05f && Physics.Raycast(position, val / magnitude, ref val2, magnitude + 0.03f, worldMask, (QueryTriggerInteraction)1)) { piece.bounced = true; piece.tf.position = ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * 0.05f; piece.vel = Vector3.Reflect(piece.vel, ((RaycastHit)(ref val2)).normal) * 0.45f; piece.spinDeg *= 1.4f; continue; } } piece.tf.position = position + val; piece.tf.Rotate(piece.spinAxis, piece.spinDeg * deltaTime, (Space)0); if (num2 < 0.9f) { piece.tf.localScale = Vector3.one * (piece.baseScale * (num2 / 0.9f)); } } } public static void Reset() { if ((Object)(object)root != (Object)null) { Object.Destroy((Object)(object)root); } root = null; active.Clear(); pool.Clear(); } private static void Recycle(int index) { Piece piece = active[index]; active.RemoveAt(index); if (!((Object)(object)piece.go == (Object)null)) { piece.go.SetActive(false); pool.Push(piece); } } private static Piece CreatePiece() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown GameObject val = new GameObject("voxdebris"); val.transform.SetParent(root.transform, false); Piece obj = new Piece { go = val, tf = val.transform, mf = val.AddComponent(), mr = val.AddComponent() }; ((Renderer)obj.mr).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj.mr).receiveShadows = false; return obj; } private static void EnsureVariants() { if (variants == null) { variants = (Mesh[])(object)new Mesh[8]; for (int i = 0; i < 8; i++) { variants[i] = BuildRock((uint)(i * 7919 + 101)); } } } private static Mesh BuildRock(uint seed) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_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_0021: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_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_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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown BuildIcosphere(out var verts, out var tris); for (int i = 0; i < verts.Count; i++) { Vector3 val = verts[i]; Vector3 normalized = ((Vector3)(ref val)).normalized; float num = VoxelVolume.ShapeNoise(normalized * 2.7f, seed); verts[i] = normalized * (1f + 0.38f * num) * 0.5f; } Vector3[] array = (Vector3[])(object)new Vector3[tris.Count]; int[] array2 = new int[tris.Count]; for (int j = 0; j < tris.Count; j++) { array[j] = verts[tris[j]]; array2[j] = j; } Mesh val2 = new Mesh { name = $"voxdebris_rock{seed}", vertices = array, triangles = array2 }; val2.RecalculateNormals(); val2.RecalculateBounds(); return val2; } private static void BuildIcosphere(out List verts, out List tris) { //IL_0029: 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_0056: 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_0083: 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_00b0: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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) float num = (1f + Mathf.Sqrt(5f)) / 2f; verts = new List { new Vector3(-1f, num, 0f), new Vector3(1f, num, 0f), new Vector3(-1f, 0f - num, 0f), new Vector3(1f, 0f - num, 0f), new Vector3(0f, -1f, num), new Vector3(0f, 1f, num), new Vector3(0f, -1f, 0f - num), new Vector3(0f, 1f, 0f - num), new Vector3(num, 0f, -1f), new Vector3(num, 0f, 1f), new Vector3(0f - num, 0f, -1f), new Vector3(0f - num, 0f, 1f) }; for (int i = 0; i < verts.Count; i++) { List obj = verts; int index = i; Vector3 val = verts[i]; obj[index] = ((Vector3)(ref val)).normalized; } int[] array = new int[60] { 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 }; tris = new List(array.Length * 4); Dictionary midCache = new Dictionary(); List vlist = verts; for (int j = 0; j < array.Length; j += 3) { int num2 = array[j]; int num3 = array[j + 1]; int num4 = array[j + 2]; int num5 = Midpoint(num2, num3); int num6 = Midpoint(num3, num4); int num7 = Midpoint(num4, num2); tris.AddRange(new int[12] { num2, num5, num7, num3, num6, num5, num4, num7, num6, num5, num6, num7 }); } int Midpoint(int a, int b) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0051: 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_0059: Unknown result type (might be due to invalid IL or missing references) long key = ((a < b) ? (((long)a << 32) | (uint)b) : (((long)b << 32) | (uint)a)); if (midCache.TryGetValue(key, out var value)) { return value; } List list = vlist; Vector3 val2 = (vlist[a] + vlist[b]) * 0.5f; list.Add(((Vector3)(ref val2)).normalized); midCache[key] = vlist.Count - 1; return vlist.Count - 1; } } private static float Range(float min, float max) { return min + (float)rng.NextDouble() * (max - min); } private static Vector3 RandomInUnitSphere() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Vector3 result = default(Vector3); for (int i = 0; i < 8; i++) { ((Vector3)(ref result))..ctor(Range(-1f, 1f), Range(-1f, 1f), Range(-1f, 1f)); if (((Vector3)(ref result)).sqrMagnitude <= 1f) { return result; } } return new Vector3(0f, 0.5f, 0f); } } internal static class FarewellBlast { private struct Wave { public readonly float t; public readonly float ring; public readonly int count; public readonly float radius; public readonly float sink; public Wave(float t, float ring, int count, float radius, float sink) { this.t = t; this.ring = ring; this.count = count; this.radius = radius; this.sink = sink; } } private static readonly bool Active = false; private static readonly Wave[] Waves = new Wave[5] { new Wave(0.15f, 19f, 10, 5f, 1.5f), new Wave(0.7f, 13f, 8, 5.5f, 1.5f), new Wave(1.3f, 8f, 7, 6f, 2f), new Wave(2.1f, 0f, 1, 11f, 3f), new Wave(2.45f, 0f, 1, 8f, 9f) }; private static bool running; private static float t0; private static Vector3 center; private static int nextWave; public static void Reset() { running = false; } public static void Trigger(Vector3 exitPos) { //IL_0024: 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) if (Active && NetworkServer.active && ScorchedVoxelsPlugin.Enabled.Value && VoxelTerrainManager.LocalConversionDone) { center = exitPos; t0 = Time.time; nextWave = 0; running = true; } } public static void Tick() { if (!running) { return; } if (!VoxelTerrainManager.LocalConversionDone) { running = false; return; } float num = Time.time - t0; while (nextWave < Waves.Length && num >= Waves[nextWave].t) { Fire(Waves[nextWave++]); } if (nextWave >= Waves.Length) { running = false; } } private static void Fire(Wave w) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_00a0: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) if (w.ring <= 0f) { Carve(center + Vector3.down * w.sink, w.radius); return; } float num = Random.value * MathF.PI * 2f; RaycastHit val2 = default(RaycastHit); for (int i = 0; i < w.count; i++) { float num2 = num + MathF.PI * 2f * ((float)i + Random.Range(-0.2f, 0.2f)) / (float)w.count; float num3 = w.ring * Random.Range(0.85f, 1.15f); Vector3 val = center + new Vector3(Mathf.Cos(num2) * num3, 0f, Mathf.Sin(num2) * num3); if (Physics.Raycast(val + Vector3.up * 12f, Vector3.down, ref val2, 40f, 1 << LayerIndex.world.intVal, (QueryTriggerInteraction)1)) { val.y = ((RaycastHit)(ref val2)).point.y; } Carve(val + Vector3.down * w.sink, w.radius); } } private static void Carve(Vector3 pos, float r) { //IL_0012: 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) r = Mathf.Min(r, ScorchedVoxelsPlugin.MaxCarveRadius.Value); VoxelTerrainManager.RequestCarve(pos, r); NetMessageExtensions.Send((INetMessage)(object)new CarveMessage(pos, r), (NetworkDestination)1); } } [HarmonyPatch(typeof(SceneExitController), "SetState")] internal static class SceneExitTeleportOutPatch { private static void Postfix(SceneExitController __instance, ExitState newState) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) try { if ((int)newState == 2 && NetworkServer.active) { FarewellBlast.Trigger(((Component)__instance).transform.position); } } catch (Exception arg) { ScorchedVoxelsPlugin.Log.LogError((object)$"[ScorchedVoxels] farewell blast trigger failed: {arg}"); } } } internal static class ConvertProgress { public static volatile string Phase = ""; public static int Done; public static int Total; private static readonly (string phase, float start, float end)[] Slices = new(string, float, float)[4] { ("preparing", 0f, 0.03f), ("voxelizing terrain", 0.03f, 0.45f), ("building meshes", 0.45f, 0.9f), ("baking colliders", 0.9f, 1f) }; public static bool IsPipeline(string phase) { (string, float, float)[] slices = Slices; for (int i = 0; i < slices.Length; i++) { if (slices[i].Item1 == phase) { return true; } } return false; } public static void Set(string phase, int total) { Phase = phase; Done = 0; Total = total; } public static float Fraction() { string phase = Phase; int total = Total; float num = ((total > 0) ? Mathf.Clamp01((float)Done / (float)total) : 0f); (string, float, float)[] slices = Slices; for (int i = 0; i < slices.Length; i++) { (string, float, float) tuple = slices[i]; if (tuple.Item1 == phase) { return tuple.Item2 + (tuple.Item3 - tuple.Item2) * num; } } return num; } } internal static class LoadingOverlay { private struct RimTier { public string name; public double min; public Color col; } private class PlayerCard { public uint userNetId; public GameObject go; public float width; public RawImage portrait; public RawImage cardBackground; public Image cardScrim; public int cardBackgroundIdx = -1; public Image rim; public Image crown; public RectTransform crownRect; public UiKit.Label name; public UiKit.Label title; public UiKit.Label status; public Image statusFill; public RectTransform statusFillRect; public Image accent; public Image border; public UiKit.Label[] statValues; public float barInnerWidth; } private class ReelView { public LootReel reel; public GameObject root; public CanvasGroup group; public RectTransform content; public UiKit.Label caption; public Image marker; public Image landFrame; public Image flash; public RectTransform wonTile; public float stride; public float pStart; public float pEnd; public float spawnedAt; public bool landed; public float landedAt; } private const float BarWidth = 720f; private const float CardHeight = 420f; private const float CardGap = 24f; private const float TipInterval = 6f; private static readonly Color ColBg = new Color(0.02f, 0.02f, 0.03f, 1f); private static readonly Color ColOrange = UiKit.AccentOrange; private static readonly Color ColGreen = UiKit.Green; private static readonly Color ColText = UiKit.TextPale; private static readonly Color ColDim = UiKit.TextDim; private static readonly Color ColGold = UiKit.Gold; private static readonly Color ColSilver = new Color(0.82f, 0.85f, 0.9f, 1f); private static readonly Color ColBronze = new Color(0.8f, 0.52f, 0.28f, 1f); private static readonly Color ColTitle = new Color(0.84f, 0.73f, 0.52f, 1f); private static readonly RimTier[] RimTiers = new RimTier[5] { new RimTier { name = "Wood", min = 0.0, col = new Color(0.44f, 0.29f, 0.15f, 1f) }, new RimTier { name = "Bronze", min = 1000000.0, col = new Color(0.83f, 0.53f, 0.26f, 1f) }, new RimTier { name = "Silver", min = 10000000.0, col = new Color(0.8f, 0.83f, 0.88f, 1f) }, new RimTier { name = "Gold", min = 100000000.0, col = new Color(1f, 0.83f, 0.35f, 1f) }, new RimTier { name = "Platinum", min = 1000000000.0, col = new Color(0.66f, 0.93f, 0.98f, 1f) } }; private static readonly string[] Tips = new string[26] { "Explosions remove terrain for real. Craters stay until the stage ends.", "Craters are synced in multiplayer. The hole you dig is the hole your friends fall into.", "The ground here is one byte per voxel. 0 is air, 255 is rock, your boots stand on 127.5.", "Terrain rebuilds in 16x16x16 chunks. An explosion only re-meshes the chunks it touched.", "Underground rock has no mesh until you expose it. Dig, and the new wall is built on the spot.", "Far terrain renders at lower detail. Craters and colliders never do — what you touch is exact.", "New crater walls borrow lighting from the nearest original wall. Re-baking would take minutes.", "The rocks flying out of craters are visual only. No collision — they fall through the floor on purpose.", "If a mesh looks wrong to convert, it stays vanilla. Guessing is how you get floating boxes.", "The teleporter never gets voxelized. We tried once. It became a cube.", "A stall near the end of the bar is normal. That's colliders baking — they take the longest.", "The host holds the stage until every player's terrain is ready. If nobody seems slow, it's you.", "Every cleared stage rolls a chance at a new title, and a separate chance at a card background pattern.", "Your first stage clear on a fresh profile always unlocks something.", "Country flags and pride flags are free for everyone from the start. Only patterns come from the lottery.", "Adjust your player card with Risk of Options: Settings > Mod Options, then Choose Title or Choose Card Background.", "Titles and card backgrounds only ever show on this loading screen. Nothing follows you into the run.", "Carved m³ counts rock actually removed. Shooting air scores nothing.", "The rim around your portrait is lifetime rock removed. Platinum takes a billion cubic meters.", "Wood, bronze, silver, gold, platinum. Every step is ten times the digging.", "Crowns go to the stage's top three players, ranked by kills, then damage, then rock carved.", "A reel spinning under a card means the lottery paid out. It always lands on the prize.", "All 199 country flags in the card picker are painted pixel by pixel.", "Rock and Stone!", "Did I hear a Rock and Stone?", "For Karl!" }; private static GameObject go; private static RectTransform fillRect; private static UiKit.Label label; private static UiKit.Label tipText; private static RectTransform cardRow; private static Sprite crownSprite; private static readonly List cards = new List(); private static int[] tipOrder; private static float shownAt; private static int lastTipIdx = -1; private static readonly Dictionary reelViews = new Dictionary(); private static readonly HashSet reelsEverShown = new HashSet(); private static readonly HashSet reelsSkipped = new HashSet(); private static readonly List reelPruneScratch = new List(); private static int reelTicksPlayed; private static float reelLastTickAt; private static bool reelStartSoundPlayed; private static bool reelLandSoundPlayed; private static readonly string[] StatLabels = new string[6] { "Kills", "Damage", "Gold", "Carved (lvl)", "Carved (run)", "Carved (ever)" }; private static Sprite edgeFadeSprite; private static Font cachedFont; private static bool fontSearched; private static RimTier TierFor(double m3Ever) { int num = RimTiers.Length - 1; while (num > 0 && m3Ever < RimTiers[num].min) { num--; } return RimTiers[num]; } public static void Show() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_026b: Unknown result type (might be due to invalid IL or missing references) //IL_028f: 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_02c6: 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_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)go != (Object)null)) { go = new GameObject("ScorchedVoxelsLoadingOverlay"); Canvas obj = go.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 30000; CanvasScaler obj2 = go.AddComponent(); obj2.uiScaleMode = (ScaleMode)1; obj2.referenceResolution = new Vector2(1920f, 1080f); obj2.matchWidthOrHeight = 0.5f; UiKit.Stretch(((Graphic)UiKit.CreateImage("bg", go.transform, ColBg)).rectTransform); Image val = UiKit.CreatePanel("barBg", go.transform, UiKit.PanelMid); ((Graphic)val).rectTransform.sizeDelta = new Vector2(728f, 24f); ((Graphic)val).rectTransform.anchoredPosition = new Vector2(0f, -462f); UiKit.Stretch(((Graphic)UiKit.CreateOutline("barEdge", ((Component)val).transform, UiKit.Outline)).rectTransform); fillRect = ((Graphic)UiKit.CreateImage("fill", ((Component)val).transform, ColOrange)).rectTransform; fillRect.anchorMin = new Vector2(0f, 0.5f); fillRect.anchorMax = new Vector2(0f, 0.5f); fillRect.pivot = new Vector2(0f, 0.5f); fillRect.anchoredPosition = new Vector2(4f, 0f); fillRect.sizeDelta = new Vector2(0f, 16f); UiKit.Label obj3 = UiKit.CreateLabel("title", go.transform, 36f, ColOrange, (TextAnchor)4); obj3.Rect.sizeDelta = new Vector2(1200f, 46f); obj3.Rect.anchoredPosition = new Vector2(0f, 470f); obj3.Bold(); obj3.Text = "SCORCHED VOXELS"; label = UiKit.CreateLabel("label", go.transform, 22f, ColText, (TextAnchor)4); label.Rect.sizeDelta = new Vector2(1200f, 34f); label.Rect.anchoredPosition = new Vector2(0f, -430f); tipText = UiKit.CreateLabel("tip", go.transform, 19f, ColDim, (TextAnchor)4); tipText.Rect.sizeDelta = new Vector2(1400f, 30f); tipText.Rect.anchoredPosition = new Vector2(0f, -385f); tipText.Italic(); GameObject val2 = new GameObject("cards"); val2.transform.SetParent(go.transform, false); cardRow = val2.AddComponent(); cardRow.sizeDelta = new Vector2(1700f, 420f); cardRow.anchoredPosition = new Vector2(0f, 30f); Random random = new Random(Environment.TickCount); tipOrder = new int[Tips.Length]; for (int i = 0; i < tipOrder.Length; i++) { tipOrder[i] = i; } for (int num = tipOrder.Length - 1; num > 0; num--) { int num2 = random.Next(num + 1); ref int reference = ref tipOrder[num]; ref int reference2 = ref tipOrder[num2]; int num3 = tipOrder[num2]; int num4 = tipOrder[num]; reference = num3; reference2 = num4; } shownAt = Time.unscaledTime; lastTipIdx = -1; } } public static void Tick() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)go == (Object)null) { return; } float num = ConvertProgress.Fraction(); if ((Object)(object)fillRect != (Object)null) { fillRect.sizeDelta = new Vector2(720f * num, 16f); } if (label != null) { string phase = ConvertProgress.Phase; if (ConvertProgress.IsPipeline(phase)) { label.Text = $"{phase} {(int)(num * 100f)}%"; } else if (ConvertProgress.Total > 1) { label.Text = $"{phase} ({ConvertProgress.Done}/{ConvertProgress.Total})"; } else { label.Text = phase; } } if (tipText != null && tipOrder != null && tipOrder.Length != 0) { int num2 = (int)((Time.unscaledTime - shownAt) / 6f) % tipOrder.Length; if (num2 != lastTipIdx) { lastTipIdx = num2; tipText.Text = Tips[tipOrder[num2]]; } } RefreshCards(); UpdateReveal(); } public static void Hide() { if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } go = null; fillRect = null; label = null; tipText = null; cardRow = null; cards.Clear(); reelViews.Clear(); reelsEverShown.Clear(); reelsSkipped.Clear(); reelTicksPlayed = 0; reelLastTickAt = 0f; reelStartSoundPlayed = false; reelLandSoundPlayed = false; } private static void UpdateReveal() { //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: 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_03eb: 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_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) if (reelViews.Count > 0) { reelPruneScratch.Clear(); foreach (KeyValuePair reelView in reelViews) { if ((Object)(object)reelView.Value.root == (Object)null) { reelPruneScratch.Add(reelView.Key); } } foreach (string item in reelPruneScratch) { reelViews.Remove(item); } } foreach (LootReel reel in LootReveal.Reels) { string text = $"{reel.userNetId}:{(int)reel.kind}"; if (reelViews.ContainsKey(text) || reelsSkipped.Contains(text)) { continue; } PlayerCard playerCard = null; foreach (PlayerCard card in cards) { if (card.userNetId == reel.userNetId) { playerCard = card; break; } } if (playerCard != null && !((Object)(object)playerCard.go == (Object)null)) { if (LootReveal.TooLateToJoin && !reelsEverShown.Contains(text)) { reelsSkipped.Add(text); ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] " + reel.userName + "'s reveal arrived after the spin was underway — unlock kept, reel skipped")); } else { reelViews[text] = BuildReelStrip(reel, playerCard); reelsEverShown.Add(text); LootReveal.ScheduleShow(); } } } if (reelViews.Count == 0) { return; } float unscaledTime = Time.unscaledTime; float num = (unscaledTime - LootReveal.ShowT0) / 4.6f; float num2 = Mathf.Clamp01(num); float num3 = 1f - Mathf.Pow(1f - num2, 3f); if (ScorchedVoxelsPlugin.RevealSounds.Value) { if (num >= 0f && !reelStartSoundPlayed) { reelStartSoundPlayed = true; PlayUiSound("Play_UI_tripleChestShutter"); } int num4 = 21; int num5 = Mathf.Min(Mathf.FloorToInt((float)num4 * num3), num4); if (num5 > reelTicksPlayed) { reelTicksPlayed = num5; if (num2 < 1f && unscaledTime - reelLastTickAt >= 0.045f) { reelLastTickAt = unscaledTime; PlayUiSound("Play_UI_menuHover"); } } if (num2 >= 1f && !reelLandSoundPlayed) { reelLandSoundPlayed = true; PlayUiSound("Play_UI_achievementUnlock"); } } foreach (ReelView value in reelViews.Values) { if ((Object)(object)value.root == (Object)null) { continue; } if ((Object)(object)value.group != (Object)null) { value.group.alpha = Mathf.Clamp01((unscaledTime - value.spawnedAt) / 0.35f); } if ((Object)(object)value.content != (Object)null) { value.content.anchoredPosition = new Vector2(Mathf.Lerp(value.pStart, value.pEnd, num3), 0f); } if ((Object)(object)value.marker != (Object)null && !value.landed) { Color colGold = ColGold; colGold.a = 0.65f + 0.35f * Mathf.Sin(unscaledTime * 9f); ((Graphic)value.marker).color = colGold; } if (num2 >= 1f && !value.landed) { value.landed = true; value.landedAt = unscaledTime; if ((Object)(object)value.marker != (Object)null) { ((Graphic)value.marker).color = ColGold; } if ((Object)(object)value.landFrame != (Object)null) { ((Behaviour)value.landFrame).enabled = true; } if ((Object)(object)value.flash != (Object)null) { ((Behaviour)value.flash).enabled = true; } if ((Object)(object)value.wonTile != (Object)null) { ((Transform)value.wonTile).SetAsLastSibling(); } if (value.caption != null) { value.caption.Text = value.reel.WonName; value.caption.Color = ColGold; } } if (!value.landed) { continue; } float num6 = unscaledTime - value.landedAt; if ((Object)(object)value.flash != (Object)null) { float num7 = 0.5f * (1f - Mathf.Clamp01(num6 / 0.4f)); if (num7 <= 0f) { ((Behaviour)value.flash).enabled = false; } else { ((Graphic)value.flash).color = new Color(1f, 0.95f, 0.75f, num7); } } if ((Object)(object)value.wonTile != (Object)null && num6 <= 0.5f) { float num8 = 1f + 0.13f * Mathf.Sin(MathF.PI * Mathf.Clamp01(num6 / 0.45f)); ((Transform)value.wonTile).localScale = new Vector3(num8, num8, 1f); } if ((Object)(object)value.landFrame != (Object)null) { Color colGold2 = ColGold; colGold2.a = 0.72f + 0.28f * Mathf.Sin(num6 * 5f); ((Graphic)value.landFrame).color = colGold2; } } } private static ReelView BuildReelStrip(LootReel reel, PlayerCard card) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_055b: 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_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: 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_05f0: 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_062a: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_0726: 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_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) ReelView reelView = new ReelView { reel = reel, spawnedAt = Time.unscaledTime }; float width = card.width; reelView.root = new GameObject("lootReel"); reelView.root.transform.SetParent(card.go.transform, false); RectTransform obj = reelView.root.AddComponent(); obj.sizeDelta = new Vector2(width, 90f); obj.anchoredPosition = new Vector2(0f, -260f); reelView.group = reelView.root.AddComponent(); reelView.group.alpha = 0f; reelView.group.blocksRaycasts = false; reelView.group.interactable = false; reelView.caption = UiKit.CreateLabel("caption", reelView.root.transform, 13f, ColTitle, (TextAnchor)4); reelView.caption.Rect.sizeDelta = new Vector2(width, 18f); reelView.caption.Rect.anchoredPosition = new Vector2(0f, 34f); reelView.caption.ClipSingleLine(); reelView.caption.Text = ((reel.kind == PrizeKind.Title) ? "WON A TITLE!" : "WON A CARD BACKGROUND!"); Image val = UiKit.CreatePanel("strip", reelView.root.transform, new Color(0.045f, 0.05f, 0.07f, 1f)); ((Graphic)val).rectTransform.sizeDelta = new Vector2(width, 54f); ((Graphic)val).rectTransform.anchoredPosition = new Vector2(0f, -4f); GameObject val2 = new GameObject("mask"); val2.transform.SetParent(((Component)val).transform, false); RectTransform obj2 = val2.AddComponent(); UiKit.Stretch(obj2); obj2.offsetMin = new Vector2(3f, 3f); obj2.offsetMax = new Vector2(-3f, -3f); val2.AddComponent(); GameObject val3 = new GameObject("reel"); val3.transform.SetParent(val2.transform, false); reelView.content = val3.AddComponent(); reelView.content.anchorMin = new Vector2(0.5f, 0.5f); reelView.content.anchorMax = new Vector2(0.5f, 0.5f); reelView.content.pivot = new Vector2(0f, 0.5f); reelView.content.sizeDelta = new Vector2(10f, 54f); float num = 44f; float num2 = ((reel.kind == PrizeKind.Background) ? Mathf.Round(num * 2f / 3f) : 84f); reelView.stride = num2 + 6f; for (int i = 0; i < reel.entries.Length; i++) { int num3 = reel.entries[i]; Image val4 = UiKit.CreatePanel($"item_{i}", (Transform)(object)reelView.content, UiKit.PanelMid); ((Graphic)val4).raycastTarget = false; ((Graphic)val4).rectTransform.anchorMin = new Vector2(0f, 0.5f); ((Graphic)val4).rectTransform.anchorMax = new Vector2(0f, 0.5f); ((Graphic)val4).rectTransform.sizeDelta = new Vector2(num2, num); ((Graphic)val4).rectTransform.anchoredPosition = new Vector2((float)i * reelView.stride, 0f); if (i == reel.landSlot) { reelView.wonTile = ((Graphic)val4).rectTransform; } if (reel.kind == PrizeKind.Background) { ((Component)val4).gameObject.AddComponent().showMaskGraphic = true; GameObject val5 = new GameObject("pv"); val5.transform.SetParent(((Component)val4).transform, false); RawImage obj3 = val5.AddComponent(); UiKit.Stretch(((Graphic)obj3).rectTransform); obj3.texture = (Texture)(object)BackgroundSystem.GetTexture(num3); ((Behaviour)obj3).enabled = (Object)(object)obj3.texture != (Object)null; ((Graphic)obj3).raycastTarget = false; } else { UiKit.Label obj4 = UiKit.CreateLabel("t", ((Component)val4).transform, 10f, ColText, (TextAnchor)4); UiKit.Stretch(obj4.Rect); obj4.Rect.offsetMin = new Vector2(4f, 1f); obj4.Rect.offsetMax = new Vector2(-4f, -1f); obj4.WrapClipped(); obj4.Text = ((num3 >= 0 && num3 < TitleSystem.Table.Length) ? TitleSystem.Table[num3] : "?"); } } Color color = default(Color); ((Color)(ref color))..ctor(0.045f, 0.05f, 0.07f, 0.95f); Image obj5 = UiKit.CreateImage("shadeL", ((Component)val).transform, color); obj5.sprite = EdgeFadeSprite(); ((Graphic)obj5).raycastTarget = false; ((Graphic)obj5).rectTransform.anchorMin = new Vector2(0f, 0f); ((Graphic)obj5).rectTransform.anchorMax = new Vector2(0f, 1f); ((Graphic)obj5).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)obj5).rectTransform.offsetMin = new Vector2(3f, 3f); ((Graphic)obj5).rectTransform.offsetMax = new Vector2(25f, -3f); Image obj6 = UiKit.CreateImage("shadeR", ((Component)val).transform, color); obj6.sprite = EdgeFadeSprite(); ((Graphic)obj6).raycastTarget = false; ((Graphic)obj6).rectTransform.anchorMin = new Vector2(1f, 0f); ((Graphic)obj6).rectTransform.anchorMax = new Vector2(1f, 1f); ((Graphic)obj6).rectTransform.offsetMin = new Vector2(-25f, 3f); ((Graphic)obj6).rectTransform.offsetMax = new Vector2(-3f, -3f); ((Transform)((Graphic)obj6).rectTransform).localScale = new Vector3(-1f, 1f, 1f); reelView.marker = UiKit.CreateImage("marker", ((Component)val).transform, ColGold); ((Graphic)reelView.marker).rectTransform.sizeDelta = new Vector2(2f, 60f); ((Graphic)reelView.marker).raycastTarget = false; reelView.landFrame = UiKit.CreateOutline("landFrame", ((Component)val).transform, ColGold); ((Graphic)reelView.landFrame).rectTransform.sizeDelta = new Vector2(num2 + 8f, num + 8f); ((Behaviour)reelView.landFrame).enabled = false; reelView.flash = UiKit.CreateImage("flash", ((Component)val).transform, Color.clear); UiKit.Stretch(((Graphic)reelView.flash).rectTransform); ((Graphic)reelView.flash).raycastTarget = false; ((Behaviour)reelView.flash).enabled = false; UiKit.Stretch(((Graphic)UiKit.CreateOutline("stripEdge", ((Component)val).transform, UiKit.Outline)).rectTransform); reelView.pEnd = (float)(-reel.landSlot) * reelView.stride; reelView.pStart = -2f * reelView.stride; reelView.content.anchoredPosition = new Vector2(reelView.pStart, 0f); return reelView; } private static Sprite EdgeFadeSprite() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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) if ((Object)(object)edgeFadeSprite != (Object)null) { return edgeFadeSprite; } Texture2D val = new Texture2D(32, 1, (TextureFormat)5, false); ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[32]; for (int i = 0; i < 32; i++) { float num = (float)i / 31f; array[i] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)((1f - num) * (1f - num) * 255f)); } val.SetPixels32(array); val.Apply(false, true); edgeFadeSprite = Sprite.Create(val, new Rect(0f, 0f, 32f, 1f), new Vector2(0.5f, 0.5f), 100f); return edgeFadeSprite; } private static bool RevealSettled(uint netId, PrizeKind kind) { string text = $"{netId}:{(int)kind}"; if (reelsSkipped.Contains(text)) { return true; } if (reelViews.TryGetValue(text, out var value)) { return value.landed; } return false; } private static void PlayUiSound(string eventName) { try { RoR2Application instance = RoR2Application.instance; if ((Object)(object)instance != (Object)null) { Util.PlaySound(eventName, ((Component)instance).gameObject); } } catch { } } private static void RefreshCards() { //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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: 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_0614: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0526: 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_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cardRow == (Object)null) { return; } ReadOnlyCollection readOnlyInstancesList = NetworkUser.readOnlyInstancesList; List alive = new List(); foreach (NetworkUser item in readOnlyInstancesList) { if ((Object)(object)item != (Object)null) { alive.Add(item); } } bool flag = alive.Count != cards.Count; NetworkInstanceId netId; if (!flag) { for (int i = 0; i < alive.Count; i++) { uint userNetId = cards[i].userNetId; netId = ((NetworkBehaviour)alive[i]).netId; if (userNetId != ((NetworkInstanceId)(ref netId)).Value) { flag = true; break; } } } if (flag) { BuildCards(alive); } if (cards.Count == 0) { return; } List list = new List(); for (int j = 0; j < alive.Count; j++) { list.Add(j); } list.Sort(delegate(int a, int b) { int num11 = K(b).CompareTo(K(a)); if (num11 != 0) { return num11; } num11 = D(b).CompareTo(D(a)); if (num11 != 0) { return num11; } num11 = M(b).CompareTo(M(a)); return (num11 != 0) ? num11 : G(b).CompareTo(G(a)); }); int[] array = new int[alive.Count]; for (int num = 0; num < list.Count; num++) { array[list[num]] = num; } uint num2 = 0u; ulong num3 = 0uL; ulong num4 = 0uL; float num5 = 0f; float num6 = 0f; foreach (NetworkUser item2 in alive) { netId = ((NetworkBehaviour)item2).netId; RosterEntry rosterEntry = LoadingRoster.Find(((NetworkInstanceId)(ref netId)).Value); if (rosterEntry != null) { if (rosterEntry.kills > num2) { num2 = rosterEntry.kills; } if (rosterEntry.damage > num3) { num3 = rosterEntry.damage; } if (rosterEntry.gold > num4) { num4 = rosterEntry.gold; } if (rosterEntry.m3Stage > num5) { num5 = rosterEntry.m3Stage; } if (rosterEntry.m3Run > num6) { num6 = rosterEntry.m3Run; } } } for (int num7 = 0; num7 < cards.Count; num7++) { PlayerCard playerCard = cards[num7]; NetworkUser val = alive[num7]; RosterEntry rosterEntry2 = LoadingRoster.Find(playerCard.userNetId); if ((Object)(object)playerCard.portrait != (Object)null && (Object)(object)playerCard.portrait.texture == (Object)null) { Texture val2 = ResolvePortrait(val); if ((Object)(object)val2 != (Object)null) { playerCard.portrait.texture = val2; ((Graphic)playerCard.portrait).color = Color.white; } } if (playerCard.name != null) { playerCard.name.Text = (string.IsNullOrEmpty(val.userName) ? $"Player {num7 + 1}" : val.userName); playerCard.name.Color = (((NetworkBehaviour)val).isLocalPlayer ? ColOrange : ColText); } bool ready = rosterEntry2?.ready ?? false; if (((NetworkBehaviour)val).isLocalPlayer && VoxelTerrainManager.LocalConversionDone) { ready = true; } UpdateStatus(playerCard, ((NetworkBehaviour)val).isLocalPlayer, ready, rosterEntry2?.progress ?? 0); int num8 = rosterEntry2?.bg ?? (((NetworkBehaviour)val).isLocalPlayer ? BackgroundSystem.CurrentBackground(val) : 0); foreach (LootReel reel in LootReveal.Reels) { if (reel.userNetId == playerCard.userNetId && reel.kind == PrizeKind.Background && reel.WonIndex == num8 && !RevealSettled(playerCard.userNetId, PrizeKind.Background)) { num8 = ((playerCard.cardBackgroundIdx >= 0) ? playerCard.cardBackgroundIdx : 0); break; } } if (num8 != playerCard.cardBackgroundIdx && (Object)(object)playerCard.cardBackground != (Object)null) { playerCard.cardBackgroundIdx = num8; Texture2D texture = BackgroundSystem.GetTexture(num8); playerCard.cardBackground.texture = (Texture)(object)texture; ((Behaviour)playerCard.cardBackground).enabled = (Object)(object)texture != (Object)null; if ((Object)(object)playerCard.cardScrim != (Object)null) { ((Behaviour)playerCard.cardScrim).enabled = (Object)(object)texture != (Object)null; } } if (playerCard.title != null) { int num9 = rosterEntry2?.title ?? (((NetworkBehaviour)val).isLocalPlayer ? TitleSystem.CurrentTitle(val) : (-1)); bool flag2 = rosterEntry2?.titleNew ?? (((NetworkBehaviour)val).isLocalPlayer && TitleSystem.IsFresh(playerCard.userNetId)); string text = ((num9 >= 0 && num9 < TitleSystem.Table.Length) ? TitleSystem.Table[num9] : ""); if (flag2 && !RevealSettled(playerCard.userNetId, PrizeKind.Title)) { text = ""; } else if (flag2 && text.Length > 0) { text = "NEW! " + text; } playerCard.title.Text = text; playerCard.title.Color = (flag2 ? ColGold : ColTitle); } bool flag3 = array[num7] < 3 && cards.Count > 1 && (K(num7) != 0 || D(num7) != 0 || M(num7) > 0f || G(num7) != 0); if ((Object)(object)playerCard.crown != (Object)null) { ((Behaviour)playerCard.crown).enabled = flag3; if (flag3) { ((Graphic)playerCard.crown).color = ((array[num7] == 0) ? ColGold : ((array[num7] == 1) ? ColSilver : ColBronze)); } } double num10 = rosterEntry2?.m3Ever ?? (((NetworkBehaviour)val).isLocalPlayer ? UserLifetimeStats.GetRunBase(val) : 0.0); RimTier rimTier = TierFor(num10); if ((Object)(object)playerCard.rim != (Object)null && ((Graphic)playerCard.rim).color != rimTier.col) { ((Graphic)playerCard.rim).color = rimTier.col; } if (playerCard.statValues != null) { SetStat(playerCard.statValues[0], (rosterEntry2 == null) ? "—" : rosterEntry2.kills.ToString(), rosterEntry2 != null && rosterEntry2.kills != 0 && rosterEntry2.kills == num2); SetStat(playerCard.statValues[1], (rosterEntry2 == null) ? "—" : Compact(rosterEntry2.damage), rosterEntry2 != null && rosterEntry2.damage != 0 && rosterEntry2.damage == num3); SetStat(playerCard.statValues[2], (rosterEntry2 == null) ? "—" : Compact(rosterEntry2.gold), rosterEntry2 != null && rosterEntry2.gold != 0 && rosterEntry2.gold == num4); SetStat(playerCard.statValues[3], (rosterEntry2 == null) ? "—" : Cubic(rosterEntry2.m3Stage), rosterEntry2 != null && rosterEntry2.m3Stage > 0f && rosterEntry2.m3Stage == num5); SetStat(playerCard.statValues[4], (rosterEntry2 == null) ? "—" : Cubic(rosterEntry2.m3Run), rosterEntry2 != null && rosterEntry2.m3Run > 0f && rosterEntry2.m3Run == num6); playerCard.statValues[5].Text = ((rosterEntry2 == null && !((NetworkBehaviour)val).isLocalPlayer) ? "—" : Cubic(num10)); playerCard.statValues[5].Color = Color.Lerp(rimTier.col, Color.white, 0.3f); } } ulong D(int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) NetworkInstanceId netId2 = ((NetworkBehaviour)alive[index]).netId; return LoadingRoster.Find(((NetworkInstanceId)(ref netId2)).Value)?.damage ?? 0; } ulong G(int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) NetworkInstanceId netId2 = ((NetworkBehaviour)alive[index]).netId; return LoadingRoster.Find(((NetworkInstanceId)(ref netId2)).Value)?.gold ?? 0; } uint K(int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) NetworkInstanceId netId2 = ((NetworkBehaviour)alive[index]).netId; return LoadingRoster.Find(((NetworkInstanceId)(ref netId2)).Value)?.kills ?? 0; } float M(int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) NetworkInstanceId netId2 = ((NetworkBehaviour)alive[index]).netId; return LoadingRoster.Find(((NetworkInstanceId)(ref netId2)).Value)?.m3Run ?? 0f; } } private static void UpdateStatus(PlayerCard card, bool isLocal, bool ready, byte remotePct) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)card.statusFill == (Object)null) { return; } float barInnerWidth = card.barInnerWidth; if (ready) { ((Graphic)card.statusFill).color = ColGreen; card.statusFillRect.anchoredPosition = new Vector2(2f, 0f); card.statusFillRect.sizeDelta = new Vector2(barInnerWidth, 8f); if (card.status != null) { card.status.Text = "READY"; card.status.Color = ColGreen; } if ((Object)(object)card.accent != (Object)null) { ((Graphic)card.accent).color = ColGreen; } if ((Object)(object)card.border != (Object)null) { ((Graphic)card.border).color = new Color(0.35f, 0.62f, 0.35f, 0.85f); } } else if (isLocal || remotePct > 0) { float num = (isLocal ? ConvertProgress.Fraction() : ((float)(int)remotePct / 100f)); ((Graphic)card.statusFill).color = ColOrange; card.statusFillRect.anchoredPosition = new Vector2(2f, 0f); card.statusFillRect.sizeDelta = new Vector2(barInnerWidth * num, 8f); if (card.status != null) { card.status.Text = $"LOADING {(int)(num * 100f)}%"; card.status.Color = ColDim; } if ((Object)(object)card.accent != (Object)null) { ((Graphic)card.accent).color = ColOrange; } } else { float num2 = barInnerWidth * 0.3f; float num3 = Mathf.PingPong((Time.unscaledTime + (float)card.userNetId * 0.37f) * 0.7f, 1f); ((Graphic)card.statusFill).color = ColOrange; card.statusFillRect.anchoredPosition = new Vector2(2f + (barInnerWidth - num2) * num3, 0f); card.statusFillRect.sizeDelta = new Vector2(num2, 8f); if (card.status != null) { card.status.Text = "LOADING"; card.status.Color = ColDim; } if ((Object)(object)card.accent != (Object)null) { ((Graphic)card.accent).color = ColOrange; } } } private static void SetStat(UiKit.Label t, string value, bool leader) { //IL_0016: 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) if (t != null) { t.Text = value; t.Color = (leader ? ColGold : ColText); } } private static void BuildCards(List users) { //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_0113: 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) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_01c0: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0453: 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_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_091f: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerCard card in cards) { if ((Object)(object)card.go != (Object)null) { Object.Destroy((Object)(object)card.go); } } cards.Clear(); if (users.Count == 0) { return; } int count = users.Count; float num = Mathf.Min(280f, (1640f - 24f * (float)(count - 1)) / (float)count); if ((Object)(object)crownSprite == (Object)null) { crownSprite = BuildCrownSprite(); } for (int i = 0; i < count; i++) { NetworkUser val = users[i]; PlayerCard playerCard = new PlayerCard(); NetworkInstanceId netId = ((NetworkBehaviour)val).netId; playerCard.userNetId = ((NetworkInstanceId)(ref netId)).Value; playerCard.width = num; PlayerCard playerCard2 = playerCard; playerCard2.go = new GameObject($"card_{i}"); playerCard2.go.transform.SetParent((Transform)(object)cardRow, false); RectTransform obj = playerCard2.go.AddComponent(); obj.sizeDelta = new Vector2(num, 420f); obj.anchoredPosition = new Vector2(((float)i - (float)(count - 1) * 0.5f) * (num + 24f), 0f); GameObject val2 = new GameObject("crown"); val2.transform.SetParent(playerCard2.go.transform, false); playerCard2.crown = val2.AddComponent(); playerCard2.crown.sprite = crownSprite; ((Behaviour)playerCard2.crown).enabled = false; playerCard2.crownRect = ((Graphic)playerCard2.crown).rectTransform; float num2 = num * 0.5f; playerCard2.crownRect.sizeDelta = new Vector2(num2, num2 * 0.83f); playerCard2.crownRect.anchoredPosition = new Vector2(0f, 210f + num2 * 0.16f); ((Transform)playerCard2.crownRect).localRotation = Quaternion.Euler(0f, 0f, 12f); Image val3 = UiKit.CreatePanel("cardFace", playerCard2.go.transform, new Color(0.075f, 0.075f, 0.095f, 1f)); ((Graphic)val3).rectTransform.sizeDelta = new Vector2(num - 2f, 418f); ((Component)val3).gameObject.AddComponent().showMaskGraphic = true; GameObject val4 = new GameObject("cardBackground"); val4.transform.SetParent(((Component)val3).transform, false); playerCard2.cardBackground = val4.AddComponent(); UiKit.Stretch(((Graphic)playerCard2.cardBackground).rectTransform); ((Graphic)playerCard2.cardBackground).color = new Color(0.62f, 0.62f, 0.62f, 1f); ((Behaviour)playerCard2.cardBackground).enabled = false; playerCard2.cardScrim = UiKit.CreateImage("cardScrim", ((Component)val3).transform, new Color(0.02f, 0.02f, 0.03f, 0.88f)); playerCard2.cardScrim.sprite = UiKit.GradientScrim(); playerCard2.cardScrim.type = (Type)0; ((Graphic)playerCard2.cardScrim).rectTransform.anchorMin = new Vector2(0f, 0f); ((Graphic)playerCard2.cardScrim).rectTransform.anchorMax = new Vector2(1f, 0f); ((Graphic)playerCard2.cardScrim).rectTransform.pivot = new Vector2(0.5f, 0f); ((Graphic)playerCard2.cardScrim).rectTransform.sizeDelta = new Vector2(0f, 300f); ((Graphic)playerCard2.cardScrim).rectTransform.anchoredPosition = Vector2.zero; ((Behaviour)playerCard2.cardScrim).enabled = false; playerCard2.accent = UiKit.CreateImage("accent", playerCard2.go.transform, ColOrange); ((Graphic)playerCard2.accent).rectTransform.sizeDelta = new Vector2(num - 10f, 4f); ((Graphic)playerCard2.accent).rectTransform.anchoredPosition = new Vector2(0f, 205f); playerCard2.rim = UiKit.CreateImage("portraitRim", playerCard2.go.transform, RimTiers[0].col); ((Graphic)playerCard2.rim).rectTransform.sizeDelta = new Vector2(158f, 158f); ((Graphic)playerCard2.rim).rectTransform.anchoredPosition = new Vector2(0f, 115f); Image val5 = UiKit.CreateImage("portraitFrame", playerCard2.go.transform, new Color(0.03f, 0.03f, 0.045f, 1f)); ((Graphic)val5).rectTransform.sizeDelta = new Vector2(146f, 146f); ((Graphic)val5).rectTransform.anchoredPosition = new Vector2(0f, 115f); GameObject val6 = new GameObject("portrait"); val6.transform.SetParent(((Component)val5).transform, false); playerCard2.portrait = val6.AddComponent(); ((Graphic)playerCard2.portrait).rectTransform.sizeDelta = new Vector2(142f, 142f); ((Graphic)playerCard2.portrait).color = new Color(1f, 1f, 1f, 0.06f); Image val7 = UiKit.CreateImage("statusBarBg", playerCard2.go.transform, new Color(0.14f, 0.14f, 0.17f, 1f)); ((Graphic)val7).rectTransform.sizeDelta = new Vector2(num - 60f, 12f); ((Graphic)val7).rectTransform.anchoredPosition = new Vector2(0f, -26f); playerCard2.barInnerWidth = num - 64f; playerCard2.statusFillRect = ((Graphic)(playerCard2.statusFill = UiKit.CreateImage("statusFill", ((Component)val7).transform, ColOrange))).rectTransform; playerCard2.statusFillRect.anchorMin = new Vector2(0f, 0.5f); playerCard2.statusFillRect.anchorMax = new Vector2(0f, 0.5f); playerCard2.statusFillRect.pivot = new Vector2(0f, 0.5f); playerCard2.statusFillRect.anchoredPosition = new Vector2(2f, 0f); playerCard2.statusFillRect.sizeDelta = new Vector2(0f, 8f); playerCard2.name = UiKit.CreateLabel("name", playerCard2.go.transform, 20f, ColText, (TextAnchor)4); playerCard2.name.Rect.sizeDelta = new Vector2(num - 20f, 26f); playerCard2.name.Rect.anchoredPosition = new Vector2(0f, 18f); playerCard2.name.ClipSingleLine(); playerCard2.title = UiKit.CreateLabel("title", playerCard2.go.transform, 14f, ColTitle, (TextAnchor)4); playerCard2.title.Rect.sizeDelta = new Vector2(num - 16f, 17f); playerCard2.title.Rect.anchoredPosition = new Vector2(0f, -8f); playerCard2.title.Italic(); playerCard2.title.ClipSingleLine(); playerCard2.status = UiKit.CreateLabel("status", playerCard2.go.transform, 14f, ColDim, (TextAnchor)4); playerCard2.status.Rect.sizeDelta = new Vector2(num - 16f, 20f); playerCard2.status.Rect.anchoredPosition = new Vector2(0f, -50f); playerCard2.statValues = new UiKit.Label[StatLabels.Length]; for (int j = 0; j < StatLabels.Length; j++) { float num3 = -80f - 22f * (float)j; UiKit.Label obj2 = UiKit.CreateLabel($"statLabel{j}", playerCard2.go.transform, 16f, ColDim, (TextAnchor)3); obj2.Rect.sizeDelta = new Vector2(num * 0.52f, 22f); obj2.Rect.anchoredPosition = new Vector2((0f - num) * 0.5f + 16f + num * 0.26f, num3); obj2.Text = StatLabels[j]; UiKit.Label label = UiKit.CreateLabel($"statValue{j}", playerCard2.go.transform, 16f, ColText, (TextAnchor)5); label.Rect.sizeDelta = new Vector2(num * 0.44f, 22f); label.Rect.anchoredPosition = new Vector2(num * 0.5f - 16f - num * 0.22f, num3); label.Text = "—"; playerCard2.statValues[j] = label; } playerCard2.border = UiKit.CreateOutline("border", playerCard2.go.transform, new Color(0.42f, 0.44f, 0.5f, 0.85f)); ((Graphic)playerCard2.border).rectTransform.sizeDelta = new Vector2(num, 420f); cards.Add(playerCard2); } } private static Texture ResolvePortrait(NetworkUser nu) { GameObject val = (((Object)(object)nu != (Object)null && (Object)(object)nu.master != (Object)null) ? nu.master.bodyPrefab : null); CharacterBody val2 = (((Object)(object)val != (Object)null) ? val.GetComponent() : null); if (!((Object)(object)val2 != (Object)null)) { return null; } return val2.portraitIcon; } private static string Compact(ulong v) { if (v < 10000) { return v.ToString(); } if (v < 1000000) { return $"{(float)v / 1000f:F1}k"; } return $"{(float)v / 1000000f:F2}M"; } private static string Cubic(double m3) { string cubicSuffix = UiKit.CubicSuffix; if (m3 < 10.0) { return $"{m3:F1} {cubicSuffix}"; } if (m3 < 10000.0) { return $"{Math.Round(m3)} {cubicSuffix}"; } if (m3 < 1000000.0) { return $"{m3 / 1000.0:F1}k {cubicSuffix}"; } if (m3 < 1000000000.0) { return $"{m3 / 1000000.0:F2}M {cubicSuffix}"; } return $"{m3 / 1000000000.0:F2}B {cubicSuffix}"; } internal static Font LoadFont() { if ((Object)(object)cachedFont != (Object)null || fontSearched) { return cachedFont; } fontSearched = true; string[] array = new string[2] { "Arial.ttf", "LegacyRuntime.ttf" }; foreach (string text in array) { try { Font builtinResource = Resources.GetBuiltinResource(text); if ((Object)(object)builtinResource != (Object)null) { ScorchedVoxelsPlugin.Log.LogInfo((object)("[ScorchedVoxels] overlay font: builtin " + text)); return cachedFont = builtinResource; } } catch { } } array = new string[3] { "Arial", "Segoe UI", "Verdana" }; foreach (string text2 in array) { try { Font val = Font.CreateDynamicFontFromOSFont(text2, 24); if ((Object)(object)val != (Object)null) { ScorchedVoxelsPlugin.Log.LogInfo((object)("[ScorchedVoxels] overlay font: OS " + text2)); return cachedFont = val; } } catch { } } try { Font[] array2 = Resources.FindObjectsOfTypeAll(); foreach (Font val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { ScorchedVoxelsPlugin.Log.LogInfo((object)("[ScorchedVoxels] overlay font: borrowed '" + ((Object)val2).name + "'")); return cachedFont = val2; } } } catch { } ScorchedVoxelsPlugin.Log.LogWarning((object)"[ScorchedVoxels] no usable UI font found — overlay text disabled"); return null; } private static Sprite BuildCrownSprite() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00ec: 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_00a6: 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) Texture2D val = new Texture2D(96, 88, (TextureFormat)5, false); ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[8448]; for (int i = 0; i < 88; i++) { for (int j = 0; j < 96; j++) { int num = 0; for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { if (Inside((float)j + ((float)l + 0.5f) / 3f, (float)i + ((float)k + 0.5f) / 3f)) { num++; } } } byte b = (byte)(num * 255 / 9); array[i * 96 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b); } } val.SetPixels32(array); val.Apply(false, true); return Sprite.Create(val, new Rect(0f, 0f, 96f, 88f), new Vector2(0.5f, 0.5f), 100f); static bool Inside(float x, float y) { if (y >= 6f && y <= 20f && x >= 4f && x <= 92f) { return true; } if (Spike(16f, 14f, 60f) || Spike(48f, 16f, 72f) || Spike(80f, 14f, 60f)) { return true; } if (!Ball(16f, 62f) && !Ball(48f, 74f)) { return Ball(80f, 62f); } return true; bool Ball(float bx, float by) { float num2 = x - bx; float num3 = y - by; return num2 * num2 + num3 * num3 <= 36f; } bool Spike(float cx, float hw, float ytip) { if (y > 20f && y <= ytip) { return Mathf.Abs(x - cx) <= hw * (1f - (y - 20f) / (ytip - 20f)); } return false; } } } } internal enum PrizeKind : byte { Title, Background } internal class LootReel { public uint userNetId; public string userName; public PrizeKind kind; public int stageKey; public int landSlot; public int[] entries; public int WonIndex => entries[landSlot]; public string WonName { get { if (kind != PrizeKind.Title) { return BackgroundSystem.Table[Mathf.Clamp(WonIndex, 0, BackgroundSystem.Table.Length - 1)].name; } return TitleSystem.Table[Mathf.Clamp(WonIndex, 0, TitleSystem.Table.Length - 1)]; } } } internal static class LootReveal { public const float StartDelay = 1.1f; public const float SpinSeconds = 4.6f; public const float LingerSeconds = 1.4f; private const int ReelLength = 28; public const int LandSlot = 23; public const int StartSlot = 2; public static readonly List Reels = new List(); private static readonly Random rng = new Random(); public static bool RevealRunning { get; private set; } public static float ShowT0 { get; private set; } = -1f; public static bool HoldingRelease { get { if (ShowT0 >= 0f) { return Time.unscaledTime < ShowT0 + 4.6f + 1.4f; } return false; } } public static bool TooLateToJoin { get { if (ShowT0 >= 0f) { return Time.unscaledTime - ShowT0 > 1.84f; } return false; } } public static int StageKey { get; private set; } = int.MinValue; public static void ScheduleShow() { if (ShowT0 < 0f) { ShowT0 = Time.unscaledTime + 1.1f; } } public static int CurrentStageKey() { if (!((Object)(object)Run.instance != (Object)null)) { return -1; } return Run.instance.stageClearCount; } public static void ResetForStage(int stageKey) { StageKey = stageKey; Reels.RemoveAll((LootReel r) => r.stageKey != stageKey); RevealRunning = false; ShowT0 = -1f; } public static void Reset() { StageKey = int.MinValue; Reels.Clear(); RevealRunning = false; ShowT0 = -1f; } public static void ReportLocalWin(NetworkUser nu, PrizeKind kind, int wonIdx) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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) if (!((Object)(object)nu == (Object)null)) { int stageKey = CurrentStageKey(); NetworkInstanceId netId; if (NetworkServer.active) { netId = ((NetworkBehaviour)nu).netId; ServerQueueReveal(stageKey, ((NetworkInstanceId)(ref netId)).Value, nu.userName, kind, wonIdx); } else { netId = ((NetworkBehaviour)nu).netId; NetMessageExtensions.Send((INetMessage)(object)new UnlockRevealMessage(stageKey, ((NetworkInstanceId)(ref netId)).Value, kind, wonIdx), (NetworkDestination)2); } } } public static void ServerQueueReveal(int stageKey, uint userNetId, string userName, PrizeKind kind, int wonIdx) { if (!NetworkServer.active) { return; } if (stageKey < 0 || stageKey != CurrentStageKey()) { ScorchedVoxelsPlugin.Log.LogWarning((object)$"[ScorchedVoxels] loot reveal for netId {userNetId} carries stage key {stageKey} (current {CurrentStageKey()}) — unlock kept, reveal dropped"); return; } if (stageKey == StageKey && TooLateToJoin) { ScorchedVoxelsPlugin.Log.LogWarning((object)$"[ScorchedVoxels] loot reveal for netId {userNetId} arrived after the spin was underway — unlock kept, reveal skipped"); return; } if (string.IsNullOrEmpty(userName)) { userName = ResolveName(userNetId); } LootReel reel = BuildReel(userNetId, userName, kind, wonIdx); reel.stageKey = stageKey; Reels.RemoveAll((LootReel r) => r.userNetId == reel.userNetId && r.kind == reel.kind); Reels.Add(reel); NetMessageExtensions.Send((INetMessage)(object)new LootReelMessage(reel), (NetworkDestination)1); } private static string ResolveName(uint id) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances != (Object)null) { NetworkInstanceId netId = ((NetworkBehaviour)readOnlyInstances).netId; if (((NetworkInstanceId)(ref netId)).Value == id) { return readOnlyInstances.userName; } } } return "Someone"; } private static LootReel BuildReel(uint userNetId, string userName, PrizeKind kind, int wonIdx) { List list = new List(); if (kind == PrizeKind.Title) { for (int i = 0; i < TitleSystem.Table.Length; i++) { if (i != wonIdx) { list.Add(i); } } } else { for (int j = 0; j < BackgroundSystem.Table.Length; j++) { if (j != wonIdx && BackgroundSystem.Table[j].cat == BgCat.Pattern) { list.Add(j); } } } if (list.Count == 0) { list.Add(wonIdx); } int[] array = new int[28]; for (int k = 0; k < 28; k++) { array[k] = list[rng.Next(list.Count)]; } array[23] = wonIdx; return new LootReel { userNetId = userNetId, userName = userName, kind = kind, landSlot = 23, entries = array }; } public static bool TryDeferRelease() { if (!HoldingRelease) { return false; } RevealRunning = true; return true; } public static void FinishReveal() { RevealRunning = false; } public static void ClientStoreReel(LootReel reel) { Reels.RemoveAll((LootReel r) => r.userNetId == reel.userNetId && r.kind == reel.kind); Reels.Add(reel); } public static void ServerResendReels() { if (!NetworkServer.active) { return; } int num = CurrentStageKey(); foreach (LootReel reel in Reels) { if (reel.stageKey == num) { NetMessageExtensions.Send((INetMessage)(object)new LootReelMessage(reel), (NetworkDestination)1); } } } } internal class UnlockRevealMessage : INetMessage, ISerializableObject { private int stageKey; private uint userNetId; private byte kind; private int wonIdx; public UnlockRevealMessage() { } public UnlockRevealMessage(int stageKey, uint userNetId, PrizeKind kind, int wonIdx) { this.stageKey = stageKey; this.userNetId = userNetId; this.kind = (byte)kind; this.wonIdx = wonIdx; } public void Serialize(NetworkWriter writer) { writer.WritePackedUInt32((uint)(stageKey + 1)); writer.WritePackedUInt32(userNetId); writer.Write(kind); writer.WritePackedUInt32((uint)wonIdx); } public void Deserialize(NetworkReader reader) { stageKey = (int)(reader.ReadPackedUInt32() - 1); userNetId = reader.ReadPackedUInt32(); kind = reader.ReadByte(); wonIdx = (int)reader.ReadPackedUInt32(); } public void OnReceived() { if (NetworkServer.active) { LootReveal.ServerQueueReveal(stageKey, userNetId, null, (PrizeKind)kind, wonIdx); } } } internal class LootReelMessage : INetMessage, ISerializableObject { private LootReel reel = new LootReel(); public LootReelMessage() { } public LootReelMessage(LootReel reel) { this.reel = reel; } public void Serialize(NetworkWriter writer) { writer.WritePackedUInt32((uint)(reel.stageKey + 1)); writer.WritePackedUInt32(reel.userNetId); writer.Write(reel.userName ?? "Someone"); writer.Write((byte)reel.kind); writer.Write((byte)reel.landSlot); writer.Write((byte)reel.entries.Length); int[] entries = reel.entries; foreach (int num in entries) { writer.WritePackedUInt32((uint)num); } } public void Deserialize(NetworkReader reader) { reel = new LootReel { stageKey = (int)(reader.ReadPackedUInt32() - 1), userNetId = reader.ReadPackedUInt32(), userName = reader.ReadString(), kind = (PrizeKind)reader.ReadByte(), landSlot = reader.ReadByte() }; reel.entries = new int[reader.ReadByte()]; for (int i = 0; i < reel.entries.Length; i++) { reel.entries[i] = (int)reader.ReadPackedUInt32(); } } public void OnReceived() { if (!NetworkServer.active && reel.entries.Length != 0 && reel.landSlot < reel.entries.Length && reel.stageKey >= 0 && reel.stageKey == LootReveal.CurrentStageKey()) { LootReveal.ClientStoreReel(reel); } } } internal static class MaterialHardness { private struct Entry { public readonly string fragment; public readonly float multiplier; public Entry(string fragment, float multiplier) { this.fragment = fragment; this.multiplier = multiplier; } } private static readonly Entry[] Table = new Entry[25] { new Entry("metal", 0.45f), new Entry("iron", 0.45f), new Entry("pipe", 0.5f), new Entry("grate", 0.5f), new Entry("concrete", 0.55f), new Entry("crystal", 0.6f), new Entry("ice", 0.7f), new Entry("rock", 0.8f), new Entry("stone", 0.8f), new Entry("boulder", 0.8f), new Entry("cliff", 0.8f), new Entry("ruins", 0.8f), new Entry("temple", 0.8f), new Entry("column", 0.8f), new Entry("pillar", 0.8f), new Entry("brick", 0.8f), new Entry("statue", 0.8f), new Entry("root", 0.9f), new Entry("wood", 0.9f), new Entry("lava", 1.1f), new Entry("grass", 1.1f), new Entry("coral", 1.15f), new Entry("dirt", 1.2f), new Entry("sand", 1.25f), new Entry("snow", 1.35f) }; public static float ScaleFor(Material mat, Material mat2) { string text = (((Object)(object)mat != (Object)null) ? ((Object)mat).name : null); string text2 = (((Object)(object)mat2 != (Object)null && (Object)(object)mat2 != (Object)(object)mat) ? ((Object)mat2).name : null); if (text == null && text2 == null) { return 1f; } Entry[] table = Table; for (int i = 0; i < table.Length; i++) { Entry entry = table[i]; if (Contains(text, entry.fragment) || Contains(text2, entry.fragment)) { return entry.multiplier; } } return 1f; } private static bool Contains(string haystack, string needle) { if (haystack != null) { return haystack.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0; } return false; } } internal static class MeshReadback { internal sealed class Data { public Vector3[] verts; public Vector2[] uv0; public Vector2[] uv2; public Color32[] colors; public int[][] subTris; public int[] SubTriangles(int s) { return subTris[s]; } } private static readonly HashSet Whitelist = new HashSet(StringComparer.OrdinalIgnoreCase) { "meshSnowyForestTerrainGround", "meshSnowyForestTerrainCaveCollison", "meshSnowyForestTerrainWall", "meshSnowyForestAqueduct", "meshSnowyForestAqueductTopLG", "meshSnowyForestAqueductTopSM", "meshSnowyForestGiantTrees", "mdlSnowyForestTreeStump", "meshSnowyForestTerrainWater" }; private static string cachedScene; private static List cachedBlobs; public static bool Whitelisted(Mesh mesh, string goName) { if (!Whitelist.Contains(((Object)mesh).name)) { return Whitelist.Contains(goName); } return true; } public static Data TryRead(Mesh mesh) { try { BundleMeshCore.MeshBlob meshBlob = FindBlob(mesh); if (meshBlob == null) { ScorchedVoxelsPlugin.Log.LogWarning((object)$"[ScorchedVoxels] mesh '{((Object)mesh).name}' ({mesh.vertexCount} verts) not found in this stage's bundles — left vanilla"); return null; } Data data = Convert(meshBlob); int num = 0; int[][] subTris = data.subTris; foreach (int[] array in subTris) { num += array.Length / 3; } ScorchedVoxelsPlugin.Log.LogInfo((object)("[ScorchedVoxels] non-readable mesh '" + ((Object)mesh).name + "' loaded from the game's bundle files: " + $"{data.verts.Length} verts, {num} tris, uv0={data.uv0 != null}, uv2={data.uv2 != null}, colors={data.colors != null}")); return data; } catch (Exception ex) { ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] bundle read failed for whitelisted mesh '" + ((Object)mesh).name + "' (" + ex.Message + ") — left vanilla")); return null; } } private static BundleMeshCore.MeshBlob FindBlob(Mesh mesh) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (cachedScene != name || cachedBlobs == null) { cachedScene = name; cachedBlobs = LoadSceneBlobs(name); } foreach (BundleMeshCore.MeshBlob cachedBlob in cachedBlobs) { if (cachedBlob.name == ((Object)mesh).name && cachedBlob.vertexCount == mesh.vertexCount && cachedBlob.subMeshCount == mesh.subMeshCount) { return cachedBlob; } } return null; } private static List LoadSceneBlobs(string scene) { List list = new List(); string text = Path.Combine(Application.streamingAssetsPath, "aa", "StandaloneWindows64"); if (!Directory.Exists(text)) { ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] addressables directory not found: " + text)); return list; } string value = scene.ToLowerInvariant(); string[] files = Directory.GetFiles(text, "*.bundle"); foreach (string text2 in files) { if (Path.GetFileName(text2).ToLowerInvariant().IndexOf(value, StringComparison.Ordinal) >= 0) { try { list.AddRange(BundleMeshCore.LoadMeshes(text2, Whitelist)); } catch (Exception ex) { ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] could not parse bundle '" + Path.GetFileName(text2) + "' (" + ex.Message + ")")); } } } return list; } private static Data Convert(BundleMeshCore.MeshBlob b) { //IL_0050: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_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) Data data = new Data { subTris = b.subTris }; data.verts = (Vector3[])(object)new Vector3[b.vertexCount]; for (int i = 0; i < b.vertexCount; i++) { data.verts[i] = new Vector3(b.positions[i * 3], b.positions[i * 3 + 1], b.positions[i * 3 + 2]); } if (b.uv0 != null) { data.uv0 = (Vector2[])(object)new Vector2[b.vertexCount]; for (int j = 0; j < b.vertexCount; j++) { data.uv0[j] = new Vector2(b.uv0[j * 2], b.uv0[j * 2 + 1]); } } if (b.uv1 != null) { data.uv2 = (Vector2[])(object)new Vector2[b.vertexCount]; for (int k = 0; k < b.vertexCount; k++) { data.uv2[k] = new Vector2(b.uv1[k * 2], b.uv1[k * 2 + 1]); } } if (b.colors != null) { data.colors = (Color32[])(object)new Color32[b.vertexCount]; for (int l = 0; l < b.vertexCount; l++) { data.colors[l] = new Color32(b.colors[l * 4], b.colors[l * 4 + 1], b.colors[l * 4 + 2], b.colors[l * 4 + 3]); } } return data; } } internal class SourceMesh { public string name; public Vector3[] verts; public int[] indices; public Material material; public MeshRenderer renderer; public MeshCollider collider; public Material[] materials; public int[] subOfTri; public int dominantSub; public Vector2[] uv0; public Color32[] colors; public Vector3[] triCenter; public float[] triRadius; public Vector2[] uv2; public int lightmapIndex = -1; public Vector4 lightmapScaleOffset; public float carveScale = 1f; public bool openShell; public Vector3[] pnVertA; public Vector3[] pnVertB; public Vector3[] pnVertC; public Vector3[] pnEdgeAB; public Vector3[] pnEdgeBC; public Vector3[] pnEdgeCA; public WindingField winding; public bool hasVisibleRenderer; public ShadowCastingMode shadowMode = (ShadowCastingMode)1; public int TriCount => indices.Length / 3; } internal static class MeshVoxelizer { private const float BinMargin = 2f; private const int MaxBandChunks = 150000; internal const float ShellDepth = 4f; private const long MaxTriChunks = 8192L; public static List Build(List sources, float desiredVoxelSize, Func isCancelled) { //IL_0133: 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_0150: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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_01da: 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_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: 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_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050f: 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_0525: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_0564: 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_0582: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058c: 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_0597: Unknown result type (might be due to invalid IL or missing references) float num = desiredVoxelSize; for (int i = 0; i < 12; i++) { int num2 = CountBandChunks(sources, num); if (num2 <= 150000) { break; } float num3 = num * 1.3f; if (ScorchedVoxelsPlugin.VerboseLogging.Value) { ScorchedVoxelsPlugin.Log.LogInfo((object)$"[ScorchedVoxels] {num2} band chunks at VoxelSize {num:F2}m exceeds budget {150000} — coarsening to {num3:F2}m"); } num = num3; } float num4 = 16f * num; float num5 = 2f * num; int num6 = 0; int num7 = 0; List list = new List(); List workVolume = new List(); List workSource = new List(); List workKey = new List(); List workTris = new List(); for (int j = 0; j < sources.Count; j++) { SourceMesh sourceMesh = sources[j]; Dictionary> dictionary = new Dictionary>(); int num8 = int.MaxValue; int num9 = int.MaxValue; int num10 = int.MaxValue; int num11 = int.MinValue; int num12 = int.MinValue; int num13 = int.MinValue; for (int k = 0; k < sourceMesh.indices.Length; k += 3) { Vector3 val = sourceMesh.verts[sourceMesh.indices[k]]; Vector3 val2 = sourceMesh.verts[sourceMesh.indices[k + 1]]; Vector3 val3 = sourceMesh.verts[sourceMesh.indices[k + 2]]; Vector3 val4 = Vector3.Min(val, Vector3.Min(val2, val3)) - Vector3.one * num5; Vector3 val5 = Vector3.Max(val, Vector3.Max(val2, val3)) + Vector3.one * num5; int num14 = Mathf.FloorToInt(val4.x / num4); int num15 = Mathf.FloorToInt(val5.x / num4); int num16 = Mathf.FloorToInt(val4.y / num4); int num17 = Mathf.FloorToInt(val5.y / num4); int num18 = Mathf.FloorToInt(val4.z / num4); int num19 = Mathf.FloorToInt(val5.z / num4); if ((long)(num15 - num14 + 1) * (long)(num17 - num16 + 1) * (num19 - num18 + 1) > 8192) { num6++; continue; } for (int l = num14; l <= num15; l++) { for (int m = num16; m <= num17; m++) { for (int n = num18; n <= num19; n++) { long key = VoxelVolume.PackKey(l, m, n); if (!dictionary.TryGetValue(key, out var value)) { value = (dictionary[key] = new List(8)); } value.Add(k / 3); if (l < num8) { num8 = l; } if (l > num11) { num11 = l; } if (m < num9) { num9 = m; } if (m > num12) { num12 = m; } if (n < num10) { num10 = n; } if (n > num13) { num13 = n; } } } } } if (dictionary.Count == 0) { continue; } if (sourceMesh.winding == null) { sourceMesh.winding = new WindingField(sourceMesh.verts, sourceMesh.indices); if (sourceMesh.winding.LooksInverted(sourceMesh.verts, sourceMesh.indices)) { for (int num20 = 0; num20 + 2 < sourceMesh.indices.Length; num20 += 3) { ref int reference = ref sourceMesh.indices[num20 + 1]; ref int reference2 = ref sourceMesh.indices[num20 + 2]; int num21 = sourceMesh.indices[num20 + 2]; int num22 = sourceMesh.indices[num20 + 1]; reference = num21; reference2 = num22; } sourceMesh.winding.FlipOrientation(); ScorchedVoxelsPlugin.Log.LogInfo((object)("[ScorchedVoxels] '" + sourceMesh.name + "' collider is wound inside-out — flipped so rock fills the correct side")); } } if (sourceMesh.pnVertA == null) { ComputePseudonormals(sourceMesh); } Vector3 val6 = sourceMesh.verts[0]; Vector3 val7 = sourceMesh.verts[0]; Vector3[] verts = sourceMesh.verts; foreach (Vector3 val8 in verts) { val6 = Vector3.Min(val6, val8); val7 = Vector3.Max(val7, val8); } Bounds meshBoundsWS = default(Bounds); ((Bounds)(ref meshBoundsWS)).SetMinMax(val6, val7); VoxelVolume voxelVolume = new VoxelVolume(num) { material = sourceMesh.material, materials = sourceMesh.materials, dominantSub = sourceMesh.dominantSub, carveScale = sourceMesh.carveScale, openShell = sourceMesh.openShell, winding = sourceMesh.winding, meshBoundsWS = meshBoundsWS, index = j, priority = sourceMesh.TriCount, name = sourceMesh.name, source = sourceMesh, lightmapIndex = sourceMesh.lightmapIndex, lightmapScaleOffset = sourceMesh.lightmapScaleOffset, renderable = sourceMesh.hasVisibleRenderer, shadowMode = sourceMesh.shadowMode }; Vector3 val9 = new Vector3((float)num8, (float)num9, (float)num10) * num4 - Vector3.one * 4f; Vector3 val10 = new Vector3((float)(num11 + 1), (float)(num12 + 1), (float)(num13 + 1)) * num4 + Vector3.one * 4f; val9.y -= 300f; Bounds boundsWS = default(Bounds); ((Bounds)(ref boundsWS)).SetMinMax(val9, val10); voxelVolume.boundsWS = boundsWS; list.Add(voxelVolume); foreach (KeyValuePair> item in dictionary) { workVolume.Add(voxelVolume); workSource.Add(sourceMesh); workKey.Add(item.Key); workTris.Add(item.Value.ToArray()); } num7 += dictionary.Count; } if (ScorchedVoxelsPlugin.VerboseLogging.Value) { ScorchedVoxelsPlugin.Log.LogInfo((object)($"[ScorchedVoxels] binned {num7} band chunks across {list.Count} volumes at voxel {num:F2}m" + ((num6 > 0) ? $" ({num6} backdrop-scale tris skipped)" : ""))); } ConvertProgress.Set("voxelizing terrain", workKey.Count); byte[][] results = new byte[workKey.Count][]; int num23 = Mathf.Clamp(Environment.ProcessorCount - 2, 1, 14); Task[] array = new Task[num23]; int cursor = -1; for (int num24 = 0; num24 < num23; num24++) { array[num24] = Task.Run(delegate { while (true) { int num27 = Interlocked.Increment(ref cursor); if (num27 >= workKey.Count || isCancelled()) { break; } results[num27] = BuildChunkDensity(workVolume[num27], workSource[num27], workTris[num27], workKey[num27]); Interlocked.Increment(ref ConvertProgress.Done); } }); } Task.WaitAll(array); foreach (SourceMesh source in sources) { source.pnVertA = (source.pnVertB = (source.pnVertC = (source.pnEdgeAB = (source.pnEdgeBC = (source.pnEdgeCA = null))))); } if (isCancelled()) { return list; } for (int num25 = 0; num25 < workKey.Count; num25++) { if (results[num25] != null) { long num26 = workKey[num25]; int cx = VoxelVolume.UnpackSigned(num26 >> 42); int cy = VoxelVolume.UnpackSigned(num26 >> 21); int cz = VoxelVolume.UnpackSigned(num26); workVolume[num25].AddBandChunk(cx, cy, cz, results[num25]); workVolume[num25].chunks[num26].srcTris = workTris[num25]; } } foreach (VoxelVolume item2 in list) { item2.SortColumns(); } return list; } private static void ComputePseudonormals(SourceMesh src) { //IL_0030: 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_00a8: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00c5: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00f1: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_017a: 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) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b1: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) Vector3[] verts = src.verts; int[] indices = src.indices; int num = indices.Length / 3; Dictionary dictionary = new Dictionary(verts.Length); int[] array = new int[verts.Length]; for (int i = 0; i < verts.Length; i++) { if (!dictionary.TryGetValue(verts[i], out var value)) { value = dictionary.Count; dictionary[verts[i]] = value; } array[i] = value; } Vector3[] array2 = (Vector3[])(object)new Vector3[dictionary.Count]; Dictionary dictionary2 = new Dictionary(num * 2); for (int j = 0; j < num; j++) { int num2 = indices[j * 3]; int num3 = indices[j * 3 + 1]; int num4 = indices[j * 3 + 2]; Vector3 val = verts[num2]; Vector3 val2 = verts[num3]; Vector3 val3 = verts[num4]; Vector3 val4 = Vector3.Cross(val2 - val, val3 - val); float magnitude = ((Vector3)(ref val4)).magnitude; if (!(magnitude < 1E-12f)) { Vector3 val5 = val4 / magnitude; int num5 = array[num2]; int num6 = array[num3]; int num7 = array[num4]; ref Vector3 reference = ref array2[num5]; reference += val5 * Corner(val2 - val, val3 - val); ref Vector3 reference2 = ref array2[num6]; reference2 += val5 * Corner(val - val2, val3 - val2); ref Vector3 reference3 = ref array2[num7]; reference3 += val5 * Corner(val - val3, val2 - val3); long key = EdgeKey(num5, num6); long key2 = EdgeKey(num6, num7); long key3 = EdgeKey(num7, num5); dictionary2.TryGetValue(key, out var value2); dictionary2[key] = value2 + val5; dictionary2.TryGetValue(key2, out var value3); dictionary2[key2] = value3 + val5; dictionary2.TryGetValue(key3, out var value4); dictionary2[key3] = value4 + val5; } } src.pnVertA = (Vector3[])(object)new Vector3[num]; src.pnVertB = (Vector3[])(object)new Vector3[num]; src.pnVertC = (Vector3[])(object)new Vector3[num]; src.pnEdgeAB = (Vector3[])(object)new Vector3[num]; src.pnEdgeBC = (Vector3[])(object)new Vector3[num]; src.pnEdgeCA = (Vector3[])(object)new Vector3[num]; for (int k = 0; k < num; k++) { int num8 = array[indices[k * 3]]; int num9 = array[indices[k * 3 + 1]]; int num10 = array[indices[k * 3 + 2]]; src.pnVertA[k] = array2[num8]; src.pnVertB[k] = array2[num9]; src.pnVertC[k] = array2[num10]; dictionary2.TryGetValue(EdgeKey(num8, num9), out src.pnEdgeAB[k]); dictionary2.TryGetValue(EdgeKey(num9, num10), out src.pnEdgeBC[k]); dictionary2.TryGetValue(EdgeKey(num10, num8), out src.pnEdgeCA[k]); } static float Corner(Vector3 u, Vector3 v) { //IL_0026: 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) float magnitude2 = ((Vector3)(ref u)).magnitude; float magnitude3 = ((Vector3)(ref v)).magnitude; if (magnitude2 < 1E-09f || magnitude3 < 1E-09f) { return 0f; } return Mathf.Acos(Mathf.Clamp(Vector3.Dot(u, v) / (magnitude2 * magnitude3), -1f, 1f)); } static long EdgeKey(int a, int b) { if (a >= b) { return ((long)b << 32) | (uint)a; } return ((long)a << 32) | (uint)b; } } private static int CountBandChunks(List sources, float vs) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0083: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00a1: 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_00a5: 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_00b1: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) float num = 16f * vs; float num2 = 2f * vs; int num3 = 0; HashSet hashSet = new HashSet(); for (int i = 0; i < sources.Count; i++) { hashSet.Clear(); SourceMesh sourceMesh = sources[i]; for (int j = 0; j < sourceMesh.indices.Length; j += 3) { Vector3 val = sourceMesh.verts[sourceMesh.indices[j]]; Vector3 val2 = sourceMesh.verts[sourceMesh.indices[j + 1]]; Vector3 val3 = sourceMesh.verts[sourceMesh.indices[j + 2]]; Vector3 val4 = Vector3.Min(val, Vector3.Min(val2, val3)) - Vector3.one * num2; Vector3 val5 = Vector3.Max(val, Vector3.Max(val2, val3)) + Vector3.one * num2; int num4 = Mathf.FloorToInt(val4.x / num); int num5 = Mathf.FloorToInt(val5.x / num); int num6 = Mathf.FloorToInt(val4.y / num); int num7 = Mathf.FloorToInt(val5.y / num); int num8 = Mathf.FloorToInt(val4.z / num); int num9 = Mathf.FloorToInt(val5.z / num); if ((long)(num5 - num4 + 1) * (long)(num7 - num6 + 1) * (num9 - num8 + 1) > 8192) { continue; } for (int k = num4; k <= num5; k++) { for (int l = num6; l <= num7; l++) { for (int m = num8; m <= num9; m++) { hashSet.Add(VoxelVolume.PackKey(k, l, m)); } } } } num3 += hashSet.Count; } return num3; } private static byte[] BuildChunkDensity(VoxelVolume vol, SourceMesh src, int[] tris, long key) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_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_0124: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_01c1: 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_01c5: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0371: 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_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038a: 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_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: 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) int num = VoxelVolume.UnpackSigned(key >> 42); int num2 = VoxelVolume.UnpackSigned(key >> 21); int num3 = VoxelVolume.UnpackSigned(key); float voxelSize = vol.voxelSize; int num4 = 16; int triCount = tris.Length; Vector3[] fa = (Vector3[])(object)new Vector3[triCount]; Vector3[] fb = (Vector3[])(object)new Vector3[triCount]; Vector3[] fc = (Vector3[])(object)new Vector3[triCount]; Vector3[] fn = (Vector3[])(object)new Vector3[triCount]; Vector3[] fsc = (Vector3[])(object)new Vector3[triCount]; float[] fsr = new float[triCount]; for (int i = 0; i < triCount; i++) { int num5 = tris[i] * 3; Vector3 val = src.verts[src.indices[num5]]; Vector3 val2 = src.verts[src.indices[num5 + 1]]; Vector3 val3 = src.verts[src.indices[num5 + 2]]; fa[i] = val; fb[i] = val2; fc[i] = val3; fn[i] = Vector3.Cross(val2 - val, val3 - val); Vector3 val4 = (val + val2 + val3) / 3f; fsc[i] = val4; float[] array = fsr; int num6 = i; Vector3 val5 = val - val4; float sqrMagnitude = ((Vector3)(ref val5)).sqrMagnitude; val5 = val2 - val4; float sqrMagnitude2 = ((Vector3)(ref val5)).sqrMagnitude; val5 = val3 - val4; array[num6] = Mathf.Sqrt(Mathf.Max(sqrMagnitude, Mathf.Max(sqrMagnitude2, ((Vector3)(ref val5)).sqrMagnitude))); } float[] array2 = new float[512]; Vector3 p = default(Vector3); for (int j = 0; j < 8; j++) { for (int k = 0; k < 8; k++) { for (int l = 0; l < 8; l++) { ((Vector3)(ref p))..ctor(((float)((num << 4) + l * 2) + 0.5f) * voxelSize, ((float)((num2 << 4) + j * 2) + 0.5f) * voxelSize, ((float)((num3 << 4) + k * 2) + 0.5f) * voxelSize); array2[(j * 8 + k) * 8 + l] = ExactSigned(p); } } } float num7 = 2.25f * voxelSize; float num8 = 3.25f * voxelSize; bool openShell = vol.openShell; Bounds meshBoundsWS = vol.meshBoundsWS; ((Bounds)(ref meshBoundsWS)).Expand(2f * voxelSize); Vector3 min = ((Bounds)(ref meshBoundsWS)).min; Vector3 max = ((Bounds)(ref meshBoundsWS)).max; byte[] array3 = new byte[num4 * num4 * num4]; Vector3 val6 = default(Vector3); for (int m = 0; m < num4; m++) { for (int n = 0; n < num4; n++) { for (int num9 = 0; num9 < num4; num9++) { float num10 = array2[((m >> 1) * 8 + (n >> 1)) * 8 + (num9 >> 1)]; byte b; if (openShell) { ((Vector3)(ref val6))..ctor(((float)((num << 4) + num9) + 0.5f) * voxelSize, ((float)((num2 << 4) + m) + 0.5f) * voxelSize, ((float)((num3 << 4) + n) + 0.5f) * voxelSize); bool flag = val6.x >= min.x && val6.x <= max.x && val6.y >= min.y && val6.y <= max.y && val6.z >= min.z && val6.z <= max.z; if (num10 > num8) { b = 0; } else if (num10 < 0f - num7 && flag) { b = byte.MaxValue; } else if (num10 < 0f - (4f + num7)) { b = 0; } else { float num11 = ExactSigned(val6); float num12 = (flag ? float.MaxValue : (0.5f + (num11 + 4f) / voxelSize)); b = (byte)(Mathf.Clamp01(Mathf.Min(0.5f - num11 / voxelSize, num12)) * 255f); } } else if (num10 > num7) { b = 0; } else if (num10 < 0f - num7) { b = byte.MaxValue; } else { float num13 = ExactSigned(new Vector3(((float)((num << 4) + num9) + 0.5f) * voxelSize, ((float)((num2 << 4) + m) + 0.5f) * voxelSize, ((float)((num3 << 4) + n) + 0.5f) * voxelSize)); b = (byte)(Mathf.Clamp01(0.5f - num13 / voxelSize) * 255f); } array3[VoxelVolume.VoxelIndex(num9, m, n)] = b; } } } return array3; float ExactSigned(Vector3 val7) { //IL_008b: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_0033: 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_00ea: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: 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_01b1: 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_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_01d7: Unknown result type (might be due to invalid IL or missing references) float num14 = float.MaxValue; float num15 = float.MaxValue; int num16 = -1; for (int num17 = 0; num17 < triCount; num17++) { if (num16 >= 0) { float num18 = val7.x - fsc[num17].x; float num19 = val7.y - fsc[num17].y; float num20 = val7.z - fsc[num17].z; float num21 = fsr[num17] + num15; if (num18 * num18 + num19 * num19 + num20 * num20 > num21 * num21) { continue; } } float num22 = PointTriDistSq(val7, fa[num17], fb[num17], fc[num17]); if (num22 < num14) { num14 = num22; num15 = Mathf.Sqrt(num22); num16 = num17; } } if (num16 < 0) { return float.MaxValue; } PointTriClosest(val7, fa[num16], fb[num16], fc[num16], out var cp, out var feature); int num23 = tris[num16]; Vector3 val8 = (Vector3)(feature switch { 0 => src.pnVertA[num23], 1 => src.pnVertB[num23], 2 => src.pnVertC[num23], 3 => src.pnEdgeAB[num23], 4 => src.pnEdgeBC[num23], 5 => src.pnEdgeCA[num23], _ => fn[num16], }); if (!(Vector3.Dot(val7 - cp, val8) >= 0f)) { return 0f - num15; } return num15; } } private static float PointTriDistSq(Vector3 p, Vector3 a, Vector3 b, Vector3 c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_007e: 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_0101: 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_00b6: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00ca: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; Vector3 val2 = c - a; Vector3 val3 = p - a; float num = Vector3.Dot(val, val3); float num2 = Vector3.Dot(val2, val3); Vector3 val4; if (num <= 0f && num2 <= 0f) { val4 = p - a; return ((Vector3)(ref val4)).sqrMagnitude; } Vector3 val5 = p - b; float num3 = Vector3.Dot(val, val5); float num4 = Vector3.Dot(val2, val5); if (num3 >= 0f && num4 <= num3) { val4 = p - b; return ((Vector3)(ref val4)).sqrMagnitude; } float num5 = num * num4 - num3 * num2; if (num5 <= 0f && num >= 0f && num3 <= 0f) { float num6 = num / (num - num3); val4 = p - (a + val * num6); return ((Vector3)(ref val4)).sqrMagnitude; } Vector3 val6 = p - c; float num7 = Vector3.Dot(val, val6); float num8 = Vector3.Dot(val2, val6); if (num8 >= 0f && num7 <= num8) { val4 = p - c; return ((Vector3)(ref val4)).sqrMagnitude; } float num9 = num7 * num2 - num * num8; if (num9 <= 0f && num2 >= 0f && num8 <= 0f) { float num10 = num2 / (num2 - num8); val4 = p - (a + val2 * num10); return ((Vector3)(ref val4)).sqrMagnitude; } float num11 = num3 * num8 - num7 * num4; if (num11 <= 0f && num4 - num3 >= 0f && num7 - num8 >= 0f) { float num12 = (num4 - num3) / (num4 - num3 + (num7 - num8)); val4 = p - (b + (c - b) * num12); return ((Vector3)(ref val4)).sqrMagnitude; } float num13 = 1f / (num11 + num9 + num5); float num14 = num9 * num13; float num15 = num5 * num13; val4 = p - (a + val * num14 + val2 * num15); return ((Vector3)(ref val4)).sqrMagnitude; } private static float PointTriClosest(Vector3 p, Vector3 a, Vector3 b, Vector3 c, out Vector3 cp, out int feature) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0107: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0136: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_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) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: 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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_0194: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; Vector3 val2 = c - a; Vector3 val3 = p - a; float num = Vector3.Dot(val, val3); float num2 = Vector3.Dot(val2, val3); Vector3 val4; if (num <= 0f && num2 <= 0f) { cp = a; feature = 0; val4 = p - a; return ((Vector3)(ref val4)).sqrMagnitude; } Vector3 val5 = p - b; float num3 = Vector3.Dot(val, val5); float num4 = Vector3.Dot(val2, val5); if (num3 >= 0f && num4 <= num3) { cp = b; feature = 1; val4 = p - b; return ((Vector3)(ref val4)).sqrMagnitude; } float num5 = num * num4 - num3 * num2; if (num5 <= 0f && num >= 0f && num3 <= 0f) { float num6 = num / (num - num3); cp = a + val * num6; feature = 3; val4 = p - cp; return ((Vector3)(ref val4)).sqrMagnitude; } Vector3 val6 = p - c; float num7 = Vector3.Dot(val, val6); float num8 = Vector3.Dot(val2, val6); if (num8 >= 0f && num7 <= num8) { cp = c; feature = 2; val4 = p - c; return ((Vector3)(ref val4)).sqrMagnitude; } float num9 = num7 * num2 - num * num8; if (num9 <= 0f && num2 >= 0f && num8 <= 0f) { float num10 = num2 / (num2 - num8); cp = a + val2 * num10; feature = 5; val4 = p - cp; return ((Vector3)(ref val4)).sqrMagnitude; } float num11 = num3 * num8 - num7 * num4; if (num11 <= 0f && num4 - num3 >= 0f && num7 - num8 >= 0f) { float num12 = (num4 - num3) / (num4 - num3 + (num7 - num8)); cp = b + (c - b) * num12; feature = 4; val4 = p - cp; return ((Vector3)(ref val4)).sqrMagnitude; } float num13 = 1f / (num11 + num9 + num5); float num14 = num9 * num13; float num15 = num5 * num13; cp = a + val * num14 + val2 * num15; feature = 6; val4 = p - cp; return ((Vector3)(ref val4)).sqrMagnitude; } } internal static class NodeGraphAdjuster { private struct PendingAdjust { public Vector3 pos; public float r; public float due; } private const float MaxNodeDrop = 4f; private const float SettleDelay = 0.75f; private static readonly FieldInfo NodesField = typeof(NodeGraph).GetField("nodes", BindingFlags.Instance | BindingFlags.NonPublic); private static NodeGraph graph; private static Node[] nodes; private static Node[] backup; private static readonly List queue = new List(); public static void OnStageStart() { graph = null; nodes = null; backup = null; queue.Clear(); } public static void Restore() { try { if (nodes != null && backup != null && nodes.Length == backup.Length) { Array.Copy(backup, nodes, backup.Length); } } catch (Exception ex) { ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] node graph restore failed: " + ex.Message)); } graph = null; nodes = null; backup = null; queue.Clear(); } public static void QueueAdjust(Vector3 pos, float r) { //IL_0017: 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) if (NetworkServer.active) { queue.Add(new PendingAdjust { pos = pos, r = r, due = Time.time + 0.75f }); } } public static void Tick() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) for (int num = queue.Count - 1; num >= 0; num--) { if (!(Time.time < queue[num].due)) { PendingAdjust pendingAdjust = queue[num]; queue.RemoveAt(num); try { Process(pendingAdjust.pos, pendingAdjust.r); } catch (Exception ex) { ScorchedVoxelsPlugin.Log.LogWarning((object)("[ScorchedVoxels] node adjust failed: " + ex.Message)); } } } } private static void Process(Vector3 center, float r) { //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_007e: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e9: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) if (nodes == null) { SceneInfo instance = SceneInfo.instance; if ((Object)(object)instance == (Object)null || NodesField == null) { return; } graph = instance.groundNodes; if ((Object)(object)graph == (Object)null) { return; } nodes = NodesField.GetValue(graph) as Node[]; if (nodes == null) { return; } backup = (Node[])nodes.Clone(); } LayerIndex world = LayerIndex.world; int num = LayerMask.op_Implicit(((LayerIndex)(ref world)).mask); float num2 = r + 1.5f; int num3 = 0; int num4 = 0; RaycastHit val = default(RaycastHit); for (int i = 0; i < nodes.Length; i++) { ref Node reference = ref nodes[i]; Vector3 position = reference.position; float num5 = position.x - center.x; float num6 = position.z - center.z; if (num5 * num5 + num6 * num6 > num2 * num2 || Mathf.Abs(position.y - center.y) > r + 4f + 2f) { continue; } float num7 = Mathf.Max(position.y, center.y + r) + 0.75f; float num8 = num7 - position.y + 4f + 1.5f; if (Physics.Raycast(new Vector3(position.x, num7, position.z), Vector3.down, ref val, num8, num, (QueryTriggerInteraction)1)) { float num9 = position.y - ((RaycastHit)(ref val)).point.y; if (!(num9 <= 0.2f)) { if (num9 <= 4f) { reference.position = new Vector3(position.x, ((RaycastHit)(ref val)).point.y, position.z); num3++; } else { reference.forbiddenHulls = (HullMask)7; num4++; } } } else { reference.forbiddenHulls = (HullMask)7; num4++; } } if (ScorchedVoxelsPlugin.VerboseLogging.Value && (num3 > 0 || num4 > 0)) { ScorchedVoxelsPlugin.Log.LogInfo((object)$"[ScorchedVoxels] nodes: {num3} moved into crater, {num4} forbidden"); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Xerdi.ScorchedVoxels", "ScorchedVoxels", "0.20.69")] public class ScorchedVoxelsPlugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static Action <0>__OnStageStart; public static UnityAction <1>__Toggle; public static UnityAction <2>__ToggleBackgrounds; } public const string Guid = "com.Xerdi.ScorchedVoxels"; public const string ModName = "ScorchedVoxels"; public const string Version = "0.20.69"; internal static ManualLogSource Log; internal static ConfigEntry Enabled; internal static ConfigEntry VoxelSize; internal static ConfigEntry RadiusMultiplier; internal static ConfigEntry MinBlastRadius; internal static ConfigEntry MaxCarveRadius; internal static ConfigEntry ExcludedNames; internal static ConfigEntry MinTerrainSize; internal static ConfigEntry LodDistance; internal static ConfigEntry VerboseLogging; internal static ConfigEntry LogTeleporterAssets; internal static ConfigEntry MemoryReport; internal static ConfigEntry DebrisEnabled; internal static ConfigEntry DebrisMaxPieces; internal static ConfigEntry TitlesEnabled; internal static ConfigEntry TitleChance; internal static ConfigEntry RevealSounds; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_02d7: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Master switch. When off, stages are left vanilla."); VoxelSize = ((BaseUnityPlugin)this).Config.Bind("Voxels", "VoxelSize", 0.5f, new ConfigDescription("PREFERRED voxel edge length in meters. Smaller = finer terrain and craters but much more memory and longer stage conversion (cost scales ~1/size^2). Maps too large for this size automatically get coarser voxels until they fit — conversion never fails on map size.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); RadiusMultiplier = ((BaseUnityPlugin)this).Config.Bind("Carving", "RadiusMultiplier", 0.45f, new ConfigDescription("Carve radius = blast radius * this value.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 2f), Array.Empty())); MinBlastRadius = ((BaseUnityPlugin)this).Config.Bind("Carving", "MinBlastRadius", 0.5f, "Blasts smaller than this (meters) do not carve."); MaxCarveRadius = ((BaseUnityPlugin)this).Config.Bind("Carving", "MaxCarveRadius", 25f, "Upper limit on carve radius (meters)."); ExcludedNames = ((BaseUnityPlugin)this).Config.Bind("TerrainSelection", "ExcludedNames", "Water", "Comma-separated fragments (case-insensitive). World meshes whose OBJECT, MATERIAL, or SHADER name contains any of these are not converted (left vanilla)."); MinTerrainSize = ((BaseUnityPlugin)this).Config.Bind("TerrainSelection", "MinTerrainSize", 15f, new ConfigDescription("World meshes whose largest bounding-box dimension is at or below this (meters) are treated as props/platforms — e.g. the teleporter pad — and left as vanilla mesh; larger meshes become voxel terrain. Tune to just above the teleporter pad's size. 0 converts everything regardless of size (may re-introduce the teleporter-pad box). NOTE: maps with small modular terrain pieces may need this lowered.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); LodDistance = ((BaseUnityPlugin)this).Config.Bind("Performance", "LodDistance", 90f, new ConfigDescription("Beyond this distance (meters) a 32m block of terrain renders as ONE quarter-detail mesh instead of 8 full-detail chunks; beyond 2.5x this distance a 64m block renders as one sixteenth-detail mesh — far fewer draw calls and triangles. Colliders always stay full detail. 0 disables LOD.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); VerboseLogging = ((BaseUnityPlugin)this).Config.Bind("Debug", "VerboseLogging", false, "Log conversion and carve activity. Console writes are slow — leave off unless debugging."); LogTeleporterAssets = ((BaseUnityPlugin)this).Config.Bind("Debug", "LogTeleporterAssets", false, "DIAGNOSTIC, one-shot per stage: logs the ENTIRE teleporter hierarchy (every child object, its mesh name, and bounding-box size in meters). Hundreds of log lines per stage — leave off unless hunting a teleporter asset."); MemoryReport = ((BaseUnityPlugin)this).Config.Bind("Debug", "MemoryReport", false, "DIAGNOSTIC, one-shot per stage: after a stage finishes converting, logs a breakdown of the mod's RAM use (chunk meshes, colliders, density, retained source meshes, winding fields) to find memory hogs. A dozen log lines per stage — leave off unless investigating memory."); DebrisEnabled = ((BaseUnityPlugin)this).Config.Bind("Effects", "DebrisEnabled", true, "Visual-only rock chunks that fly out of carves and fall through the map. No colliders, no physics — a handful of transform updates per frame."); DebrisMaxPieces = ((BaseUnityPlugin)this).Config.Bind("Effects", "DebrisMaxPieces", 30, new ConfigDescription("Hard cap on debris pieces alive at once; new bursts recycle the oldest pieces past this. Each piece costs one raycast per frame until its single bounce.", (AcceptableValueBase)(object)new AcceptableValueRange(4, 30), Array.Empty())); TitlesEnabled = ((BaseUnityPlugin)this).Config.Bind("Titles", "TitlesEnabled", true, "Every finished level rolls a chance to unlock a cosmetic title (random pick from the ones you don't own yet). Titles persist per user profile and show ONLY on the loading-screen player cards."); TitleChance = ((BaseUnityPlugin)this).Config.Bind("Titles", "TitleChance", 0.05f, new ConfigDescription("Chance per finished level to unlock a title, and (separate independent roll) a card background pattern. Rolled locally per player — purely cosmetic, so it doesn't need to match between machines.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); RevealSounds = ((BaseUnityPlugin)this).Config.Bind("Titles", "RevealSounds", true, "Sound effects for the loading-screen prize reel (spin-up shutter, per-tile tick, unlock chime), borrowed from the game's own UI soundbank. Always ONE shared sound source — four simultaneous winners are exactly as loud as one."); if (ScorchedEarthIsActive()) { Log.LogError((object)"ScorchedVoxels: ScorchedEarth is installed and enabled — ScorchedVoxels DISABLED itself (both mods carving the same explosions corrupts terrain). Disable one of the two."); return; } new Harmony("com.Xerdi.ScorchedVoxels").PatchAll(typeof(ScorchedVoxelsPlugin).Assembly); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); Stage.onStageStartGlobal += OnStageStart; Run.onRunDestroyGlobal += delegate { UserLifetimeStats.OnRunEnd(); VoxelTerrainManager.OnRunDestroy(); CarveStats.ResetRun(); TitleSystem.OnRunEnd(); }; if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { try { SetupRiskOfOptions(); } catch (Exception ex) { Log.LogWarning((object)("ScorchedVoxels: Risk of Options integration failed (menu skipped): " + ex.Message)); } } Log.LogInfo((object)"ScorchedVoxels 0.20.69 loaded."); } private static bool ScorchedEarthIsActive() { if (!Chainloader.PluginInfos.TryGetValue("com.Xerdi.ScorchedEarth", out var value)) { return false; } try { if ((((object)value.Instance)?.GetType().GetField("Enabled", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null) is ConfigEntry val) { return val.Value; } } catch { } return true; } [MethodImpl(MethodImplOptions.NoInlining)] private static void SetupRiskOfOptions() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0049: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_012c: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0193: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01da: 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_01e5: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown ModSettingsManager.SetModDescription("Destructible voxel terrain — explosions carve real craters. Terrain/voxel settings apply from the NEXT stage; in multiplayer the host's geometry settings win."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Enabled)); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(VoxelSize, new StepSliderConfig { min = 0.5f, max = 2f, increment = 0.05f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(RadiusMultiplier, new StepSliderConfig { min = 0.05f, max = 2f, increment = 0.05f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(MinBlastRadius, new StepSliderConfig { min = 0f, max = 10f, increment = 0.25f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(MaxCarveRadius, new StepSliderConfig { min = 1f, max = 60f, increment = 1f })); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(ExcludedNames)); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(MinTerrainSize, new StepSliderConfig { min = 0f, max = 100f, increment = 1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LodDistance, new StepSliderConfig { min = 0f, max = 500f, increment = 5f })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(DebrisEnabled)); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(DebrisMaxPieces, new IntSliderConfig { min = 4, max = 30 })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(TitlesEnabled)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RevealSounds)); object obj = <>O.<1>__Toggle; if (obj == null) { UnityAction val = TitlePickerUI.Toggle; <>O.<1>__Toggle = val; obj = (object)val; } ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Choose Title", "Titles", "Pick which earned title your loading-screen card wears, right here in this panel. Earned titles are full brightness, locked ones are dimmed, the worn one is framed.", "Browse", (UnityAction)obj)); object obj2 = <>O.<2>__ToggleBackgrounds; if (obj2 == null) { UnityAction val2 = TitlePickerUI.ToggleBackgrounds; <>O.<2>__ToggleBackgrounds = val2; obj2 = (object)val2; } ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Choose Card Background", "Titles", "Pick your loading-screen calling card, right here in this panel: every country's flag and every pride flag is always available, pattern backgrounds unlock via the level lottery.", "Browse", (UnityAction)obj2)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(VerboseLogging)); } private static void OnStageStart(Stage stage) { try { VoxelTerrainManager.OnStageStart(stage); } catch (Exception arg) { Log.LogError((object)$"Stage conversion failed: {arg}"); } } private void Update() { MainThread.Pump(); VoxelTerrainManager.Tick(); } } internal static class MainThread { private static readonly ConcurrentQueue queue = new ConcurrentQueue(); public static void Post(Action action) { queue.Enqueue(action); } public static void Pump() { Action result; while (queue.TryDequeue(out result)) { try { result(); } catch (Exception arg) { ScorchedVoxelsPlugin.Log.LogError((object)$"Main-thread callback failed: {arg}"); } } } } [HarmonyPatch(typeof(BlastAttack), "Fire")] internal static class BlastAttackFirePatch { private static void Postfix(BlastAttack __instance) { //IL_0052: 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) try { if (ScorchedVoxelsPlugin.Enabled.Value && NetworkServer.active) { float radius = __instance.radius; if (!(radius < ScorchedVoxelsPlugin.MinBlastRadius.Value)) { float num = Mathf.Clamp(radius * ScorchedVoxelsPlugin.RadiusMultiplier.Value, 0.9f, ScorchedVoxelsPlugin.MaxCarveRadius.Value); VoxelTerrainManager.RequestCarve(__instance.position, num, ResolveAttackerUserId(__instance.attacker)); NetMessageExtensions.Send((INetMessage)(object)new CarveMessage(__instance.position, num), (NetworkDestination)1); } } } catch (Exception arg) { ScorchedVoxelsPlugin.Log.LogError((object)$"OnBlast failed: {arg}"); } } private static uint ResolveAttackerUserId(GameObject attacker) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attacker == (Object)null) { return 0u; } CharacterBody component = attacker.GetComponent(); CharacterMaster val = (((Object)(object)component != (Object)null) ? component.master : null); for (int i = 0; i < 4; i++) { if (!((Object)(object)val != (Object)null)) { break; } if ((Object)(object)val.minionOwnership == (Object)null) { break; } if ((Object)(object)val.minionOwnership.ownerMaster == (Object)null) { break; } val = val.minionOwnership.ownerMaster; } PlayerCharacterMasterController val2 = (((Object)(object)val != (Object)null) ? val.playerCharacterMasterController : null); NetworkUser val3 = (((Object)(object)val2 != (Object)null) ? val2.networkUser : null); if (!((Object)(object)val3 != (Object)null)) { return 0u; } NetworkInstanceId netId = ((NetworkBehaviour)val3).netId; return ((NetworkInstanceId)(ref netId)).Value; } } internal static class SurfaceNets { private const int N = 16; private const int S = 18; private const int C = 17; [ThreadStatic] private static float[] samples; [ThreadStatic] private static int[] cellVert; [ThreadStatic] private static Dictionary edgeUse; [ThreadStatic] private static Dictionary skirtVert; private static readonly int[,] corner = new int[8, 3] { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 1, 1, 0 }, { 0, 0, 1 }, { 1, 0, 1 }, { 0, 1, 1 }, { 1, 1, 1 } }; private static readonly int[,] cellEdge = new int[12, 2] { { 0, 1 }, { 2, 3 }, { 4, 5 }, { 6, 7 }, { 0, 2 }, { 1, 3 }, { 4, 6 }, { 5, 7 }, { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 } }; private static int SIdx(int x, int y, int z) { return ((y + 1) * 18 + (z + 1)) * 18 + (x + 1); } private static int CIdx(int x, int y, int z) { return ((y + 1) * 17 + (z + 1)) * 17 + (x + 1); } public static bool Build(VoxelVolume volume, int ox, int oy, int oz, int step, byte[] fastDensity, List rivals, List positions, List normals, List indices, bool skirts = true, bool dilate = true) { //IL_0241: 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_031e: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: 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_03e9: 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_040f: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) positions.Clear(); normals.Clear(); indices.Clear(); if (samples == null) { samples = new float[5832]; } if (cellVert == null) { cellVert = new int[4913]; } float num = volume.voxelSize * (float)step; long lastKey = long.MinValue; VoxelChunk lastChunk = null; byte lastSolid = 0; for (int i = -1; i <= 16; i++) { for (int j = -1; j <= 16; j++) { for (int k = -1; k <= 16; k++) { byte b; if (step == 1) { b = ((fastDensity != null && (uint)k < 16u && (uint)i < 16u && (uint)j < 16u) ? fastDensity[VoxelVolume.VoxelIndex(k, i, j)] : volume.SampleCached(ox + k, oy + i, oz + j, ref lastKey, ref lastChunk, ref lastSolid)); } else { int num2 = ox + k * step; int num3 = oy + i * step; int num4 = oz + j * step; int num5 = 0; int num6 = 0; for (int l = 0; l < step; l++) { for (int m = 0; m < step; m++) { for (int n = 0; n < step; n++) { int num7 = volume.SampleCached(num2 + n, num3 + l, num4 + m, ref lastKey, ref lastChunk, ref lastSolid); if (num7 > num5) { num5 = num7; } num6 += num7; } } } b = (dilate ? ((byte)num5) : ((byte)(num6 / (step * step * step)))); } samples[SIdx(k, i, j)] = (int)b; } } } for (int num8 = 0; num8 < cellVert.Length; num8++) { cellVert[num8] = -1; } Vector3 item = default(Vector3); Vector3 val3 = default(Vector3); for (int num9 = -1; num9 < 16; num9++) { for (int num10 = -1; num10 < 16; num10++) { for (int num11 = -1; num11 < 16; num11++) { int num12 = 0; for (int num13 = 0; num13 < 8; num13++) { if (samples[SIdx(num11 + corner[num13, 0], num9 + corner[num13, 1], num10 + corner[num13, 2])] >= 127.5f) { num12 |= 1 << num13; } } if (num12 == 0 || num12 == 255) { continue; } Vector3 val = Vector3.zero; int num14 = 0; for (int num15 = 0; num15 < 12; num15++) { int num16 = cellEdge[num15, 0]; int num17 = cellEdge[num15, 1]; bool num18 = (num12 & (1 << num16)) != 0; bool flag = (num12 & (1 << num17)) != 0; if (num18 != flag) { float num19 = samples[SIdx(num11 + corner[num16, 0], num9 + corner[num16, 1], num10 + corner[num16, 2])]; float num20 = samples[SIdx(num11 + corner[num17, 0], num9 + corner[num17, 1], num10 + corner[num17, 2])]; float num21 = (127.5f - num19) / (num20 - num19); val += new Vector3((float)corner[num16, 0] + (float)(corner[num17, 0] - corner[num16, 0]) * num21, (float)corner[num16, 1] + (float)(corner[num17, 1] - corner[num16, 1]) * num21, (float)corner[num16, 2] + (float)(corner[num17, 2] - corner[num16, 2]) * num21); num14++; } } if (num14 != 0) { Vector3 val2 = val / (float)num14; ((Vector3)(ref item))..ctor(((float)num11 + 0.5f + val2.x) * num, ((float)num9 + 0.5f + val2.y) * num, ((float)num10 + 0.5f + val2.z) * num); ((Vector3)(ref val3))..ctor(SampleFace(num11, num9, num10, 0, positive: true) - SampleFace(num11, num9, num10, 0, positive: false), SampleFace(num11, num9, num10, 1, positive: true) - SampleFace(num11, num9, num10, 1, positive: false), SampleFace(num11, num9, num10, 2, positive: true) - SampleFace(num11, num9, num10, 2, positive: false)); Vector3 item2 = ((((Vector3)(ref val3)).sqrMagnitude > 1E-12f) ? (-((Vector3)(ref val3)).normalized) : Vector3.up); cellVert[CIdx(num11, num9, num10)] = positions.Count; positions.Add(item); normals.Add(item2); } } } } if (positions.Count == 0) { return false; } for (int num22 = 0; num22 < 16; num22++) { for (int num23 = 0; num23 < 16; num23++) { for (int num24 = 0; num24 < 16; num24++) { bool flag2 = samples[SIdx(num24, num22, num23)] >= 127.5f; int num25 = ox + num24 * step; int num26 = oy + num22 * step; int num27 = oz + num23 * step; if (samples[SIdx(num24 + 1, num22, num23)] >= 127.5f != flag2 && !RivalCrosses(rivals, num25, num26, num27, num25 + step, num26, num27)) { EmitQuad(indices, cellVert[CIdx(num24, num22 - 1, num23 - 1)], cellVert[CIdx(num24, num22, num23 - 1)], cellVert[CIdx(num24, num22, num23)], cellVert[CIdx(num24, num22 - 1, num23)], flag2); } if (samples[SIdx(num24, num22 + 1, num23)] >= 127.5f != flag2 && !RivalCrosses(rivals, num25, num26, num27, num25, num26 + step, num27)) { EmitQuad(indices, cellVert[CIdx(num24 - 1, num22, num23 - 1)], cellVert[CIdx(num24 - 1, num22, num23)], cellVert[CIdx(num24, num22, num23)], cellVert[CIdx(num24, num22, num23 - 1)], flag2); } if (samples[SIdx(num24, num22, num23 + 1)] >= 127.5f != flag2 && !RivalCrosses(rivals, num25, num26, num27, num25, num26, num27 + step)) { EmitQuad(indices, cellVert[CIdx(num24 - 1, num22 - 1, num23)], cellVert[CIdx(num24, num22 - 1, num23)], cellVert[CIdx(num24, num22, num23)], cellVert[CIdx(num24 - 1, num22, num23)], flag2); } } } } if (indices.Count == 0) { return false; } if (step > 1 && skirts) { AddSkirts(positions, normals, indices, volume.openShell ? num : Mathf.Max(10f, 1.5f * num)); } return true; } private static void AddSkirts(List positions, List normals, List indices, float depth) { if (edgeUse == null) { edgeUse = new Dictionary(); } if (skirtVert == null) { skirtVert = new Dictionary(); } edgeUse.Clear(); skirtVert.Clear(); int count = indices.Count; for (int i = 0; i < count; i += 3) { Bump(EKey(indices[i], indices[i + 1])); Bump(EKey(indices[i + 1], indices[i + 2])); Bump(EKey(indices[i + 2], indices[i])); } foreach (KeyValuePair item3 in edgeUse) { if (item3.Value == 1) { int num = (int)(item3.Key >> 32); int num2 = (int)(item3.Key & 0xFFFFFFFFu); int item = Sunk(num); int item2 = Sunk(num2); indices.Add(num); indices.Add(num2); indices.Add(item2); indices.Add(num); indices.Add(item2); indices.Add(item); indices.Add(num2); indices.Add(num); indices.Add(item); indices.Add(num2); indices.Add(item); indices.Add(item2); } } static void Bump(long k) { edgeUse.TryGetValue(k, out var value); edgeUse[k] = value + 1; } static long EKey(int a, int b) { if (a >= b) { return ((long)b << 32) | (uint)a; } return ((long)a << 32) | (uint)b; } int Sunk(int num3) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (skirtVert.TryGetValue(num3, out var value)) { return value; } value = positions.Count; positions.Add(positions[num3] - normals[num3] * depth); normals.Add(normals[num3]); skirtVert[num3] = value; return value; } } private static bool RivalCrosses(List rivals, int ax, int ay, int az, int bx, int by, int bz) { if (rivals == null) { return false; } for (int i = 0; i < rivals.Count; i++) { VoxelVolume voxelVolume = rivals[i]; if ((float)(int)voxelVolume.Sample(ax, ay, az) >= 127.5f != (float)(int)voxelVolume.Sample(bx, by, bz) >= 127.5f) { return true; } } return false; } private static float SampleFace(int x, int y, int z, int axis, bool positive) { float num = 0f; for (int i = 0; i < 8; i++) { if (axis switch { 1 => corner[i, 1], 0 => corner[i, 0], _ => corner[i, 2], } == 1 == positive) { num += samples[SIdx(x + corner[i, 0], y + corner[i, 1], z + corner[i, 2])]; } } return num * 0.25f; } private static void EmitQuad(List indices, int v0, int v1, int v2, int v3, bool baseSolid) { if (v0 >= 0 && v1 >= 0 && v2 >= 0 && v3 >= 0) { if (baseSolid) { indices.Add(v0); indices.Add(v1); indices.Add(v2); indices.Add(v0); indices.Add(v2); indices.Add(v3); } else { indices.Add(v0); indices.Add(v3); indices.Add(v2); indices.Add(v0); indices.Add(v2); indices.Add(v1); } } } } internal static class TitlePickerUI { private enum Mode { Titles, Backgrounds } private class Tile { public int idx; public Image frame; public Image face; public RawImage preview; public UiKit.Label label; public bool unlocked; } [CompilerGenerated] private static class <>O { public static UnityAction <0>__Close; } private static Mode mode; private const float Pad = 12f; private const float HeaderH = 46f; private const float FooterH = 48f; private const float SectionH = 30f; private const float Gap = 8f; private const float BgTileW = 88f; private const float BgTileH = 132f; private const float TitleRowH = 32f; private static GameObject root; private static string profileKey; private static readonly List tiles = new List(); private static UiKit.Label footer; private static UiKit.Label headerCount; public static void Toggle() { if ((Object)(object)root != (Object)null && mode == Mode.Titles) { Close(); } else { Open(Mode.Titles); } } public static void ToggleBackgrounds() { if ((Object)(object)root != (Object)null && mode == Mode.Backgrounds) { Close(); } else { Open(Mode.Backgrounds); } } public static void Close() { if ((Object)(object)root != (Object)null) { Object.Destroy((Object)(object)root); } root = null; tiles.Clear(); footer = null; headerCount = null; } private static void Open(Mode m) { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00f5: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_0176: Expected O, but got Unknown Close(); mode = m; profileKey = UserLifetimeStats.ProfileKey(LocalUserManager.GetFirstLocalUser()); if (profileKey == null) { ScorchedVoxelsPlugin.Log.LogWarning((object)"[ScorchedVoxels] picker: no user profile to pick for"); return; } GameObject val = (((Object)(object)EventSystem.current != (Object)null) ? EventSystem.current.currentSelectedGameObject : null); RectTransform val2 = FindSettingsSubPanel(val); RectTransform val3 = FindDescriptionPanel(val2) ?? val2; if ((Object)(object)val3 != (Object)null) { root = new GameObject("ScorchedVoxelsPicker"); root.transform.SetParent((Transform)(object)val3, false); RectTransform obj = root.AddComponent(); UiKit.Stretch(obj); BuildInto(obj, val, val2); return; } ScorchedVoxelsPlugin.Log.LogWarning((object)"[ScorchedVoxels] picker: settings panel not found, using overlay"); root = new GameObject("ScorchedVoxelsPickerOverlay"); Canvas obj2 = root.AddComponent(); obj2.renderMode = (RenderMode)0; obj2.sortingOrder = 30500; CanvasScaler obj3 = root.AddComponent(); obj3.uiScaleMode = (ScaleMode)1; obj3.referenceResolution = new Vector2(1920f, 1080f); obj3.matchWidthOrHeight = 0.5f; root.AddComponent(); Image obj4 = UiKit.CreateImage("backdrop", root.transform, new Color(0f, 0f, 0f, 0.72f)); UiKit.Stretch(((Graphic)obj4).rectTransform); ButtonClickedEvent onClick = ((Component)obj4).gameObject.AddComponent