Decompiled source of GymExpanded v1.0.1

Mods/RumbleGym++.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Il2Cpp;
using Il2CppRUMBLE.MoveSystem;
using MelonLoader;
using RumbleGym__;
using RumbleModdingAPI;
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(Class1), "RumbleGym++", "1.0.1", "SpooderCode", null)]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RumbleGym++")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RumbleGym++")]
[assembly: AssemblyTitle("RumbleGym++")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RumbleGym__;

public class Class1 : MelonMod
{
	private GameObject islands;

	private GameObject cliff;

	private GameObject desert;

	public override void OnLateInitializeMelon()
	{
		Calls.onMapInitialized += OnInit;
	}

	public void disableHowardRoof()
	{
		Stationstuds.GetGameObject().SetActive(false);
		TrackPillars.GetGameObject().SetActive(false);
		Trackroof.GetGameObject().SetActive(false);
		Trackwall.GetGameObject().SetActive(false);
		((Component)GymProduction.GetGameObject().transform.Find("Collission_group/Environment_Collission/Col_environment21")).gameObject.SetActive(false);
	}

	public void OnInit()
	{
		//IL_00dd: 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_0127: 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_0171: 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_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		if (Scene.GetSceneName() == "Gym")
		{
			islands = Object.Instantiate<GameObject>(Calls.LoadAssetFromStream<GameObject>((MelonMod)(object)this, "RumbleGym__.Resources.rumbleislands", "RUMBLEIslands"));
			addColliders(islands);
			cliff = Object.Instantiate<GameObject>(Calls.LoadAssetFromStream<GameObject>((MelonMod)(object)this, "RumbleGym__.Resources.thecliff", "The Cliff"));
			addColliders(cliff);
			desert = Object.Instantiate<GameObject>(Calls.LoadAssetFromStream<GameObject>((MelonMod)(object)this, "RumbleGym__.Resources.thedesert", "Desert"));
			addColliders(desert);
			if ((Object)(object)islands != (Object)null && (Object)(object)cliff != (Object)null && (Object)(object)desert != (Object)null)
			{
				islands.transform.position = new Vector3(-32.3891f, 3.7856f, -63.0866f);
				islands.transform.eulerAngles = new Vector3(0f, 25.47f, 0f);
				cliff.transform.position = new Vector3(26.5417f, -1.7327f, -19.9502f);
				cliff.transform.eulerAngles = new Vector3(0f, 79.91f, 0f);
				desert.transform.position = new Vector3(45.4624f, -28.4783f, -109.1801f);
				desert.transform.eulerAngles = new Vector3(0f, 333.46f, 0f);
				Vista.GetGameObject().transform.position = new Vector3(-77.253f, 0f, 0f);
				SceneBoundaryPlayerGYM.GetGameObject().transform.localScale = new Vector3(350f, 70f, 350f);
				SceneBoundaryStructuresGYM.GetGameObject().transform.localScale = new Vector3(350f, 70f, 350f);
				disableHowardRoof();
			}
		}
	}

	public void addColliders(GameObject obj)
	{
		if (obj.transform.childCount > 0)
		{
			for (int i = 0; i < obj.transform.childCount; i++)
			{
				addColliders(((Component)obj.transform.GetChild(i)).gameObject);
			}
		}
		MeshFilter val = default(MeshFilter);
		if (obj.TryGetComponent<MeshFilter>(ref val))
		{
			MeshCollider val2 = obj.AddComponent<MeshCollider>();
			val2.sharedMesh = val.mesh;
			if (((Object)obj).name.Contains("$"))
			{
				obj.layer = 9;
				GroundCollider val3 = obj.AddComponent<GroundCollider>();
				val3.collider = (Collider)(object)val2;
				((Behaviour)val3).enabled = true;
			}
			else
			{
				obj.layer = 10;
				KillStructureOnImpact val4 = obj.AddComponent<KillStructureOnImpact>();
			}
		}
	}
}