Decompiled source of Bondrewd Captain v1.0.0

Bondrewd_captain.dll

Decompiled 8 hours ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using MonoMod.RuntimeDetour.HookGen;
using RoR2;
using RoR2.ContentManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		return new MonoScriptData
		{
			FilePathsData = new byte[122]
			{
				0, 0, 0, 1, 0, 0, 0, 59, 92, 65,
				115, 115, 101, 116, 115, 92, 83, 107, 105, 110,
				77, 111, 100, 115, 92, 66, 111, 110, 100, 114,
				101, 119, 100, 95, 99, 97, 112, 116, 97, 105,
				110, 92, 66, 111, 110, 100, 114, 101, 119, 100,
				95, 99, 97, 112, 116, 97, 105, 110, 80, 108,
				117, 103, 105, 110, 46, 99, 115, 0, 0, 0,
				6, 0, 0, 0, 47, 92, 65, 115, 115, 101,
				116, 115, 92, 83, 107, 105, 110, 77, 111, 100,
				115, 92, 66, 111, 110, 100, 114, 101, 119, 100,
				95, 99, 97, 112, 116, 97, 105, 110, 92, 83,
				116, 97, 116, 105, 99, 67, 111, 100, 101, 46,
				99, 115
			},
			TypesData = new byte[254]
			{
				0, 0, 0, 0, 39, 66, 111, 110, 100, 114,
				101, 119, 100, 95, 99, 97, 112, 116, 97, 105,
				110, 124, 66, 111, 110, 100, 114, 101, 119, 100,
				95, 99, 97, 112, 116, 97, 105, 110, 80, 108,
				117, 103, 105, 110, 0, 0, 0, 0, 24, 66,
				111, 110, 100, 114, 101, 119, 100, 95, 99, 97,
				112, 116, 97, 105, 110, 124, 72, 101, 108, 112,
				101, 114, 115, 0, 0, 0, 0, 28, 66, 111,
				110, 100, 114, 101, 119, 100, 95, 99, 97, 112,
				116, 97, 105, 110, 124, 82, 101, 109, 111, 118,
				101, 67, 108, 111, 110, 101, 0, 0, 0, 0,
				31, 66, 111, 110, 100, 114, 101, 119, 100, 95,
				99, 97, 112, 116, 97, 105, 110, 124, 70, 105,
				101, 108, 100, 69, 120, 99, 101, 112, 116, 105,
				111, 110, 0, 0, 0, 0, 33, 66, 111, 110,
				100, 114, 101, 119, 100, 95, 99, 97, 112, 116,
				97, 105, 110, 124, 69, 108, 101, 109, 101, 110,
				116, 69, 120, 99, 101, 112, 116, 105, 111, 110,
				0, 0, 0, 0, 28, 66, 111, 110, 100, 114,
				101, 119, 100, 95, 99, 97, 112, 116, 97, 105,
				110, 124, 73, 110, 115, 101, 114, 116, 66, 111,
				110, 101, 115, 0, 0, 0, 0, 36, 66, 111,
				110, 100, 114, 101, 119, 100, 95, 99, 97, 112,
				116, 97, 105, 110, 124, 65, 100, 100, 68, 121,
				110, 97, 109, 105, 99, 67, 111, 108, 108, 105,
				100, 101, 114, 115
			},
			TotalFiles = 2,
			TotalTypes = 7,
			IsEditorOnly = false
		};
	}
}
namespace Bondrewd_captain;

[BepInPlugin("com.frosty_angrier.Bondrewd_captain", "bondrewd_captain", "1.0.0")]
public class Bondrewd_captainPlugin : BaseUnityPlugin
{
	private static AssetBundle assetBundle;

	private static readonly List<Material> materialsWithRoRShader = new List<Material>();

	internal static Bondrewd_captainPlugin Instance { get; private set; }

	internal static ManualLogSource InstanceLogger
	{
		get
		{
			Bondrewd_captainPlugin instance = Instance;
			if (instance == null)
			{
				return null;
			}
			return ((BaseUnityPlugin)instance).Logger;
		}
	}

