using System;
using System.Collections.Generic;
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;
using MonoMod.RuntimeDetour.HookGen;
using RoR2;
using RoR2.ContentManagement;
using RuneFoxMods.DynamicSkins;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Rendering;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace RuneFoxMods
{
internal class Utils
{
public static void PrintBodyCatalog()
{
Debug.Log((object)"\nBodyCatalog");
foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs)
{
Debug.Log((object)((Object)allBodyPrefab).name);
}
Debug.Log((object)"\n");
}
public static void ReadChildren(GameObject parent, int tabs, bool includecomponents = true)
{
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
string text = "";
for (int i = 0; i < tabs; i++)
{
text += " ";
}
for (int j = 0; j < parent.transform.childCount; j++)
{
Transform child = parent.transform.GetChild(j);
if ((Object)(object)child == (Object)null)
{
break;
}
string text2 = ((Component)child).gameObject.activeInHierarchy.ToString();
Debug.Log((object)(text + ((Object)child).name + " " + text2 + " " + ((Component)child).transform.position));
if (includecomponents)
{
ReadComponents(((Component)child).gameObject, tabs + 1);
Debug.Log((object)"");
}
ReadChildren(((Component)child).gameObject, tabs + 1, includecomponents);
}
}
public static void readheiarchy(GameObject parent, bool includeComponents = true)
{
Debug.Log((object)((Object)parent).name);
if (includeComponents)
{
ReadComponents(parent, 1);
Debug.Log((object)"");
}
ReadChildren(parent, 1, includeComponents);
}
public static void ReadComponents(GameObject obj, int tabs)
{
string text = "";
for (int i = 0; i < tabs; i++)
{
text += " ";
}
Component[] components = obj.GetComponents(typeof(Component));
Component[] array = components;
foreach (Component val in array)
{
string text2 = "";
Debug.Log((object)(text + "Comp: " + ((object)val).GetType().ToString() + " " + text2));
}
}
public static void PrintAllPaths(GameObject parent)
{
Debug.Log((object)((Object)parent).name);
PrintAllPathsInner(parent, ((Object)parent).name);
}
private static void PrintAllPathsInner(GameObject parent, string parent_string)
{
int childCount = parent.transform.childCount;
for (int i = 0; i < childCount; i++)
{
Transform child = parent.transform.GetChild(i);
if (((Object)child).name.EndsWith("_end"))
{
break;
}
string text = parent_string + "/" + ((Object)child).name;
Debug.Log((object)(" " + ((Object)child).name + "\t\t" + text));
PrintAllPathsInner(((Component)child).gameObject, text);
}
}
public static void PrintDynamicBone(DynamicBone DB)
{
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: 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_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: 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)
Debug.Log((object)("Root: " + DB.m_Root));
Debug.Log((object)("Damping: " + DB.m_Damping));
Debug.Log((object)("Damping Dist: " + DB.m_DampingDistrib));
Debug.Log((object)("Elasticity: " + DB.m_Elasticity));
Debug.Log((object)("Elasticity Dist: " + DB.m_ElasticityDistrib));
Debug.Log((object)("Stiffness: " + DB.m_Stiffness));
Debug.Log((object)("Stiffness Dist: " + DB.m_StiffnessDistrib));
Debug.Log((object)("Inert: " + DB.m_Inert));
Debug.Log((object)("Inert Dist: " + DB.m_InertDistrib));
Debug.Log((object)("Radius: " + DB.m_Radius));
Debug.Log((object)("Radius Dist: " + DB.m_RadiusDistrib));
Debug.Log((object)("End Length: " + DB.m_EndLength));
Debug.Log((object)("End Offset: " + DB.m_EndOffset));
Debug.Log((object)("Gravity: " + DB.m_Gravity));
Debug.Log((object)("Force: " + DB.m_Force));
Debug.Log((object)("FreezeAxis: " + DB.m_FreezeAxis));
Debug.Log((object)("Colliders: " + DB.m_Colliders.Count));
foreach (DynamicBoneCollider collider in DB.m_Colliders)
{
Debug.Log((object)("\t Parent: " + ((Object)((Component)collider).transform).name));
Debug.Log((object)("\t Direction: " + collider.m_Direction));
Debug.Log((object)("\t Center " + collider.m_Center));
Debug.Log((object)("\t Bound " + collider.m_Bound));
Debug.Log((object)("\t Radius " + collider.m_Radius));
Debug.Log((object)("\t Height " + collider.m_Height));
}
Debug.Log((object)("Exclusions: " + DB.m_Exclusions.Count));
foreach (Transform exclusion in DB.m_Exclusions)
{
Debug.Log((object)("\t Transform: " + ((Object)exclusion).name));
}
}
public static ChildLocator GetChildLocator(GameObject body)
{
ChildLocator val = null;
Transform child = body.transform.GetChild(0);
if (Object.op_Implicit((Object)(object)child))
{
Transform child2 = child.GetChild(0);
if (Object.op_Implicit((Object)(object)child2))
{
val = ((Component)child2).GetComponent<ChildLocator>();
if (Object.op_Implicit((Object)(object)val))
{
Debug.Log((object)"Locator Found");
}
}
}
return val;
}
public static Transform FindChildInTree(Transform Root, string name)
{
Queue<Transform> queue = new Queue<Transform>();
queue.Enqueue(Root);
while (queue.Count != 0)
{
Transform val = queue.Dequeue();
if (((Object)val).name == name)
{
return val;
}
for (int i = 0; i < val.childCount; i++)
{
Transform child = val.GetChild(i);
queue.Enqueue(child);
}
}
return null;
}
public static string RemoveCloneNaming(string str)
{
return str.Remove(str.Length - 7);
}
}
}
namespace RuneFoxMods.DynamicSkins
{
public static class DynamicSkinHelpers
{
public static SkinnedMeshRenderer[] GetBaseSkinRenderers(GameObject modelObject)
{
SkinnedMeshRenderer[] componentsInChildren = modelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true);
List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>();
SkinnedMeshRenderer[] array = componentsInChildren;
foreach (SkinnedMeshRenderer val in array)
{
if ((Object)(object)((Component)val).transform.parent == (Object)(object)modelObject.transform)
{
list.Add(val);
}
}
return list.ToArray();
}
public static Transform[] BoneArrayBuilder(Transform NewBoneRoot)
{
List<Transform> list = new List<Transform>();
BoneArrayBuilderHelper(NewBoneRoot, list);
return list.ToArray();
}
public static void BoneArrayBuilderHelper(Transform parent, List<Transform> list)
{
if (!((Object)parent).name.EndsWith("_end"))
{
list.Add(parent);
}
for (int i = 0; i < parent.childCount; i++)
{
BoneArrayBuilderHelper(parent.GetChild(i), list);
}
}
public static Transform GetArmature(GameObject obj)
{
return GetArmatureHelper(obj);
}
public static Transform GetArmatureHelper(GameObject obj)
{
if (((Object)obj).name.ToLower().Contains("armature"))
{
return obj.transform;
}
for (int i = 0; i < obj.transform.childCount; i++)
{
Transform armatureHelper = GetArmatureHelper(((Component)obj.transform.GetChild(i)).gameObject);
if (Object.op_Implicit((Object)(object)armatureHelper))
{
return armatureHelper;
}
}
return null;
}
public static Transform GetTopParent(Transform obj)
{
Transform val = obj;
while ((Object)(object)val.parent != (Object)null)
{
val = val.parent;
}
return val;
}
public static string GetPrevBoneInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
{
Transform[] bones = meshRenderer.bones;
for (int i = 0; i <= bones.Length - 1; i++)
{
if (((Object)bones[i + 1]).name == ((Object)targetBone).name)
{
return ((Object)bones[i]).name;
}
}
return null;
}
public static int GetBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
{
Transform[] bones = meshRenderer.bones;
for (int i = 0; i <= bones.Length; i++)
{
if (((Object)bones[i]).name == ((Object)targetBone).name)
{
return i;
}
}
return -1;
}
public static int GetPrevBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
{
Transform[] bones = meshRenderer.bones;
for (int i = 0; i <= bones.Length - 1; i++)
{
if (((Object)bones[i + 1]).name == ((Object)targetBone).name)
{
return i;
}
}
return -1;
}
}
internal class DynamicSkinManager
{
internal Dictionary<string, SkinDef> SkinDefs = new Dictionary<string, SkinDef>();
private GameObject LastModelObject;
internal Dictionary<string, SortedList<int, Modification>> ModificationList = new Dictionary<string, SortedList<int, Modification>>();
private Dictionary<GameObject, AppliedModifications> ModifiedObjects = new Dictionary<GameObject, AppliedModifications>();
internal ManualLogSource InstanceLogger;
internal void AddModification(string skinNameToken, int boneIndex, Modification modification)
{
if (!ModificationList.TryGetValue(skinNameToken, out var value))
{
value = new SortedList<int, Modification>();
ModificationList.Add(skinNameToken, value);
}
value.Add(boneIndex, modification);
}
internal void AddSkinDef(SkinDef skinDef)
{
SkinDefs.Add(skinDef.nameToken, skinDef);
}
internal void SkinDefApply(Action<SkinDef, GameObject> orig, SkinDef self, GameObject modelObject)
{
orig(self, modelObject);
RemoveInvalidModelObjects();
ModifiedObjects.TryGetValue(modelObject, out var value);
try
{
if (!SkinDefs.TryGetValue(self.nameToken, out var _))
{
if (value != null)
{
ClearSkinModifications(LastModelObject, value);
}
}
else if (value == null)
{
AppliedModifications appliedModifications = new AppliedModifications();
ModifiedObjects.Add(modelObject, appliedModifications);
ApplySkinModifications(self, modelObject, appliedModifications);
}
}
catch (Exception ex)
{
InstanceLogger.LogWarning((object)"An error occured while adding accessories to a skin");
InstanceLogger.LogError((object)ex);
}
}
private void RemoveInvalidModelObjects()
{
foreach (GameObject item in ModifiedObjects.Keys.Where((GameObject el) => !Object.op_Implicit((Object)(object)el)).ToList())
{
ModifiedObjects.Remove(item);
}
}
private void ClearSkinModifications(GameObject modelObject, AppliedModifications modifications)
{
while (modifications.BaseModelModifications.Count != 0)
{
Modification modification = modifications.BaseModelModifications.Pop();
clearModification(modification, modelObject, modifications);
}
while (modifications.OtherModifications.Count != 0)
{
clearModification(modifications.OtherModifications[0], modelObject, modifications);
}
ModifiedObjects.Remove(modelObject);
}
private void ApplySkinModifications(SkinDef skindef, GameObject modelObject, AppliedModifications modifications)
{
CharacterModel component = modelObject.GetComponent<CharacterModel>();
LastModelObject = modelObject;
if (!ModificationList.TryGetValue(skindef.nameToken, out var value))
{
return;
}
foreach (KeyValuePair<int, Modification> item in value)
{
ApplyModification(modelObject, component, item.Value, modifications);
}
}
private static void ApplyModification(GameObject modelObject, CharacterModel characterModel, Modification modification, AppliedModifications modifications)
{
string bodyname = modification.bodyname;
string parentname = modification.parentname;
Transform val = Utils.FindChildInTree(modelObject.transform, parentname);
GameObject val2;
if (modification.affectsbasemodel)
{
val2 = Object.Instantiate<GameObject>(modification.prefab, val, false);
((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name);
modification.instance = val2;
modification.inst_armature = val2;
ModificationApplyBones(modelObject, modification, modifications);
}
else
{
val2 = Object.Instantiate<GameObject>(modification.prefab, modelObject.transform, false);
((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name);
modification.instance = val2;
Transform armature = DynamicSkinHelpers.GetArmature(val2);
((Component)armature).transform.SetParent(val, false);
modification.inst_armature = ((Component)armature).gameObject;
}
modification.instance = val2;
if (modification.dynamicBoneData != null)
{
ModificationApplyDynamicBones(modelObject, modification);
}
ModificationAddRenderers(val2, characterModel);
modifications.OtherModifications.Add(modification);
}
private static void ModificationApplyBones(GameObject modelObject, Modification modification, AppliedModifications modifications)
{
SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject);
List<Transform> list = baseSkinRenderers[0].bones.ToList();
Transform[] array = DynamicSkinHelpers.BoneArrayBuilder(modification.instance.transform);
list.InsertRange(modification.boneIndex, array);
modification.boneCount = array.Length;
SkinnedMeshRenderer[] array2 = baseSkinRenderers;
foreach (SkinnedMeshRenderer val in array2)
{
val.bones = list.ToArray();
}
modifications.BaseModelModifications.Push(modification);
}
private static void ModificationApplyDynamicBones(GameObject modelObject, Modification modification)
{
//IL_005e: 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_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)
//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)
//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_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: 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_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
DynamicBone val = (modification.inst_dynamicBone = modification.instance.AddComponent<DynamicBone>());
List<DynamicBoneCollider> list = new List<DynamicBoneCollider>();
foreach (DynamicBoneColliderData collider in modification.dynamicBoneData.m_Colliders)
{
Transform val2 = Utils.FindChildInTree(modelObject.transform, collider.m_parent_name);
DynamicBoneCollider val3 = ((Component)val2).gameObject.AddComponent<DynamicBoneCollider>();
val3.m_Direction = collider.m_Direction;
val3.m_Center = collider.m_Center;
val3.m_Bound = collider.m_Bound;
val3.m_Radius = collider.m_Radius;
val3.m_Height = collider.m_Height;
list.Add(val3);
}
modification.inst_DB_colliders = list;
Transform root = (val.m_Root = Utils.FindChildInTree(modification.inst_armature.transform, modification.dynamicBoneData.m_Root));
val.m_Damping = modification.dynamicBoneData.m_Damping;
val.m_DampingDistrib = modification.dynamicBoneData.m_DampingDistrib;
val.m_Elasticity = modification.dynamicBoneData.m_Elasticity;
val.m_ElasticityDistrib = modification.dynamicBoneData.m_ElasticityDistrib;
val.m_Stiffness = modification.dynamicBoneData.m_Stiffness;
val.m_StiffnessDistrib = modification.dynamicBoneData.m_StiffnessDistrib;
val.m_Inert = modification.dynamicBoneData.m_Inert;
val.m_InertDistrib = modification.dynamicBoneData.m_InertDistrib;
val.m_Radius = modification.dynamicBoneData.m_Radius;
val.m_RadiusDistrib = modification.dynamicBoneData.m_RadiusDistrib;
val.m_EndLength = modification.dynamicBoneData.m_EndLength;
val.m_EndOffset = modification.dynamicBoneData.m_EndOffset;
val.m_Gravity = modification.dynamicBoneData.m_Gravity;
val.m_Force = modification.dynamicBoneData.m_Force;
val.m_Colliders = list;
val.m_Exclusions = new List<Transform>();
foreach (string exclusion in modification.dynamicBoneData.m_Exclusions)
{
Transform val4 = Utils.FindChildInTree(root, exclusion);
if ((Object)(object)val4 != (Object)null)
{
val.m_Exclusions.Add(val4);
}
else
{
Debug.LogWarning((object)"Tried to exclude a transform that could not be found");
}
}
val.m_FreezeAxis = modification.dynamicBoneData.m_FreezeAxis;
}
private static void ModificationAddRenderers(GameObject newPart, CharacterModel characterModel)
{
//IL_0050: 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_0082: 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)
SkinnedMeshRenderer[] componentsInChildren = newPart.GetComponentsInChildren<SkinnedMeshRenderer>(true);
Array.Resize(ref characterModel.baseRendererInfos, characterModel.baseRendererInfos.Length + componentsInChildren.Length);
if (componentsInChildren.Length != 0)
{
int num = componentsInChildren.Length;
SkinnedMeshRenderer[] array = componentsInChildren;
foreach (SkinnedMeshRenderer val in array)
{
characterModel.baseRendererInfos[characterModel.baseRendererInfos.Length - num] = new RendererInfo
{
renderer = (Renderer)(object)componentsInChildren[^num],
ignoreOverlays = false,
defaultShadowCastingMode = (ShadowCastingMode)1,
defaultMaterial = ((Renderer)val).sharedMaterial
};
num--;
}
}
}
private void clearModification(Modification modification, GameObject modelObject, AppliedModifications modifications)
{
if (modification.inst_DB_colliders != null)
{
foreach (DynamicBoneCollider inst_DB_collider in modification.inst_DB_colliders)
{
Object.Destroy((Object)(object)inst_DB_collider);
}
}
if (modification.affectsbasemodel)
{
SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject);
List<Transform> list = baseSkinRenderers[0].bones.ToList();
list.RemoveRange(modification.boneIndex, modification.boneCount);
SkinnedMeshRenderer[] array = baseSkinRenderers;
foreach (SkinnedMeshRenderer val in array)
{
val.bones = list.ToArray();
}
}
Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_dynamicBone);
Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_armature);
Object.Destroy((Object)(object)modifications.OtherModifications[0].instance);
if (!modifications.OtherModifications.Remove(modification))
{
InstanceLogger.LogError((object)"Skin Modification was not removed");
}
}
}
internal class Modification
{
public string prefabpath;
public string bodyname;
public string parentname;
public GameObject prefab;
public bool affectsbasemodel;
public DynamicBoneData dynamicBoneData;
public string parentSkinToken;
public int boneIndex;
public int boneCount;
public GameObject instance;
public GameObject inst_armature;
public DynamicBone inst_dynamicBone;
public List<DynamicBoneCollider> inst_DB_colliders = new List<DynamicBoneCollider>();
public Modification(string PrefabPath, string ParentName, string BodyName, string ParentSkinToken, int BoneIndex, bool AffectsBaseModel, AssetBundle assetBundle)
{
bodyname = BodyName;
prefabpath = PrefabPath;
parentname = ParentName;
parentSkinToken = ParentSkinToken;
affectsbasemodel = AffectsBaseModel;
boneIndex = BoneIndex;
prefab = assetBundle.LoadAsset<GameObject>(prefabpath);
if ((Object)(object)prefab == (Object)null)
{
Debug.LogWarning((object)("Asset at " + PrefabPath + " was not loaded"));
}
}
}
internal class AppliedModifications
{
public Stack<Modification> BaseModelModifications = new Stack<Modification>();
public List<Modification> OtherModifications = new List<Modification>();
}
internal class DynamicBoneData
{
public string m_Root;
public float m_Damping;
public AnimationCurve m_DampingDistrib;
public float m_Elasticity;
public AnimationCurve m_ElasticityDistrib;
public float m_Stiffness;
public AnimationCurve m_StiffnessDistrib;
public float m_Inert;
public AnimationCurve m_InertDistrib;
public float m_Radius;
public AnimationCurve m_RadiusDistrib;
public float m_EndLength;
public Vector3 m_EndOffset;
public Vector3 m_Gravity;
public Vector3 m_Force;
public List<DynamicBoneColliderData> m_Colliders;
public List<string> m_Exclusions;
public FreezeAxis m_FreezeAxis;
public DynamicBoneData(string root, float damping, AnimationCurve damping_dist, float elasticity, AnimationCurve elasticity_dist, float stiffness, AnimationCurve stiffness_dist, float inert, AnimationCurve inert_dist, float radius, AnimationCurve radius_dist, float end_length, Vector3 end_offset, Vector3 gravity, Vector3 force, List<DynamicBoneColliderData> colliders, List<string> exclusions, FreezeAxis freeze_axis)
{
//IL_0066: 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_006e: 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_0076: 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_008e: 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)
m_Root = root;
m_Damping = damping;
m_DampingDistrib = damping_dist;
m_Elasticity = elasticity;
m_ElasticityDistrib = elasticity_dist;
m_Stiffness = stiffness;
m_StiffnessDistrib = stiffness_dist;
m_Inert = inert;
m_InertDistrib = inert_dist;
m_Radius = radius;
m_RadiusDistrib = radius_dist;
m_EndLength = end_length;
m_EndOffset = end_offset;
m_Gravity = gravity;
m_Force = force;
m_Colliders = colliders;
m_Exclusions = exclusions;
m_FreezeAxis = freeze_axis;
}
}
internal class DynamicBoneColliderData
{
public string m_parent_name;
public Direction m_Direction;
public Vector3 m_Center;
public Bound m_Bound;
public float m_Radius;
public float m_Height;
public DynamicBoneColliderData(string parent_name, Direction direction, Vector3 Center, Bound bound, float radius, float heaight)
{
//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_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_001e: 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)
m_parent_name = parent_name;
m_Direction = direction;
m_Center = Center;
m_Bound = bound;
m_Radius = radius;
m_Height = heaight;
}
}
}
namespace BrazilianHatsuneMiku
{
[BepInPlugin("com.Vitus.BrazilianHatsuneMiku", "Brazilian Hatsune Miku", "1.0.0")]
public class BrazilianHatsuneMikuPlugin : BaseUnityPlugin
{
private class FieldException : Exception
{
public FieldException(string message, Exception innerException)
: base(message, innerException)
{
}
}
public class DynamicSkinExtension
{
private Modification MikuSkinDefBaseFlowerModification;
private Modification MikuSkinDefBaseHairFace1Modification;
private Modification MikuSkinDefBaseHairFace2Modification;
private Modification MikuSkinDefBaseHairFace3Modification;
private Modification MikuSkinDefBaseHairFaceLeftModification;
private Modification MikuSkinDefBaseHairFaceRightModification;
private Modification MikuSkinDefBaseHairStrand1Modification;
private Modification MikuSkinDefBaseHairStrand2Modification;
private Modification MikuSkinDefBaseHairStrand3Modification;
private Modification MikuSkinDefBaseHairStrand4Modification;
private Modification MikuSkinDefBaseHairStrand5Modification;
private Modification MikuSkinDefBaseHairStrand6Modification;
private Modification MikuSkinDefBaseHairStrand8Modification;
private Modification MikuSkinDefBaseHairStrand10Modification;
private Modification MikuSkinDefBaseHairStrand11Modification;
private Modification MikuSkinDefBaseHairStrand12Modification;
private Modification MikuSkinDefBaseHairStrand13Modification;
private Modification MikuSkinDefBaseHairStrand14Modification;
private Modification MikuSkinDefBaseHairStrand15Modification;
private Modification MikuSkinDefBaseHairStrand16Modification;
private Modification MikuSkinDefBaseHairStrand17Modification;
private Modification MikuSkinDefBaseHairStrand18Modification;
private Modification MikuSkinDefBaseHairStrand19Modification;
private Modification MikuSkinDefBaseHairStrand20Modification;
private Modification MikuSkinDefBaseHairStrand21Modification;
private Modification MikuSkinDefBaseHairStrand22Modification;
private Modification MikuSkinDefBaseHairStrand23Modification;
private Modification MikuSkinDefBaseHairTail1LeftModification;
private Modification MikuSkinDefBaseHairTail1RightModification;
private Modification MikuSkinDefBaseHairTail2LeftModification;
private Modification MikuSkinDefBaseHairTail2RightModification;
private Modification MikuSkinDefBaseHairTail3LeftModification;
private Modification MikuSkinDefBaseHairTail3RightModification;
private Modification MikuSkinDefBaseHairTail4LeftModification;
private Modification MikuSkinDefBaseHairTail4RightModification;
private Modification MikuSkinDefBaseHairTail5LeftModification;
private Modification MikuSkinDefBaseHairTail5RightModification;
private Modification MikuSkinDefBaseHairTail6LeftModification;
private Modification MikuSkinDefBaseHairTail6RightModification;
private Modification MikuSkinDefBaseHairTail7RightModification;
internal void BeforeStart()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
_DynamicSkinManager.InstanceLogger = ((BaseUnityPlugin)Instance).Logger;
new Hook((MethodBase)typeof(SkinDef).GetMethod("Apply"), (Delegate)new Action<Action<SkinDef, GameObject>, SkinDef, GameObject>(_DynamicSkinManager.SkinDefApply)).Apply();
}
internal void AfterStart()
{
InitializeModifications();
InitializeDynamicBones();
AddModificationsToList();
}
internal void BeforeBodyCatalogInit()
{
SeekerBodyMikuSkinDefSkinAddedEvent += onSkinAdded;
}
internal void AfterBodyCatalogInit()
{
}
private void InitializeModifications()
{
MikuSkinDefBaseFlowerModification = new Modification("BaseFlower.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 57, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairFace1Modification = new Modification("BaseHairFace1.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 58, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairFace2Modification = new Modification("BaseHairFace2.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 185, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairFace3Modification = new Modification("BaseHairFace3.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 187, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairFaceLeftModification = new Modification("BaseHairFaceLeft.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 66, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairFaceRightModification = new Modification("BaseHairFaceRight.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 60, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand1Modification = new Modification("BaseHairStrand1.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 64, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand2Modification = new Modification("BaseHairStrand2.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 70, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand3Modification = new Modification("BaseHairStrand3.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 72, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand4Modification = new Modification("BaseHairStrand4.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 75, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand5Modification = new Modification("BaseHairStrand5.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 79, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand6Modification = new Modification("BaseHairStrand6.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 82, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand8Modification = new Modification("BaseHairStrand8.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 89, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand10Modification = new Modification("BaseHairStrand10.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 116, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand11Modification = new Modification("BaseHairStrand11.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 119, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand12Modification = new Modification("BaseHairStrand12.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 123, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand13Modification = new Modification("BaseHairStrand13.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 126, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand14Modification = new Modification("BaseHairStrand14.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 130, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand15Modification = new Modification("BaseHairStrand15.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 133, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand16Modification = new Modification("BaseHairStrand16.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 136, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand17Modification = new Modification("BaseHairStrand17.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 139, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand18Modification = new Modification("BaseHairStrand18.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 142, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand19Modification = new Modification("BaseHairStrand19.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 145, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand20Modification = new Modification("BaseHairStrand20.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 148, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand21Modification = new Modification("BaseHairStrand21.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 151, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand22Modification = new Modification("BaseHairStrand22.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 153, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairStrand23Modification = new Modification("BaseHairStrand23.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 155, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail1LeftModification = new Modification("BaseHairTail1Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 158, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail1RightModification = new Modification("BaseHairTail1Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 100, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail2LeftModification = new Modification("BaseHairTail2Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 162, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail2RightModification = new Modification("BaseHairTail2Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 95, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail3LeftModification = new Modification("BaseHairTail3Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 166, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail3RightModification = new Modification("BaseHairTail3Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 105, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail4LeftModification = new Modification("BaseHairTail4Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 170, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail4RightModification = new Modification("BaseHairTail4Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 109, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail5LeftModification = new Modification("BaseHairTail5Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 174, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail5RightModification = new Modification("BaseHairTail5Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 113, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail6LeftModification = new Modification("BaseHairTail6Left.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 179, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail6RightModification = new Modification("BaseHairTail6Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 92, AffectsBaseModel: true, assetBundle);
MikuSkinDefBaseHairTail7RightModification = new Modification("BaseHairTail7Right.prefab", "Head", "SeekerBody", "VITUS_SKIN_MIKUSKINDEF_NAME", 85, AffectsBaseModel: true, assetBundle);
}
private void InitializeDynamicBones()
{
//IL_003e: 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_0066: 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_00d1: 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_0105: 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_0181: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: 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_02e1: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_037d: 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_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03c5: 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_0441: Unknown result type (might be due to invalid IL or missing references)
//IL_0455: Unknown result type (might be due to invalid IL or missing references)
//IL_0475: Unknown result type (might be due to invalid IL or missing references)
//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0505: 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_058d: 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_05b5: Unknown result type (might be due to invalid IL or missing references)
//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
//IL_063d: Unknown result type (might be due to invalid IL or missing references)
//IL_0651: Unknown result type (might be due to invalid IL or missing references)
//IL_0665: Unknown result type (might be due to invalid IL or missing references)
//IL_0685: Unknown result type (might be due to invalid IL or missing references)
//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0701: Unknown result type (might be due to invalid IL or missing references)
//IL_0715: Unknown result type (might be due to invalid IL or missing references)
//IL_0735: Unknown result type (might be due to invalid IL or missing references)
//IL_079d: Unknown result type (might be due to invalid IL or missing references)
//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
//IL_084d: Unknown result type (might be due to invalid IL or missing references)
//IL_0861: Unknown result type (might be due to invalid IL or missing references)
//IL_0875: Unknown result type (might be due to invalid IL or missing references)
//IL_0895: Unknown result type (might be due to invalid IL or missing references)
//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0911: Unknown result type (might be due to invalid IL or missing references)
//IL_0925: Unknown result type (might be due to invalid IL or missing references)
//IL_0945: Unknown result type (might be due to invalid IL or missing references)
//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
//IL_09f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
//IL_0aa5: Unknown result type (might be due to invalid IL or missing references)
//IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
//IL_0b21: Unknown result type (might be due to invalid IL or missing references)
//IL_0b35: Unknown result type (might be due to invalid IL or missing references)
//IL_0b55: Unknown result type (might be due to invalid IL or missing references)
//IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
//IL_0be5: Unknown result type (might be due to invalid IL or missing references)
//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
//IL_0c81: Unknown result type (might be due to invalid IL or missing references)
//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb5: Unknown result type (might be due to invalid IL or missing references)
//IL_0d1d: Unknown result type (might be due to invalid IL or missing references)
//IL_0d31: Unknown result type (might be due to invalid IL or missing references)
//IL_0d45: Unknown result type (might be due to invalid IL or missing references)
//IL_0d65: Unknown result type (might be due to invalid IL or missing references)
//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
//IL_0de1: Unknown result type (might be due to invalid IL or missing references)
//IL_0df5: Unknown result type (might be due to invalid IL or missing references)
//IL_0e15: Unknown result type (might be due to invalid IL or missing references)
//IL_0e7d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e91: Unknown result type (might be due to invalid IL or missing references)
//IL_0ea5: Unknown result type (might be due to invalid IL or missing references)
//IL_0ec5: Unknown result type (might be due to invalid IL or missing references)
//IL_0f2d: Unknown result type (might be due to invalid IL or missing references)
//IL_0f41: Unknown result type (might be due to invalid IL or missing references)
//IL_0f55: Unknown result type (might be due to invalid IL or missing references)
//IL_0f75: Unknown result type (might be due to invalid IL or missing references)
//IL_0fdd: Unknown result type (might be due to invalid IL or missing references)
//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
//IL_1005: Unknown result type (might be due to invalid IL or missing references)
//IL_1025: Unknown result type (might be due to invalid IL or missing references)
//IL_108d: Unknown result type (might be due to invalid IL or missing references)
//IL_10a1: Unknown result type (might be due to invalid IL or missing references)
//IL_10b5: Unknown result type (might be due to invalid IL or missing references)
//IL_10d5: Unknown result type (might be due to invalid IL or missing references)
//IL_113d: Unknown result type (might be due to invalid IL or missing references)
//IL_1151: Unknown result type (might be due to invalid IL or missing references)
//IL_1165: Unknown result type (might be due to invalid IL or missing references)
//IL_1185: Unknown result type (might be due to invalid IL or missing references)
//IL_11ed: Unknown result type (might be due to invalid IL or missing references)
//IL_1201: Unknown result type (might be due to invalid IL or missing references)
//IL_1215: Unknown result type (might be due to invalid IL or missing references)
//IL_1235: Unknown result type (might be due to invalid IL or missing references)
//IL_129d: Unknown result type (might be due to invalid IL or missing references)
//IL_12b1: Unknown result type (might be due to invalid IL or missing references)
//IL_12c5: Unknown result type (might be due to invalid IL or missing references)
//IL_12e5: Unknown result type (might be due to invalid IL or missing references)
//IL_1316: Unknown result type (might be due to invalid IL or missing references)
//IL_1347: Unknown result type (might be due to invalid IL or missing references)
//IL_13af: Unknown result type (might be due to invalid IL or missing references)
//IL_13c3: Unknown result type (might be due to invalid IL or missing references)
//IL_13d7: Unknown result type (might be due to invalid IL or missing references)
//IL_13f7: Unknown result type (might be due to invalid IL or missing references)
//IL_1428: Unknown result type (might be due to invalid IL or missing references)
//IL_1459: Unknown result type (might be due to invalid IL or missing references)
//IL_14c1: Unknown result type (might be due to invalid IL or missing references)
//IL_14d5: Unknown result type (might be due to invalid IL or missing references)
//IL_14e9: Unknown result type (might be due to invalid IL or missing references)
//IL_1509: Unknown result type (might be due to invalid IL or missing references)
//IL_153a: Unknown result type (might be due to invalid IL or missing references)
//IL_156b: Unknown result type (might be due to invalid IL or missing references)
//IL_15d3: Unknown result type (might be due to invalid IL or missing references)
//IL_15e7: Unknown result type (might be due to invalid IL or missing references)
//IL_15fb: Unknown result type (might be due to invalid IL or missing references)
//IL_161b: Unknown result type (might be due to invalid IL or missing references)
//IL_164c: Unknown result type (might be due to invalid IL or missing references)
//IL_167d: Unknown result type (might be due to invalid IL or missing references)
//IL_16e5: Unknown result type (might be due to invalid IL or missing references)
//IL_16f9: Unknown result type (might be due to invalid IL or missing references)
//IL_170d: Unknown result type (might be due to invalid IL or missing references)
//IL_172d: Unknown result type (might be due to invalid IL or missing references)
//IL_175e: Unknown result type (might be due to invalid IL or missing references)
//IL_178f: Unknown result type (might be due to invalid IL or missing references)
//IL_17f7: Unknown result type (might be due to invalid IL or missing references)
//IL_180b: Unknown result type (might be due to invalid IL or missing references)
//IL_181f: Unknown result type (might be due to invalid IL or missing references)
//IL_183f: Unknown result type (might be due to invalid IL or missing references)
//IL_1870: Unknown result type (might be due to invalid IL or missing references)
//IL_18a1: Unknown result type (might be due to invalid IL or missing references)
//IL_1909: Unknown result type (might be due to invalid IL or missing references)
//IL_191d: Unknown result type (might be due to invalid IL or missing references)
//IL_1931: Unknown result type (might be due to invalid IL or missing references)
//IL_1951: Unknown result type (might be due to invalid IL or missing references)
//IL_1982: Unknown result type (might be due to invalid IL or missing references)
//IL_19b3: Unknown result type (might be due to invalid IL or missing references)
//IL_1a1b: Unknown result type (might be due to invalid IL or missing references)
//IL_1a2f: Unknown result type (might be due to invalid IL or missing references)
//IL_1a43: Unknown result type (might be due to invalid IL or missing references)
//IL_1a63: Unknown result type (might be due to invalid IL or missing references)
//IL_1a94: Unknown result type (might be due to invalid IL or missing references)
//IL_1ac5: Unknown result type (might be due to invalid IL or missing references)
//IL_1b2d: Unknown result type (might be due to invalid IL or missing references)
//IL_1b41: Unknown result type (might be due to invalid IL or missing references)
//IL_1b55: Unknown result type (might be due to invalid IL or missing references)
//IL_1b75: Unknown result type (might be due to invalid IL or missing references)
//IL_1ba6: Unknown result type (might be due to invalid IL or missing references)
//IL_1bd7: Unknown result type (might be due to invalid IL or missing references)
//IL_1c3f: Unknown result type (might be due to invalid IL or missing references)
//IL_1c53: Unknown result type (might be due to invalid IL or missing references)
//IL_1c67: Unknown result type (might be due to invalid IL or missing references)
//IL_1c87: Unknown result type (might be due to invalid IL or missing references)
//IL_1cb8: Unknown result type (might be due to invalid IL or missing references)
//IL_1ce9: Unknown result type (might be due to invalid IL or missing references)
//IL_1d51: Unknown result type (might be due to invalid IL or missing references)
//IL_1d65: Unknown result type (might be due to invalid IL or missing references)
//IL_1d79: Unknown result type (might be due to invalid IL or missing references)
//IL_1d99: Unknown result type (might be due to invalid IL or missing references)
//IL_1dca: Unknown result type (might be due to invalid IL or missing references)
//IL_1dfb: Unknown result type (might be due to invalid IL or missing references)
//IL_1e63: Unknown result type (might be due to invalid IL or missing references)
//IL_1e77: Unknown result type (might be due to invalid IL or missing references)
//IL_1e8b: Unknown result type (might be due to invalid IL or missing references)
//IL_1eab: Unknown result type (might be due to invalid IL or missing references)
//IL_1edc: Unknown result type (might be due to invalid IL or missing references)
//IL_1f0d: Unknown result type (might be due to invalid IL or missing references)
//IL_1f75: Unknown result type (might be due to invalid IL or missing references)
//IL_1f89: Unknown result type (might be due to invalid IL or missing references)
//IL_1f9d: Unknown result type (might be due to invalid IL or missing references)
//IL_1fbd: Unknown result type (might be due to invalid IL or missing references)
//IL_1fee: Unknown result type (might be due to invalid IL or missing references)
//IL_201f: Unknown result type (might be due to invalid IL or missing references)
MikuSkinDefBaseFlowerModification.dynamicBoneData = new DynamicBoneData("BaseFlower", 0.7f, null, 0.2f, null, 0.5f, null, 0.3f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairFace1Modification.dynamicBoneData = new DynamicBoneData("BaseHairFace1", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairFace2Modification.dynamicBoneData = new DynamicBoneData("BaseHairFace2", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairFace3Modification.dynamicBoneData = new DynamicBoneData("BaseHairFace3", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairFaceLeftModification.dynamicBoneData = new DynamicBoneData("BaseHairFaceLeft", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairFaceRightModification.dynamicBoneData = new DynamicBoneData("BaseHairFaceRight", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand1Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand1", 0.619f, null, 0.05f, null, 0.586f, null, 0.532f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand2Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand2", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand3Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand3", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand4Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand4", 0.641f, null, 0.05f, null, 0.766f, null, 0.618f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand5Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand5", 0.51f, null, 0.05f, null, 0.663f, null, 0.505f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand6Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand6", 0.684f, null, 0.05f, null, 0.81f, null, 0.657f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand8Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand8", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand10Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand10", 0.537f, null, 0.05f, null, 0.673f, null, 0.603f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand11Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand11", 0.668f, null, 0.05f, null, 0.717f, null, 0.619f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand12Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand12", 0.75f, null, 0.05f, null, 0.8f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand13Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand13", 0.75f, null, 0.05f, null, 0.9f, null, 0.7f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand14Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand14", 0.4f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand15Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand15", 0.4f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand16Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand16", 0.4f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand17Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand17", 0.4f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand18Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand18", 0.6f, null, 0.05f, null, 0.7f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand19Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand19", 0.7f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand20Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand20", 0.75f, null, 0.05f, null, 0.7f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand21Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand21", 0.6f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand22Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand22", 0.5f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairStrand23Modification.dynamicBoneData = new DynamicBoneData("BaseHairStrand23", 0.5f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail1LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail1Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail1RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail1Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail2LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail2Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail2RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail2Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail3LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail3Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail3RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail3Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail4LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail4Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail4RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail4Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail5LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail5Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail5RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail5Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail6LeftModification.dynamicBoneData = new DynamicBoneData("BaseHairTail6Left", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail6RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail6Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
MikuSkinDefBaseHairTail7RightModification.dynamicBoneData = new DynamicBoneData("BaseHairTail7Right", 0.2f, null, 0.05f, null, 0.6f, null, 0.5f, null, 0.03f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
{
new DynamicBoneColliderData("Spine3", (Direction)1, new Vector3(0f, 0.1f, 0f), (Bound)0, 0.2f, 0f),
new DynamicBoneColliderData("L_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f),
new DynamicBoneColliderData("R_Forearm", (Direction)1, new Vector3(0.02f, 0f, 0f), (Bound)0, 0.12f, 0f)
}, new List<string>(), (FreezeAxis)0);
}
private void AddModificationsToList()
{
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 57, MikuSkinDefBaseFlowerModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 58, MikuSkinDefBaseHairFace1Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 185, MikuSkinDefBaseHairFace2Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 187, MikuSkinDefBaseHairFace3Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 66, MikuSkinDefBaseHairFaceLeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 60, MikuSkinDefBaseHairFaceRightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 64, MikuSkinDefBaseHairStrand1Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 70, MikuSkinDefBaseHairStrand2Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 72, MikuSkinDefBaseHairStrand3Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 75, MikuSkinDefBaseHairStrand4Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 79, MikuSkinDefBaseHairStrand5Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 82, MikuSkinDefBaseHairStrand6Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 89, MikuSkinDefBaseHairStrand8Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 116, MikuSkinDefBaseHairStrand10Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 119, MikuSkinDefBaseHairStrand11Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 123, MikuSkinDefBaseHairStrand12Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 126, MikuSkinDefBaseHairStrand13Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 130, MikuSkinDefBaseHairStrand14Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 133, MikuSkinDefBaseHairStrand15Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 136, MikuSkinDefBaseHairStrand16Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 139, MikuSkinDefBaseHairStrand17Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 142, MikuSkinDefBaseHairStrand18Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 145, MikuSkinDefBaseHairStrand19Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 148, MikuSkinDefBaseHairStrand20Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 151, MikuSkinDefBaseHairStrand21Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 153, MikuSkinDefBaseHairStrand22Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 155, MikuSkinDefBaseHairStrand23Modification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 158, MikuSkinDefBaseHairTail1LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 100, MikuSkinDefBaseHairTail1RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 162, MikuSkinDefBaseHairTail2LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 95, MikuSkinDefBaseHairTail2RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 166, MikuSkinDefBaseHairTail3LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 105, MikuSkinDefBaseHairTail3RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 170, MikuSkinDefBaseHairTail4LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 109, MikuSkinDefBaseHairTail4RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 174, MikuSkinDefBaseHairTail5LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 113, MikuSkinDefBaseHairTail5RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 179, MikuSkinDefBaseHairTail6LeftModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 92, MikuSkinDefBaseHairTail6RightModification);
_DynamicSkinManager.AddModification("VITUS_SKIN_MIKUSKINDEF_NAME", 85, MikuSkinDefBaseHairTail7RightModification);
}
private static void onSkinAdded(object sender, SkinAddedArgs e)
{
_DynamicSkinManager.AddSkinDef(e.skinDef);
}
}
public delegate void VoidDelegate();
public class SkinAddedArgs : EventArgs
{
public SkinDef skinDef { get; }
public GameObject bodyPrefab { get; }
public SkinAddedArgs(SkinDef newSkinDef, GameObject newGameObject)
{
skinDef = newSkinDef;
bodyPrefab = newGameObject;
}
}
private static AssetBundle assetBundle;
private static readonly List<Material> materialsWithRoRShader = new List<Material>();
private static DynamicSkinExtension _DynamicSkinExtension = new DynamicSkinExtension();
private static DynamicSkinManager _DynamicSkinManager = new DynamicSkinManager();
private static VoidDelegate BeforeStartDelegate;
private static VoidDelegate AfterStartDelegate;
private static VoidDelegate BeforeBodyCatalogDelegate;
private static VoidDelegate AfterBodyCatalogDelegate;
internal static BrazilianHatsuneMikuPlugin Instance { get; private set; }
internal static ManualLogSource InstanceLogger
{
get
{
BrazilianHatsuneMikuPlugin instance = Instance;
return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null;
}
}
private static event EventHandler<SkinAddedArgs> SeekerBodyMikuSkinDefSkinAddedEvent;
private void Start()
{
Instance = this;
BeforeStart();
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BrazilianHatsuneMiku.vitusbrazilianhatsunemiku"))
{
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();
AfterStart();
}
private void BeforeStart()
{
BeforeStartDelegate = (VoidDelegate)Delegate.Combine(BeforeStartDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeStart));
BeforeStartDelegate?.Invoke();
}
private void AfterStart()
{
AfterStartDelegate = (VoidDelegate)Delegate.Combine(AfterStartDelegate, new VoidDelegate(_DynamicSkinExtension.AfterStart));
AfterStartDelegate?.Invoke();
}
private static void BeforeBodyCatalogInit()
{
BeforeBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(BeforeBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeBodyCatalogInit));
BeforeBodyCatalogDelegate?.Invoke();
}
private static void AfterBodyCatalogInit()
{
AfterBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(AfterBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.AfterBodyCatalogInit));
AfterBodyCatalogDelegate?.Invoke();
}
private static void ReplaceShaders()
{
LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Miku/Mikuterial.mat");
}
private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths)
{
//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)
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("VITUS_SKIN_MIKUSKINDEF_NAME", "Hatsune");
}
private static void Nothing(Action<SkinDef> orig, SkinDef self)
{
}
private static void BodyCatalogInit()
{
BeforeBodyCatalogInit();
MethodInfo method = typeof(SkinDef).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic);
HookEndpointManager.Add((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
AddSeekerBodyMikuSkinDefSkin();
HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
AfterBodyCatalogInit();
}
private static void SeekerBodyMikuSkinDefSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
{
BrazilianHatsuneMikuPlugin.SeekerBodyMikuSkinDefSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
}
private static void AddSeekerBodyMikuSkinDefSkin()
{
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
string text = "SeekerBody";
string text2 = "MikuSkinDef";
try
{
GameObject val = BodyCatalog.FindBodyPrefab(text);
if (!Object.op_Implicit((Object)(object)val))
{
InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
return;
}
ModelLocator component = val.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 skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
if (!Object.op_Implicit((Object)(object)skinController))
{
InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
return;
}
Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
TryCatchThrow("Icon", delegate
{
skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\BrazilianHatsuneMiku\\Icons\\MikuSkinDefIcon.png");
});
((Object)skin).name = text2;
skin.nameToken = "VITUS_SKIN_MIKUSKINDEF_NAME";
skin.rootObject = gameObject;
TryCatchThrow("Base Skins", delegate
{
skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] };
});
TryCatchThrow("Unlockable Name", delegate
{
skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "Hatsune"));
});
TryCatchThrow("Game Object Activations", delegate
{
skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
});
TryCatchThrow("Renderer Infos", delegate
{
//IL_0011: 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_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)
skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[1]
{
new RendererInfo
{
defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Miku/Mikuterial.mat"),
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = false,
renderer = renderers[0]
}
};
});
TryCatchThrow("Mesh Replacements", delegate
{
//IL_0011: 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_0063: 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_006d: 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_008b: Unknown result type (might be due to invalid IL or missing references)
skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[3]
{
new MeshReplacement
{
mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\BrazilianHatsuneMiku\\Meshes\\BrazHatsuneMikuDyn.mesh"),
renderer = renderers[0]
},
new MeshReplacement
{
mesh = null,
renderer = renderers[1]
},
new MeshReplacement
{
mesh = null,
renderer = renderers[2]
}
};
});
TryCatchThrow("Minion Skin Replacements", delegate
{
skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
});
TryCatchThrow("Projectile Ghost Replacements", delegate
{
skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
});
Array.Resize(ref skinController.skins, skinController.skins.Length + 1);
skinController.skins[skinController.skins.Length - 1] = skin;
BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins;
SeekerBodyMikuSkinDefSkinAdded(skin, val);
}
catch (FieldException ex)
{
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 ex2)
{
InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
InstanceLogger.LogError((object)ex2);
}
}
private static void TryCatchThrow(string message, Action action)
{
try
{
action?.Invoke();
}
catch (Exception innerException)
{
throw new FieldException(message, innerException);
}
}
}
}