Decompiled source of FlappyBirdWalls v1.3.1

Mods/FlappyBirdWalls.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using FlappyBirdWalls;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.MoveSystem;
using Il2CppRUMBLE.Players.Subsystems;
using Il2CppRUMBLE.Pools;
using Il2CppRUMBLE.Poses;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using RumbleModUI;
using RumbleModdingAPI.RMAPI;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "FlappyBirdWalls", "1.3.1", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("FlappyBirdWalls")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d46b3a8a46315434c1bd7e1bb67f19336f30187a")]
[assembly: AssemblyProduct("FlappyBirdWalls")]
[assembly: AssemblyTitle("FlappyBirdWalls")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FlappyBirdWalls;

[RegisterTypeInIl2Cpp]
public class FlappyBird : MonoBehaviour
{
	public class Bird
	{
		public bool isAlive = false;

		public int gameScore = 0;

		public float height = 0f;

		public float speedY = 0f;

		public Bird()
		{
			isAlive = true;
			gameScore = 0;
			height = 0f;
			speedY = 0f;
		}
	}

	[CompilerGenerated]
	private sealed class <GameLoop>d__21 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public FlappyBird <>4__this;

		private Exception <e>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <GameLoop>d__21(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<e>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (<>4__this.bird.isAlive && <>4__this.gameStarted)
			{
				try
				{
					<>4__this.CheckPipes();
					<>4__this.MovePipes();
					<>4__this.MoveBird();
					<>4__this.UpdatePositions();
				}
				catch (Exception ex)
				{
					<e>5__1 = ex;
					Melon<Main>.Logger.Error((object)<e>5__1);
				}
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			<>4__this.gameStarted = false;
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Bird bird = new Bird();

	private List<Vector2> pipes = new List<Vector2>
	{
		Vector2.zero,
		Vector2.zero
	};

	private Random random = new Random();

	private const int maxPipeHeight = 200;

	private const float halfScreenHeight = 400f;

	private const float halfScreenWidth = 250f;

	public bool gameStarted = false;

	internal GameObject trigger;

	internal GameObject canvas;

	internal GameObject birdMain;

	internal GameObject birdUp;

	internal GameObject birdFlat;

	internal GameObject birdDown;

	internal GameObject pipe1;

	internal GameObject pipe2;

	internal GameObject score1;

	internal GameObject score2;

	private void Start()
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
		Object.Destroy((Object)(object)val.GetComponent<MeshRenderer>());
		trigger = val;
		((Object)val).name = "FlappyBirdTrigger";
		val.transform.parent = ((Component)this).gameObject.transform;
		val.transform.localPosition = new Vector3(0f, 0f, -0.315f);
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = new Vector3(1.1f, 1.9f, 0.01f);
		val.layer = 22;
		((Collider)val.GetComponent<BoxCollider>()).isTrigger = true;
		canvas = Object.Instantiate<GameObject>(Main.ddolCanvas);
		score1 = ((Component)canvas.transform.GetChild(0).GetChild(0)).gameObject;
		score2 = ((Component)canvas.transform.GetChild(0).GetChild(1)).gameObject;
		pipe1 = ((Component)canvas.transform.GetChild(1).GetChild(0)).gameObject;
		pipe2 = ((Component)canvas.transform.GetChild(1).GetChild(1)).gameObject;
		birdMain = ((Component)canvas.transform.GetChild(2)).gameObject;
		birdUp = ((Component)canvas.transform.GetChild(2).GetChild(0)).gameObject;
		birdFlat = ((Component)canvas.transform.GetChild(2).GetChild(1)).gameObject;
		birdDown = ((Component)canvas.transform.GetChild(2).GetChild(2)).gameObject;
		canvas.transform.parent = ((Component)this).gameObject.transform;
		canvas.transform.localPosition = new Vector3(0f, 0f, -0.315f);
		canvas.transform.localRotation = Quaternion.identity;
		canvas.transform.localScale = new Vector3(0.0023f, 0.0023f, 0.0023f);
		val.AddComponent<FlappyBirdStart>();
	}

	public void StartGame()
	{
		//IL_0035: 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)
		gameStarted = true;
		bird = new Bird();
		pipes = new List<Vector2>
		{
			new Vector2(275f, (float)random.Next(-200, 200)),
			new Vector2(575f, (float)random.Next(-200, 200))
		};
		canvas.SetActive(true);
		TextMeshProUGUI component = score1.GetComponent<TextMeshProUGUI>();
		((TMP_Text)component).text = "1";
		((TMP_Text)component).alignment = (TextAlignmentOptions)514;
		((TMP_Text)component).fontSize = Main.fontSize;
		TextMeshProUGUI component2 = score2.GetComponent<TextMeshProUGUI>();
		((TMP_Text)component2).text = "2";
		((TMP_Text)component2).alignment = (TextAlignmentOptions)514;
		((TMP_Text)component2).fontSize = Main.fontSize;
		MelonCoroutines.Start(GameLoop());
	}

	public void Jump()
	{
		if (bird.speedY < 5f)
		{
			bird.speedY = 0f;
		}
		bird.speedY += 5f;
	}

	[IteratorStateMachine(typeof(<GameLoop>d__21))]
	private IEnumerator GameLoop()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <GameLoop>d__21(0)
		{
			<>4__this = this
		};
	}

	private void UpdatePositions()
	{
		//IL_0021: 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_004f: 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_007b: 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_009b: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
		birdMain.transform.localPosition = new Vector3(-125f, bird.height, 0f);
		pipe1.transform.localPosition = new Vector3(pipes[0].x, pipes[0].y, 0f);
		pipe2.transform.localPosition = new Vector3(pipes[1].x, pipes[1].y, 0f);
		score1.transform.parent = pipe1.transform;
		score1.transform.localPosition = Vector3.zero;
		score2.transform.parent = pipe2.transform;
		score2.transform.localPosition = Vector3.zero;
	}

	private void MoveBird()
	{
		bird.speedY -= 0.1f;
		bird.height += bird.speedY;
		if (Math.Abs(bird.speedY) < 1f)
		{
			if (!birdFlat.activeSelf)
			{
				birdFlat.SetActive(true);
				birdUp.SetActive(false);
				birdDown.SetActive(false);
			}
		}
		else if (0f < bird.speedY)
		{
			if (!birdUp.activeSelf)
			{
				birdUp.SetActive(true);
				birdFlat.SetActive(false);
				birdDown.SetActive(false);
			}
		}
		else if (bird.speedY < 0f && !birdDown.activeSelf)
		{
			birdDown.SetActive(true);
			birdUp.SetActive(false);
			birdFlat.SetActive(false);
		}
		if (bird.height < -400f)
		{
			bird.isAlive = false;
		}
		if (bird.height > 400f)
		{
			bird.isAlive = false;
		}
	}

	private void CheckPipes()
	{
		//IL_0010: 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)
		for (int i = 0; i < pipes.Count; i++)
		{
			if (pipes[i].x < -300f)
			{
				pipes[i] = new Vector2(300f, (float)random.Next(-200, 200));
				TextMeshProUGUI component = ((Component)((i == 0) ? pipe1 : pipe2).transform.GetChild(0)).gameObject.GetComponent<TextMeshProUGUI>();
				((TMP_Text)component).text = (int.Parse(((TMP_Text)component).text) + 2).ToString();
			}
		}
	}

	private void MovePipes()
	{
		//IL_0017: 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_0038: 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_007d: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < pipes.Count; i++)
		{
			pipes[i] = new Vector2(pipes[i].x - 1f, pipes[i].y);
			if (Math.Abs(-125f - pipes[i].x) < 75f && 80f < Math.Abs(bird.height - pipes[i].y))
			{
				bird.isAlive = false;
			}
		}
	}
}
[RegisterTypeInIl2Cpp]
public class FlappyBirdStart : MonoBehaviour
{
	private FlappyBird gameToStart;

	public FlappyBirdStart()
	{
		gameToStart = ((Component)((Component)this).gameObject.transform.parent).GetComponent<FlappyBird>();
	}

	private void OnTriggerEnter(Collider other)
	{
		try
		{
			if (Main.touchPlay && (!(((Object)((Component)other).gameObject).name != "Bone_HandAlpha_L") || !(((Object)((Component)other).gameObject).name != "Bone_HandAlpha_R")))
			{
				if (!gameToStart.gameStarted)
				{
					gameToStart.StartGame();
				}
				else
				{
					gameToStart.Jump();
				}
			}
		}
		catch
		{
		}
	}
}
internal class BuildInfo
{
	public const string ModName = "FlappyBirdWalls";

	public const string Author = "UlvakSkillz";

	public const string ModVersion = "1.3.1";
}
public class Main : MelonMod
{
	[HarmonyPatch(typeof(Structure), "OnFetchFromPool")]
	public static class StructureSpawn
	{
		private static void Postfix(ref Structure __instance)
		{
			if (currentScene == "Loader")
			{
				return;
			}
			try
			{
				if (((Object)((Component)__instance).gameObject).name != "Wall")
				{
					return;
				}
			}
			catch (Exception ex)
			{
				MelonLogger.Msg((object)ex);
				return;
			}
			((Component)((Component)__instance).gameObject.transform.GetChild(0)).gameObject.AddComponent<FlappyBird>();
		}
	}

	[HarmonyPatch(typeof(Structure), "OnReturnToPool")]
	public static class StructureBreak
	{
		private static void Postfix(ref Structure __instance)
		{
			if (!(((Object)((Component)__instance).gameObject).name != "Wall"))
			{
				FlappyBird component = ((Component)((Component)__instance).gameObject.transform.GetChild(0)).gameObject.GetComponent<FlappyBird>();
				if (!((Object)(object)component == (Object)null))
				{
					component.gameStarted = false;
					Object.Destroy((Object)(object)component.canvas);
					Object.Destroy((Object)(object)component.trigger);
					Object.Destroy((Object)(object)component);
				}
			}
		}
	}

	[HarmonyPatch(typeof(PlayerPoseSystem), "OnPoseSetCompleted", new Type[] { typeof(PoseSet) })]
	private static class PosePatch
	{
		private static void Postfix(PoseSet set)
		{
			try
			{
				if (!kickPlay || !(((Object)set).name == "PoseSetKick"))
				{
					return;
				}
				GameObject val = SelectStructure(((Component)Singleton<PlayerManager>.instance.localPlayer.Controller.PlayerCamera).transform);
				if (!((Object)(object)val == (Object)null) && !(((Object)val).name != "Wall"))
				{
					FlappyBird component = ((Component)val.transform.GetChild(0)).GetComponent<FlappyBird>();
					if (!component.gameStarted)
					{
						component.StartGame();
					}
					else
					{
						component.Jump();
					}
				}
			}
			catch
			{
			}
		}

		private static GameObject SelectStructure(Transform playerPos)
		{
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: 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)
			//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)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: 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_01b2: 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_01e1: 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_01f0: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//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_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: 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_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			List<GameObject> list = new List<GameObject>();
			List<GameObject> list2 = new List<GameObject>();
			List<float> list3 = new List<float>();
			List<PooledMonoBehaviour> val = new List<PooledMonoBehaviour>();
			List<PooledMonoBehaviour>[] array = new List<PooledMonoBehaviour>[12]
			{
				pooledStructuresWall, pooledStructuresCube, pooledStructuresPillar, pooledStructuresBall, pooledStructuresDisc, pooledStructuresBoulder, pooledStructuresSmallRock, pooledStructuresBoulderBall, pooledStructuresWrappedWall, pooledStructuresPrisonedPillar,
				pooledStructuresCageCube, pooledStructuresDockedDisk
			};
			List<PooledMonoBehaviour>[] array2 = array;
			foreach (List<PooledMonoBehaviour> val2 in array2)
			{
				for (int j = 0; j < val2.Count; j++)
				{
					if (((Component)((Component)val2[j]).transform).gameObject.active)
					{
						val.Add(val2[j]);
					}
				}
			}
			Vector2 val4 = default(Vector2);
			Vector2 val5 = default(Vector2);
			for (int k = 0; k < val.Count; k++)
			{
				GameObject gameObject = ((Component)((Component)val[k]).transform).gameObject;
				float item = Vector2.Distance(Vector2.op_Implicit(gameObject.transform.position), Vector2.op_Implicit(playerPos.position));
				float num = Vector2.Distance(new Vector2(0f, gameObject.transform.position.y), new Vector2(0f, playerPos.position.y));
				if (!(Vector2.Distance(new Vector2(gameObject.transform.position.x, gameObject.transform.position.z), new Vector2(((Component)playerPos).transform.position.x, ((Component)playerPos).transform.position.z)) < 2.5f) || !(num < 2.5f))
				{
					continue;
				}
				Vector3 val3 = playerPos.forward;
				float x = ((Vector3)(ref val3)).normalized.x;
				val3 = playerPos.forward;
				((Vector2)(ref val4))..ctor(x, ((Vector3)(ref val3)).normalized.z);
				val3 = gameObject.transform.position - playerPos.position;
				float x2 = ((Vector3)(ref val3)).normalized.x;
				val3 = gameObject.transform.position - playerPos.position;
				((Vector2)(ref val5))..ctor(x2, ((Vector3)(ref val3)).normalized.z);
				float num2 = Vector2.Dot(val4, val5);
				float num3 = Mathf.Acos(num2) * Mathf.Rad2Deg;
				if (num3 <= 90f)
				{
					list.Add(gameObject);
					if (num3 <= 30f)
					{
						list2.Add(gameObject);
						list3.Add(item);
					}
				}
			}
			if (list.Count > 0)
			{
				if (list2.Count > 0)
				{
					int index = -1;
					float num4 = 2.6f;
					for (int l = 0; l < list2.Count; l++)
					{
						if (list3[l] < num4)
						{
							index = l;
							num4 = list3[l];
						}
					}
					return list2[index];
				}
				int index2 = -1;
				float num5 = 2.6f;
				for (int m = 0; m < list.Count; m++)
				{
					float num6 = Vector2.Distance(new Vector2(list[m].transform.position.x, list[m].transform.position.z), new Vector2(((Component)playerPos).transform.position.x, ((Component)playerPos).transform.position.z));
					if (num6 < num5)
					{
						index2 = m;
						num5 = num6;
					}
				}
				return list[index2];
			}
			return null;
		}
	}

	public static GameObject ddolCanvas;

	public Mod FlappyBirdWalls = new Mod();

	private static string currentScene = "Loader";

	private static bool scoreInit = false;

	internal static bool touchPlay = true;

	internal static bool kickPlay = true;

	internal static float fontSize = 64f;

	private static List<PooledMonoBehaviour> pooledStructuresWall;

	private static List<PooledMonoBehaviour> pooledStructuresCube;

	private static List<PooledMonoBehaviour> pooledStructuresPillar;

	private static List<PooledMonoBehaviour> pooledStructuresBall;

	private static List<PooledMonoBehaviour> pooledStructuresDisc;

	private static List<PooledMonoBehaviour> pooledStructuresBoulder;

	private static List<PooledMonoBehaviour> pooledStructuresSmallRock;

	private static List<PooledMonoBehaviour> pooledStructuresBoulderBall;

	private static List<PooledMonoBehaviour> pooledStructuresWrappedWall;

	private static List<PooledMonoBehaviour> pooledStructuresPrisonedPillar;

	private static List<PooledMonoBehaviour> pooledStructuresCageCube;

	private static List<PooledMonoBehaviour> pooledStructuresDockedDisk;

	private static TextMeshProUGUI ddolScore1;

	private static TextMeshProUGUI ddolScore2;

	public override void OnLateInitializeMelon()
	{
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Expected O, but got Unknown
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Expected O, but got Unknown
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Expected O, but got Unknown
		ddolCanvas = Object.Instantiate<GameObject>(AssetBundles.LoadAssetFromStream<GameObject>((MelonMod)(object)this, "FlappyBirdWalls.flappybird", "Canvas"));
		((Object)ddolCanvas).name = "Flappy Bird Canvas";
		ddolCanvas.SetActive(false);
		Object.DontDestroyOnLoad((Object)(object)ddolCanvas);
		FlappyBirdWalls.ModName = "FlappyBirdWalls";
		FlappyBirdWalls.ModVersion = "1.3.1";
		FlappyBirdWalls.SetFolder("FlappyBirdWalls");
		FlappyBirdWalls.AddToList("Touch Play", true, 0, "Toggles Touching the Wall to Play", new Tags());
		FlappyBirdWalls.AddToList("Kick Play", true, 0, "Toggles Kicking the Wall to Play", new Tags());
		FlappyBirdWalls.AddToList("Score Size", 20f, "Set's the Font Size for the Score", new Tags());
		FlappyBirdWalls.GetFromFile();
		UI.instance.UI_Initialized += delegate
		{
			UI.instance.AddMod(FlappyBirdWalls);
		};
		FlappyBirdWalls.ModSaved += Save;
		Save();
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
		if (currentScene == "Loader")
		{
			pooledStructuresWall = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("Wall")].PooledObjects;
			pooledStructuresCube = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("RockCube")].PooledObjects;
			pooledStructuresPillar = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("Pillar")].PooledObjects;
			pooledStructuresBall = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("Ball")].PooledObjects;
			pooledStructuresDisc = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("Disc")].PooledObjects;
			pooledStructuresBoulder = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("LargeRock")].PooledObjects;
			pooledStructuresSmallRock = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("SmallRock")].PooledObjects;
			pooledStructuresBoulderBall = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("BoulderBall")].PooledObjects;
			pooledStructuresWrappedWall = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("WrappedWall")].PooledObjects;
			pooledStructuresPrisonedPillar = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("PrisonedPillar")].PooledObjects;
			pooledStructuresCageCube = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("CageCube")].PooledObjects;
			pooledStructuresDockedDisk = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("DockedDisk")].PooledObjects;
		}
		else if (!scoreInit && currentScene == "Gym")
		{
			GameObject val = Object.Instantiate<GameObject>(MountainRank.GetGameObject());
			val.SetActive(true);
			GameObject val2 = Object.Instantiate<GameObject>(val);
			((Object)val).name = "Score1";
			((Object)val2).name = "Score2";
			val.transform.SetParent(ddolCanvas.transform.GetChild(0));
			val2.transform.SetParent(ddolCanvas.transform.GetChild(0));
			ddolScore1 = val.GetComponent<TextMeshProUGUI>();
			ddolScore2 = val2.GetComponent<TextMeshProUGUI>();
			((TMP_Text)ddolScore1).fontSize = fontSize;
			((TMP_Text)ddolScore2).fontSize = fontSize;
			scoreInit = true;
		}
	}

	private void Save()
	{
		touchPlay = (bool)FlappyBirdWalls.Settings[0].SavedValue;
		kickPlay = (bool)FlappyBirdWalls.Settings[1].SavedValue;
		fontSize = (float)FlappyBirdWalls.Settings[2].SavedValue;
		if (currentScene != "Loader")
		{
			((TMP_Text)ddolScore1).fontSize = fontSize;
			((TMP_Text)ddolScore2).fontSize = fontSize;
		}
	}
}