	private void Start()
	{
		Instance = this;
		using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Bondrewd_captain.frosty_angrierbondrewd_captain"))
		{
			assetBundle = AssetBundle.LoadFromStream(stream);
		}
		((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit);
		HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings));
		ReplaceShaders();
	}

	private static void ReplaceShaders()
	{
		LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/resources/bondmaterial.mat");
	}

	private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths)
	{
		//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)
		Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion();
		foreach (string text in materialPaths)
		{
			Material val = assetBundle.LoadAsset<Material>(text);
			val.shader = shader;
			materialsWithRoRShader.Add(val);
		}
	}

	private static void LanguageLoadStrings(Action<Language> orig, Language self)
	{
		orig(self);
		self.SetStringByToken("FROSTY_ANGRIER_SKIN_BOND_MOD_NAME", "");
	}

	private static void BodyCatalogInit()
	{
		AddCaptainBodyBond_modSkin();
	}

	private static SkinDef CreateCaptainBodyBond_modSkin(GameObject mdl, ModelSkinController skinController)
	{
		Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true);
		mdl.GetComponentsInChildren<Light>(true);
		SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
		SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>();
		skin.skinDefParams = skinParams;
		((Object)skin).name = "bond_mod";
		skin.nameToken = "FROSTY_ANGRIER_SKIN_BOND_MOD_NAME";
		skin.rootObject = mdl;
		Helpers.TryCatchThrow("Icon", delegate
		{
			skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\Bondrewd_captain\\Icons\\bond_modIcon.png");
		});
		Helpers.TryCatchThrow("Unlockable Name", delegate
		{
			skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "Bondrewd"));
		});
		Helpers.TryCatchThrow("Base Skins", delegate
		{
			skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { Helpers.ThrowIfOutOfBounds(0, "Index 0 is out of bounds of skins array", skinController.skins, 0) };
		});
		Helpers.TryCatchThrow("Game Object Activations", delegate
		{
			skinParams.gameObjectActivations = Array.Empty<GameObjectActivation>();
		});
		Helpers.TryCatchThrow("Renderer Infos", delegate
		{
			//IL_0010: 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_0088: 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_0092: 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_00fc: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: 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_0171: 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_018b: 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_01ee: 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_0258: 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_0262: 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_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: 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_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[7]
			{
				new RendererInfo
				{
					defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/bondmaterial.mat"),
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false,
					renderer = Helpers.ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Captain\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Captain"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(1, "There is no renderer with the name \"CaptainChestArmor\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainChestArmor"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(2, "There is no renderer with the name \"CaptainCoat\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainCoat"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(3, "There is no renderer with the name \"CaptainGunArm\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainGunArm"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(4, "There is no renderer with the name \"CaptainHat\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainHat"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(5, "There is no renderer with the name \"CaptainHead\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainHead"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				},
				new RendererInfo
				{
					defaultMaterial = null,
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = true,
					renderer = Helpers.ThrowIfNull<Renderer>(6, "There is no renderer with the name \"CaptainUndercoat\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "CaptainUndercoat"))),
					hideOnDeath = false,
					ignoresMaterialOverrides = false
				}
			};
		});
		Helpers.TryCatchThrow("MeshReplacements", delegate
		{
			//IL_0010: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
			{
				new MeshReplacement
				{
					mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\Bondrewd_captain\\Meshes\\Captain.mesh"),
					renderer = Helpers.ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Captain\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Captain")))
				}
			};
		});
		Helpers.TryCatchThrow("Light Infos", delegate
		{
			skinParams.lightReplacements = Array.Empty<LightInfo>();
		});
		Helpers.TryCatchThrow("Minion Skin Replacements", delegate
		{
			skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
		});
		Helpers.TryCatchThrow("Projectile Ghost Replacements", delegate
		{
			skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
		});
		return skin;
	}

	private static void AddCaptainBodyBond_modSkin()
	{
		string text = "CaptainBody";
		string text2 = "bond_mod";
		GameObject bodyPrefab = BodyCatalog.FindBodyPrefab(text);
		if (!Object.op_Implicit((Object)(object)bodyPrefab))
		{
			InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
			return;
		}
		try
		{
			ModelLocator component = bodyPrefab.GetComponent<ModelLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
				return;
			}
			GameObject gameObject = ((Component)component.modelTransform).gameObject;
			ModelSkinController val = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
				return;
			}
			SkinDef val2 = CreateCaptainBodyBond_modSkin(gameObject, val);
			Array.Resize(ref val.skins, val.skins.Length + 1);
			val.skins[val.skins.Length - 1] = val2;
		}
		catch (FieldException ex)
		{
			if (ex.InnerException is ElementException ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}");
				InstanceLogger.LogWarning((object)ex2.Message);
				InstanceLogger.LogError((object)ex.InnerException);
			}
			else
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
		}
		catch (Exception ex3)
		{
			InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
			InstanceLogger.LogError((object)ex3);
		}
		try
		{
			SurvivorDef val3 = ((IEnumerable<SurvivorDef>)ContentManager.survivorDefs).FirstOrDefault((Func<SurvivorDef, bool>)((SurvivorDef d) => (Object)(object)d.bodyPrefab == (Object)(object)bodyPrefab));
			if (!Object.op_Implicit((Object)(object)val3))
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because SurvivorDef doesn't exist"));
				return;
			}
			ModelSkinController componentInChildren = val3.displayPrefab.GetComponentInChildren<ModelSkinController>();
			if (!Object.op_Implicit((Object)(object)componentInChildren))
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
			}
			else
			{
				SkinDef val4 = CreateCaptainBodyBond_modSkin(((Component)componentInChildren).gameObject, componentInChildren);
				Array.Resize(ref componentInChildren.skins, componentInChildren.skins.Length + 1);
				componentInChildren.skins[^1] = val4;
			}
		}
		catch (FieldException ex4)
		{
			if (ex4.InnerException is ElementException ex5)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)$"Field causing issue: {ex4.Message}, element: {ex5.Index}");
				InstanceLogger.LogWarning((object)ex5.Message);
				InstanceLogger.LogError((object)ex4.InnerException);
			}
			else
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex4.Message));
				InstanceLogger.LogError((object)ex4.InnerException);
			}
		}
		catch (Exception ex6)
		{
			InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\""));
			InstanceLogger.LogError((object)ex6);
		}
	}
}
public static class Helpers
{
	private static GameObject prefabHolder;

