Decompiled source of CharredGym v2.0.2

Mods/CharredGym.dll

Decompiled 5 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using CharredGym;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MelonLoader;
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(main), "CharredGym", "2.0.2", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTitle("CharredGym")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CharredGym")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("26416457-dd59-49f0-b7b3-074b6fef37a5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CharredGym;

public class main : MelonMod
{
	private string currentScene = "Loader";

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

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
	}

	private void Init()
	{
		if (currentScene == "Gym")
		{
			MelonCoroutines.Start(Loaded());
		}
	}

	private IEnumerator Loaded()
	{
		yield return (object)new WaitForFixedUpdate();
		yield return (object)new WaitForFixedUpdate();
		Material material = ((Renderer)Root.GetGameObject().GetComponent<MeshRenderer>()).material;
		MeshRenderer rumbleStationWoodMeshRenderer = FightResFloor.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)rumbleStationWoodMeshRenderer).material.shader = new Shader(((Il2CppObjectBase)material.shader).Pointer);
		MeshRenderer rumbleStationMetalMeshRenderer = Industrial.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(rumbleStationMetalMeshRenderer, material);
		MeshRenderer rumbleStationRoofMeshRenderer = ArenaMetalRim.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)rumbleStationRoofMeshRenderer).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		MeshRenderer rumbleStationStorageMeshRenderer = Storage.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials2(rumbleStationStorageMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials0and1(rumbleStationStorageMeshRenderer, material);
		MeshRenderer boxMeshRenderer = Crate.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials1(boxMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		MeshRenderer rankSignsMetalMeshRenderer = RankSign.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(rankSignsMetalMeshRenderer, material);
		MeshRenderer measureAreaMetalMeshRenderer = MeasureArea.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(measureAreaMetalMeshRenderer, material);
		MeshRenderer rumbleStationBenchMeshRenderer = WoodsetLarge.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)rumbleStationBenchMeshRenderer).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		MeshRenderer parkboardMeshRenderer = Model.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials0(parkboardMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		MeshRenderer parkboardRotatingScreenMeshRenderer = RotatingScreen.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(parkboardRotatingScreenMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		GameObject parkboardPrimaryDisplayGameObject = ((Component)PrimaryDisplay.GetGameObject().transform.GetChild(0)).gameObject;
		for (int i2 = 0; i2 < 4; i2++)
		{
			((Renderer)((Component)parkboardPrimaryDisplayGameObject.transform.GetChild(i2)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		}
		MeshRenderer ParkboardParkNameplateMeshRenderer = ((Component)PrimaryDisplay.GetGameObject().transform.GetChild(2).GetChild(0)).gameObject.GetComponent<MeshRenderer>();
		((Renderer)ParkboardParkNameplateMeshRenderer).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		GameObject DailyLeaderboardFrameGameObject = Frame.GetGameObject();
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(0)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(2)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(3)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(4)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(5)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(11)).GetComponent<MeshRenderer>()).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		((Renderer)((Component)DailyLeaderboardFrameGameObject.transform.GetChild(12)).GetComponent<MeshRenderer>()).material = material;
		MeshRenderer rumbleStationWoodsetMeshRenderer = WoodsetLarge.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)rumbleStationWoodsetMeshRenderer).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		MeshRenderer spawnAreaWoodMeshRenderer = PathToSchool.GetGameObject().GetComponent<MeshRenderer>();
		((Il2CppArrayBase<Material>)(object)((Renderer)spawnAreaWoodMeshRenderer).materials)[1].shader = new Shader(((Il2CppObjectBase)material.shader).Pointer);
		MeshRenderer spawnAreaMetalMeshRenderer = PathToSchool.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials0and2(spawnAreaMetalMeshRenderer, material);
		GameObject signsGameObject = Signs.GetGameObject();
		for (int n = 0; n < signsGameObject.transform.childCount; n++)
		{
			ReskinSignMeshRenderer(((Component)signsGameObject.transform.GetChild(n).GetChild(3)).gameObject.GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material, material);
		}
		MeshRenderer poseGhostWoodMeshRenderer = WoodsetPlank.GetGameObject().GetComponent<MeshRenderer>();
		((Il2CppArrayBase<Material>)(object)((Renderer)poseGhostWoodMeshRenderer).materials)[0].shader = new Shader(((Il2CppObjectBase)material.shader).Pointer);
		MeshRenderer poseGhostMetalMeshRenderer = Industrial.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(poseGhostMetalMeshRenderer, material);
		MeshRenderer poseGhostRoofMeshRenderer = Roof.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)poseGhostRoofMeshRenderer).material = ((Renderer)rumbleStationWoodMeshRenderer).material;
		GameObject planksGameObject = Planks.GetGameObject();
		for (int m = 0; m < planksGameObject.transform.childCount; m++)
		{
			ReskinMeshRenderer(((Component)planksGameObject.transform.GetChild(m)).gameObject.GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material);
		}
		MeshRenderer bridgeMeshRenderer = BridgeMesh.GetGameObject().GetComponent<MeshRenderer>();
		((Il2CppArrayBase<Material>)(object)((Renderer)bridgeMeshRenderer).materials)[0].shader = new Shader(((Il2CppObjectBase)material.shader).Pointer);
		ReskinMeshRendererMaterials1(bridgeMeshRenderer, material);
		MeshRenderer upperRingMetalMeshRenderer = ArenaMetalRim.GetGameObject().GetComponent<MeshRenderer>();
		((Renderer)upperRingMetalMeshRenderer).material = material;
		MeshRenderer stairsMeshRenderer = Stair.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(stairsMeshRenderer, material);
		GameObject combatCarvingsGameObject = CombatCarvings.GetGameObject();
		for (int l = 0; l < combatCarvingsGameObject.transform.childCount; l++)
		{
			ReskinPodiumMeshRenderer(((Component)combatCarvingsGameObject.transform.GetChild(l).GetChild(0)).gameObject.GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material, material);
		}
		MeshRenderer trackStopMetalMeshRenderer = HowardTrackStop.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(trackStopMetalMeshRenderer, material);
		MeshRenderer stationFloorMeshRenderer = StationFloor.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials2(stationFloorMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials0and1(stationFloorMeshRenderer, material);
		MeshRenderer sidePlintMeshRenderer = StationSidePlint000.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(sidePlintMeshRenderer, material);
		MeshRenderer sidePlintMeshRenderer2 = StationSidePlint001.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials1(sidePlintMeshRenderer2, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials0(sidePlintMeshRenderer2, material);
		MeshRenderer stationStudsMeshRenderer = StationStuds.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(stationStudsMeshRenderer, material);
		MeshRenderer stationWallMeshRenderer = StationWall.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials0(stationWallMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials1(stationWallMeshRenderer, material);
		MeshRenderer studsAndStrengthMeshRenderer = StudsAndStrength.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(studsAndStrengthMeshRenderer, material);
		MeshRenderer trackMeshRenderer = Track.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials1and2(trackMeshRenderer, material);
		MeshRenderer trackPillarsMeshRenderer = TrackPillars.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(trackPillarsMeshRenderer, material);
		MeshRenderer trackPlintMeshRenderer = TrackPlint.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(trackPlintMeshRenderer, material);
		MeshRenderer trackRoofMeshRenderer = TrackRoof.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials0(trackRoofMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials1(trackRoofMeshRenderer, material);
		MeshRenderer trackWallMeshRenderer = TrackWall.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRendererMaterials0(trackWallMeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		ReskinMeshRendererMaterials1(trackWallMeshRenderer, material);
		GameObject woodset1GameObject = Woodset1.GetGameObject();
		for (int k = 0; k < woodset1GameObject.transform.childCount; k++)
		{
			ReskinMeshRenderer(((Component)woodset1GameObject.transform.GetChild(k)).gameObject.GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material);
		}
		GameObject woodset2GameObject = Woodset2.GetGameObject();
		for (int j = 0; j < woodset2GameObject.transform.childCount; j++)
		{
			ReskinMeshRenderer(((Component)woodset2GameObject.transform.GetChild(j)).gameObject.GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material);
		}
		MeshRenderer howardStorageMeshRenderer = Storage.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(howardStorageMeshRenderer, material);
		GameObject boxesGameObject = Props.GetGameObject();
		for (int i = 0; i < 5; i++)
		{
			ReskinMeshRendererMaterials1(((Component)boxesGameObject.transform.GetChild(i + 1)).GetComponent<MeshRenderer>(), ((Renderer)rumbleStationWoodMeshRenderer).material);
		}
		MeshRenderer Tetherball1MeshRenderer = Tetherball0.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(Tetherball1MeshRenderer, material);
		ReskinMeshRendererMaterials2(Tetherball1MeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		MeshRenderer Tetherball1CageMeshRenderer = ((Component)Ball.GetGameObject().transform.GetChild(1)).gameObject.GetComponent<MeshRenderer>();
		((Renderer)((Component)Ball.GetGameObject().transform.GetChild(1)).gameObject.GetComponent<MeshRenderer>()).material.color = new Color(0.5f, 0.25f, 0.3f, 1f);
		ReskinMeshRendererMaterials1and2(Tetherball1CageMeshRenderer, material);
		MeshRenderer Tetherball2MeshRenderer = Tetherball1.GetGameObject().GetComponent<MeshRenderer>();
		ReskinMeshRenderer(Tetherball2MeshRenderer, material);
		ReskinMeshRendererMaterials2(Tetherball2MeshRenderer, ((Renderer)rumbleStationWoodMeshRenderer).material);
		MeshRenderer Tetherball2CageMeshRenderer = ((Component)Ball.GetGameObject().transform.GetChild(1)).gameObject.GetComponent<MeshRenderer>();
		((Renderer)((Component)Ball.GetGameObject().transform.GetChild(1)).gameObject.GetComponent<MeshRenderer>()).material.color = new Color(0.5f, 0.25f, 0.3f, 1f);
		ReskinMeshRendererMaterials1and2(Tetherball2CageMeshRenderer, material);
		MeshRenderer PoseSelectorPlate1MeshRenderer = ((Component)PoseDisplaySelector.GetGameObject().transform.GetChild(1).GetChild(0)).gameObject.GetComponent<MeshRenderer>();
		ReskinMeshRenderer(PoseSelectorPlate1MeshRenderer, material);
		ReskinMeshRendererWithChildren(((Component)((Component)PoseSelectorPlate1MeshRenderer).gameObject.transform.parent.GetChild(1)).GetComponent<MeshRenderer>(), material);
		ReskinMeshRendererWithChildren(((Component)((Component)PoseSelectorPlate1MeshRenderer).gameObject.transform.parent.GetChild(2)).GetComponent<MeshRenderer>(), material);
		MeshRenderer PoseSelectorPlate2MeshRenderer = ((Component)PoseDisplaySelector.GetGameObject().transform.GetChild(1).GetChild(0)).gameObject.GetComponent<MeshRenderer>();
		ReskinMeshRenderer(PoseSelectorPlate2MeshRenderer, material);
		ReskinMeshRendererWithChildren(((Component)((Component)PoseSelectorPlate2MeshRenderer).gameObject.transform.parent.GetChild(1)).GetComponent<MeshRenderer>(), material);
		ReskinMeshRendererWithChildren(((Component)((Component)PoseSelectorPlate2MeshRenderer).gameObject.transform.parent.GetChild(2)).GetComponent<MeshRenderer>(), material);
	}

	private void ReskinMeshRendererWithChildren(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		ReskinMeshRenderer(meshRendererToBeReskinned, mat);
		for (int i = 0; i < ((Component)meshRendererToBeReskinned).transform.childCount; i++)
		{
			ReskinMeshRenderer(((Component)((Component)meshRendererToBeReskinned).transform.GetChild(i)).GetComponent<MeshRenderer>(), mat);
		}
	}

	private void ReskinPodiumMeshRenderer(MeshRenderer meshRendererToBeReskinned, Material woodMaterial, Material metalMaterial)
	{
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit((Material[])(object)new Material[5]
		{
			((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[0],
			woodMaterial,
			metalMaterial,
			metalMaterial,
			metalMaterial
		});
	}

	private void ReskinSignMeshRenderer(MeshRenderer meshRendererToBeReskinned, Material woodMaterial, Material metalMaterial)
	{
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit((Material[])(object)new Material[6]
		{
			metalMaterial,
			metalMaterial,
			((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[2],
			((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[3],
			woodMaterial,
			((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[5]
		});
	}

	private void ReskinMeshRenderer(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			array[i] = mat;
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials0and1(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 0 && i != 1)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials0and2(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 0 && i != 2)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials1and2(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 1 && i != 2)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials1(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 1)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials2(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 2)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}

	private void ReskinMeshRendererMaterials0(MeshRenderer meshRendererToBeReskinned, Material mat)
	{
		Material[] array = (Material[])(object)new Material[((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length];
		for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials).Length; i++)
		{
			if (i != 0)
			{
				array[i] = ((Il2CppArrayBase<Material>)(object)((Renderer)meshRendererToBeReskinned).materials)[i];
			}
			else
			{
				array[i] = mat;
			}
		}
		((Renderer)meshRendererToBeReskinned).materials = Il2CppReferenceArray<Material>.op_Implicit(array);
	}
}