private void FindDynamicBoneTypes() { if (_dynamicBoneType != null) { return; } Type dyBoneType = ValidationUtils.GetTypeFromName("DynamicBone"); if (dyBoneType == null) { return; } Type dyBoneColliderType = ValidationUtils.GetTypeFromName("DynamicBoneColliderBase") ?? ValidationUtils.GetTypeFromName("DynamicBoneCollider"); if (dyBoneColliderType == null) { return; } FieldInfo rootFieldInfo = dyBoneType.GetField("m_Root", BindingFlags.Public | BindingFlags.Instance); if (rootFieldInfo == null || rootFieldInfo.FieldType != typeof(Transform)) { return; } FieldInfo exclusionsFieldInfo = dyBoneType.GetField("m_Exclusions", BindingFlags.Public | BindingFlags.Instance); if (exclusionsFieldInfo == null || exclusionsFieldInfo.FieldType != typeof(List <Transform>)) { return; } FieldInfo collidersFieldInfo = dyBoneType.GetField("m_Colliders", BindingFlags.Public | BindingFlags.Instance); if (collidersFieldInfo == null || collidersFieldInfo.FieldType.GetGenericTypeDefinition() != typeof(List <>) || collidersFieldInfo.FieldType.GetGenericArguments().Single() != dyBoneColliderType) { return; } FieldInfo endLengthFieldInfo = dyBoneType.GetField("m_EndLength", BindingFlags.Public | BindingFlags.Instance); if (endLengthFieldInfo == null || endLengthFieldInfo.FieldType != typeof(float)) { return; } FieldInfo endOffsetFieldInfo = dyBoneType.GetField("m_EndOffset", BindingFlags.Public | BindingFlags.Instance); if (endOffsetFieldInfo == null || endOffsetFieldInfo.FieldType != typeof(Vector3)) { return; } _dynamicBoneType = dyBoneType; _dynamicBoneRootFieldInfo = rootFieldInfo; _dynamicBoneExclusionsFieldInfo = exclusionsFieldInfo; _dynamicBoneCollidersFieldInfo = collidersFieldInfo; _dynamicBoneEndLengthFieldInfo = endLengthFieldInfo; _dynamicBoneEndOffsetFieldInfo = endOffsetFieldInfo; }