	public static GameObject ClonePrefab(GameObject gameObject)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)prefabHolder))
		{
			prefabHolder = new GameObject("PrefabHolder");
			Object.DontDestroyOnLoad((Object)(object)prefabHolder);
			prefabHolder.SetActive(false);
		}
		GameObject obj = Object.Instantiate<GameObject>(gameObject, prefabHolder.transform);
		obj.AddComponent<RemoveClone>();
		((Object)obj).name = ((Object)gameObject).name;
		return obj;
	}

	public static Transform GetChild(this Transform transform, int index, out Transform child)
	{
		return child = transform.GetChild(index);
	}

	public static GameObject WithComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component
	{
		T obj = gameObject.AddComponent<T>();
		modifier?.Invoke(obj);
		return gameObject;
	}

	public static GameObject WithTryComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component
	{
		if (Object.op_Implicit((Object)(object)gameObject) && !Object.op_Implicit((Object)(object)gameObject.GetComponent<T>()))
		{
			T obj = gameObject.AddComponent<T>();
			modifier?.Invoke(obj);
		}
		return gameObject;
	}

	public static T ThrowIfEquals<T>(int index, string message, T value, T expected) where T : Enum
	{
		if (value.Equals(expected))
		{
			throw new ElementException(index, message);
		}
		return value;
	}

	public static T ThrowIfOutOfBounds<T>(int index, string message, T[] array, int elementIndex) where T : class
	{
		if (array == null || array.Length <= elementIndex)
		{
			throw new ElementException(index, message);
		}
		return array[elementIndex];
	}

	public static T ThrowIfNull<T>(int index, string message, T value) where T : class
	{
		if (value == null)
		{
			throw new ElementException(index, message);
		}
		return value;
	}

	public static void TryCatchThrow(string message, Action action)
	{
		try
		{
			action?.Invoke();
		}
		catch (Exception innerException)
		{
			throw new FieldException(message, innerException);
		}
	}
}
public class RemoveClone : MonoBehaviour
{
	public void Awake()
	{
		string name = ((Object)this).name;
		((Object)this).name = name.Substring(0, name.Length - 7);
	}
}
public class FieldException : Exception
{
	public FieldException(string message, Exception innerException)
		: base(message, innerException)
	{
	}
}
public class ElementException : Exception
{
	public int Index { get; }

	public ElementException(int index, string message)
		: base(message)
	{
		Index = index;
	}
}
public class InsertBones : MonoBehaviour
{
	private readonly List<SkinnedMeshRenderer> modifiedRenderers = new List<SkinnedMeshRenderer>();

	public List<string> rendererPaths = new List<string>();

	public List<Transform> newBones = new List<Transform>();

	public string afterPath;

	public void Awake()
	{
		Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform;
		Transform value = ((Component)transform).transform.Find(afterPath);
		foreach (string rendererPath in rendererPaths)
		{
			Transform obj = transform.Find(rendererPath);
			SkinnedMeshRenderer val = ((obj != null) ? ((Component)obj).GetComponent<SkinnedMeshRenderer>() : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				Transform[] array = val.bones;
				int num = Array.IndexOf(array, value) + 1;
				if (num != 0)
				{
					Array.Resize(ref array, array.Length + newBones.Count);
					Array.Copy(array, num, array, num + newBones.Count, array.Length - newBones.Count - num);
					newBones.CopyTo(array, num);
					val.bones = array;
					modifiedRenderers.Add(val);
				}
			}
		}
	}

	public void OnDestroy()
	{
		foreach (SkinnedMeshRenderer modifiedRenderer in modifiedRenderers)
		{
			if (Object.op_Implicit((Object)(object)modifiedRenderer))
			{
				Transform[] array = modifiedRenderer.bones;
				int num = Array.IndexOf(array, ((Component)this).transform);
				Array.Copy(array, num + newBones.Count, array, num, array.Length - num - newBones.Count);
				Array.Resize(ref array, array.Length - newBones.Count);
				modifiedRenderer.bones = array;
			}
		}
		modifiedRenderers.Clear();
	}
}
public class AddDynamicColliders : MonoBehaviour
{
	public List<string> paths = new List<string>();

	public void Awake()
	{
		Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform;
		List<DynamicBoneCollider> list = new List<DynamicBoneCollider>();
		foreach (string path in paths)
		{
			Transform val = transform.Find(path);
			if (Object.op_Implicit((Object)(object)val))
			{
				list.AddRange(((Component)val).GetComponents<DynamicBoneCollider>());
			}
		}
		DynamicBone[] components = ((Component)this).GetComponents<DynamicBone>();
		for (int i = 0; i < components.Length; i++)
		{
			components[i].m_Colliders.AddRange(list);
		}
	}
}