ghorsington 3 years ago
parent
commit
afec831cc1
217 changed files with 30633 additions and 5761 deletions
  1. 5 5
      Assembly-CSharp.sln
  2. 1479 0
      Assembly-CSharp/AIKCtrl.cs
  3. 430 0
      Assembly-CSharp/ALimbIKCtrl.cs
  4. 30 0
      Assembly-CSharp/ATwistCtrl.cs
  5. 6 1
      Assembly-CSharp/AbstractFreeModeItem.cs
  6. 68 0
      Assembly-CSharp/AnkleTwist.cs
  7. 105 25
      Assembly-CSharp/Assembly-CSharp.csproj
  8. 563 0
      Assembly-CSharp/AutoKupaCtrl.cs
  9. 286 0
      Assembly-CSharp/BaseFader.cs
  10. 308 819
      Assembly-CSharp/BaseKagManager.cs
  11. 1 1
      Assembly-CSharp/BasePhotoCustomObject.cs
  12. 1 1
      Assembly-CSharp/BasePhotoWindowManager.cs
  13. 114 0
      Assembly-CSharp/BinaryReaderExtensions.cs
  14. 83 0
      Assembly-CSharp/BinaryWriterExtensions.cs
  15. 4 4
      Assembly-CSharp/BjMotionControl.cs
  16. 2 0
      Assembly-CSharp/BlendData.cs
  17. 0 132
      Assembly-CSharp/BodyCtrlData.cs
  18. 112 0
      Assembly-CSharp/BodySelectCtrl.cs
  19. 40 0
      Assembly-CSharp/BodySelectMgr.cs
  20. 197 0
      Assembly-CSharp/BoneDistanceToSkinMgr.cs
  21. 2 2
      Assembly-CSharp/BoneHair3.cs
  22. 570 0
      Assembly-CSharp/BoneMorphDefine.cs
  23. 28 17
      Assembly-CSharp/BoneMorph_.cs
  24. 286 0
      Assembly-CSharp/CM3.cs
  25. 205 0
      Assembly-CSharp/CMMImporter.cs
  26. 106 15
      Assembly-CSharp/CMSystem.cs
  27. 21 2
      Assembly-CSharp/CMT.cs
  28. 127 0
      Assembly-CSharp/CRCEdit/ConfigBridgeData.cs
  29. 216 0
      Assembly-CSharp/CRCEdit/EditBridge.cs
  30. 10 6
      Assembly-CSharp/CacheBoneDataArray.cs
  31. 267 28
      Assembly-CSharp/CharacterMgr.cs
  32. 1 1
      Assembly-CSharp/CompetitiveShowAPI.cs
  33. 2 2
      Assembly-CSharp/CompetitiveShowMgr.cs
  34. 15 2
      Assembly-CSharp/ConfigManager.cs
  35. 2 2
      Assembly-CSharp/ControllerShortcutSettingData.cs
  36. 3 2
      Assembly-CSharp/DailyCtrl.cs
  37. 51 0
      Assembly-CSharp/DailyMgr.cs
  38. 52 10
      Assembly-CSharp/Dance/UndressItem.cs
  39. 126 62
      Assembly-CSharp/DanceMain.cs
  40. 1 1
      Assembly-CSharp/DeskManager.cs
  41. 3 3
      Assembly-CSharp/DynamicBone.cs
  42. 95 0
      Assembly-CSharp/DynamicBoneColliderData.cs
  43. 311 0
      Assembly-CSharp/DynamicBoneMgr.cs
  44. 160 0
      Assembly-CSharp/DynamicBoneStatus.cs
  45. 491 0
      Assembly-CSharp/DynamicMuneBone.cs
  46. 836 0
      Assembly-CSharp/DynamicMuneYureBone.cs
  47. 26 11
      Assembly-CSharp/DynamicSkirtBone.cs
  48. 927 0
      Assembly-CSharp/DynamicYureBone.cs
  49. 1 1
      Assembly-CSharp/EditMod.cs
  50. 173 0
      Assembly-CSharp/ElbowKneeIKCtrl.cs
  51. 0 121
      Assembly-CSharp/ElbowKneeIKData.cs
  52. 12 0
      Assembly-CSharp/EmpireLifeModeData.cs
  53. 29 7
      Assembly-CSharp/EmpireLifeModeManager.cs
  54. 55 0
      Assembly-CSharp/FABRIKCtrl.cs
  55. 23 2
      Assembly-CSharp/FaceWindow.cs
  56. 7 3
      Assembly-CSharp/Facility.cs
  57. 62 1
      Assembly-CSharp/FacilityDataTable.cs
  58. 1 1
      Assembly-CSharp/FacilityManager.cs
  59. 88 0
      Assembly-CSharp/FaderEventDriven.cs
  60. 144 0
      Assembly-CSharp/FreeFBIKCtrl.cs
  61. 506 0
      Assembly-CSharp/FreeFBIKEffector.cs
  62. 80 9
      Assembly-CSharp/FreeModeItemEveryday.cs
  63. 38 6
      Assembly-CSharp/FreeModeItemLifeMode.cs
  64. 3 3
      Assembly-CSharp/FreeModeItemList.cs
  65. 8 8
      Assembly-CSharp/FreeModeItemVip.cs
  66. 4 4
      Assembly-CSharp/FreeModeSceneSelectBase.cs
  67. 0 717
      Assembly-CSharp/FullBodyIKCtrl.cs
  68. 1500 0
      Assembly-CSharp/FullBodyIKMgr.cs
  69. 32 14
      Assembly-CSharp/GameInShopMain.cs
  70. 64 13
      Assembly-CSharp/GameMain.cs
  71. 1 1
      Assembly-CSharp/GameModeManager.cs
  72. 66 19
      Assembly-CSharp/GameUty.cs
  73. 23 5
      Assembly-CSharp/GravityTransformControl.cs
  74. 401 0
      Assembly-CSharp/HandFootIKCtrl.cs
  75. 0 285
      Assembly-CSharp/HandFootIKData.cs
  76. 2 2
      Assembly-CSharp/HandSignShortcut.cs
  77. 10 0
      Assembly-CSharp/IDynamicBone.cs
  78. 20 0
      Assembly-CSharp/IFade.cs
  79. 201 0
      Assembly-CSharp/IKBodyOffsetCtrl.cs
  80. 51 0
      Assembly-CSharp/IKColliderMeta.cs
  81. 0 1418
      Assembly-CSharp/IKCtrlData.cs
  82. 28 0
      Assembly-CSharp/IKTargetBoneCtrl.cs
  83. 533 81
      Assembly-CSharp/ImportCM.cs
  84. 8 0
      Assembly-CSharp/KaraokeDataManager.cs
  85. 283 0
      Assembly-CSharp/KasaiUtility.cs
  86. 3 3
      Assembly-CSharp/Kasizuki/KasizukiManager.cs
  87. 2 40
      Assembly-CSharp/KupaCtrl.cs
  88. 315 0
      Assembly-CSharp/LimbColliderMgr.cs
  89. 0 68
      Assembly-CSharp/LimbIKData.cs
  90. 4 3
      Assembly-CSharp/LoadReplaceMaid.cs
  91. 109 17
      Assembly-CSharp/MPN.cs
  92. 11 9
      Assembly-CSharp/MPN_TYPE_RANGE.cs
  93. 805 190
      Assembly-CSharp/Maid.cs
  94. 12 8
      Assembly-CSharp/MaidColliderCollect.cs
  95. 415 0
      Assembly-CSharp/MaidExtension/MaidCostumeChangeController.cs
  96. 0 147
      Assembly-CSharp/MaidExtension/MaidMekureController.cs
  97. 1 1
      Assembly-CSharp/MaidParts.cs
  98. 56 11
      Assembly-CSharp/MaidProp.cs
  99. 107 0
      Assembly-CSharp/MaidStatus/GP003Status.cs
  100. 42 2
      Assembly-CSharp/MaidStatus/Status.cs
  101. 1 1
      Assembly-CSharp/MaidStatus/SubMaid.cs
  102. 306 0
      Assembly-CSharp/MaterialMgr.cs
  103. 28 0
      Assembly-CSharp/MathCM.cs
  104. 1 1
      Assembly-CSharp/McSkip.cs
  105. 709 280
      Assembly-CSharp/Menu.cs
  106. 5 1
      Assembly-CSharp/Misc.cs
  107. 3 3
      Assembly-CSharp/ModCompile.cs
  108. 1272 0
      Assembly-CSharp/MotionKagManager.cs
  109. 28 0
      Assembly-CSharp/MouthIKCtrl.cs
  110. 54 0
      Assembly-CSharp/MuneIKCtrl.cs
  111. 10 10
      Assembly-CSharp/OvrIK.cs
  112. 407 0
      Assembly-CSharp/PenisIKCtrl.cs
  113. 2 2
      Assembly-CSharp/PhotoManEditManager.cs
  114. 1 1
      Assembly-CSharp/PhotoModeSaveAndLoad.cs
  115. 4 7
      Assembly-CSharp/PhotoMotionData.cs
  116. 9 1
      Assembly-CSharp/PlacementWindow.cs
  117. 77 0
      Assembly-CSharp/PlayerStatus/GP003Status.cs
  118. 11 1
      Assembly-CSharp/PlayerStatus/Status.cs
  119. 29 0
      Assembly-CSharp/PosRotScale.cs
  120. 36 18
      Assembly-CSharp/PoseEditWindow.cs
  121. 1 1
      Assembly-CSharp/PresetCtrl.cs
  122. 1 1
      Assembly-CSharp/PresetServer.cs
  123. 52 0
      Assembly-CSharp/PrivateMaidMode/GP003MainMenuManager.cs
  124. 1 1
      Assembly-CSharp/PrivateMaidMode/PrivateModeMgr.cs
  125. 55 0
      Assembly-CSharp/PrivateMaidMode/SceneGP003MainMenuScreenManager.cs
  126. 22 0
      Assembly-CSharp/ProfileMgr.cs
  127. 106 0
      Assembly-CSharp/SavedAttachData.cs
  128. 74 7
      Assembly-CSharp/ScenarioData.cs
  129. 42 4
      Assembly-CSharp/SceneCasino.cs
  130. 1 1
      Assembly-CSharp/SceneCasinoShop.cs
  131. 494 131
      Assembly-CSharp/SceneEdit.cs
  132. 1 0
      Assembly-CSharp/SceneEditInfo.cs
  133. 11 3
      Assembly-CSharp/SceneEditWindow/CustomPartsWindow.cs
  134. 26 21
      Assembly-CSharp/SceneEditWindow/CustomViewItem.cs
  135. 1 1
      Assembly-CSharp/SceneEditWindow/PoseIconData.cs
  136. 39 7
      Assembly-CSharp/SceneFacilityManagement.cs
  137. 1 0
      Assembly-CSharp/SceneKasizukiMainMenu.cs
  138. 1 1
      Assembly-CSharp/SceneNPCEdit/NPCEditMain.cs
  139. 1 1
      Assembly-CSharp/SceneNPCEdit/SaveData.cs
  140. 1 0
      Assembly-CSharp/SceneUserEditMain.cs
  141. 2 4
      Assembly-CSharp/SceneVRCommunication.cs
  142. 8 1
      Assembly-CSharp/SceneVRTouch.cs
  143. 120 87
      Assembly-CSharp/Schedule/ScheduleAPI.cs
  144. 111 2
      Assembly-CSharp/Schedule/ScheduleCSVData.cs
  145. 8 0
      Assembly-CSharp/Schedule/ScheduleWork.cs
  146. 277 0
      Assembly-CSharp/Scourt/Utility/Parse.cs
  147. 225 10
      Assembly-CSharp/ScriptManager.cs
  148. 82 0
      Assembly-CSharp/ShoulderThighIKCtrl.cs
  149. 0 95
      Assembly-CSharp/ShoulderThighIKData.cs
  150. 86 0
      Assembly-CSharp/ShoulderTwist.cs
  151. 141 0
      Assembly-CSharp/SkinThickness.cs
  152. 4 0
      Assembly-CSharp/SpinBoxButton.cs
  153. 28 14
      Assembly-CSharp/SystemShortcut.cs
  154. 6 0
      Assembly-CSharp/TAttachPoint.cs
  155. 2498 512
      Assembly-CSharp/TBody.cs
  156. 4 0
      Assembly-CSharp/TBodyHit.cs
  157. 802 59
      Assembly-CSharp/TBodySkin.cs
  158. 64 30
      Assembly-CSharp/TMorph.cs
  159. 1046 0
      Assembly-CSharp/TMorphBone.cs
  160. 1831 0
      Assembly-CSharp/TMorphSkin.cs
  161. 69 0
      Assembly-CSharp/ThighTwist.cs
  162. 13 0
      Assembly-CSharp/TitleCtrl.cs
  163. 261 0
      Assembly-CSharp/TongueCtrl.cs
  164. 9 2
      Assembly-CSharp/TouchAction_Mgr.cs
  165. 117 0
      Assembly-CSharp/Tuple.2.cs
  166. 133 0
      Assembly-CSharp/Tuple.3.cs
  167. 164 0
      Assembly-CSharp/Tuple.4.cs
  168. 40 0
      Assembly-CSharp/Tuple.cs
  169. 38 0
      Assembly-CSharp/UTY.cs
  170. 65 0
      Assembly-CSharp/UndressDance_Mgr.cs
  171. 155 10
      Assembly-CSharp/UndressingManager.cs
  172. 16 1
      Assembly-CSharp/UndressingWindow.cs
  173. 8 1
      Assembly-CSharp/VRChoices.cs
  174. 8 1
      Assembly-CSharp/VRTouchComm.cs
  175. 89 0
      Assembly-CSharp/Vector3Int.cs
  176. 13 2
      Assembly-CSharp/Webs.cs
  177. 12 6
      Assembly-CSharp/WindowPartsBoneCheckBox.cs
  178. 18 9
      Assembly-CSharp/WindowPartsFaceMorph.cs
  179. 1 1
      Assembly-CSharp/WindowPartsFingerPreset.cs
  180. 25 4
      Assembly-CSharp/WindowPartsMekureCheckBox.cs
  181. 68 0
      Assembly-CSharp/WristTwist.cs
  182. 59 14
      Assembly-CSharp/YotogiManager.cs
  183. 2 4
      Assembly-CSharp/YotogiOldManager.cs
  184. 1 1
      Assembly-CSharp/YotogiOldSkillSelectWaitMotion.cs
  185. 1 1
      Assembly-CSharp/YotogiSkillSelectWaitMotion.cs
  186. 17 2
      Assembly-CSharp/com/workman/cm3d2/scene/dailyEtc/DailyAPI.cs
  187. 19 3
      Assembly-CSharp/jiggleBone.cs
  188. 20 0
      Assembly-CSharp/kt/ISaveLoadBinary.cs
  189. 52 0
      Assembly-CSharp/kt/PermTempAction.2.cs
  190. 52 0
      Assembly-CSharp/kt/PermTempAction.3.cs
  191. 52 0
      Assembly-CSharp/kt/PermTempAction.4.cs
  192. 52 0
      Assembly-CSharp/kt/PermTempAction.5.cs
  193. 52 0
      Assembly-CSharp/kt/PermTempAction.cs
  194. 175 0
      Assembly-CSharp/kt/Physics/ANativeColliderBase.cs
  195. 235 0
      Assembly-CSharp/kt/Physics/NativeCapsuleCollider.cs
  196. 30 0
      Assembly-CSharp/kt/Physics/NativeCapsuleColliderStatus.cs
  197. 78 0
      Assembly-CSharp/kt/Physics/NativeColliderStatus.cs
  198. 186 0
      Assembly-CSharp/kt/Physics/NativeMaidPropCollider.cs
  199. 27 0
      Assembly-CSharp/kt/Physics/NativeMaidPropColliderStatus.cs
  200. 126 0
      Assembly-CSharp/kt/Physics/NativePlaneCollider.cs
  201. 18 0
      Assembly-CSharp/kt/Physics/NativePlaneColliderStatus.cs
  202. 92 0
      Assembly-CSharp/kt/Physics/NativeSphereCollider.cs
  203. 17 0
      Assembly-CSharp/kt/Physics/NativeSphereColliderStatus.cs
  204. 27 0
      Assembly-CSharp/kt/Serialization/ASerializationVersionControl.cs
  205. 198 0
      Assembly-CSharp/kt/Utility/DebugUtility.cs
  206. 279 0
      Assembly-CSharp/kt/Utility/MathUtility.cs
  207. 297 0
      Assembly-CSharp/kt/Utility/UnityUtility.cs
  208. 33 0
      Assembly-CSharp/kt/ik/BodyOffsetIKParam.cs
  209. 144 0
      Assembly-CSharp/kt/ik/IKAttachParam.cs
  210. 268 0
      Assembly-CSharp/kt/ik/IKColliderSaveLoader.cs
  211. 242 0
      Assembly-CSharp/kt/ik/IKScriptHelper.cs
  212. 18 0
      Assembly-CSharp/kt/ik/InsertIKParam.cs
  213. 26 0
      Assembly-CSharp/kt/ik/PenisIKParam.cs
  214. 1 1
      Assembly-CSharp/scoutmode/ScoutMaidData.cs
  215. 1 1
      Assembly-CSharp/uGUICharacterSelectManager.cs
  216. 6 3
      Assembly-CSharp/uGUIKaraokeSelect.cs
  217. 28 0
      Assembly-CSharp/wf/Serialization/AJsonSerializationVersionControl.cs

+ 5 - 5
Assembly-CSharp.sln

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.28729.10
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{34835194-016C-48BF-BF42-8B9849DAC63D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{09246E70-928A-4345-9131-076F4D4174DE}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,10 +11,10 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{34835194-016C-48BF-BF42-8B9849DAC63D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{34835194-016C-48BF-BF42-8B9849DAC63D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{34835194-016C-48BF-BF42-8B9849DAC63D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{34835194-016C-48BF-BF42-8B9849DAC63D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{09246E70-928A-4345-9131-076F4D4174DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{09246E70-928A-4345-9131-076F4D4174DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{09246E70-928A-4345-9131-076F4D4174DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{09246E70-928A-4345-9131-076F4D4174DE}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

File diff suppressed because it is too large
+ 1479 - 0
Assembly-CSharp/AIKCtrl.cs


+ 430 - 0
Assembly-CSharp/ALimbIKCtrl.cs

@@ -0,0 +1,430 @@
+using System;
+using System.Collections.Generic;
+using kt.Physics;
+using kt.Utility;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+public abstract class ALimbIKCtrl : AIKCtrl
+{
+	public ALimbIKCtrl(FullBodyIKMgr ik_mgr, FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_mgr, effector_type)
+	{
+		ALimbIKCtrl $this = this;
+		this.chain = chain;
+		this.ikMapping = ik_mapping;
+		this.OrijinPull = this.chain.pull;
+		this.ColliderMeta = base.constraintTarget.parent.gameObject.AddComponent<IKColliderMeta>();
+		this.ColliderMeta.effectorType = this.effectorType;
+		if (this.myIKMgr.body.IsCrcBody)
+		{
+			ik_mgr.colliderLoader.onPostLoad.Add(delegate
+			{
+				$this.ColliderMeta.colliderList = ik_mgr.colliderLoader.GetColliderList(effector_type);
+				$this.colliderEnable = false;
+			}, false);
+		}
+		GameObject gameObject = new GameObject(effector_type.ToString() + "_IKPlaneCollider");
+		gameObject.transform.SetParent(this.myIKMgr.planeColliderTrans, false);
+		this.floorCollider = gameObject.AddComponent<NativePlaneCollider>();
+		this.floorCollider.planeStatus.direction = MathUtility.VectorType.Y;
+		this.floorCollider.enabled = true;
+		this.wallCollider = gameObject.gameObject.AddComponent<NativePlaneCollider>();
+		this.wallCollider.planeStatus.direction = MathUtility.VectorType.Z;
+		this.wallCollider.enabled = false;
+		this.myIKMgr.AddFloorCollider(this.floorCollider);
+		this.myIKMgr.AddWallCollider(this.wallCollider);
+	}
+
+	protected List<ANativeColliderBase> ColliderList
+	{
+		get
+		{
+			return this.ColliderMeta.colliderList;
+		}
+	}
+
+	public abstract bool isLeft { get; }
+
+	public abstract ALimbIKCtrl pairIK { get; }
+
+	public override bool isNeedFullbodySolverUpdate
+	{
+		get
+		{
+			return (base.isIKExec && this.IsPullBody) || (this.isNeedCorrect && this.correctType == ALimbIKCtrl.BorderCorrectType.HalfBody);
+		}
+	}
+
+	public bool isNeedCorrect { get; protected set; }
+
+	public bool colliderEnable
+	{
+		get
+		{
+			return this.ColliderMeta.enabled;
+		}
+		set
+		{
+			this.ColliderMeta.enabled = value;
+		}
+	}
+
+	public NativePlaneCollider floorCollider { get; protected set; }
+
+	public NativePlaneCollider wallCollider { get; protected set; }
+
+	public NativeMaidPropCollider limbCapsule { get; protected set; }
+
+	public override void Reset()
+	{
+		base.Reset();
+		this.correctType = ALimbIKCtrl.BorderCorrectType.Bone;
+		this.colliderEnable = false;
+		this.HitCheckLimbList.Clear();
+		this.isOldHitCheck = false;
+	}
+
+	public override void SetPullState(bool pull_on)
+	{
+		this.IsPullBody = pull_on;
+		if (pull_on)
+		{
+			this.chain.pull = this.OrijinPull;
+		}
+		else
+		{
+			this.chain.pull = 0.1f;
+		}
+	}
+
+	public void AddHitCheckLimb(ALimbIKCtrl limb)
+	{
+		if (!this.HitCheckLimbList.Contains(limb))
+		{
+			this.HitCheckLimbList.Add(limb);
+		}
+	}
+
+	public override void TargetTransCpy()
+	{
+		base.TargetTransCpy();
+		if (base.isUpperBody)
+		{
+			this.ikMapping.weight = 0f;
+		}
+	}
+
+	public override void ApplyIKSetting()
+	{
+		this.isNeedCorrect = false;
+		this.SolvedBonePos = base.bone.position;
+		base.ApplyIKSetting();
+		if (!base.isIKExec)
+		{
+			this.SetTargetTransformNoExec();
+		}
+		if (this.correctType == ALimbIKCtrl.BorderCorrectType.HalfBody)
+		{
+			this.HitCheck();
+		}
+		if (base.isUpperBody)
+		{
+			this.ikMapping.weight = Mathf.Max(this.ikMapping.weight, Mathf.Max(base.positionWeight, base.rotationWeight));
+		}
+	}
+
+	protected virtual void SetTargetTransformNoExec()
+	{
+	}
+
+	public virtual void HitCheck()
+	{
+		if (this.myIKMgr.body.IsCrcBody)
+		{
+			this.CheckLimbCapsule();
+		}
+		this.CheckPlaneCollider();
+	}
+
+	private void CheckLimbCapsule()
+	{
+		using (HashSet<ALimbIKCtrl>.Enumerator enumerator = this.HitCheckLimbList.GetEnumerator())
+		{
+			while (enumerator.MoveNext())
+			{
+				ALimbIKCtrl limb = enumerator.Current;
+				ALimbIKCtrl $this = this;
+				if (this.myIKMgr.ikExecOrder >= limb.myIKMgr.ikExecOrder && !limb.myIKMgr.body.isLateUpdateEnd && !this.myIKMgr.body.isLateUpdateEnd)
+				{
+					if (limb.myIKMgr.isIKExec)
+					{
+						limb.myIKMgr.onPostSolverUpdate.Add(delegate
+						{
+							$this.CheckLimbCapsule(limb);
+						}, true);
+					}
+					else
+					{
+						limb.myIKMgr.body.onLateUpdateEnd.Add(delegate
+						{
+							$this.CheckLimbCapsule(limb);
+						}, true);
+					}
+				}
+				else
+				{
+					this.CheckLimbCapsule(limb);
+				}
+			}
+		}
+	}
+
+	private void CheckLimbCapsule(ALimbIKCtrl limb)
+	{
+		NativeMaidPropCollider limbCapsule = limb.limbCapsule;
+		if (!limbCapsule)
+		{
+			return;
+		}
+		for (int i = 0; i < 4; i++)
+		{
+			Vector3 b;
+			if (!limbCapsule.Collide(this.limbCapsule, out b))
+			{
+				break;
+			}
+			Vector3 vector = base.bone.position + b;
+			Transform bone = this.ChainParentCtrl.bone;
+			Debug.DrawLine(base.bone.position, vector, Color.red);
+			bone.rotation = Quaternion.FromToRotation(base.bone.position - bone.position, vector - bone.position) * bone.rotation;
+		}
+	}
+
+	private void CheckPlaneCollider()
+	{
+		if (this.correctType != ALimbIKCtrl.BorderCorrectType.HalfBody)
+		{
+			bool flag = false;
+			Vector3 offset = Vector3.zero;
+			if (this.ChainParentCtrl != null && this.ChainParentCtrl.isNeedCorrect)
+			{
+				flag |= this.CheckPlaneCollider(this.floorCollider);
+				flag |= this.CheckPlaneCollider(this.wallCollider);
+				offset = this.SolvedBonePos - base.bone.position;
+			}
+			if (!flag)
+			{
+				flag |= this.CheckPlaneCollider(this.floorCollider, offset, null);
+				flag |= this.CheckPlaneCollider(this.wallCollider, offset, null);
+			}
+		}
+		else
+		{
+			this.CheckPlaneCollider(this.floorCollider, base.constraintTarget);
+			this.CheckPlaneCollider(this.wallCollider, base.constraintTarget);
+		}
+	}
+
+	private bool CheckPlaneCollider(NativePlaneCollider plane_collider)
+	{
+		return this.CheckPlaneCollider(plane_collider, Vector3.zero, null);
+	}
+
+	private bool CheckPlaneCollider(NativePlaneCollider plane_collider, Transform target_trs)
+	{
+		return this.CheckPlaneCollider(plane_collider, Vector3.zero, target_trs);
+	}
+
+	private bool CheckPlaneCollider(NativePlaneCollider plane_collider, Vector3 offset, Transform copy_trs = null)
+	{
+		if (!plane_collider.enabled || !this.colliderEnable)
+		{
+			return false;
+		}
+		Vector3 zero = Vector3.zero;
+		bool flag = false;
+		if (this.isOldHitCheck)
+		{
+			for (int i = 0; i < 4; i++)
+			{
+				Vector3 position = base.bone.position;
+				bool flag2 = plane_collider.Collide(ref position, 0f);
+				flag = (flag || flag2);
+				if (!flag2)
+				{
+					break;
+				}
+				if (this.ChainParentCtrl)
+				{
+					Debug.DrawLine(this.ChainParentCtrl.bone.position, base.bone.position, Color.gray, 0f, false);
+				}
+				this.DoPlaneCorrect(position - base.bone.position);
+			}
+			if (flag && this.ChainParentCtrl != null)
+			{
+				Debug.DrawLine(this.ChainParentCtrl.bone.position, base.bone.position, Color.magenta);
+			}
+		}
+		else if (this.ColliderList != null)
+		{
+			foreach (ANativeColliderBase anativeColliderBase in this.ColliderList)
+			{
+				if (anativeColliderBase && anativeColliderBase.enabled)
+				{
+					Vector3 localPosition = anativeColliderBase.transform.localPosition;
+					Quaternion localRotation = anativeColliderBase.transform.localRotation;
+					if (copy_trs && copy_trs != base.bone)
+					{
+						Vector3 position2 = base.bone.InverseTransformPoint(anativeColliderBase.transform.position);
+						Quaternion rhs = Quaternion.Inverse(base.bone.rotation) * anativeColliderBase.transform.rotation;
+						anativeColliderBase.transform.position = copy_trs.TransformPoint(position2);
+						anativeColliderBase.transform.rotation = copy_trs.rotation * rhs;
+					}
+					else
+					{
+						anativeColliderBase.transform.position += offset;
+					}
+					for (int j = 0; j < 4; j++)
+					{
+						bool flag3 = plane_collider.Collide(anativeColliderBase, out zero);
+						flag = (flag || flag3);
+						if (!flag3)
+						{
+							break;
+						}
+						if (this.ChainParentCtrl)
+						{
+							Debug.DrawLine(this.ChainParentCtrl.bone.position, base.bone.position, Color.gray, 0f, false);
+						}
+						anativeColliderBase.transform.localPosition = localPosition;
+						anativeColliderBase.transform.localRotation = localRotation;
+						this.DoPlaneCorrect(zero);
+					}
+					anativeColliderBase.transform.localPosition = localPosition;
+					anativeColliderBase.transform.localRotation = localRotation;
+				}
+			}
+			if (flag && this.ChainParentCtrl != null)
+			{
+				Debug.DrawLine(this.ChainParentCtrl.bone.position, base.bone.position, Color.magenta);
+			}
+		}
+		return flag;
+	}
+
+	protected virtual void DoPlaneCorrect(Vector3 normal)
+	{
+		switch (this.correctType)
+		{
+		case ALimbIKCtrl.BorderCorrectType.Bone:
+		{
+			Vector3 vector = base.bone.position + normal;
+			Debug.DrawLine(base.bone.position, vector);
+			if (this.ChainParentCtrl != null)
+			{
+				AIKCtrl.PosRotPair posRotPair = default(AIKCtrl.PosRotPair);
+				if (this.ChainChildCtrl)
+				{
+					posRotPair.Copy(this.ChainChildCtrl.bone);
+				}
+				Quaternion rotation = base.bone.rotation;
+				Transform bone = this.ChainParentCtrl.bone;
+				Vector3 fromDirection = base.bone.position - bone.position;
+				Vector3 toDirection = vector - bone.position;
+				bone.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * bone.rotation;
+				base.bone.rotation = rotation;
+				if (this.ChainChildCtrl)
+				{
+					fromDirection = this.ChainChildCtrl.bone.position - base.bone.position;
+					toDirection = posRotPair.pos - base.bone.position;
+					base.bone.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * base.bone.rotation;
+					this.ChainChildCtrl.bone.rotation = posRotPair.rot;
+				}
+				this.isNeedCorrect = true;
+			}
+			break;
+		}
+		case ALimbIKCtrl.BorderCorrectType.HalfBody:
+			if (!base.GetIKSettingData(AIKCtrl.IKAttachType.NewPoint).isIKExec)
+			{
+				base.GetIKSettingData(AIKCtrl.IKAttachType.NewPoint).isIKExec = true;
+			}
+			if (base.positionWeight == 0f)
+			{
+				base.positionWeight = 1f;
+			}
+			base.constraintTarget.position += normal;
+			break;
+		case ALimbIKCtrl.BorderCorrectType.Chara:
+			this.myIKMgr.bodyOffsetCtrl.AddPosOffset(normal);
+			break;
+		case ALimbIKCtrl.BorderCorrectType.WithPartner:
+			this.myIKMgr.bodyOffsetCtrl.AddPosOffset(normal);
+			foreach (Maid maid in this.myIKMgr.partnerList)
+			{
+				maid.body0.fullBodyIK.bodyOffsetCtrl.AddPosOffset(normal);
+			}
+			break;
+		}
+	}
+
+	public bool ForceCollidePlaneCollider(ALimbIKCtrl.BorderCorrectType correct_type, NativePlaneCollider collider)
+	{
+		bool colliderEnable = this.colliderEnable;
+		this.colliderEnable = true;
+		ALimbIKCtrl.BorderCorrectType borderCorrectType = this.correctType;
+		this.correctType = correct_type;
+		bool result = this.CheckPlaneCollider(collider);
+		this.correctType = borderCorrectType;
+		this.colliderEnable = colliderEnable;
+		return result;
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		this.SolvedBonePos = base.bone.position;
+	}
+
+	public override void OnPostIKUpdate()
+	{
+		if (base.isIKExec && this.correctType != ALimbIKCtrl.BorderCorrectType.HalfBody)
+		{
+			this.HitCheck();
+		}
+		base.OnPostIKUpdate();
+	}
+
+	private const int COLIDER_CHECK_COUNT = 4;
+
+	public ALimbIKCtrl.BorderCorrectType correctType;
+
+	private IKColliderMeta ColliderMeta;
+
+	public readonly FBIKChain chain;
+
+	public readonly IKMappingLimb ikMapping;
+
+	protected float OrijinPull = -1f;
+
+	protected ALimbIKCtrl ChainParentCtrl;
+
+	protected ALimbIKCtrl ChainChildCtrl;
+
+	protected bool IsPullBody = true;
+
+	private Vector3 SolvedBonePos;
+
+	private HashSet<ALimbIKCtrl> HitCheckLimbList = new HashSet<ALimbIKCtrl>();
+
+	[HideInInspector]
+	public bool isOldHitCheck;
+
+	public enum BorderCorrectType
+	{
+		Bone,
+		HalfBody,
+		Chara,
+		WithPartner,
+		All
+	}
+}

+ 30 - 0
Assembly-CSharp/ATwistCtrl.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public abstract class ATwistCtrl
+{
+	public ATwistCtrl(Maid.AutoTwist twist_type, TBody body)
+	{
+		this.twistType = twist_type;
+		this.twistBones = new List<KeyValuePair<Transform, Transform>>();
+		this.body = body;
+	}
+
+	public Transform bone { get; protected set; }
+
+	public Transform mrBone { get; protected set; }
+
+	public List<KeyValuePair<Transform, Transform>> twistBones { get; protected set; }
+
+	public abstract void ApplyTwist();
+
+	protected Transform GetMRBone(string bone_name)
+	{
+		return this.body.m_dicBonesMR[bone_name];
+	}
+
+	public readonly Maid.AutoTwist twistType;
+
+	public readonly TBody body;
+}

+ 6 - 1
Assembly-CSharp/AbstractFreeModeItem.cs

@@ -17,12 +17,17 @@ public abstract class AbstractFreeModeItem
 
 	public abstract string[] condition_text_terms { get; }
 
-	public abstract bool is_enabled { get; }
+	public virtual bool isEnabled(Maid maid)
+	{
+		return this.is_enabled;
+	}
 
 	public abstract string play_file_name { get; }
 
 	public abstract AbstractFreeModeItem.ItemType type { get; }
 
+	protected abstract bool is_enabled { get; }
+
 	protected static HashSet<int> GetEnabledIdList()
 	{
 		if (AbstractFreeModeItem.enabled_id_list_ != null)

+ 68 - 0
Assembly-CSharp/AnkleTwist.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AnkleTwist : ATwistCtrl
+{
+	public AnkleTwist(bool is_left, TBody body) : base((!is_left) ? Maid.AutoTwist.AnkleR : Maid.AutoTwist.AnkleL, body)
+	{
+		string str;
+		if (body.IsCrcBody)
+		{
+			str = "Bip01";
+		}
+		else
+		{
+			str = (body.boMAN ? "ManBip" : "Bip01");
+		}
+		string str2 = (!is_left) ? " R Foot" : " L Foot";
+		base.bone = body.GetBone(str + str2);
+		base.mrBone = base.GetMRBone(str + str2);
+		if (body.IsCrcBody)
+		{
+			for (int i = 0; i < 5; i++)
+			{
+				string name = (!is_left) ? string.Format("CalfTwist{0}_R", i + 1) : string.Format("CalfTwist{0}_L", i + 1);
+				Transform transform = base.bone.parent.Find(name);
+				if (transform)
+				{
+					Transform transform2 = base.mrBone.parent.Find(name);
+					if (transform2)
+					{
+						base.twistBones.Add(new KeyValuePair<Transform, Transform>(transform2, transform));
+					}
+				}
+			}
+		}
+	}
+
+	public override void ApplyTwist()
+	{
+		Vector3 vector = base.bone.rotation * Vector3.forward;
+		Vector3 vector2 = base.bone.parent.rotation * base.mrBone.localRotation * Vector3.forward;
+		Vector3 normalized = (base.bone.position - base.bone.parent.position).normalized;
+		vector2 = (vector2 - normalized * Vector3.Dot(vector2, normalized)).normalized;
+		vector = (vector - normalized * Vector3.Dot(vector, normalized)).normalized;
+		float f = Vector3.Dot(vector2, vector);
+		float num = Mathf.Acos(f) * 57.29578f;
+		if (float.IsNaN(num))
+		{
+			num = 0f;
+		}
+		else
+		{
+			Vector3 lhs = Vector3.Cross(normalized, vector2);
+			if (Vector3.Dot(lhs, vector) < 0f)
+			{
+				num = -num;
+			}
+		}
+		for (int i = 0; i < base.twistBones.Count; i++)
+		{
+			KeyValuePair<Transform, Transform> keyValuePair = base.twistBones[i];
+			float num2 = (float)i / (float)base.twistBones.Count;
+			keyValuePair.Value.localRotation = keyValuePair.Key.localRotation;
+			keyValuePair.Value.rotation = Quaternion.AngleAxis(num * num2, normalized) * keyValuePair.Value.rotation;
+		}
+	}
+}

+ 105 - 25
Assembly-CSharp/Assembly-CSharp.csproj

@@ -4,7 +4,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{34835194-016C-48BF-BF42-8B9849DAC63D}</ProjectGuid>
+    <ProjectGuid>{09246E70-928A-4345-9131-076F4D4174DE}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>Assembly-CSharp</RootNamespace>
     <AssemblyName>Assembly-CSharp</AssemblyName>
@@ -34,52 +34,55 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Assembly-CSharp-firstpass">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\Assembly-CSharp-firstpass.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\Assembly-CSharp-firstpass.dll</HintPath>
     </Reference>
     <Reference Include="Assembly-UnityScript-firstpass">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\Assembly-UnityScript-firstpass.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\Assembly-UnityScript-firstpass.dll</HintPath>
     </Reference>
     <Reference Include="FoveUnityPlugin">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\FoveUnityPlugin.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\FoveUnityPlugin.dll</HintPath>
     </Reference>
     <Reference Include="Ionic.Zlib">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\Ionic.Zlib.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\Ionic.Zlib.dll</HintPath>
     </Reference>
     <Reference Include="JsonFx.Json">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\JsonFx.Json.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\JsonFx.Json.dll</HintPath>
     </Reference>
     <Reference Include="LeapCSharp.NET3.5">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\LeapCSharp.NET3.5.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\LeapCSharp.NET3.5.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json">
+      <HintPath>..\..\..\..\..\com\1.57\Managed\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.dll</HintPath>
     </Reference>
     <Reference Include="System.Core">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.Core.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.Core.dll</HintPath>
     </Reference>
     <Reference Include="System.Drawing">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.Drawing.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.Drawing.dll</HintPath>
     </Reference>
     <Reference Include="System.Windows.Forms">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.Windows.Forms.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.Windows.Forms.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.Xml.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.Xml.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml.Linq">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\System.Xml.Linq.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\System.Xml.Linq.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\UnityEngine.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UI">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\UnityEngine.UI.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\UnityEngine.UI.dll</HintPath>
     </Reference>
     <Reference Include="Win32">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\Win32.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\Win32.dll</HintPath>
     </Reference>
     <Reference Include="zxing.unity">
-      <HintPath>..\..\..\..\..\com\1.56\Managed\zxing.unity.dll</HintPath>
+      <HintPath>..\..\..\..\..\com\1.57\Managed\zxing.unity.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -96,7 +99,9 @@
     <Compile Include="AdditionalScenario.cs" />
     <Compile Include="AdjustObjHeightToMaidBone.cs" />
     <Compile Include="ADVKagManager.cs" />
+    <Compile Include="AIKCtrl.cs" />
     <Compile Include="AlignmentPresetWindow.cs" />
+    <Compile Include="ALimbIKCtrl.cs" />
     <Compile Include="AMAction.cs" />
     <Compile Include="AMAnimationAction.cs" />
     <Compile Include="AMAnimationKey.cs" />
@@ -147,6 +152,7 @@
     <Compile Include="AnimatorData.cs" />
     <Compile Include="AnimatorPlayer.cs" />
     <Compile Include="AnimatorTimeline.cs" />
+    <Compile Include="AnkleTwist.cs" />
     <Compile Include="Appeal_Mgr.cs" />
     <Compile Include="ArcTeleport.cs" />
     <Compile Include="AssertHelper.cs" />
@@ -155,9 +161,11 @@
     <Compile Include="AttachPrefab.cs" />
     <Compile Include="AttributeViewer.cs" />
     <Compile Include="AttributeViewerOld.cs" />
+    <Compile Include="ATwistCtrl.cs" />
     <Compile Include="AudioMixerMgr.cs" />
     <Compile Include="AudioSourceMgr.cs" />
     <Compile Include="AudioSourceParent.cs" />
+    <Compile Include="AutoKupaCtrl.cs" />
     <Compile Include="AutoPiston.cs" />
     <Compile Include="AutoRotate.cs" />
     <Compile Include="AVProVideoPlayer.cs" />
@@ -172,6 +180,7 @@
     <Compile Include="BackupParamAccessor\SCENE_ID.cs" />
     <Compile Include="BaseCreatePanel.cs" />
     <Compile Include="BaseCreateViewerCtrl.cs" />
+    <Compile Include="BaseFader.cs" />
     <Compile Include="BaseInput2.cs" />
     <Compile Include="BaseKagManager.cs" />
     <Compile Include="BaseMaidPhotoWindow.cs" />
@@ -194,6 +203,8 @@
     <Compile Include="BGWindow.cs" />
     <Compile Include="BigThumbnail.cs" />
     <Compile Include="Billboard.cs" />
+    <Compile Include="BinaryReaderExtensions.cs" />
+    <Compile Include="BinaryWriterExtensions.cs" />
     <Compile Include="BjMotionControl.cs" />
     <Compile Include="BjPlayer.cs" />
     <Compile Include="BjVoiceMgr.cs" />
@@ -202,15 +213,18 @@
     <Compile Include="BMFont.cs" />
     <Compile Include="BMGlyph.cs" />
     <Compile Include="BMSymbol.cs" />
-    <Compile Include="BodyCtrlData.cs" />
+    <Compile Include="BodySelectCtrl.cs" />
+    <Compile Include="BodySelectMgr.cs" />
     <Compile Include="BodyStatusCtrl.cs" />
     <Compile Include="BodyStatusMgr.cs" />
     <Compile Include="BoneAttachPos.cs" />
     <Compile Include="BoneDebug.cs" />
+    <Compile Include="BoneDistanceToSkinMgr.cs" />
     <Compile Include="BoneHair.cs" />
     <Compile Include="BoneHair2.cs" />
     <Compile Include="BoneHair3.cs" />
     <Compile Include="BoneMorph.cs" />
+    <Compile Include="BoneMorphDefine.cs" />
     <Compile Include="BoneMorphLocal.cs" />
     <Compile Include="BoneMorph_.cs" />
     <Compile Include="BoneScaleDef.cs" />
@@ -253,6 +267,7 @@
     <Compile Include="ClickedEventHandler.cs" />
     <Compile Include="ClipboardHelper.cs" />
     <Compile Include="CM3.cs" />
+    <Compile Include="CMMImporter.cs" />
     <Compile Include="CMSystem.cs" />
     <Compile Include="CMT.cs" />
     <Compile Include="ColliderEvent.cs" />
@@ -286,6 +301,8 @@
     <Compile Include="CopyHandRig.cs" />
     <Compile Include="CostumePartsEnabledCtrl.cs" />
     <Compile Include="CostumePartsEnabledMgr.cs" />
+    <Compile Include="CRCEdit\ConfigBridgeData.cs" />
+    <Compile Include="CRCEdit\EditBridge.cs" />
     <Compile Include="CreateBGObjectSubWindow.cs" />
     <Compile Include="CsvImporter.cs" />
     <Compile Include="DailyCtrl.cs" />
@@ -356,19 +373,25 @@
     <Compile Include="DynamicBone.cs" />
     <Compile Include="DynamicBoneCollider.cs" />
     <Compile Include="DynamicBoneColliderBase.cs" />
+    <Compile Include="DynamicBoneColliderData.cs" />
     <Compile Include="DynamicBoneDemo1.cs" />
+    <Compile Include="DynamicBoneMgr.cs" />
     <Compile Include="DynamicBoneMuneCollider.cs" />
     <Compile Include="DynamicBonePlaneCollider.cs" />
+    <Compile Include="DynamicBoneStatus.cs" />
     <Compile Include="DynamicLabelBG.cs" />
+    <Compile Include="DynamicMuneBone.cs" />
+    <Compile Include="DynamicMuneYureBone.cs" />
     <Compile Include="DynamicSkirtBone.cs" />
     <Compile Include="DynamicUIGrid.cs" />
+    <Compile Include="DynamicYureBone.cs" />
     <Compile Include="EditItemTextureCache.cs" />
     <Compile Include="EditMod.cs" />
     <Compile Include="EditOkCancel.cs" />
     <Compile Include="EditViewReset.cs" />
     <Compile Include="Edit\MaidProfile.cs" />
     <Compile Include="EffectWindow.cs" />
-    <Compile Include="ElbowKneeIKData.cs" />
+    <Compile Include="ElbowKneeIKCtrl.cs" />
     <Compile Include="EmpireLifeModeAPI.cs" />
     <Compile Include="EmpireLifeModeData.cs" />
     <Compile Include="EmpireLifeModeFacilityUI.cs" />
@@ -385,6 +408,7 @@
     <Compile Include="ExampleWheelController.cs" />
     <Compile Include="ExChangeUI.cs" />
     <Compile Include="ExtensionsDictionaryClass.cs" />
+    <Compile Include="FABRIKCtrl.cs" />
     <Compile Include="FaceWindow.cs" />
     <Compile Include="Facility.cs" />
     <Compile Include="FacilityDataTable.cs" />
@@ -401,6 +425,7 @@
     <Compile Include="Fade.cs" />
     <Compile Include="FadeImage.cs" />
     <Compile Include="FadeInAndFadeOutOnGUI.cs" />
+    <Compile Include="FaderEventDriven.cs" />
     <Compile Include="FadeUI.cs" />
     <Compile Include="Farm_Mng.cs" />
     <Compile Include="FFNameDialog.cs" />
@@ -413,6 +438,8 @@
     <Compile Include="FoveCamera.cs" />
     <Compile Include="FoveEyeRayMgr.cs" />
     <Compile Include="FpsCounter.cs" />
+    <Compile Include="FreeFBIKCtrl.cs" />
+    <Compile Include="FreeFBIKEffector.cs" />
     <Compile Include="FreeModeInit.cs" />
     <Compile Include="FreeModeItemEveryday.cs" />
     <Compile Include="FreeModeItemLifeMode.cs" />
@@ -425,7 +452,7 @@
     <Compile Include="FreeSkillSelect.cs" />
     <Compile Include="FreeSkillSelectOld.cs" />
     <Compile Include="FrontCamera.cs" />
-    <Compile Include="FullBodyIKCtrl.cs" />
+    <Compile Include="FullBodyIKMgr.cs" />
     <Compile Include="GameInShop.cs" />
     <Compile Include="GameInShopMain.cs" />
     <Compile Include="GameMain.cs" />
@@ -443,7 +470,7 @@
     <Compile Include="HairMode.cs" />
     <Compile Include="Hand.cs" />
     <Compile Include="HandEnableDisableNotifier.cs" />
-    <Compile Include="HandFootIKData.cs" />
+    <Compile Include="HandFootIKCtrl.cs" />
     <Compile Include="HandSignShortcut.cs" />
     <Compile Include="HideScroll.cs" />
     <Compile Include="HideScrollEventCatch.cs" />
@@ -541,11 +568,15 @@
     <Compile Include="ICODES\STUDIO\WWebView\WWebViewSystem.cs" />
     <Compile Include="ICODES\STUDIO\WWebView\WWebViewWin32.cs" />
     <Compile Include="IDisposableBase.cs" />
+    <Compile Include="IDynamicBone.cs" />
     <Compile Include="IExperienceSystem.cs" />
+    <Compile Include="IFade.cs" />
     <Compile Include="IFadeCam.cs" />
-    <Compile Include="IKCtrlData.cs" />
+    <Compile Include="IKBodyOffsetCtrl.cs" />
+    <Compile Include="IKColliderMeta.cs" />
     <Compile Include="IKDragPoint.cs" />
     <Compile Include="IKManager.cs" />
+    <Compile Include="IKTargetBoneCtrl.cs" />
     <Compile Include="ImgDisplay.cs" />
     <Compile Include="ImportCM.cs" />
     <Compile Include="InfinityColorTextureCache.cs" />
@@ -594,6 +625,32 @@
     <Compile Include="Kasizuki\SystemDataType.cs" />
     <Compile Include="Kasizuki\WorkCountReplace.cs" />
     <Compile Include="KeyboardShortcutManager.cs" />
+    <Compile Include="kt\ik\BodyOffsetIKParam.cs" />
+    <Compile Include="kt\ik\IKAttachParam.cs" />
+    <Compile Include="kt\ik\IKColliderSaveLoader.cs" />
+    <Compile Include="kt\ik\IKScriptHelper.cs" />
+    <Compile Include="kt\ik\InsertIKParam.cs" />
+    <Compile Include="kt\ik\PenisIKParam.cs" />
+    <Compile Include="kt\ISaveLoadBinary.cs" />
+    <Compile Include="kt\PermTempAction.2.cs" />
+    <Compile Include="kt\PermTempAction.3.cs" />
+    <Compile Include="kt\PermTempAction.4.cs" />
+    <Compile Include="kt\PermTempAction.5.cs" />
+    <Compile Include="kt\PermTempAction.cs" />
+    <Compile Include="kt\Physics\ANativeColliderBase.cs" />
+    <Compile Include="kt\Physics\NativeCapsuleCollider.cs" />
+    <Compile Include="kt\Physics\NativeCapsuleColliderStatus.cs" />
+    <Compile Include="kt\Physics\NativeColliderStatus.cs" />
+    <Compile Include="kt\Physics\NativeMaidPropCollider.cs" />
+    <Compile Include="kt\Physics\NativeMaidPropColliderStatus.cs" />
+    <Compile Include="kt\Physics\NativePlaneCollider.cs" />
+    <Compile Include="kt\Physics\NativePlaneColliderStatus.cs" />
+    <Compile Include="kt\Physics\NativeSphereCollider.cs" />
+    <Compile Include="kt\Physics\NativeSphereColliderStatus.cs" />
+    <Compile Include="kt\Serialization\ASerializationVersionControl.cs" />
+    <Compile Include="kt\Utility\DebugUtility.cs" />
+    <Compile Include="kt\Utility\MathUtility.cs" />
+    <Compile Include="kt\Utility\UnityUtility.cs" />
     <Compile Include="KupaCtrl.cs" />
     <Compile Include="LagPosition.cs" />
     <Compile Include="LagRotation.cs" />
@@ -689,8 +746,8 @@
     <Compile Include="LifeModeChangeWindow.cs" />
     <Compile Include="LightMain.cs" />
     <Compile Include="LightWindow.cs" />
+    <Compile Include="LimbColliderMgr.cs" />
     <Compile Include="LimbControl.cs" />
-    <Compile Include="LimbIKData.cs" />
     <Compile Include="LineRendererNormals.cs" />
     <Compile Include="LineRendererSimpleFlat.cs" />
     <Compile Include="LipSyncDemo_SetCurrentTarget.cs" />
@@ -704,7 +761,7 @@
     <Compile Include="MaidColliderCollect.cs" />
     <Compile Include="MaidExaminationCtrl.cs" />
     <Compile Include="MaidExaminationMgr.cs" />
-    <Compile Include="MaidExtension\MaidMekureController.cs" />
+    <Compile Include="MaidExtension\MaidCostumeChangeController.cs" />
     <Compile Include="MaidIdleMotionAdditiveHook.cs" />
     <Compile Include="MaidItemWindow.cs" />
     <Compile Include="MaidManagement.cs" />
@@ -725,6 +782,7 @@
     <Compile Include="MaidStatus\EyePartsTab.cs" />
     <Compile Include="MaidStatus\Feature.cs" />
     <Compile Include="MaidStatus\Feeling.cs" />
+    <Compile Include="MaidStatus\GP003Status.cs" />
     <Compile Include="MaidStatus\HeroineType.cs" />
     <Compile Include="MaidStatus\IClassSystem.cs" />
     <Compile Include="MaidStatus\JobClass.cs" />
@@ -759,6 +817,7 @@
     <Compile Include="MainBusinessWindow.cs" />
     <Compile Include="MakeReferenceData.cs" />
     <Compile Include="MaterialColorChanger.cs" />
+    <Compile Include="MaterialMgr.cs" />
     <Compile Include="MathCM.cs" />
     <Compile Include="MatPropSave.cs" />
     <Compile Include="MayuAlphaWindow.cs" />
@@ -782,9 +841,11 @@
     <Compile Include="MotionKagManager.cs" />
     <Compile Include="MotionWindow.cs" />
     <Compile Include="MouseExposition.cs" />
+    <Compile Include="MouthIKCtrl.cs" />
     <Compile Include="MovieTextureCtrl.cs" />
     <Compile Include="MPN.cs" />
     <Compile Include="MPN_TYPE_RANGE.cs" />
+    <Compile Include="MuneIKCtrl.cs" />
     <Compile Include="MyRoomCustom\CreativeRoom.cs" />
     <Compile Include="MyRoomCustom\CreativeRoomManager.cs" />
     <Compile Include="MyRoomCustom\CreativeRoomUIObjectSettings.cs" />
@@ -903,6 +964,7 @@
     <Compile Include="PaperAirplaneTarget.cs" />
     <Compile Include="PartColliderData.cs" />
     <Compile Include="PartsMgrBase.cs" />
+    <Compile Include="PenisIKCtrl.cs" />
     <Compile Include="PhotoAlignmentPreset.cs" />
     <Compile Include="PhotoBGData.cs" />
     <Compile Include="PhotoBGObjectData.cs" />
@@ -938,6 +1000,7 @@
     <Compile Include="PlacementWindow.cs" />
     <Compile Include="PlaneRect.cs" />
     <Compile Include="PlayerHand.cs" />
+    <Compile Include="PlayerStatus\GP003Status.cs" />
     <Compile Include="PlayerStatus\NightWorkState.cs" />
     <Compile Include="PlayerStatus\ScheduleData.cs" />
     <Compile Include="PlayerStatus\ScheduleSlotBackup.cs" />
@@ -961,10 +1024,12 @@
     <Compile Include="PrivateEventManager.cs" />
     <Compile Include="PrivateEventSelectPanel.cs" />
     <Compile Include="PrivateMaidMode\DataBase.cs" />
+    <Compile Include="PrivateMaidMode\GP003MainMenuManager.cs" />
     <Compile Include="PrivateMaidMode\PrivateCharaSelectMain.cs" />
     <Compile Include="PrivateMaidMode\PrivateMaid.cs" />
     <Compile Include="PrivateMaidMode\PrivateModeMgr.cs" />
     <Compile Include="PrivateMaidMode\PrivateSettingManager.cs" />
+    <Compile Include="PrivateMaidMode\SceneGP003MainMenuScreenManager.cs" />
     <Compile Include="PrivateMaidMode\TouchDataBase.cs" />
     <Compile Include="PrivateMaidTouchKagManager.cs" />
     <Compile Include="PrivateMaidTouchManager.cs" />
@@ -1060,6 +1125,7 @@
     <Compile Include="SAMeshColliderCommon.cs" />
     <Compile Include="SaveAndLoadCtrl.cs" />
     <Compile Include="SaveAndLoadMgr.cs" />
+    <Compile Include="SavedAttachData.cs" />
     <Compile Include="SaveMaidhandPos.cs" />
     <Compile Include="ScenarioData.cs" />
     <Compile Include="ScenarioSelectMgr.cs" />
@@ -1148,6 +1214,7 @@
     <Compile Include="Schedule\WorkResultSceneMode.cs" />
     <Compile Include="Schedule\WorkResultSlot.cs" />
     <Compile Include="Score_Mgr.cs" />
+    <Compile Include="Scourt\Utility\Parse.cs" />
     <Compile Include="scoutmode\LockData.cs" />
     <Compile Include="scoutmode\SceneScoutScreenManager.cs" />
     <Compile Include="scoutmode\ScoutCharacterSelectCtrl.cs" />
@@ -1173,12 +1240,14 @@
     <Compile Include="ShootCutInTex.cs" />
     <Compile Include="Shop.cs" />
     <Compile Include="ShopItem.cs" />
-    <Compile Include="ShoulderThighIKData.cs" />
+    <Compile Include="ShoulderThighIKCtrl.cs" />
+    <Compile Include="ShoulderTwist.cs" />
     <Compile Include="SimpleExperienceSystem.cs" />
     <Compile Include="SimpleMaidPlate.cs" />
     <Compile Include="SingletonBase.cs" />
     <Compile Include="Size.cs" />
     <Compile Include="SkillBtnWithChubLip.cs" />
+    <Compile Include="SkinThickness.cs" />
     <Compile Include="SliderTypeRandomPresetButton.cs" />
     <Compile Include="SlotManager.cs" />
     <Compile Include="SlotUImgr.cs" />
@@ -1274,6 +1343,7 @@
     <Compile Include="TextureScale.cs" />
     <Compile Include="TextureSelectSubWindow.cs" />
     <Compile Include="THair1.cs" />
+    <Compile Include="ThighTwist.cs" />
     <Compile Include="THitSphere.cs" />
     <Compile Include="THp.cs" />
     <Compile Include="ThumShot.cs" />
@@ -1286,6 +1356,9 @@
     <Compile Include="TitleReturnCommand.cs" />
     <Compile Include="TitleUpArrowCommand.cs" />
     <Compile Include="TMorph.cs" />
+    <Compile Include="TMorphBone.cs" />
+    <Compile Include="TMorphSkin.cs" />
+    <Compile Include="TongueCtrl.cs" />
     <Compile Include="TouchActionParam.cs" />
     <Compile Include="TouchAction_Mgr.cs" />
     <Compile Include="TouchRegionExplanationWithChubLip.cs" />
@@ -1340,6 +1413,10 @@
     <Compile Include="TrophyAchieveEffect.cs" />
     <Compile Include="TrophyInfo.cs" />
     <Compile Include="Trophy_UI.cs" />
+    <Compile Include="Tuple.2.cs" />
+    <Compile Include="Tuple.3.cs" />
+    <Compile Include="Tuple.4.cs" />
+    <Compile Include="Tuple.cs" />
     <Compile Include="Tutorial5.cs" />
     <Compile Include="TutorialOpenObject.cs" />
     <Compile Include="TutorialPanel.cs" />
@@ -1546,6 +1623,7 @@
     <Compile Include="UTJ\FbxExporter\PinnedList.cs" />
     <Compile Include="UTJ\FbxExporter\PinnedObject.cs" />
     <Compile Include="UTY.cs" />
+    <Compile Include="Vector3Int.cs" />
     <Compile Include="VelocityTracker.cs" />
     <Compile Include="ViveBaseStationHide.cs" />
     <Compile Include="ViveCamera.cs" />
@@ -1652,6 +1730,7 @@
     <Compile Include="wf\Parse.cs" />
     <Compile Include="wf\ReadOnlyDictionary.cs" />
     <Compile Include="wf\ReadOnlySortedDictionary.cs" />
+    <Compile Include="wf\Serialization\AJsonSerializationVersionControl.cs" />
     <Compile Include="wf\StopWatch.cs" />
     <Compile Include="wf\TweenHash.cs" />
     <Compile Include="wf\ui\AbstractSliderWrapper.cs" />
@@ -1682,6 +1761,7 @@
     <Compile Include="WorkTaskUnit.cs" />
     <Compile Include="WorldTransformAxis.cs" />
     <Compile Include="WorldTransformRotate.cs" />
+    <Compile Include="WristTwist.cs" />
     <Compile Include="XOR128.cs" />
     <Compile Include="XOR32.cs" />
     <Compile Include="XVI\AniLipSync\LowLatencyLipSyncContext.cs" />

+ 563 - 0
Assembly-CSharp/AutoKupaCtrl.cs

@@ -0,0 +1,563 @@
+using System;
+using System.Collections.Generic;
+using kt.Utility;
+using UnityEngine;
+
+[Serializable]
+public class AutoKupaCtrl
+{
+	public AutoKupaCtrl(TBody tgt_body, AutoKupaCtrl.MorphType morph_type)
+	{
+		this.body = tgt_body;
+		this.morphType = morph_type;
+		switch (this.morphType)
+		{
+		case AutoKupaCtrl.MorphType.Vagina:
+			this.morphName = "openvagina";
+			this.MorphInsert.bone = tgt_body.GetBone("_IK_vagina");
+			break;
+		case AutoKupaCtrl.MorphType.Anal:
+			this.morphName = "openanal";
+			this.MorphInsert.bone = tgt_body.GetBone("_IK_anal");
+			break;
+		case AutoKupaCtrl.MorphType.Kupa:
+			this.morphName = "openkupa";
+			this.MorphInsert.bone = tgt_body.GetBone("_IK_vagina");
+			break;
+		}
+		this.isNotKupa = true;
+	}
+
+	public int morphIndex
+	{
+		get
+		{
+			return (this.BodySkin.morph == null) ? -1 : ((int)this.BodySkin.morph.hash[this.morphName]);
+		}
+	}
+
+	private TBodySkin BodySkin
+	{
+		get
+		{
+			return this.body.GetSlot(0);
+		}
+	}
+
+	public AutoKupaCtrl.MovementType movementType { get; private set; }
+
+	public AutoKupaCtrl.KupaType kupaType { get; private set; }
+
+	public bool isNotKupa { get; private set; }
+
+	public float morphValue
+	{
+		get
+		{
+			return this.BodySkin.morph.GetBlendValues(this.morphIndex);
+		}
+		set
+		{
+			int num = MathUtility.RatioToPercentage(this.BodySkin.morph.GetBlendValues(this.morphIndex), false);
+			int num2 = MathUtility.RatioToPercentage(value * this.morphValueMax, true);
+			bool flag = num != num2;
+			if (flag)
+			{
+				this.BodySkin.morph.FixBlendValues();
+			}
+		}
+	}
+
+	public float morphValueMax
+	{
+		get
+		{
+			return this.MorphValueMax;
+		}
+		set
+		{
+			this.MorphValueMax = Mathf.Clamp01(value);
+		}
+	}
+
+	public AutoKupaCtrl.TimerParam morphTime
+	{
+		get
+		{
+			return this.MorphTime;
+		}
+	}
+
+	public AutoKupaCtrl.InsertParam morphInsert
+	{
+		get
+		{
+			return this.MorphInsert;
+		}
+	}
+
+	public void KupaUpdate()
+	{
+		if (this.isNotKupa)
+		{
+			return;
+		}
+		if (!this.IsDoneSetUp)
+		{
+			this.SetKupaTimer(AutoKupaCtrl.KupaType.Close, this.body.motionBlendTime, 0f);
+		}
+		AutoKupaCtrl.MovementType movementType = this.movementType;
+		if (movementType != AutoKupaCtrl.MovementType.Insert)
+		{
+			if (movementType == AutoKupaCtrl.MovementType.Timer)
+			{
+				this.MorphTime.curTime += Time.deltaTime;
+				float morphValue = (this.kupaType != AutoKupaCtrl.KupaType.Open) ? (1f - this.MorphTime.ratio) : this.MorphTime.ratio;
+				this.morphValue = morphValue;
+			}
+		}
+		else
+		{
+			int chain_count = this.MorphInsert.chainBones.Length;
+			Transform chainEndBone = this.MorphInsert.chainEndBone;
+			if (!chainEndBone)
+			{
+				this.Finish();
+				return;
+			}
+			Vector3 lhs = chainEndBone.position - this.MorphInsert.bone.position;
+			float end_length = Vector3.Dot(lhs, this.MorphInsert.worldInsertAxis);
+			bool isInsert = this.MorphInsert.isInsert;
+			if (this.MorphInsert.isInsert && this.kupaType == AutoKupaCtrl.KupaType.Open)
+			{
+				this.MorphInsert.isInsert = (end_length <= 0f);
+			}
+			else
+			{
+				this.MorphInsert.isInsert = (end_length <= 0f && this.IsKupaRangeIn(chainEndBone.position));
+			}
+			if (!this.MorphInsert.isInsert)
+			{
+				this.kupaSpeed = this.MorphInsert.kupaSpeedIn;
+				this.MorphInsert.lastInsertValue = 0f;
+				this.MorphInsert.adjustVal = 0f;
+				if (!this.MorphInsert.isTimeClose)
+				{
+					this.morphValue = 0f;
+					if (this.kupaType == AutoKupaCtrl.KupaType.Close)
+					{
+						this.isNotKupa = true;
+						this.kupaSpeed = -1f;
+					}
+				}
+				else
+				{
+					AutoKupaCtrl.TimerParam timeCloseParam = this.MorphInsert.timeCloseParam;
+					this.SetKupaTimer(AutoKupaCtrl.KupaType.Close, timeCloseParam.totalTime, timeCloseParam.waitTime);
+				}
+				return;
+			}
+			DebugUtility.DrawSquare(this.MorphInsert.bone.position, this.MorphInsert.bone.rotation, this.MorphInsert.checkInsertAxis, 0.05f);
+			DebugUtility.DrawObjAxis(chainEndBone, 0.0625f);
+			Func<Vector3, float> func = delegate(Vector3 pos)
+			{
+				float num5 = Vector3.Dot(pos - this.MorphInsert.bone.position, this.MorphInsert.worldInsertAxis);
+				return (num5 <= 0f) ? 1f : (1f - num5 / (num5 + Mathf.Abs(end_length)));
+			};
+			float num = func(this.MorphInsert.chainStartBone.position);
+			float num2 = num - this.MorphInsert.lastInsertValue;
+			bool flag = false;
+			if (Mathf.Abs(num2) > 0.001f)
+			{
+				float num3 = (num2 <= 0f) ? this.MorphInsert.kupaSpeedOut : this.MorphInsert.kupaSpeedIn;
+				flag = (num3 != this.kupaSpeed);
+				this.kupaSpeed = num3;
+			}
+			Func<float, Vector3> func2 = delegate(float speed)
+			{
+				float num5 = Mathf.Floor(speed);
+				float f = (float)chain_count * Mathf.Clamp01(num5 / 10f);
+				int num6 = Mathf.Clamp(Mathf.FloorToInt(f) - 1, 0, chain_count - 1);
+				int num7 = Mathf.Clamp(num6 + 1, 0, chain_count - 1);
+				Vector3 position = this.MorphInsert.chainBones[num6].position;
+				Vector3 position2 = this.MorphInsert.chainBones[num7].position;
+				float t = speed - num5;
+				return Vector3.Lerp(position, position2, t);
+			};
+			this.MorphInsert.lastInsertValue = num;
+			Vector3 vector = func2(this.kupaSpeed);
+			float num4 = func(vector);
+			if (flag)
+			{
+				this.morphInsert.adjustVal = this.morphValue - num4;
+			}
+			DebugUtility.DrawAxis(vector, chainEndBone.rotation, Color.cyan, Color.cyan, Color.cyan, 0.0625f);
+			if (this.morphValue >= 1f)
+			{
+				if (num4 >= 1f)
+				{
+					this.morphInsert.adjustVal = 0f;
+				}
+			}
+			else if (this.morphValue <= 0f && num4 <= 0f)
+			{
+				this.morphInsert.adjustVal = 0f;
+			}
+			if (this.MorphInsert.isValueFixed)
+			{
+				this.morphValue = this.MorphInsert.fixedValue;
+			}
+			else
+			{
+				if (this.MorphInsert.isTimeClose && this.morphValue > num4 + this.morphInsert.adjustVal)
+				{
+					return;
+				}
+				this.morphValue = num4 + this.morphInsert.adjustVal;
+			}
+		}
+		if (this.kupaType == AutoKupaCtrl.KupaType.Close)
+		{
+			this.isNotKupa = (this.morphValue <= 0f);
+			if (this.isNotKupa)
+			{
+				this.kupaSpeed = -1f;
+			}
+		}
+	}
+
+	public bool IsKupaRangeIn(Vector3 position)
+	{
+		Vector3 lhs = position - this.MorphInsert.bone.position;
+		Quaternion rotation = Quaternion.FromToRotation(Vector3.forward, this.MorphInsert.worldInsertAxis);
+		Vector3 rhs = rotation * Vector3.up;
+		Vector3 rhs2 = rotation * Vector3.right;
+		float num = Mathf.Abs(Vector3.Dot(lhs, rhs));
+		float num2 = Mathf.Abs(Vector3.Dot(lhs, rhs2));
+		return num <= 0.05f && num2 <= 0.05f;
+	}
+
+	public void SetInsertParamFromScript(KagTagSupport tag_data)
+	{
+		this.MorphInsert.isValueFixed = tag_data.IsValid("kupafixed");
+		if (this.MorphInsert.isValueFixed)
+		{
+			this.MorphInsert.fixedValue = MathUtility.PercentageToRatio(tag_data.GetTagProperty("kupafixed").AsInteger(), false);
+		}
+		else
+		{
+			if (tag_data.IsValid("kupaspeed"))
+			{
+				this.MorphInsert.kupaSpeedIn = (this.MorphInsert.kupaSpeedOut = MathUtility.PercentageToRatio(tag_data.GetTagProperty("kupaspeed").AsInteger(), false));
+			}
+			else
+			{
+				if (tag_data.IsValid("kupaspeedin"))
+				{
+					this.MorphInsert.kupaSpeedIn = MathUtility.PercentageToRatio(tag_data.GetTagProperty("kupaspeedin").AsInteger(), false);
+				}
+				if (tag_data.IsValid("kupaspeedout"))
+				{
+					this.MorphInsert.kupaSpeedOut = MathUtility.PercentageToRatio(tag_data.GetTagProperty("kupaspeedout").AsInteger(), false);
+				}
+			}
+			this.morphValueMax = ((!tag_data.IsValid("kupamax")) ? 1f : MathUtility.PercentageToRatio(tag_data.GetTagProperty("kupamax").AsInteger(), false));
+		}
+		this.MorphInsert.isTimeClose = tag_data.IsValid("timeclose");
+		if (this.MorphInsert.isTimeClose)
+		{
+			string[] array = tag_data.GetTagProperty("timeclose").AsString().Split(new char[]
+			{
+				' '
+			});
+			string[] array2 = array;
+			int i = 0;
+			while (i < array2.Length)
+			{
+				string text = array2[i];
+				string text2 = text.Split(new char[]
+				{
+					'='
+				})[0];
+				float num = MathUtility.MillisecondToSecond(int.Parse(text.Split(new char[]
+				{
+					'='
+				})[1]));
+				if (text2 != null)
+				{
+					if (!(text2 == "time"))
+					{
+						if (text2 == "wait")
+						{
+							this.MorphInsert.timeCloseParam.waitTime = num;
+						}
+					}
+					else
+					{
+						this.MorphInsert.timeCloseParam.totalTime = num;
+					}
+				}
+				IL_213:
+				i++;
+				continue;
+				goto IL_213;
+			}
+		}
+		else
+		{
+			this.MorphInsert.timeCloseParam.Reset();
+		}
+	}
+
+	public void SetKupaInsert(AutoKupaCtrl.InsertObjType insert, TBody tgt_body, Vector3 insert_axis)
+	{
+		Transform[] kupaInsertObjs = tgt_body.GetKupaInsertObjs(insert);
+		if (kupaInsertObjs != null)
+		{
+			this.MorphInsert.boneBody = tgt_body;
+			this.isUpdateTBody = (this.MorphInsert.boneBody == this.body);
+			if (!this.isUpdateTBody)
+			{
+				if (tgt_body.fullBodyIK.isIKExec)
+				{
+					tgt_body.fullBodyIK.onPostSolverUpdate.Add(new Action(this.KupaUpdate), false);
+				}
+				else
+				{
+					tgt_body.onLateUpdateEnd.Add(new Action(this.KupaUpdate), false);
+				}
+			}
+			this.SetKupaInsert(kupaInsertObjs, insert_axis);
+		}
+	}
+
+	public void SetKupaInsertFromBgItem(string item_name, Vector3 insert_axis)
+	{
+		GameObject prefabFromBg = GameMain.Instance.BgMgr.GetPrefabFromBg(item_name);
+		if (!prefabFromBg)
+		{
+			return;
+		}
+		Transform transform = prefabFromBg.transform.Find("Bone_insert1");
+		Transform[] chain_bones = UnityUtility.GetAllChildren(transform, true).ToArray();
+		this.SetKupaInsert(chain_bones, insert_axis);
+	}
+
+	public void SetKupaInsert(Transform[] chain_bones, Vector3 insert_axis)
+	{
+		this.SetKupaInsert(AutoKupaCtrl.KupaType.Open, chain_bones, insert_axis);
+	}
+
+	public void SetKupaInsert(AutoKupaCtrl.KupaType kupa_type, Transform[] chain_bones, Vector3 insert_axis)
+	{
+		this.movementType = AutoKupaCtrl.MovementType.Insert;
+		this.isNotKupa = false;
+		this.IsDoneSetUp = true;
+		this.kupaType = kupa_type;
+		this.MorphInsert.chainBones = chain_bones;
+		this.MorphInsert.checkInsertAxis = insert_axis;
+		this.MorphInsert.isInsert = false;
+		if (this.kupaSpeed < 0f)
+		{
+			this.kupaSpeed = ((this.kupaType != AutoKupaCtrl.KupaType.Open) ? this.MorphInsert.kupaSpeedOut : this.MorphInsert.kupaSpeedIn);
+		}
+	}
+
+	public void SetKupaTimer(AutoKupaCtrl.KupaType kupa_type, float kupa_time, float wait = 0f)
+	{
+		this.movementType = AutoKupaCtrl.MovementType.Timer;
+		this.isNotKupa = false;
+		this.IsDoneSetUp = true;
+		this.kupaType = kupa_type;
+		this.MorphTime.Reset();
+		this.MorphTime.waitTime = wait;
+		this.MorphTime.totalTime = kupa_time;
+	}
+
+	public void StopKupa()
+	{
+		this.isNotKupa = true;
+	}
+
+	public void DoneStateReset()
+	{
+		this.IsDoneSetUp = false;
+		this.isUpdateTBody = true;
+		this.MorphInsert.isValueFixed = false;
+		if (this.MorphInsert.boneBody)
+		{
+			this.MorphInsert.boneBody.fullBodyIK.onPostSolverUpdate.Remove(new Action(this.KupaUpdate));
+			this.MorphInsert.boneBody.onLateUpdateEnd.Remove(new Action(this.KupaUpdate));
+		}
+		this.MorphInsert.boneBody = null;
+	}
+
+	public void Finish()
+	{
+		this.isNotKupa = true;
+		this.IsDoneSetUp = false;
+		this.MorphTime.Reset();
+		this.MorphInsert.isInsert = false;
+		if (this.BodySkin != null && this.BodySkin.morph != null)
+		{
+			this.BodySkin.morph.FixBlendValues();
+		}
+	}
+
+	private const float KUPA_RANGE_MAX = 0.05f;
+
+	public static readonly Dictionary<string, AutoKupaCtrl.MorphType> InsertBoneMorphDic = new Dictionary<string, AutoKupaCtrl.MorphType>
+	{
+		{
+			"_IK_vagina",
+			AutoKupaCtrl.MorphType.Vagina
+		},
+		{
+			"_IK_anal",
+			AutoKupaCtrl.MorphType.Anal
+		}
+	};
+
+	public readonly TBody body;
+
+	public readonly AutoKupaCtrl.MorphType morphType;
+
+	public readonly string morphName;
+
+	private bool IsDoneSetUp;
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float MorphValueMax = 1f;
+
+	[Range(1f, 10f)]
+	public float kupaSpeed = -1f;
+
+	[SerializeField]
+	private AutoKupaCtrl.TimerParam MorphTime = new AutoKupaCtrl.TimerParam();
+
+	[SerializeField]
+	private AutoKupaCtrl.InsertParam MorphInsert = new AutoKupaCtrl.InsertParam();
+
+	public bool isUpdateTBody = true;
+
+	public enum MorphType
+	{
+		Vagina,
+		Anal,
+		Kupa
+	}
+
+	public enum MovementType
+	{
+		Insert,
+		Timer
+	}
+
+	public enum KupaType
+	{
+		Open,
+		Close
+	}
+
+	public enum InsertObjType
+	{
+		Penis,
+		Finger_R0,
+		Finger_R1,
+		Finger_R2,
+		Finger_R3,
+		Finger_R4,
+		Finger_L0,
+		Finger_L1,
+		Finger_L2,
+		Finger_L3,
+		Finger_L4,
+		HandItem_R,
+		HandItem_L,
+		BgItem
+	}
+
+	[Serializable]
+	public class TimerParam
+	{
+		public float ratio
+		{
+			get
+			{
+				return (this.totalTime <= 0f) ? 1f : Mathf.Clamp01(Mathf.Max(this.curTime - this.waitTime, 0f) / this.totalTime);
+			}
+		}
+
+		public void Reset()
+		{
+			this.curTime = 0f;
+			this.waitTime = 0f;
+		}
+
+		public float curTime;
+
+		public float totalTime;
+
+		public float waitTime;
+	}
+
+	[Serializable]
+	public class InsertParam
+	{
+		public Transform chainStartBone
+		{
+			get
+			{
+				return (this.chainBones == null || this.chainBones.Length == 0) ? null : this.chainBones[0];
+			}
+		}
+
+		public Transform chainEndBone
+		{
+			get
+			{
+				return (this.chainBones == null || this.chainBones.Length == 0) ? null : this.chainBones[this.chainBones.Length - 1];
+			}
+		}
+
+		public Vector3 worldInsertAxis
+		{
+			get
+			{
+				return this.bone.rotation * this.checkInsertAxis;
+			}
+		}
+
+		public TBody boneBody;
+
+		public Transform[] chainBones;
+
+		public Transform bone;
+
+		public Vector3 checkInsertAxis;
+
+		[ReadOnly]
+		public bool isInsert;
+
+		[Range(1f, 10f)]
+		public float kupaSpeedIn = 1f;
+
+		[Range(1f, 10f)]
+		public float kupaSpeedOut = 1f;
+
+		[ReadOnly]
+		public float adjustVal;
+
+		[HideInInspector]
+		public float lastInsertValue;
+
+		public bool isValueFixed;
+
+		public float fixedValue = 1f;
+
+		public bool isTimeClose;
+
+		public AutoKupaCtrl.TimerParam timeCloseParam = new AutoKupaCtrl.TimerParam();
+	}
+}

+ 286 - 0
Assembly-CSharp/BaseFader.cs

@@ -0,0 +1,286 @@
+using System;
+using System.Collections;
+using UnityEngine;
+
+public abstract class BaseFader : IFade
+{
+	public static bool StartCrossFade(IFade fadeIn, IFade fadeOut, float time, bool skippable = true, Func<float, bool> onUpdateFadeIn = null, Action onCompletedFadeIn = null, Func<float, bool> onUpdateFadeOut = null, Action onCompletedFadeOut = null)
+	{
+		if (fadeIn == null || fadeOut == null || fadeIn.isShow || fadeOut.isHide || fadeIn == fadeOut)
+		{
+			return false;
+		}
+		bool flag = fadeIn.StartFade(BaseFader.FadeType.In, time, skippable, onUpdateFadeIn, onCompletedFadeIn);
+		return flag | fadeOut.StartFade(BaseFader.FadeType.Out, time, skippable, onUpdateFadeOut, onCompletedFadeOut);
+	}
+
+	public static bool StartCrossFade(IFade fadeIn, IFade fadeOut, bool skippable = true, Func<float, bool> onUpdateFadeIn = null, Action onCompletedFadeIn = null, Func<float, bool> onUpdateFadeOut = null, Action onCompletedFadeOut = null)
+	{
+		if (fadeIn == null || fadeOut == null || fadeIn.isShow || fadeOut.isHide || fadeIn == fadeOut)
+		{
+			return false;
+		}
+		bool flag = fadeIn.StartFade(BaseFader.FadeType.In, skippable, onUpdateFadeIn, onCompletedFadeIn);
+		return flag | fadeOut.StartFade(BaseFader.FadeType.Out, skippable, onUpdateFadeOut, onCompletedFadeOut);
+	}
+
+	public static float DefaultFadeTime
+	{
+		get
+		{
+			return 0.5f;
+		}
+	}
+
+	public virtual float customDefaultFadeTime
+	{
+		get
+		{
+			return this.customDefaultFadeTime_;
+		}
+		set
+		{
+			this.customDefaultFadeTime_ = value;
+		}
+	}
+
+	public BaseFader.FadeState state { get; protected set; }
+
+	public virtual bool isShow
+	{
+		get
+		{
+			return this.state == BaseFader.FadeState.Show || this.state == BaseFader.FadeState.FadeInNow;
+		}
+	}
+
+	public virtual bool isHide
+	{
+		get
+		{
+			return this.state == BaseFader.FadeState.Hide || this.state == BaseFader.FadeState.FadeOutNow;
+		}
+	}
+
+	public virtual bool isFadeNow
+	{
+		get
+		{
+			return this.state == BaseFader.FadeState.FadeInNow || this.state == BaseFader.FadeState.FadeOutNow;
+		}
+	}
+
+	BaseFader.FadeState IFade.state
+	{
+		get
+		{
+			return this.state;
+		}
+	}
+
+	float IFade.defaultFadeTime
+	{
+		get
+		{
+			return this.customDefaultFadeTime;
+		}
+	}
+
+	protected MonoBehaviour coroutineInstant
+	{
+		get
+		{
+			return GameMain.Instance;
+		}
+	}
+
+	public bool StartFade(BaseFader.FadeType type, bool skippable = true, Func<float, bool> onUpdate = null, Action onCompleted = null)
+	{
+		return this.StartFade(type, this.customDefaultFadeTime, skippable, onUpdate, onCompleted);
+	}
+
+	public virtual bool StartFade(BaseFader.FadeType type, float time, bool skippable = true, Func<float, bool> onUpdate = null, Action onCompleted = null)
+	{
+		if (type == BaseFader.FadeType.In)
+		{
+			if (this.isShow)
+			{
+				return false;
+			}
+			this.StartFade(true, time, skippable, onUpdate, onCompleted);
+		}
+		else
+		{
+			if (this.isHide)
+			{
+				return false;
+			}
+			this.StartFade(false, time, skippable, onUpdate, onCompleted);
+		}
+		return true;
+	}
+
+	public virtual void FadeComplete()
+	{
+		if (this.state == BaseFader.FadeState.FadeOutNow)
+		{
+			if (this.fadeCoroutine != null)
+			{
+				this.coroutineInstant.StopCoroutine(this.fadeCoroutine);
+			}
+			this.fadeCoroutine = null;
+			this.ApplyFadeValue(0f);
+			this.state = BaseFader.FadeState.Hide;
+			if (this.onCompleted != null)
+			{
+				this.onCompleted();
+			}
+			this.onCompleted = null;
+		}
+		else if (this.state == BaseFader.FadeState.FadeInNow)
+		{
+			if (this.fadeCoroutine != null)
+			{
+				this.coroutineInstant.StopCoroutine(this.fadeCoroutine);
+			}
+			this.fadeCoroutine = null;
+			this.ApplyFadeValue(1f);
+			this.state = BaseFader.FadeState.Show;
+			if (this.onCompleted != null)
+			{
+				this.onCompleted();
+			}
+			this.onCompleted = null;
+		}
+	}
+
+	protected virtual void StartFade(bool typeIn, float time, bool skippable, Func<float, bool> onUpdate, Action onCompleted)
+	{
+		if (typeIn && this.state == BaseFader.FadeState.FadeOutNow)
+		{
+			if (this.fadeCoroutine != null)
+			{
+				this.coroutineInstant.StopCoroutine(this.fadeCoroutine);
+			}
+			this.fadeCoroutine = null;
+			this.OnAbortFadeOut();
+		}
+		else if (!typeIn && this.state == BaseFader.FadeState.FadeInNow)
+		{
+			if (this.fadeCoroutine != null)
+			{
+				this.coroutineInstant.StopCoroutine(this.fadeCoroutine);
+			}
+			this.fadeCoroutine = null;
+			this.OnAbortFadeIn();
+		}
+		this.state = ((!typeIn) ? BaseFader.FadeState.FadeOutNow : BaseFader.FadeState.FadeInNow);
+		this.onCompleted = onCompleted;
+		if (typeIn)
+		{
+			this.OnBeforeFadeIn();
+		}
+		else
+		{
+			this.OnBeforeFadeOut();
+		}
+		this.fadeCoroutine = this.coroutineInstant.StartCoroutine(this.Fade(this.GetFadeValue(), (!typeIn) ? 0f : 1f, time, skippable, onUpdate, delegate
+		{
+			this.state = ((!typeIn) ? BaseFader.FadeState.Hide : BaseFader.FadeState.Show);
+			if (this.onCompleted != null)
+			{
+				this.onCompleted();
+			}
+			this.onCompleted = null;
+			if (typeIn)
+			{
+				this.OnAfterFadeIn();
+			}
+			else
+			{
+				this.OnAfterFadeOut();
+			}
+		}));
+	}
+
+	protected virtual IEnumerator Fade(float from, float to, float fadeTime, bool skippable, Func<float, bool> onUpdate, Action onComplete)
+	{
+		if (fadeTime > 0f)
+		{
+			float totalTime = 0f;
+			while (fadeTime >= totalTime)
+			{
+				totalTime += Time.unscaledDeltaTime;
+				float value = Mathf.Lerp(from, to, totalTime / fadeTime);
+				if ((skippable && this.CheckSkipState()) || (onUpdate != null && !onUpdate(value)))
+				{
+					break;
+				}
+				this.ApplyFadeValue(value);
+				yield return null;
+			}
+		}
+		else if (onUpdate != null)
+		{
+			onUpdate(to);
+		}
+		this.ApplyFadeValue(to);
+		if (onComplete != null)
+		{
+			onComplete();
+		}
+		this.fadeCoroutine = null;
+		yield break;
+	}
+
+	protected abstract void ApplyFadeValue(float value);
+
+	protected abstract float GetFadeValue();
+
+	protected abstract bool CheckSkipState();
+
+	protected virtual void OnBeforeFadeIn()
+	{
+	}
+
+	protected virtual void OnAfterFadeIn()
+	{
+	}
+
+	protected virtual void OnBeforeFadeOut()
+	{
+	}
+
+	protected virtual void OnAfterFadeOut()
+	{
+	}
+
+	protected virtual void OnAbortFadeIn()
+	{
+	}
+
+	protected virtual void OnAbortFadeOut()
+	{
+	}
+
+	protected Action onCompleted;
+
+	protected Coroutine fadeCoroutine;
+
+	protected float customDefaultFadeTime_ = BaseFader.DefaultFadeTime;
+
+	public enum FadeType
+	{
+		In,
+		Out
+	}
+
+	public enum FadeState
+	{
+		None,
+		Show,
+		Hide,
+		FadeInNow,
+		FadeOutNow
+	}
+}

File diff suppressed because it is too large
+ 308 - 819
Assembly-CSharp/BaseKagManager.cs


+ 1 - 1
Assembly-CSharp/BasePhotoCustomObject.cs

@@ -173,7 +173,7 @@ public abstract class BasePhotoCustomObject : MonoBehaviour, IComparable<BasePho
 			using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
 			{
 				binaryWriter.Write("COM3D2_PHOTO_CUSTOM_OBJECT");
-				binaryWriter.Write(1550);
+				binaryWriter.Write(1570);
 				binaryWriter.Write(this.type.ToString());
 				binaryWriter.Write(this.scale_);
 				binaryWriter.Write(this.enabledTextureColor_);

+ 1 - 1
Assembly-CSharp/BasePhotoWindowManager.cs

@@ -153,7 +153,7 @@ public abstract class BasePhotoWindowManager : MonoBehaviour
 			using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
 			{
 				binaryWriter.Write(this.save_header_uidata);
-				binaryWriter.Write(1550);
+				binaryWriter.Write(1570);
 				binaryWriter.Write(this.save_data_.Count);
 				foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair3 in this.save_data_)
 				{

+ 114 - 0
Assembly-CSharp/BinaryReaderExtensions.cs

@@ -0,0 +1,114 @@
+using System;
+using System.IO;
+using UnityEngine;
+
+internal static class BinaryReaderExtensions
+{
+	public static void ReadNaS(this BinaryReader br, out string str)
+	{
+		if (br.ReadBoolean())
+		{
+			str = br.ReadString();
+		}
+		else
+		{
+			str = null;
+		}
+	}
+
+	public static int Read(this BinaryReader br, out int i)
+	{
+		return i = br.ReadInt32();
+	}
+
+	public static float Read(this BinaryReader br, out float f)
+	{
+		return f = br.ReadSingle();
+	}
+
+	public static ulong Read(this BinaryReader br, out ulong ul)
+	{
+		return ul = br.ReadUInt64();
+	}
+
+	public static bool Read(this BinaryReader br, out bool b)
+	{
+		return b = br.ReadBoolean();
+	}
+
+	public static void Read(this BinaryReader br, out Vector2 v2)
+	{
+		br.Read(out v2.x);
+		br.Read(out v2.y);
+	}
+
+	public static void Read(this BinaryReader br, out Vector3 v3)
+	{
+		br.Read(out v3.x);
+		br.Read(out v3.y);
+		br.Read(out v3.z);
+	}
+
+	public static void Read(this BinaryReader br, out Vector4 v4)
+	{
+		br.Read(out v4.x);
+		br.Read(out v4.y);
+		br.Read(out v4.z);
+		br.Read(out v4.w);
+	}
+
+	public static void Read(this BinaryReader br, out Quaternion v4)
+	{
+		br.Read(out v4.x);
+		br.Read(out v4.y);
+		br.Read(out v4.z);
+		br.Read(out v4.w);
+	}
+
+	public static void Read(this BinaryReader br, out float[] fary)
+	{
+		fary = null;
+		if (br.ReadBoolean())
+		{
+			int num = br.ReadInt32();
+			fary = new float[num];
+			for (int i = 0; i < num; i++)
+			{
+				fary[i] = br.ReadSingle();
+			}
+		}
+	}
+
+	public static void Read(this BinaryReader br, out int[] iary)
+	{
+		iary = null;
+		if (br.ReadBoolean())
+		{
+			int num = br.ReadInt32();
+			iary = new int[num];
+			for (int i = 0; i < num; i++)
+			{
+				iary[i] = br.ReadInt32();
+			}
+		}
+	}
+
+	public static void Read(this BinaryReader br, out Vector4[] v4ary)
+	{
+		v4ary = null;
+		if (br.ReadBoolean())
+		{
+			int num = br.ReadInt32();
+			v4ary = new Vector4[num];
+			for (int i = 0; i < num; i++)
+			{
+				br.Read(out v4ary[i]);
+			}
+		}
+	}
+
+	public static T ReadParse<T>(this BinaryReader br, out T value)
+	{
+		return value = (T)((object)Enum.Parse(typeof(T), br.ReadString()));
+	}
+}

+ 83 - 0
Assembly-CSharp/BinaryWriterExtensions.cs

@@ -0,0 +1,83 @@
+using System;
+using System.IO;
+using UnityEngine;
+
+internal static class BinaryWriterExtensions
+{
+	public static void WriteNaS(this BinaryWriter bw, string str)
+	{
+		bw.Write(str != null);
+		if (str != null)
+		{
+			bw.Write(str);
+		}
+	}
+
+	public static void Write(this BinaryWriter bw, Vector2 v2)
+	{
+		bw.Write(v2.x);
+		bw.Write(v2.y);
+	}
+
+	public static void Write(this BinaryWriter bw, Vector3 v3)
+	{
+		bw.Write(v3.x);
+		bw.Write(v3.y);
+		bw.Write(v3.z);
+	}
+
+	public static void Write(this BinaryWriter bw, Vector4 v4)
+	{
+		bw.Write(v4.x);
+		bw.Write(v4.y);
+		bw.Write(v4.z);
+		bw.Write(v4.w);
+	}
+
+	public static void Write(this BinaryWriter bw, Quaternion q)
+	{
+		bw.Write(q.x);
+		bw.Write(q.y);
+		bw.Write(q.z);
+		bw.Write(q.w);
+	}
+
+	public static void Write(this BinaryWriter bw, float[] fary)
+	{
+		bw.Write(fary != null);
+		if (fary != null)
+		{
+			bw.Write(fary.Length);
+			foreach (float value in fary)
+			{
+				bw.Write(value);
+			}
+		}
+	}
+
+	public static void Write(this BinaryWriter bw, int[] iary)
+	{
+		bw.Write(iary != null);
+		if (iary != null)
+		{
+			bw.Write(iary.Length);
+			foreach (int value in iary)
+			{
+				bw.Write(value);
+			}
+		}
+	}
+
+	public static void Write(this BinaryWriter bw, Vector4[] v4ary)
+	{
+		bw.Write(v4ary != null);
+		if (v4ary != null)
+		{
+			bw.Write(v4ary.Length);
+			foreach (Vector4 v in v4ary)
+			{
+				bw.Write(v);
+			}
+		}
+	}
+}

+ 4 - 4
Assembly-CSharp/BjMotionControl.cs

@@ -179,7 +179,7 @@ public class BjMotionControl : MonoBehaviour
 				{
 					object obj = enumerator.Current;
 					AnimationState animationState = (AnimationState)obj;
-					if (animationState.name == motion_name)
+					if (animationState.name == motion_name || animationState.name == "crc_" + motion_name)
 					{
 						motion_end = (animationState.normalizedTime < last_time);
 						last_time = animationState.normalizedTime;
@@ -227,7 +227,7 @@ public class BjMotionControl : MonoBehaviour
 				{
 					object obj = enumerator.Current;
 					AnimationState animationState = (AnimationState)obj;
-					if (animationState.name == motion_name)
+					if (animationState.name == motion_name || animationState.name == "crc_" + motion_name)
 					{
 						motion_end = (animationState.normalizedTime < last_time);
 						last_time = animationState.normalizedTime;
@@ -266,7 +266,7 @@ public class BjMotionControl : MonoBehaviour
 		this.nMotionName = label;
 		this.m_ScriptMgr.StopMotionScript();
 		this.m_ScriptMgr.is_motion_blend = this.m_IsMotionBlend;
-		this.m_ScriptMgr.LoadMotionScript(0, false, "work_002.ks", label, string.Empty, string.Empty, false, true, false);
+		this.m_ScriptMgr.LoadMotionScript(0, false, "work_002.ks", label, string.Empty, string.Empty, false, true, false, false);
 		this.m_IsMotionBlend = true;
 		if (!this.IsWait)
 		{
@@ -289,7 +289,7 @@ public class BjMotionControl : MonoBehaviour
 		this.nMotionName = first_label;
 		this.m_ScriptMgr.StopMotionScript();
 		this.m_ScriptMgr.is_motion_blend = this.m_IsMotionBlend;
-		this.m_ScriptMgr.LoadMotionScript(0, false, "work_002.ks", first_label, string.Empty, string.Empty, false, true, false);
+		this.m_ScriptMgr.LoadMotionScript(0, false, "work_002.ks", first_label, string.Empty, string.Empty, false, true, false, false);
 		this.m_IsMotionBlend = true;
 		if (!this.IsWait)
 		{

+ 2 - 0
Assembly-CSharp/BlendData.cs

@@ -10,4 +10,6 @@ public class BlendData
 	public Vector3[] vert;
 
 	public Vector3[] norm;
+
+	public Vector4[] tans;
 }

+ 0 - 132
Assembly-CSharp/BodyCtrlData.cs

@@ -1,132 +0,0 @@
-using System;
-using UnityEngine;
-
-[Serializable]
-public class BodyCtrlData : IKCtrlData
-{
-	public BodyCtrlData(FullBodyIKCtrl ik_ctrl) : base(ik_ctrl, ik_ctrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Root), false, false)
-	{
-		this.PosBaseBone = this.TargetBone;
-		this.m_ChainBones = new Transform[]
-		{
-			this.TargetBone
-		};
-		this.m_ForceIKEnable = false;
-	}
-
-	public bool IsDoSetCharaPos { get; private set; }
-
-	public Vector3 OrijinMaidPos { get; private set; }
-
-	public override void ApplyIKSetting()
-	{
-		this.OrijinMaidPos = this.MyIKCtrl.TgtChara.GetPos();
-		this.m_PosOffset = Vector3.zero;
-		base.ApplyIKSetting();
-	}
-
-	private bool CheckDoIK()
-	{
-		if (!base.IsIKExec)
-		{
-			return false;
-		}
-		if (this.HeightFit == BodyCtrlData.HeightFitType.None)
-		{
-			return true;
-		}
-		int num = this.MyIKCtrl.TgtChara.GetProp(MPN.sintyou).value + this.MyIKCtrl.TgtChara.GetProp(MPN.DouPer).value;
-		Maid tgtChara = base.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).curTargetData.TgtChara;
-		int num2 = tgtChara.GetProp(MPN.sintyou).value + tgtChara.GetProp(MPN.DouPer).value;
-		if (this.HeightFit == BodyCtrlData.HeightFitType.Higher)
-		{
-			return num > num2;
-		}
-		return num < num2;
-	}
-
-	protected override void SetTargetTransform(IKCtrlData.IKSettingData data, Vector3 pos, Quaternion rot)
-	{
-		if (!data.IsPointAttach || !this.CheckDoIK())
-		{
-			return;
-		}
-		if (data.FirstFrame && !data.BlendNow)
-		{
-			this.m_FirstBonePos = this.PosBaseBone.position;
-		}
-		Vector3 b = (!data.BlendNow) ? this.m_FirstBonePos : this.PosBaseBone.position;
-		pos = ((!data.BlendNow) ? this.m_FirstTgtPosRot.pos : pos);
-		base.SetTargetTransform(data, pos, rot);
-		Vector3 enable = this.m_OffsetEnable.GetEnable(base.IKTarget.position - b, false);
-		if (data.BlendType == IKCtrlData.IKBlendType.IK_To_IK)
-		{
-			this.m_PosOffset = Vector3.Lerp(this.m_lastPosOffset, enable, data.BlendWeight);
-		}
-		else if (data.BlendType == IKCtrlData.IKBlendType.IK_To_Detach)
-		{
-			this.m_PosOffset = Vector3.Lerp(Vector3.zero, this.m_lastPosOffset, 1f - data.BlendWeight);
-		}
-		else
-		{
-			this.m_PosOffset = Vector3.Lerp(Vector3.zero, enable, data.BlendWeight);
-		}
-		base.PositionWeight = data.BlendWeight;
-	}
-
-	public override void Update()
-	{
-		if (!this.CheckDoIK())
-		{
-			return;
-		}
-		this.SetPosOffset(this.m_PosOffset);
-	}
-
-	public void SetPosOffset(Vector3 offset)
-	{
-		if (!base.IsIKExec)
-		{
-			base.PointIK.IsIKExec = true;
-			base.PositionWeight = 1f;
-		}
-		this.IsDoSetCharaPos = true;
-		Vector3 pos = this.MyIKCtrl.TgtChara.GetPos();
-		this.MyIKCtrl.TgtChara.SetPos(pos + offset * base.PositionWeight);
-	}
-
-	public void CharaPosReset()
-	{
-		if (this.IsDoSetCharaPos)
-		{
-			this.MyIKCtrl.TgtChara.SetPos(this.OrijinMaidPos);
-		}
-		this.IsDoSetCharaPos = false;
-	}
-
-	public override void Detach(IKCtrlData.IKAttachType attachType)
-	{
-		this.m_lastPosOffset = this.m_PosOffset;
-		base.Detach(attachType);
-		base.BlendPosRot.Copy(this.PosBaseBone);
-		this.HeightFit = BodyCtrlData.HeightFitType.None;
-	}
-
-	[SerializeField]
-	private Vector3 m_PosOffset = Vector3.zero;
-
-	private Vector3 m_FirstBonePos = Vector3.zero;
-
-	private Vector3 m_lastPosOffset = Vector3.zero;
-
-	public Transform PosBaseBone;
-
-	public BodyCtrlData.HeightFitType HeightFit = BodyCtrlData.HeightFitType.None;
-
-	public enum HeightFitType
-	{
-		Higher,
-		Lower,
-		None
-	}
-}

+ 112 - 0
Assembly-CSharp/BodySelectCtrl.cs

@@ -0,0 +1,112 @@
+using System;
+using SceneEditWindow;
+using UnityEngine;
+
+public class BodySelectCtrl : MonoBehaviour
+{
+	private void Start()
+	{
+		this.m_sceneEdit = GameObject.Find("__SceneEdit__").GetComponent<SceneEdit>();
+		this.oldBodyButtonFrame = UTY.GetChildObject(this.oldBodyButton.gameObject, "Frame", false).GetComponent<UI2DSprite>();
+		this.newBodyButtonFrame = UTY.GetChildObject(this.newBodyButton.gameObject, "Frame", false).GetComponent<UI2DSprite>();
+		this.defaultColor = this.oldBodyButton.defaultColor;
+		if (this.m_sceneEdit != null)
+		{
+			this.FrameButtonActive(this.m_sceneEdit.maid);
+		}
+	}
+
+	private void Update()
+	{
+		if (this.isBusy && !GameMain.Instance.CharacterMgr.IsBusy())
+		{
+			GameMain.Instance.MainCamera.FadeIn(0.3f, false, null, true, true, default(Color));
+			if (!this.m_sceneEdit.maid.IsCrcBody)
+			{
+				this.m_sceneEdit.UpdataCollidert();
+				this.m_sceneEdit.pauseIconWindow.Exec(PoseIconData.itemList[0].id);
+			}
+			this.isBusy = false;
+		}
+	}
+
+	public void FrameButtonActive(Maid maid)
+	{
+		if (maid.IsCrcBody)
+		{
+			this.FrameChange(true);
+			this.newBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f);
+		}
+		else
+		{
+			this.FrameChange(false);
+			this.oldBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f);
+		}
+	}
+
+	public void NewBodyButtonEnabled(bool hasCrcBody)
+	{
+		this.newBodyButton.isEnabled = hasCrcBody;
+	}
+
+	public void FrameChange(bool isActive)
+	{
+		this.newBodyButtonFrame.gameObject.SetActive(isActive);
+		this.oldBodyButtonFrame.gameObject.SetActive(!isActive);
+	}
+
+	public void OnClickOldBody()
+	{
+		if (SceneEdit.Instance.maid.IsCrcBody)
+		{
+			GameMain.Instance.CharacterMgr.SwapNewMaidBody(SceneEdit.Instance.maid.ActiveSlotNo, false);
+			this.newBodyButton.defaultColor = this.defaultColor;
+			this.oldBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f);
+			this.FrameChange(false);
+			this.m_sceneEdit.PanelOpenClose();
+			this.m_sceneEdit.UpdateCategoryButton();
+			if (GameMain.Instance.CharacterMgr.IsBusy())
+			{
+				GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
+			}
+			this.isBusy = true;
+		}
+	}
+
+	public void OnClickNewBody()
+	{
+		if (!SceneEdit.Instance.maid.IsCrcBody)
+		{
+			GameMain.Instance.CharacterMgr.SwapNewMaidBody(SceneEdit.Instance.maid.ActiveSlotNo, true);
+			this.oldBodyButton.defaultColor = this.defaultColor;
+			this.newBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f);
+			this.FrameChange(true);
+			this.m_sceneEdit.PanelOpenClose();
+			this.m_sceneEdit.UpdateCategoryButton();
+			if (GameMain.Instance.CharacterMgr.IsBusy())
+			{
+				GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
+			}
+			this.isBusy = true;
+		}
+	}
+
+	[SerializeField]
+	private BodySelectMgr bodySelectMgr;
+
+	[SerializeField]
+	private UIButton oldBodyButton;
+
+	[SerializeField]
+	private UIButton newBodyButton;
+
+	private UI2DSprite oldBodyButtonFrame;
+
+	private UI2DSprite newBodyButtonFrame;
+
+	private Color defaultColor;
+
+	private SceneEdit m_sceneEdit;
+
+	private bool isBusy;
+}

+ 40 - 0
Assembly-CSharp/BodySelectMgr.cs

@@ -0,0 +1,40 @@
+using System;
+using UnityEngine;
+
+public class BodySelectMgr : BaseMgr<BodySelectMgr>
+{
+	private void Start()
+	{
+		UIRoot componentInParent = base.GetComponentInParent<UIRoot>();
+		this.m_goBodySelectPanel = componentInParent.transform.Find("BodySelectPanel").gameObject;
+		if (this.m_goBodySelectPanel == null)
+		{
+			Debug.LogError(string.Format("{0}が見つかりませんでした", "BodySelectPanel"));
+			return;
+		}
+		this.m_goBodySelectPanel.SetActive(false);
+		this.m_bodySelectCtrl = this.m_goBodySelectPanel.GetComponent<BodySelectCtrl>();
+		this.m_sceneEdit = GameObject.Find("__SceneEdit__").GetComponent<SceneEdit>();
+	}
+
+	public void OpenBodySelectPanel()
+	{
+		this.m_goBodySelectPanel.SetActive(true);
+		this.m_bodySelectCtrl.NewBodyButtonEnabled(this.m_sceneEdit.maid.HasCrcBody);
+	}
+
+	public void CloseBodySelectPanel()
+	{
+		this.m_goBodySelectPanel.SetActive(false);
+	}
+
+	private void Update()
+	{
+	}
+
+	private GameObject m_goBodySelectPanel;
+
+	private BodySelectCtrl m_bodySelectCtrl;
+
+	private SceneEdit m_sceneEdit;
+}

+ 197 - 0
Assembly-CSharp/BoneDistanceToSkinMgr.cs

@@ -0,0 +1,197 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+internal class BoneDistanceToSkinMgr
+{
+	public BoneDistanceToSkinMgr(TMorphSkin morph, SkinThickness skinThick, Transform t)
+	{
+		BoneDistanceToSkinMgr $this = this;
+		Action<SkinThickness.Group> action = delegate(SkinThickness.Group grp)
+		{
+			Transform start = CMT.SearchObjName(t, grp.startBoneName, false);
+			Transform end = CMT.SearchObjName(t, grp.endBoneName, false);
+			BoneDistanceToSkinMgr.Group group = new BoneDistanceToSkinMgr.Group(morph, start, end);
+			$this.m_BoneDistanceToSkin[grp.groupName] = group;
+			BoneDistanceToSkinMgr.Group group2 = group;
+			foreach (SkinThickness.Group.Point point in grp.points)
+			{
+				Transform target = CMT.SearchObjName(t, point.targetBoneName, false);
+				group2.AddPoint(point, target);
+			}
+		};
+		if (skinThick.use)
+		{
+			foreach (KeyValuePair<string, SkinThickness.Group> keyValuePair in skinThick.groups)
+			{
+				action(keyValuePair.Value);
+			}
+		}
+	}
+
+	public void Update()
+	{
+		foreach (KeyValuePair<string, BoneDistanceToSkinMgr.Group> keyValuePair in this.m_BoneDistanceToSkin)
+		{
+			keyValuePair.Value.UpdateDisntace();
+		}
+	}
+
+	public float GetDistanceToSkinByAngle(string groupName, float ratio, float angle, out float defaultDistance)
+	{
+		return this.m_BoneDistanceToSkin[groupName].GetDistanceToSkinByAngle(ratio, angle, out defaultDistance);
+	}
+
+	private Dictionary<string, BoneDistanceToSkinMgr.Group> m_BoneDistanceToSkin = new Dictionary<string, BoneDistanceToSkinMgr.Group>();
+
+	private class Group
+	{
+		public Group(TMorphSkin morph, Transform start, Transform end)
+		{
+			this.m_morph = morph;
+			this.m_start = start;
+			this.m_end = end;
+		}
+
+		public void AddPoint(SkinThickness.Group.Point point, Transform target)
+		{
+			this.m_points.Add(new BoneDistanceToSkinMgr.Group.Point(this, point, target));
+		}
+
+		public void UpdateDisntace()
+		{
+			foreach (BoneDistanceToSkinMgr.Group.Point point in this.m_points)
+			{
+				point.UpdateDisntace();
+			}
+		}
+
+		public float GetDistanceToSkinByAngle(float ratio, float angle, out float defaultDistance)
+		{
+			float result = 0f;
+			BoneDistanceToSkinMgr.Group.Point point = this.m_points[0];
+			BoneDistanceToSkinMgr.Group.Point point2 = this.m_points[this.m_points.Count - 1];
+			angle %= 360f;
+			if (angle < 0f)
+			{
+				angle = 360f + angle;
+			}
+			if (ratio <= point.m_distRatioNow)
+			{
+				float num = MathCM.SignedAngle(this.m_start.up, point.m_target.up, this.m_start.right);
+				result = point.GetNearAngleDistance(angle - num, out defaultDistance);
+			}
+			else if (point2.m_distRatioNow <= ratio)
+			{
+				float num2 = MathCM.SignedAngle(this.m_start.up, point2.m_target.up, this.m_start.right);
+				result = point2.GetNearAngleDistance(angle - num2, out defaultDistance);
+			}
+			else
+			{
+				defaultDistance = 0f;
+				for (int i = 0; i < this.m_points.Count - 1; i++)
+				{
+					point = this.m_points[i];
+					point2 = this.m_points[i + 1];
+					if (point.m_distRatioNow <= ratio && ratio <= point2.m_distRatioNow)
+					{
+						float num3 = (ratio - point.m_distRatioNow) / (point2.m_distRatioNow - point.m_distRatioNow);
+						float num4 = MathCM.SignedAngle(this.m_start.up, point.m_target.up, this.m_start.right);
+						float num5 = MathCM.SignedAngle(this.m_start.up, point2.m_target.up, this.m_start.right);
+						float num6 = num4 + (num5 - num4) * num3;
+						float num7;
+						float nearAngleDistance = point.GetNearAngleDistance(angle - num6, out num7);
+						float num8;
+						float nearAngleDistance2 = point2.GetNearAngleDistance(angle - num6, out num8);
+						result = nearAngleDistance + (nearAngleDistance2 - nearAngleDistance) * num3;
+						defaultDistance = num7 + (num8 - num7) * num3;
+						break;
+					}
+				}
+			}
+			return result;
+		}
+
+		private TMorphSkin m_morph;
+
+		private Transform m_start;
+
+		private Transform m_end;
+
+		private List<BoneDistanceToSkinMgr.Group.Point> m_points = new List<BoneDistanceToSkinMgr.Group.Point>();
+
+		private class Point
+		{
+			public Point(BoneDistanceToSkinMgr.Group group, SkinThickness.Group.Point point, Transform target)
+			{
+				this.m_group = group;
+				this.m_pointDef = point;
+				this.m_target = target;
+				this.m_distRatioDef = this.m_pointDef.ratioSegmentStartToEnd;
+				foreach (SkinThickness.Group.Point.DefPerAngle defPerAngle in this.m_pointDef.distanceParAngle)
+				{
+					this.m_angleDistance.Add(new BoneDistanceToSkinMgr.Group.Point.AngleDist
+					{
+						angle = defPerAngle.angleDgree,
+						defDisntace = defPerAngle.defaultDistance,
+						vidx = defPerAngle.vidx
+					});
+				}
+			}
+
+			public void UpdateDisntace()
+			{
+				this.m_distRatioNow = Vector3.Distance(this.m_group.m_start.position, this.m_target.position) / Vector3.Distance(this.m_group.m_start.position, this.m_group.m_end.position);
+				foreach (BoneDistanceToSkinMgr.Group.Point.AngleDist angleDist in this.m_angleDistance)
+				{
+					Vector3 zero = Vector3.zero;
+					this.m_group.m_morph.CalcVidxToPos(angleDist.vidx, ref zero);
+					angleDist.nowDistance = (this.m_target.position - zero).magnitude;
+				}
+			}
+
+			public float GetNearAngleDistance(float angle, out float defDistance)
+			{
+				angle %= 360f;
+				float num = 360f;
+				int index = -1;
+				for (int i = 0; i < this.m_angleDistance.Count; i++)
+				{
+					float num2 = Mathf.Abs((float)this.m_angleDistance[i].angle - angle);
+					if (num2 < num)
+					{
+						num = num2;
+						index = i;
+					}
+				}
+				BoneDistanceToSkinMgr.Group.Point.AngleDist angleDist = this.m_angleDistance[index];
+				float nowDistance = angleDist.nowDistance;
+				defDistance = angleDist.defDisntace;
+				return nowDistance;
+			}
+
+			private BoneDistanceToSkinMgr.Group m_group;
+
+			public SkinThickness.Group.Point m_pointDef;
+
+			public Transform m_target;
+
+			public float m_distRatioDef;
+
+			public float m_distRatioNow;
+
+			private List<BoneDistanceToSkinMgr.Group.Point.AngleDist> m_angleDistance = new List<BoneDistanceToSkinMgr.Group.Point.AngleDist>();
+
+			private class AngleDist
+			{
+				public int angle;
+
+				public float nowDistance;
+
+				public float defDisntace;
+
+				public int vidx;
+			}
+		}
+	}
+}

+ 2 - 2
Assembly-CSharp/BoneHair3.cs

@@ -25,7 +25,7 @@ public class BoneHair3
 	{
 		if (this.m_SkirtBone != null)
 		{
-			this.m_SkirtBone.Uninit();
+			this.m_SkirtBone.UnInit();
 			UnityEngine.Object.DestroyImmediate(this.m_SkirtBone);
 			this.m_SkirtBone = null;
 		}
@@ -82,7 +82,7 @@ public class BoneHair3
 	{
 		if (this.m_SkirtBone != null)
 		{
-			this.m_SkirtBone.UpdateSelf();
+			this.m_SkirtBone.DynamicUpdate();
 		}
 	}
 

+ 570 - 0
Assembly-CSharp/BoneMorphDefine.cs

@@ -0,0 +1,570 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BoneMorphDefine
+{
+	public static void Init()
+	{
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.KubiScl, "Bip01 Neck", 0.95f, 1f, 1f, 1.05f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.KubiScl, "Bip01 Head", 0.8f, 1f, 1f, 1.2f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UdeScl, "Bip01 ? UpperArm_SCL_", 0.85f, 1f, 1f, 1.15f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UdeScl, "Bip01 ? Forearm_SCL_", 0.85f, 1f, 1f, 1.15f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.EyeSclX, "Eyepos_L", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.EyeSclX, "Eyepos_R", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.EyeSclY, "Eyepos_L", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.EyeSclY, "Eyepos_R", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.EyePosX, "Eyepos_R", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.EyePosX, "Eyepos_L", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.EyePosY, "Eyepos_R", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.EyePosY, "Eyepos_L", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.HeadX, "Bip01 Head", 1f, 0.9f, 0.8f, 1f, 1.1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.HeadY, "Bip01 Head", 0.8f, 0.9f, 1f, 1.2f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouPer, "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouPer, "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Spine", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Spine0a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Spine1", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Spine1a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Neck", 0.97f, 1f, 1f, 1.03f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 Head", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 ? UpperArm_SCL_", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 ? Forearm_SCL_", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.sintyou, "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.kata, "Bip01 ? Clavicle", 0.98f, 1f, 0.5f, 1.02f, 1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.kata, "Spine1aScale", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.MunePosX, "Mune_?", 0.5f, 1f, 1f, 1.5f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.MunePosY, "Mune_?", 1f, 1f, 0.5f, 1f, 1.1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.MuneThick, "Mune_?_scale", 1f, 0.5f, 0.5f, 1f, 1.5f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.MuneLong, "Mune_?_scale", 0.5f, 1f, 1f, 1.5f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick1X, "Spine1aScale", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick1Y, "Spine1aScale", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick2X, "Spine1Scale", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick2Y, "Spine1Scale", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick3X, "Spine0aScale", 1f, 1f, 0.5f, 1f, 1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick3Y, "Spine0aScale", 1f, 0.45f, 1f, 1f, 1.55f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ShoulderThick, "Kata_?", 0.925f, 0.75f, 1f, 1.075f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickX, "UpperTwist1_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickX, "UpperTwist2_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickX, "UpperTwist3_?", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickY, "UpperTwist1_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickY, "UpperTwist2_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmThickY, "UpperTwist3_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickX, "ForeTwist2_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickX, "ForeTwist3_?", 1f, 1f, 0.5f, 1f, 1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickX, "ForeTwist4_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickX, "ForeTwist5_?", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickY, "ForeTwist2_?", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickY, "ForeTwist3_?", 1f, 0.5f, 1f, 1f, 1.5f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickY, "ForeTwist4_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.LowerArmThickY, "ForeTwist5_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickX, "UpperTwist4_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickX, "UpperTwist5_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickX, "ForeTwist1_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickX, "ForeTwist2_?", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickY, "UpperTwist4_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickY, "UpperTwist5_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickY, "ForeTwist1_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ElbowThickY, "ForeTwist2_?", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.NeckThickX, "NeckScale", 1f, 1f, 0.35f, 1f, 1f, 1.65f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.NeckThickX, "HeadScale", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.NeckThickY, "NeckScale", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.NeckThickY, "HeadScale", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.HandSize, "Bip01 ? Hand", 0.925f, 0.925f, 0.925f, 1.075f, 1.075f, 1.075f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick4X, "SpineScale", 1f, 1f, 0.5f, 1f, 1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick4Y, "SpineScale", 1f, 0.3f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick5X, "PelvisScale", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.DouThick5Y, "PelvisScale", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.WaistPos, "Bip01 Spine0a", 0.75f, 1f, 1f, 1.25f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.WaistPos, "Bip01 Spine1", 1.225f, 1f, 1f, 0.775f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAID, MPN.HipRot, "Hip_?", 0.5f, 1f, 1f, 1.5f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickX, "ThighTwist1_?", 1f, 1f, 0.615f, 1f, 1f, 1.55f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickX, "ThighTwist2_?", 1f, 1f, 0.79f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickX, "ThighTwist3_?", 1f, 1f, 0.825f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickY, "ThighTwist1_?", 1f, 0.73f, 1f, 1f, 1.45f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickY, "ThighTwist2_?", 1f, 0.88f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighThickY, "ThighTwist3_?", 1f, 0.91f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickX, "ThighTwist4_?", 1f, 1f, 0.88f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickX, "ThighTwist5_?", 1f, 1f, 0.68f, 1f, 1f, 1.8f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickX, "CalfTwist1_?", 1f, 1f, 0.68f, 1f, 1f, 1.8f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickX, "CalfTwist2_?", 1f, 1f, 0.84f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickY, "ThighTwist4_?", 1f, 0.92f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickY, "ThighTwist5_?", 1f, 0.72f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickY, "CalfTwist1_?", 1f, 0.72f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.KneeThickY, "CalfTwist2_?", 1f, 0.88f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickX, "CalfTwist2_?", 1f, 1f, 0.84f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickX, "CalfTwist3_?", 1f, 1f, 0.76f, 1f, 1f, 1.6f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickX, "CalfTwist4_?", 1f, 1f, 0.84f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickY, "CalfTwist2_?", 1f, 0.85f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickY, "CalfTwist3_?", 1f, 0.75f, 1f, 1f, 1.5f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.CalfThickY, "CalfTwist4_?", 1f, 0.85f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickX, "CalfTwist3_?", 1f, 1f, 0.88f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickX, "CalfTwist4_?", 1f, 1f, 0.82f, 1f, 1f, 1.45f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickX, "CalfTwist5_?", 1f, 1f, 0.82f, 1f, 1f, 1.45f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickY, "CalfTwist3_?", 1f, 0.895f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickY, "CalfTwist4_?", 1f, 0.755f, 1f, 1f, 1.35f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.AnkleThickY, "CalfTwist5_?", 1f, 0.804f, 1f, 1f, 1.28f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.FootSize, "Bip01 ? Foot", 1f, 0.85f, 0.85f, 1f, 1.15f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickX, "UpperTwist2_?", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickX, "UpperTwist3_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickX, "UpperTwist4_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickY, "UpperTwist2_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickY, "UpperTwist3_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.UpperArmLowerThickY, "UpperTwist4_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.WristThickX, "ForeTwist5_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.WristThickX, "ForeTwist6_?", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.WristThickY, "ForeTwist5_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.WristThickY, "ForeTwist6_?", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ClavicleThick, "Bip01 ? Clavicle_SCL_", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ShoulderTension, "Kata_?", 0.925f, 1f, 0.75f, 1.075f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickX, "ThighTwist2_?", 1f, 1f, 0.88f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickX, "ThighTwist3_?", 1f, 1f, 0.84f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickX, "ThighTwist4_?", 1f, 1f, 0.88f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickY, "ThighTwist2_?", 1f, 0.86f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickY, "ThighTwist3_?", 1f, 0.79f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighLowerThickY, "ThighTwist4_?", 1f, 0.825f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighShin, "Bip01 ? Thigh_SCL_", 1.05f, 1f, 1f, 0.95f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAID, MPN.ThighShin, "Bip01 ? Calf_SCL_", 0.95f, 1f, 1f, 1.05f, 1f, 1f);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ThighTwist1_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ThighTwist2_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ThighTwist3_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ThighTwist4_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ThighTwist5_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "Bip01 ? Calf", "Bip01 ? Thigh_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "CalfTwist1_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "CalfTwist2_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "CalfTwist3_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "CalfTwist4_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "CalfTwist5_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "Bip01 ? Foot", "Bip01 ? Calf_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "UpperTwist1_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "UpperTwist2_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "UpperTwist3_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "UpperTwist4_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "UpperTwist5_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "Bip01 ? Forearm", "Bip01 ? UpperArm_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist1_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist2_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist3_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist4_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist5_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "ForeTwist6_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "Bip01 ? Hand", "Bip01 ? Forearm_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_UpperArm?_tgt", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_UpperArm?_2_tgt", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_ForeArm?_tgt", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_ForeArm?_2_tgt", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_thigh?_tgt", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_thigh?_2_tgt", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_calf?_tgt", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAID, "_IK_calf?_2_tgt", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.KubiScl, "Bip01 Neck", 0.95f, 1f, 1f, 1.05f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.KubiScl, "Bip01 Head", 0.8f, 1f, 1f, 1.2f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UdeScl, "Bip01 ? UpperArm_SCL_", 0.85f, 1f, 1f, 1.15f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UdeScl, "Bip01 ? Forearm_SCL_", 0.85f, 1f, 1f, 1.15f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.EyeSclX, "Eyepos_L", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.EyeSclX, "Eyepos_R", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.EyeSclY, "Eyepos_L", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.EyeSclY, "Eyepos_R", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.EyePosX, "Eyepos_R", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.EyePosX, "Eyepos_L", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.EyePosY, "Eyepos_R", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.EyePosY, "Eyepos_L", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.HeadX, "Bip01 Head", 1f, 0.9f, 0.8f, 1f, 1.1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.HeadY, "Bip01 Head", 0.8f, 0.9f, 1f, 1.2f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouPer, "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouPer, "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Spine", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Spine0a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Spine1", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Spine1a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Neck", 0.97f, 1f, 1f, 1.03f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 Head", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 ? UpperArm_SCL_", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 ? Forearm_SCL_", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.sintyou, "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.kata, "Bip01 ? Clavicle", 0.98f, 1f, 0.5f, 1.02f, 1f, 1.5f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.kata, "Spine1aScale", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick1X, "Spine1aScale", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick1Y, "Spine1aScale", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick2X, "Spine1Scale", 1f, 1f, 0.55f, 1f, 1f, 1.45f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick2Y, "Spine1Scale", 1f, 0.65f, 1f, 1f, 1.35f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick3X, "Spine0aScale", 1f, 1f, 0.25f, 1f, 1f, 1.75f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick3Y, "Spine0aScale", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ShoulderThick, "Kata_?", 0.8f, 0.7f, 1f, 1.2f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ShoulderTension, "Kata_?", 0.8f, 1f, 0.8f, 1.2f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickX, "UpperTwist1_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickX, "UpperTwist2_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickX, "UpperTwist3_?", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickY, "UpperTwist1_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickY, "UpperTwist2_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmThickY, "UpperTwist3_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickX, "UpperTwist2_?", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickX, "UpperTwist3_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickX, "UpperTwist4_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickY, "UpperTwist2_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickY, "UpperTwist3_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.UpperArmLowerThickY, "UpperTwist4_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickX, "UpperTwist4_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickX, "UpperTwist5_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickX, "ForeTwist1_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickX, "ForeTwist2_?", 1f, 1f, 0.8f, 1f, 1f, 1.2f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickY, "UpperTwist4_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickY, "UpperTwist5_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickY, "ForeTwist1_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ElbowThickY, "ForeTwist2_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickX, "ForeTwist2_?", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickX, "ForeTwist3_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickX, "ForeTwist4_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickX, "ForeTwist5_?", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickY, "ForeTwist2_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickY, "ForeTwist3_?", 1f, 0.65f, 1f, 1f, 1.35f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickY, "ForeTwist4_?", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.LowerArmThickY, "ForeTwist5_?", 1f, 0.9f, 1f, 1f, 1.1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.WristThickX, "ForeTwist5_?", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.WristThickX, "ForeTwist6_?", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.WristThickY, "ForeTwist5_?", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.WristThickY, "ForeTwist6_?", 1f, 0.95f, 1f, 1f, 1.05f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.NeckThickX, "NeckScale", 1f, 1f, 0.35f, 1f, 1f, 1.65f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.NeckThickX, "HeadScale", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.NeckThickY, "NeckScale", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.NeckThickY, "HeadScale", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.HandSize, "Bip01 ? Hand", 0.85f, 0.85f, 0.85f, 1.15f, 1.15f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick4X, "SpineScale", 1f, 1f, 0.2f, 1f, 1f, 1.8f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick4Y, "SpineScale", 1f, 0.3f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick5X, "PelvisScale", 1f, 1f, 0.65f, 1f, 1f, 1.35f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.DouThick5Y, "PelvisScale", 1f, 0.6f, 1f, 1f, 1.4f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.WaistPos, "Bip01 Spine0a", 0.75f, 1f, 1f, 1.25f, 1f, 1f);
+		BoneMorphDefine.SetPosition(BoneMorphDefine.CH.MAN, MPN.WaistPos, "Bip01 Spine1", 1.225f, 1f, 1f, 0.775f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickX, "ThighTwist1_?", 1f, 1f, 0.45f, 1f, 1f, 1.55f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickX, "ThighTwist2_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickX, "ThighTwist3_?", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickY, "ThighTwist1_?", 1f, 0.55f, 1f, 1f, 1.45f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickY, "ThighTwist2_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighThickY, "ThighTwist3_?", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickX, "ThighTwist2_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickX, "ThighTwist3_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickX, "ThighTwist4_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickY, "ThighTwist2_?", 1f, 0.8f, 1f, 1f, 1.2f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickY, "ThighTwist3_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighLowerThickY, "ThighTwist4_?", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickX, "ThighTwist4_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickX, "ThighTwist5_?", 1f, 1f, 0.2f, 1f, 1f, 1.8f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickX, "CalfTwist1_?", 1f, 1f, 0.2f, 1f, 1f, 1.8f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickX, "CalfTwist2_?", 1f, 1f, 0.65f, 1f, 1f, 1.35f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickY, "ThighTwist4_?", 1f, 0.75f, 1f, 1f, 1.25f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickY, "ThighTwist5_?", 1f, 0.3f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickY, "CalfTwist1_?", 1f, 0.3f, 1f, 1f, 1.7f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.KneeThickY, "CalfTwist2_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickX, "CalfTwist2_?", 1f, 1f, 0.65f, 1f, 1f, 1.35f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickX, "CalfTwist3_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickX, "CalfTwist4_?", 1f, 1f, 0.6f, 1f, 1f, 1.4f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickY, "CalfTwist2_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickY, "CalfTwist3_?", 1f, 0.65f, 1f, 1f, 1.35f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.CalfThickY, "CalfTwist4_?", 1f, 0.7f, 1f, 1f, 1.3f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickX, "CalfTwist3_?", 1f, 1f, 0.7f, 1f, 1f, 1.3f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickX, "CalfTwist4_?", 1f, 1f, 0.55f, 1f, 1f, 1.45f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickX, "CalfTwist5_?", 1f, 1f, 0.15f, 1f, 1f, 1.85f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickY, "CalfTwist3_?", 1f, 0.85f, 1f, 1f, 1.15f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickY, "CalfTwist4_?", 1f, 0.65f, 1f, 1f, 1.35f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.AnkleThickY, "CalfTwist5_?", 1f, 0.4f, 1f, 1f, 1.6f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.FootSize, "Bip01 ? Foot", 1f, 0.85f, 0.85f, 1f, 1.15f, 1.15f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ClavicleThick, "Bip01 ? Clavicle_SCL_", 1f, 1f, 0.75f, 1f, 1f, 1.25f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighShin, "Bip01 ? Thigh_SCL_", 1.05f, 1f, 1f, 0.95f, 1f, 1f);
+		BoneMorphDefine.SetScale(BoneMorphDefine.CH.MAN, MPN.ThighShin, "Bip01 ? Calf_SCL_", 0.95f, 1f, 1f, 1.05f, 1f, 1f);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ThighTwist1_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ThighTwist2_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ThighTwist3_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ThighTwist4_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ThighTwist5_?", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "Bip01 ? Calf", "Bip01 ? Thigh_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "CalfTwist1_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "CalfTwist2_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "CalfTwist3_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "CalfTwist4_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "CalfTwist5_?", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "Bip01 ? Foot", "Bip01 ? Calf_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "UpperTwist1_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "UpperTwist2_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "UpperTwist3_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "UpperTwist4_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "UpperTwist5_?", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "Bip01 ? Forearm", "Bip01 ? UpperArm_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist1_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist2_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist3_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist4_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist5_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "ForeTwist6_?", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "Bip01 ? Hand", "Bip01 ? Forearm_SCL_", true, false);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_UpperArm?_tgt", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_UpperArm?_2_tgt", "Bip01 ? UpperArm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_ForeArm?_tgt", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_ForeArm?_2_tgt", "Bip01 ? Forearm_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_thigh?_tgt", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_thigh?_2_tgt", "Bip01 ? Thigh_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_calf?_tgt", "Bip01 ? Calf_SCL_", true, true);
+		BoneMorphDefine.SetLink(BoneMorphDefine.CH.MAN, "_IK_calf?_2_tgt", "Bip01 ? Calf_SCL_", true, true);
+	}
+
+	private static void SetScale(BoneMorphDefine.CH ch, MPN tag, string bname, float x, float y, float z, float x2, float y2, float z2)
+	{
+		Action<string> action = delegate(string bn)
+		{
+			Dictionary<string, List<BoneMorphDefine.BoneProp>> dictionary = (ch != BoneMorphDefine.CH.MAID) ? BoneMorphDefine.m_dicMan : BoneMorphDefine.m_dicMaid;
+			List<BoneMorphDefine.BoneProp> list;
+			if (!dictionary.TryGetValue(bn, out list))
+			{
+				List<BoneMorphDefine.BoneProp> list2 = new List<BoneMorphDefine.BoneProp>();
+				dictionary[bn] = list2;
+				list = list2;
+			}
+			BoneMorphDefine.BoneProp boneProp = list.Find((BoneMorphDefine.BoneProp a) => a.strProp == tag);
+			if (boneProp == null)
+			{
+				boneProp = new BoneMorphDefine.BoneProp();
+				list.Add(boneProp);
+			}
+			boneProp.strProp = tag;
+			boneProp.nIndex = Array.FindIndex<MPN>(BoneMorphDefine.PropNames, (MPN a) => a == tag);
+			NDebug.Assert(boneProp.nIndex != -1, () => "SetScale " + BoneMorphDefine.PropNames + " not found.");
+			boneProp.bExistS = true;
+			boneProp.vMinS = new Vector3(x, y, z);
+			boneProp.vMaxS = new Vector3(x2, y2, z2);
+		};
+		if (bname.Contains("?"))
+		{
+			string obj = bname.Replace('?', 'L');
+			string obj2 = bname.Replace('?', 'R');
+			action(obj);
+			action(obj2);
+		}
+		else
+		{
+			action(bname);
+		}
+	}
+
+	private static void SetPosition(BoneMorphDefine.CH ch, MPN tag, string bname, float x, float y, float z, float x2, float y2, float z2)
+	{
+		Action<string> action = delegate(string bn)
+		{
+			Dictionary<string, List<BoneMorphDefine.BoneProp>> dictionary = (ch != BoneMorphDefine.CH.MAID) ? BoneMorphDefine.m_dicMan : BoneMorphDefine.m_dicMaid;
+			List<BoneMorphDefine.BoneProp> list;
+			if (!dictionary.TryGetValue(bn, out list))
+			{
+				List<BoneMorphDefine.BoneProp> list2 = new List<BoneMorphDefine.BoneProp>();
+				dictionary[bn] = list2;
+				list = list2;
+			}
+			BoneMorphDefine.BoneProp boneProp = list.Find((BoneMorphDefine.BoneProp a) => a.strProp == tag);
+			if (boneProp == null)
+			{
+				boneProp = new BoneMorphDefine.BoneProp();
+				list.Add(boneProp);
+			}
+			boneProp.strProp = tag;
+			boneProp.nIndex = Array.FindIndex<MPN>(BoneMorphDefine.PropNames, (MPN a) => a == tag);
+			NDebug.Assert(boneProp.nIndex != -1, () => "SetPosition " + BoneMorphDefine.PropNames + " not found.");
+			boneProp.bExistP = true;
+			boneProp.vMinP = new Vector3(x, y, z);
+			boneProp.vMaxP = new Vector3(x2, y2, z2);
+		};
+		if (bname.Contains("?"))
+		{
+			string obj = bname.Replace('?', 'L');
+			string obj2 = bname.Replace('?', 'R');
+			action(obj);
+			action(obj2);
+		}
+		else
+		{
+			action(bname);
+		}
+	}
+
+	private static void SetRotation(BoneMorphDefine.CH ch, MPN tag, string bname, float axisX, float axisY, float axisZ, float rot, float rot2)
+	{
+		Action<string> action = delegate(string bn)
+		{
+			Dictionary<string, List<BoneMorphDefine.BoneProp>> dictionary = (ch != BoneMorphDefine.CH.MAID) ? BoneMorphDefine.m_dicMan : BoneMorphDefine.m_dicMaid;
+			List<BoneMorphDefine.BoneProp> list;
+			if (!dictionary.TryGetValue(bn, out list))
+			{
+				List<BoneMorphDefine.BoneProp> list2 = new List<BoneMorphDefine.BoneProp>();
+				dictionary[bn] = list2;
+				list = list2;
+			}
+			BoneMorphDefine.BoneProp boneProp = list.Find((BoneMorphDefine.BoneProp a) => a.strProp == tag);
+			if (boneProp == null)
+			{
+				boneProp = new BoneMorphDefine.BoneProp();
+				list.Add(boneProp);
+			}
+			boneProp.strProp = tag;
+			boneProp.nIndex = Array.FindIndex<MPN>(BoneMorphDefine.PropNames, (MPN a) => a == tag);
+			NDebug.Assert(boneProp.nIndex != -1, () => "SetRotation " + BoneMorphDefine.PropNames + " not found.");
+			boneProp.bExistR = true;
+			boneProp.vRotAxis = new Vector3(axisX, axisY, axisZ);
+			boneProp.fMinR = rot;
+			boneProp.fMaxR = rot2;
+		};
+		if (bname.Contains("?"))
+		{
+			string obj = bname.Replace('?', 'L');
+			string obj2 = bname.Replace('?', 'R');
+			action(obj);
+			action(obj2);
+		}
+		else
+		{
+			action(bname);
+		}
+	}
+
+	private static void SetLink(BoneMorphDefine.CH ch, string my_, string virtualParent_, bool calcPos_ = true, bool calcScale_ = true)
+	{
+		Action<string, string> action = delegate(string bnMy, string bnParnt)
+		{
+			List<BoneMorphDefine.LinkProp> list = (ch != BoneMorphDefine.CH.MAID) ? BoneMorphDefine.m_linkedBoneManDef : BoneMorphDefine.m_linkedBoneMaidDef;
+			list.Add(new BoneMorphDefine.LinkProp
+			{
+				myName = bnMy,
+				virtualParent = bnParnt,
+				calcPos = calcPos_,
+				calcScale = calcScale_
+			});
+		};
+		if (my_.Contains("?") || virtualParent_.Contains("?"))
+		{
+			string arg = my_.Replace('?', 'L');
+			string arg2 = my_.Replace('?', 'R');
+			string arg3 = virtualParent_.Replace('?', 'L');
+			string arg4 = virtualParent_.Replace('?', 'R');
+			action(arg, arg3);
+			action(arg2, arg4);
+		}
+		else
+		{
+			action(my_, virtualParent_);
+		}
+	}
+
+	public static Dictionary<string, List<BoneMorphDefine.BoneProp>> m_dicMaid = new Dictionary<string, List<BoneMorphDefine.BoneProp>>();
+
+	public static Dictionary<string, List<BoneMorphDefine.BoneProp>> m_dicMan = new Dictionary<string, List<BoneMorphDefine.BoneProp>>();
+
+	public static List<BoneMorphDefine.LinkProp> m_linkedBoneMaidDef = new List<BoneMorphDefine.LinkProp>();
+
+	public static List<BoneMorphDefine.LinkProp> m_linkedBoneManDef = new List<BoneMorphDefine.LinkProp>();
+
+	public static readonly MPN[] PropNames = new MPN[]
+	{
+		MPN.KubiScl,
+		MPN.UdeScl,
+		MPN.EyeSclX,
+		MPN.EyeSclY,
+		MPN.EyePosX,
+		MPN.EyePosY,
+		MPN.HeadX,
+		MPN.HeadY,
+		MPN.DouPer,
+		MPN.sintyou,
+		MPN.kata,
+		MPN.MuneUpDown,
+		MPN.MuneYori,
+		MPN.MunePosX,
+		MPN.MunePosY,
+		MPN.MuneThick,
+		MPN.MuneLong,
+		MPN.MuneDir,
+		MPN.DouThick1X,
+		MPN.DouThick1Y,
+		MPN.DouThick2X,
+		MPN.DouThick2Y,
+		MPN.DouThick3X,
+		MPN.DouThick3Y,
+		MPN.ShoulderThick,
+		MPN.UpperArmThickX,
+		MPN.UpperArmThickY,
+		MPN.LowerArmThickX,
+		MPN.LowerArmThickY,
+		MPN.ElbowThickX,
+		MPN.ElbowThickY,
+		MPN.NeckThickX,
+		MPN.NeckThickY,
+		MPN.HandSize,
+		MPN.DouThick4X,
+		MPN.DouThick4Y,
+		MPN.DouThick5X,
+		MPN.DouThick5Y,
+		MPN.WaistPos,
+		MPN.HipRot,
+		MPN.ThighThickX,
+		MPN.ThighThickY,
+		MPN.ThighThickX,
+		MPN.ThighThickY,
+		MPN.KneeThickX,
+		MPN.KneeThickY,
+		MPN.CalfThickX,
+		MPN.CalfThickY,
+		MPN.AnkleThickX,
+		MPN.AnkleThickY,
+		MPN.FootSize,
+		MPN.UpperArmLowerThickX,
+		MPN.UpperArmLowerThickY,
+		MPN.WristThickX,
+		MPN.WristThickY,
+		MPN.ClavicleThick,
+		MPN.ShoulderTension,
+		MPN.ThighLowerThickX,
+		MPN.ThighLowerThickY,
+		MPN.ThighShin
+	};
+
+	public class BoneProp
+	{
+		public MPN strProp;
+
+		public int nIndex;
+
+		public bool bExistP;
+
+		public bool bExistS;
+
+		public bool bExistR;
+
+		public Vector3 vMinP;
+
+		public Vector3 vMaxP;
+
+		public Vector3 vMinS;
+
+		public Vector3 vMaxS;
+
+		public Vector3 vRotAxis;
+
+		public float fMinR;
+
+		public float fMaxR;
+	}
+
+	private enum CH
+	{
+		MAID,
+		MAN
+	}
+
+	public class LinkProp
+	{
+		public string myName;
+
+		public string virtualParent;
+
+		public bool calcPos;
+
+		public bool calcScale;
+	}
+}

+ 28 - 17
Assembly-CSharp/BoneMorph_.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 
 public class BoneMorph_
 {
-	public void Init()
+	public virtual void Init()
 	{
 		if (this.bones != null)
 		{
@@ -21,7 +21,7 @@ public class BoneMorph_
 		this.bones = new List<BoneMorphLocal>();
 	}
 
-	public void Uninit()
+	public virtual void Uninit()
 	{
 		this.m_listBoneMorphPos.Clear();
 		this.m_listBoneMorphScl.Clear();
@@ -36,7 +36,13 @@ public class BoneMorph_
 
 	public void InitBoneMorphEdit(Transform t, MPN f_mpn, TBody.SlotID f_slot, TBodySkin tbskin)
 	{
+		this.Init(tbskin, f_mpn, f_slot);
+	}
+
+	public virtual void Init(TBodySkin tbskin, MPN f_mpn, TBody.SlotID f_slot)
+	{
 		this.m_tbSkin = tbskin;
+		Transform obj_tr = tbskin.obj_tr;
 		Func<string, Transform, BoneMorph_.BoneMorphPos> func = delegate(string propertyName, Transform boneTrans)
 		{
 			this.m_listBoneMorphPos.RemoveAll((BoneMorph_.BoneMorphPos f) => f.strPropName == propertyName);
@@ -57,7 +63,7 @@ public class BoneMorph_
 		};
 		if (f_mpn == MPN.head && f_slot == TBody.SlotID.head)
 		{
-			Transform transform = CMT.SearchObjName(t, "Ear_L", false);
+			Transform transform = CMT.SearchObjName(obj_tr, "Ear_L", false);
 			bool flag = transform != null;
 			if (flag)
 			{
@@ -100,36 +106,36 @@ public class BoneMorph_
 				func2("Earrot_L", transform);
 				func3("Earscl_L", transform);
 			}
-			Transform transform2 = CMT.SearchObjName(t, "Ear_R", false);
+			Transform transform2 = CMT.SearchObjName(obj_tr, "Ear_R", false);
 			if (transform2 != null)
 			{
 				func2("Earrot_R", transform2);
 				func3("Earscl_R", transform2);
 			}
-			Transform transform3 = CMT.SearchObjName(t, "Nose", false);
+			Transform transform3 = CMT.SearchObjName(obj_tr, "Nose", false);
 			if (transform3 != null)
 			{
 				func("Nosepos", transform3);
 				func3("Nosescl", transform3);
 			}
-			Transform transform4 = CMT.SearchObjName(t, "Mayupos", false);
+			Transform transform4 = CMT.SearchObjName(obj_tr, "Mayupos", false);
 			if (transform4 != null)
 			{
 				func("MayuY", transform4);
 			}
-			Transform transform5 = CMT.SearchObjName(t, "Mayupos_L", false);
+			Transform transform5 = CMT.SearchObjName(obj_tr, "Mayupos_L", false);
 			if (transform5 != null)
 			{
 				func("Mayupos_L", transform5);
 				func2("Mayurot_L", transform5);
 			}
-			Transform transform6 = CMT.SearchObjName(t, "Mayupos_R", false);
+			Transform transform6 = CMT.SearchObjName(obj_tr, "Mayupos_R", false);
 			if (transform6 != null)
 			{
 				func("Mayupos_R", transform6);
 				func2("Mayurot_R", transform6);
 			}
-			Transform transform7 = CMT.SearchObjName(t, "Eye_L", false);
+			Transform transform7 = CMT.SearchObjName(obj_tr, "Eye_L", false);
 			if (transform7 != null)
 			{
 				func("EyeBallPosXL", transform7);
@@ -143,7 +149,7 @@ public class BoneMorph_
 				boneMorphScl.m_vAddMin += new Vector3(0f, -0.3f, -0.3f);
 				boneMorphScl.m_vAddMax += new Vector3(0f, 0.1f, 0.1f);
 			}
-			Transform transform8 = CMT.SearchObjName(t, "Eye_R", false);
+			Transform transform8 = CMT.SearchObjName(obj_tr, "Eye_R", false);
 			if (transform8 != null)
 			{
 				func("EyeBallPosXR", transform8);
@@ -159,8 +165,8 @@ public class BoneMorph_
 			}
 			if (120 <= tbskin.PartsVersion)
 			{
-				Transform transform9 = CMT.SearchObjName(t, "Mayupos_L", false);
-				Transform transform10 = CMT.SearchObjName(t, "Mayupos_R", false);
+				Transform transform9 = CMT.SearchObjName(obj_tr, "Mayupos_L", false);
+				Transform transform10 = CMT.SearchObjName(obj_tr, "Mayupos_R", false);
 				if (transform9 != null && transform10 != null)
 				{
 					BoneMorph_.BoneMorphScl boneMorphScl3 = func3("MayuLongL", transform9);
@@ -176,6 +182,11 @@ public class BoneMorph_
 
 	public void DelBoneMorphEdit(MPN f_mpn, TBody.SlotID f_slot)
 	{
+		this.UninitItem(f_mpn, f_slot);
+	}
+
+	public virtual void UninitItem(MPN f_mpn, TBody.SlotID f_slot)
+	{
 		if (f_mpn == MPN.head && f_slot == TBody.SlotID.head)
 		{
 			HashSet<string> removeTargetPropNames = new HashSet<string>(new string[]
@@ -256,12 +267,12 @@ public class BoneMorph_
 		}
 	}
 
-	public void AddRoot(Transform root)
+	public virtual void AddRoot(Transform root)
 	{
 		this.AddRoot_lp(root, 0, 0f);
 	}
 
-	public void ChangeMorphPosValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
+	public virtual void ChangeMorphPosValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
 	{
 		BoneMorph_.BoneMorphPos boneMorphPos = this.m_listBoneMorphPos.Find((BoneMorph_.BoneMorphPos f) => f.strPropName == strPropName && f.trBone.name == f_strBoneName);
 		if (boneMorphPos != null)
@@ -271,7 +282,7 @@ public class BoneMorph_
 		}
 	}
 
-	public void ChangeMorphSclValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
+	public virtual void ChangeMorphSclValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
 	{
 		BoneMorph_.BoneMorphScl boneMorphScl = this.m_listBoneMorphScl.Find((BoneMorph_.BoneMorphScl f) => f.strPropName == strPropName && f.trBone.name == f_strBoneName);
 		if (boneMorphScl != null)
@@ -281,7 +292,7 @@ public class BoneMorph_
 		}
 	}
 
-	public void ChangeMorphRotatioValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
+	public virtual void ChangeMorphRotatioValue(string strPropName, string f_strBoneName, Vector3 f_fAddMin, Vector3 f_fAddMax)
 	{
 		BoneMorph_.BoneMorphRotatio boneMorphRotatio = this.m_listBoneMorphRot.Find((BoneMorph_.BoneMorphRotatio f) => f.strPropName == strPropName && f.trBone.name == f_strBoneName);
 		if (boneMorphRotatio != null)
@@ -291,7 +302,7 @@ public class BoneMorph_
 		}
 	}
 
-	public void Blend()
+	public virtual void Blend()
 	{
 		for (int i = this.bones.Count - 1; i >= 0; i--)
 		{

+ 286 - 0
Assembly-CSharp/CM3.cs

@@ -209,4 +209,290 @@ public static class CM3
 			string.Empty
 		}
 	};
+
+	public static Dictionary<string, string> newManBodyMenuSwap = new Dictionary<string, string>
+	{
+		{
+			"mbody_moza_i_.menu",
+			"crc_mbluebody_moza_i_.menu"
+		},
+		{
+			"mbody_i_.menu",
+			"crc_mbluebody001_i_.menu"
+		},
+		{
+			"mbody001_i_.menu",
+			"crc_mbluebody002_i_.menu"
+		},
+		{
+			"mbody002_i_.menu",
+			"crc_mbluebody003_i_.menu"
+		},
+		{
+			"mbody003_i_.menu",
+			"crc_mbluebody004_i_.menu"
+		},
+		{
+			"mbody004_i_.menu",
+			"crc_mbluebody005_i_.menu"
+		},
+		{
+			"mbody005_i_.menu",
+			"crc_mbluebody006_i_.menu"
+		},
+		{
+			"mbody006_i_.menu",
+			"crc_mbluebody007_i_.menu"
+		},
+		{
+			"mhead000_i_.menu",
+			"crc_mhead000_i_.menu"
+		},
+		{
+			"mhead001_i_.menu",
+			"crc_mhead001_i_.menu"
+		},
+		{
+			"mhead002_i_.menu",
+			"crc_mhead002_i_.menu"
+		},
+		{
+			"mhead003_i_.menu",
+			"crc_mhead003_i_.menu"
+		},
+		{
+			"mhead004_i_.menu",
+			"crc_mhead004_i_.menu"
+		},
+		{
+			"mhead007_i_.menu",
+			"crc_mhead007_i_.menu"
+		},
+		{
+			"mhead008_i_.menu",
+			"crc_mhead008_i_.menu"
+		},
+		{
+			"mhead009_i_.menu",
+			"crc_mhead009_i_.menu"
+		},
+		{
+			"mhead010_i_.menu",
+			"crc_mhead010_i_.menu"
+		}
+	};
+
+	public static Dictionary<MPN, KeyValuePair<int, int>> newManParaPairs = new Dictionary<MPN, KeyValuePair<int, int>>
+	{
+		{
+			MPN.Hara,
+			new KeyValuePair<int, int>(0, 100)
+		},
+		{
+			MPN.DouThick1X,
+			new KeyValuePair<int, int>(45, 100)
+		},
+		{
+			MPN.DouThick1Y,
+			new KeyValuePair<int, int>(10, 100)
+		},
+		{
+			MPN.DouThick2X,
+			new KeyValuePair<int, int>(45, 100)
+		},
+		{
+			MPN.DouThick2Y,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.DouThick3X,
+			new KeyValuePair<int, int>(45, 80)
+		},
+		{
+			MPN.DouThick3Y,
+			new KeyValuePair<int, int>(30, 90)
+		},
+		{
+			MPN.UpperArmThickX,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.UpperArmThickY,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.LowerArmThickX,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.LowerArmThickY,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.ElbowThickX,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.ElbowThickY,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.NeckThickX,
+			new KeyValuePair<int, int>(40, 80)
+		},
+		{
+			MPN.NeckThickY,
+			new KeyValuePair<int, int>(40, 80)
+		},
+		{
+			MPN.DouThick4X,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.DouThick4Y,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.DouThick5X,
+			new KeyValuePair<int, int>(45, 90)
+		},
+		{
+			MPN.DouThick5Y,
+			new KeyValuePair<int, int>(45, 100)
+		},
+		{
+			MPN.HipSize,
+			new KeyValuePair<int, int>(0, 50)
+		},
+		{
+			MPN.ThighThickX,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.ThighThickY,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.KneeThickX,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.KneeThickY,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.CalfThickX,
+			new KeyValuePair<int, int>(40, 90)
+		},
+		{
+			MPN.CalfThickY,
+			new KeyValuePair<int, int>(40, 90)
+		},
+		{
+			MPN.AnkleThickX,
+			new KeyValuePair<int, int>(50, 100)
+		},
+		{
+			MPN.AnkleThickY,
+			new KeyValuePair<int, int>(50, 100)
+		},
+		{
+			MPN.UpperArmLowerThickX,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.UpperArmLowerThickY,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.WristThickX,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.WristThickY,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.ClavicleThick,
+			new KeyValuePair<int, int>(30, 100)
+		},
+		{
+			MPN.ShoulderTension,
+			new KeyValuePair<int, int>(0, 50)
+		},
+		{
+			MPN.ThighLowerThickX,
+			new KeyValuePair<int, int>(40, 100)
+		},
+		{
+			MPN.ThighLowerThickY,
+			new KeyValuePair<int, int>(40, 100)
+		}
+	};
+
+	public static Dictionary<TBody.MaskMode, HashSet<TBody.SlotID>> newBodyPartsMask = new Dictionary<TBody.MaskMode, HashSet<TBody.SlotID>>
+	{
+		{
+			TBody.MaskMode.None,
+			new HashSet<TBody.SlotID>()
+		},
+		{
+			TBody.MaskMode.Nude,
+			new HashSet<TBody.SlotID>
+			{
+				TBody.SlotID.wear,
+				TBody.SlotID.skirt,
+				TBody.SlotID.onepiece,
+				TBody.SlotID.mizugi_top,
+				TBody.SlotID.mizugi_buttom,
+				TBody.SlotID.mizugi,
+				TBody.SlotID.stkg,
+				TBody.SlotID.glove,
+				TBody.SlotID.shoes,
+				TBody.SlotID.accKubi,
+				TBody.SlotID.accKoshi,
+				TBody.SlotID.accUde,
+				TBody.SlotID.accUde_2,
+				TBody.SlotID.accHeso,
+				TBody.SlotID.accAshi,
+				TBody.SlotID.accAshi_2,
+				TBody.SlotID.accSenaka,
+				TBody.SlotID.bra,
+				TBody.SlotID.panz,
+				TBody.SlotID.slip,
+				TBody.SlotID.stkg
+			}
+		},
+		{
+			TBody.MaskMode.Underwear,
+			new HashSet<TBody.SlotID>
+			{
+				TBody.SlotID.wear,
+				TBody.SlotID.skirt,
+				TBody.SlotID.onepiece,
+				TBody.SlotID.mizugi_top,
+				TBody.SlotID.mizugi_buttom,
+				TBody.SlotID.mizugi,
+				TBody.SlotID.stkg,
+				TBody.SlotID.glove,
+				TBody.SlotID.shoes
+			}
+		},
+		{
+			TBody.MaskMode.Swim,
+			new HashSet<TBody.SlotID>
+			{
+				TBody.SlotID.wear,
+				TBody.SlotID.skirt,
+				TBody.SlotID.onepiece,
+				TBody.SlotID.stkg,
+				TBody.SlotID.glove,
+				TBody.SlotID.shoes,
+				TBody.SlotID.bra,
+				TBody.SlotID.panz,
+				TBody.SlotID.slip,
+				TBody.SlotID.stkg
+			}
+		}
+	};
 }

+ 205 - 0
Assembly-CSharp/CMMImporter.cs

@@ -0,0 +1,205 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+
+public class CMMImporter
+{
+	public static bool ImportOnlyBone(string fileName, GameObject parent)
+	{
+		CMMImporter.CMModel cmmodel = new CMMImporter.CMModel();
+		cmmodel.Deserialize(fileName);
+		foreach (CMMImporter.CMModel.CMObject cmobject in cmmodel.bones)
+		{
+			Transform transform = parent.transform.Find(cmobject.path);
+			if (transform == null)
+			{
+				Debug.Log("skip !! " + cmobject.path);
+			}
+			else
+			{
+				transform.localPosition = cmobject.localPos;
+				transform.localRotation = cmobject.localRot;
+				transform.localScale = cmobject.localScale;
+			}
+		}
+		return true;
+	}
+
+	public static bool ImportModel(string fileName, GameObject parent, TMorph tgtMorph)
+	{
+		CMMImporter.CMModel cmmodel = new CMMImporter.CMModel();
+		cmmodel.Deserialize(fileName);
+		foreach (CMMImporter.CMModel.CMObject cmobject in cmmodel.bones)
+		{
+			Transform transform = parent.transform.Find(cmobject.path);
+			if (transform == null)
+			{
+				Debug.Log("skip !! " + cmobject.path);
+			}
+			else
+			{
+				transform.localPosition = cmobject.localPos;
+				transform.localRotation = cmobject.localRot;
+				transform.localScale = cmobject.localScale;
+			}
+		}
+		foreach (CMMImporter.CMModel.CMMorph cmmorph in cmmodel.morphs)
+		{
+			if (!tgtMorph.hash.Contains(cmmorph.name))
+			{
+				Debug.LogError("target morph name is not found. " + cmmorph.name);
+			}
+			else
+			{
+				tgtMorph.SetBlendValues(cmmorph.idx, cmmorph.value);
+			}
+		}
+		tgtMorph.FixBlendValues();
+		return true;
+	}
+
+	private class CMModel
+	{
+		public bool Serialize(string fileName)
+		{
+			FileStream fileStream = new FileStream(fileName, FileMode.CreateNew);
+			BinaryWriter binaryWriter = new BinaryWriter(fileStream);
+			binaryWriter.Write("CMMODEL");
+			binaryWriter.Write(100);
+			binaryWriter.Write(this.bones.Count);
+			for (int i = 0; i < this.bones.Count; i++)
+			{
+				this.bones[i].Serialize(binaryWriter);
+			}
+			binaryWriter.Write(this.morphs.Count);
+			for (int j = 0; j < this.morphs.Count; j++)
+			{
+				this.morphs[j].Serialize(binaryWriter);
+			}
+			fileStream.Close();
+			binaryWriter.Close();
+			return true;
+		}
+
+		public bool Deserialize(string fileName)
+		{
+			this.bones.Clear();
+			this.morphs.Clear();
+			FileStream fileStream = new FileStream(fileName, FileMode.Open);
+			BinaryReader binaryReader = new BinaryReader(fileStream);
+			string text = binaryReader.ReadString();
+			int num = binaryReader.ReadInt32();
+			int num2 = binaryReader.ReadInt32();
+			for (int i = 0; i < num2; i++)
+			{
+				this.bones.Add(new CMMImporter.CMModel.CMObject(binaryReader));
+			}
+			int num3 = binaryReader.ReadInt32();
+			for (int j = 0; j < num3; j++)
+			{
+				this.morphs.Add(new CMMImporter.CMModel.CMMorph(binaryReader));
+			}
+			fileStream.Close();
+			binaryReader.Close();
+			return true;
+		}
+
+		private const int CMMODEL_VER = 100;
+
+		public List<CMMImporter.CMModel.CMObject> bones = new List<CMMImporter.CMModel.CMObject>();
+
+		public List<CMMImporter.CMModel.CMMorph> morphs = new List<CMMImporter.CMModel.CMMorph>();
+
+		public class CMObject
+		{
+			public CMObject(Transform tr, string parentPath)
+			{
+				this.name = tr.name;
+				this.parentName = ((!(tr.parent != null)) ? null : tr.parent.name);
+				this.path = this.name + parentPath;
+				this.localPos = tr.localPosition;
+				this.localRot = tr.localRotation;
+				this.localScale = tr.localScale;
+			}
+
+			public CMObject(BinaryReader br)
+			{
+				this.name = br.ReadString();
+				this.parentName = br.ReadString();
+				this.path = br.ReadString();
+				this.localPos.x = br.ReadSingle();
+				this.localPos.y = br.ReadSingle();
+				this.localPos.z = br.ReadSingle();
+				this.localRot.x = br.ReadSingle();
+				this.localRot.y = br.ReadSingle();
+				this.localRot.z = br.ReadSingle();
+				this.localRot.w = br.ReadSingle();
+				this.localScale.x = br.ReadSingle();
+				this.localScale.y = br.ReadSingle();
+				this.localScale.z = br.ReadSingle();
+			}
+
+			public bool Serialize(BinaryWriter bw)
+			{
+				bw.Write(this.name);
+				bw.Write((this.parentName != null) ? this.parentName : string.Empty);
+				bw.Write(this.path);
+				bw.Write(this.localPos.x);
+				bw.Write(this.localPos.y);
+				bw.Write(this.localPos.z);
+				bw.Write(this.localRot.x);
+				bw.Write(this.localRot.y);
+				bw.Write(this.localRot.z);
+				bw.Write(this.localRot.w);
+				bw.Write(this.localScale.x);
+				bw.Write(this.localScale.y);
+				bw.Write(this.localScale.z);
+				return true;
+			}
+
+			public string name;
+
+			public string parentName;
+
+			public string path;
+
+			public Vector3 localPos;
+
+			public Quaternion localRot;
+
+			public Vector3 localScale;
+		}
+
+		public class CMMorph
+		{
+			public CMMorph(string name, int idx, float value)
+			{
+				this.name = name;
+				this.idx = idx;
+				this.value = value;
+			}
+
+			public CMMorph(BinaryReader br)
+			{
+				this.name = br.ReadString();
+				this.idx = br.ReadInt32();
+				this.value = br.ReadSingle();
+			}
+
+			public bool Serialize(BinaryWriter bw)
+			{
+				bw.Write(this.name);
+				bw.Write(this.idx);
+				bw.Write(this.value);
+				return true;
+			}
+
+			public string name;
+
+			public int idx;
+
+			public float value;
+		}
+	}
+}

+ 106 - 15
Assembly-CSharp/CMSystem.cs

@@ -5,6 +5,7 @@ using System.Linq;
 using System.Windows.Forms;
 using System.Xml.Linq;
 using System.Xml.Serialization;
+using CRCEdit;
 using UnityEngine;
 
 public class CMSystem
@@ -22,7 +23,7 @@ public class CMSystem
 		this.ShadowQuality = CMSystem.ShadowQualityType.Medium;
 		this.TextureQuality = CMSystem.TextureQualityType.High;
 		this.TargetFPS = 60;
-		this.VSync = false;
+		this.VSyncMode = CMSystem.VSyncType.Off;
 		this.ViewFps = false;
 		this.Bloom = true;
 		this.BloomValue = 50;
@@ -32,7 +33,9 @@ public class CMSystem
 		this.YotogiSubtitleVisible = true;
 		this.EjaculationSeEnabled = true;
 		this.NetUse = false;
-		this.CM3D2Path = string.Empty;
+		string empty = string.Empty;
+		this.CREditSystemPath = empty;
+		this.CM3D2Path = empty;
 		this.LoadSystem();
 		this.LoadLauncherCfg();
 	}
@@ -93,8 +96,11 @@ public class CMSystem
 
 	public CMSystem.TextureQualityType TextureQuality { get; set; }
 
+	[Obsolete]
 	public bool VSync { get; set; }
 
+	public CMSystem.VSyncType VSyncMode { get; set; }
+
 	public int TargetFPS { get; set; }
 
 	public bool ViewFps { get; set; }
@@ -239,6 +245,8 @@ public class CMSystem
 
 	public string CM3D2Path { get; private set; }
 
+	public string CREditSystemPath { get; private set; }
+
 	public int DesktopCaptureMonitorNo
 	{
 		get
@@ -807,16 +815,17 @@ public class CMSystem
 		}
 		if (!GameMain.Instance.VRMode || GameMain.Instance.VRDummyMode)
 		{
-			if (this.VSync)
+			if (this.VSyncMode == CMSystem.VSyncType.Off)
 			{
-				if (QualitySettings.vSyncCount != 60)
-				{
-					QualitySettings.vSyncCount = 60;
-				}
+				QualitySettings.vSyncCount = 0;
 			}
-			else if (QualitySettings.vSyncCount != 0)
+			else if (this.VSyncMode == CMSystem.VSyncType.On)
 			{
-				QualitySettings.vSyncCount = 0;
+				QualitySettings.vSyncCount = 1;
+			}
+			else if (this.VSyncMode == CMSystem.VSyncType.Half)
+			{
+				QualitySettings.vSyncCount = 2;
 			}
 			if (UnityEngine.Application.targetFrameRate != this.TargetFPS)
 			{
@@ -855,7 +864,7 @@ public class CMSystem
 	{
 		XElement xelement = new XElement("Config", new object[]
 		{
-			new XAttribute("Version", 1550),
+			new XAttribute("Version", 1570),
 			new XElement("System", new XElement("SysButtonShowAlways", this.SysButtonShowAlways)),
 			new XElement("Screen", new object[]
 			{
@@ -865,7 +874,7 @@ public class CMSystem
 				new XElement("Antialias", this.Antialias),
 				new XElement("ShadowQuality", this.ShadowQuality),
 				new XElement("TextureQuality", this.TextureQuality),
-				new XElement("VSync", this.VSync),
+				new XElement("VSyncMode", this.VSyncMode),
 				new XElement("TargetFPS", this.TargetFPS),
 				new XElement("ViewFps", this.ViewFps),
 				new XElement("Bloom", this.Bloom),
@@ -999,7 +1008,7 @@ public class CMSystem
 				this.Antialias = (CMSystem.AntiAliasType)Enum.Parse(typeof(CMSystem.AntiAliasType), this.getElemetn(xelm2, "Antialias", CMSystem.AntiAliasType.X2.ToString()).Value);
 				this.ShadowQuality = (CMSystem.ShadowQualityType)Enum.Parse(typeof(CMSystem.ShadowQualityType), this.getElemetn(xelm2, "ShadowQuality", CMSystem.ShadowQualityType.Medium.ToString()).Value);
 				this.TextureQuality = (CMSystem.TextureQualityType)Enum.Parse(typeof(CMSystem.TextureQualityType), this.getElemetn(xelm2, "TextureQuality", CMSystem.TextureQualityType.High.ToString()).Value);
-				this.VSync = bool.Parse(this.getElemetn(xelm2, "VSync", "false").Value);
+				this.VSyncMode = (CMSystem.VSyncType)Enum.Parse(typeof(CMSystem.VSyncType), this.getElemetn(xelm2, "VSyncMode", CMSystem.VSyncType.Off.ToString()).Value);
 				this.TargetFPS = int.Parse(this.getElemetn(xelm2, "TargetFPS", "60").Value);
 				this.ViewFps = bool.Parse(this.getElemetn(xelm2, "ViewFps", "false").Value);
 				this.Bloom = bool.Parse(this.getElemetn(xelm2, "Bloom", "true").Value);
@@ -1204,7 +1213,7 @@ public class CMSystem
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("CM3D2_SYSTEM2");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		binaryWriter.Write(this.m_dicEditColorPresetData.Count);
 		foreach (KeyValuePair<int, Dictionary<string, int>> keyValuePair in this.m_dicEditColorPresetData)
 		{
@@ -1329,12 +1338,87 @@ public class CMSystem
 							}
 							this.CM3D2Path = text2;
 						}
+						else if (string.Equals(a, "m_strCREditSystemPath", StringComparison.OrdinalIgnoreCase))
+						{
+							text2 = text2.Replace("/", "\\");
+							if (!string.IsNullOrEmpty(text2))
+							{
+								string path2 = Path.Combine(text2, "CR Launcher.exe");
+								if (!File.Exists(path2))
+								{
+									NUty.WinMessageBox(NUty.GetWindowHandle(), "CR Edit System連携エラー\n" + text2 + " には CR Launcher.exeが存在しません", "警告", 48);
+									text2 = string.Empty;
+								}
+								this.CREditSystemPath = text2;
+							}
+						}
+					}
+					if (string.IsNullOrEmpty(this.CREditSystemPath))
+					{
+						string text3 = Path.Combine(UTY.gameProjectPath, "KISS_Edit").Replace("/", "\\");
+						if (File.Exists(Path.Combine(text3, "CR Launcher.exe")))
+						{
+							this.CREditSystemPath = text3;
+						}
 					}
 				}
 			}
 		}
 	}
 
+	public ConfigBridgeData ToConfigBridgeData()
+	{
+		return new ConfigBridgeData
+		{
+			system = 
+			{
+				windowSizeX = this.m_siScreenSize.width,
+				windowSizeY = this.m_siScreenSize.height,
+				isFullScreenMode = this.FullScreen,
+				targetFrameRate = this.TargetFPS,
+				screenShotSuperSize = (int)this.m_eScreenShotSuperSize,
+				antiAlias = (int)this.Antialias,
+				shadowQuality = (int)this.ShadowQuality,
+				textureQualit = (int)this.TextureQuality,
+				videoPlayerPreferredFilter = this.m_SConfig.DShowFilter,
+				inputUseLegacyAxisMode = this.m_SConfig.InputUseLegacyAxisMode
+			},
+			sound = 
+			{
+				master = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolumeAll() / 100f
+				},
+				system = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.System) / 100f
+				},
+				bgm = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Bgm) / 100f
+				},
+				dance = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolumeDance() / 100f
+				},
+				se = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Se) / 100f
+				},
+				voice = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.Voice) / 100f,
+					isPlay3DPositioning = GameMain.Instance.SoundMgr.GetThreeD(AudioSourceMgr.Type.VoiceHeroine)
+				},
+				voiceHeroine = 
+				{
+					voluem = (float)GameMain.Instance.SoundMgr.GetVolume(AudioSourceMgr.Type.VoiceHeroine) / 100f
+				},
+				isEjaculationSeEnabled = this.EjaculationSeEnabled
+			}
+		};
+	}
+
 	private Dictionary<int, Dictionary<string, int>> m_dicEditColorPresetData = new Dictionary<int, Dictionary<string, int>>();
 
 	[XmlIgnore]
@@ -1496,6 +1580,13 @@ public class CMSystem
 		High
 	}
 
+	public enum VSyncType
+	{
+		Off,
+		On,
+		Half
+	}
+
 	public class TransDD
 	{
 		public TransDD()
@@ -1910,7 +2001,7 @@ public class CMSystem
 
 		public void OnBeforeSerialize()
 		{
-			this.m_nVersion = 1550;
+			this.m_nVersion = 1570;
 		}
 
 		public void OnAfterDeserialize()
@@ -1918,7 +2009,7 @@ public class CMSystem
 		}
 
 		[SerializeField]
-		private int m_nVersion = 1550;
+		private int m_nVersion = 1570;
 
 		[SerializeField]
 		private string m_strDShowFilter = "Microsoft DTV-DVD Video Decoder";

+ 21 - 2
Assembly-CSharp/CMT.cs

@@ -31,6 +31,20 @@ public class CMT
 		return null;
 	}
 
+	public static void SearchAndAddTrans(Transform t, Dictionary<string, Transform> dic)
+	{
+		string name = t.name;
+		if (name.Contains("_SM_"))
+		{
+			return;
+		}
+		dic[name] = t;
+		for (int i = 0; i < t.childCount; i++)
+		{
+			CMT.SearchAndAddTrans(t.GetChild(i), dic);
+		}
+	}
+
 	public static void SearchAndAddObj(Transform t, Dictionary<string, Transform> dic)
 	{
 		string name = t.name;
@@ -63,7 +77,7 @@ public class CMT
 		return null;
 	}
 
-	public static void BindTrans(List<Transform> listPosRot, List<Transform> listScl, Dictionary<string, Transform> body1, Transform t)
+	public static void BindTrans(List<Transform> listPosRot, List<Transform> listScl, Dictionary<string, Transform> body1, Transform t, bool is_crc_body = false)
 	{
 		Transform item;
 		if (body1.TryGetValue(t.name, out item))
@@ -75,10 +89,15 @@ public class CMT
 				listScl.Add(t);
 				listScl.Add(item);
 			}
+			else if (is_crc_body && t.name.Contains("chinko"))
+			{
+				listScl.Add(t);
+				listScl.Add(item);
+			}
 		}
 		for (int i = 0; i < t.childCount; i++)
 		{
-			CMT.BindTrans(listPosRot, listScl, body1, t.GetChild(i));
+			CMT.BindTrans(listPosRot, listScl, body1, t.GetChild(i), is_crc_body);
 		}
 	}
 

+ 127 - 0
Assembly-CSharp/CRCEdit/ConfigBridgeData.cs

@@ -0,0 +1,127 @@
+using System;
+using wf.Serialization;
+
+namespace CRCEdit
+{
+	[Serializable]
+	public class ConfigBridgeData : AJsonSerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public ConfigBridgeData.System system = new ConfigBridgeData.System();
+
+		public ConfigBridgeData.Game game = new ConfigBridgeData.Game();
+
+		public ConfigBridgeData.Sound sound = new ConfigBridgeData.Sound();
+
+		[Serializable]
+		public class System : AJsonSerializationVersionControl
+		{
+			public override int FixVersion
+			{
+				get
+				{
+					return 1000;
+				}
+			}
+
+			public int windowSizeX;
+
+			public int windowSizeY;
+
+			public bool isFullScreenMode;
+
+			public bool isVSyncEnabled;
+
+			public int targetFrameRate;
+
+			public int screenShotSuperSize;
+
+			public int antiAlias;
+
+			public int shadowQuality;
+
+			public int textureQualit;
+
+			public string videoPlayerPreferredFilter;
+
+			public bool inputUseLegacyAxisMode;
+		}
+
+		[Serializable]
+		public class Game : AJsonSerializationVersionControl
+		{
+			public override int FixVersion
+			{
+				get
+				{
+					return 1000;
+				}
+			}
+		}
+
+		[Serializable]
+		public class Sound : AJsonSerializationVersionControl
+		{
+			public override int FixVersion
+			{
+				get
+				{
+					return 1000;
+				}
+			}
+
+			public ConfigBridgeData.Sound.SimpleActorWrapper master = new ConfigBridgeData.Sound.SimpleActorWrapper();
+
+			public ConfigBridgeData.Sound.SimpleActorWrapper system = new ConfigBridgeData.Sound.SimpleActorWrapper();
+
+			public ConfigBridgeData.Sound.SimpleActorWrapper bgm = new ConfigBridgeData.Sound.SimpleActorWrapper();
+
+			public ConfigBridgeData.Sound.SimpleActorWrapper dance = new ConfigBridgeData.Sound.SimpleActorWrapper();
+
+			public ConfigBridgeData.Sound.ActorWrapper se = new ConfigBridgeData.Sound.ActorWrapper();
+
+			public ConfigBridgeData.Sound.ActorWrapper voice = new ConfigBridgeData.Sound.ActorWrapper();
+
+			public ConfigBridgeData.Sound.SimpleActorWrapper voiceHeroine = new ConfigBridgeData.Sound.SimpleActorWrapper();
+
+			public bool isEjaculationSeEnabled;
+
+			[Serializable]
+			public class SimpleActorWrapper : AJsonSerializationVersionControl
+			{
+				public override int FixVersion
+				{
+					get
+					{
+						return 1000;
+					}
+				}
+
+				public float voluem;
+
+				public bool mute;
+			}
+
+			[Serializable]
+			public class ActorWrapper : ConfigBridgeData.Sound.SimpleActorWrapper
+			{
+				public override int FixVersion
+				{
+					get
+					{
+						return 1000;
+					}
+				}
+
+				public bool isPlay3DPositioning;
+			}
+		}
+	}
+}

+ 216 - 0
Assembly-CSharp/CRCEdit/EditBridge.cs

@@ -0,0 +1,216 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.IO;
+using UnityEngine;
+
+namespace CRCEdit
+{
+	public class EditBridge
+	{
+		public static string EditWorkDirectory
+		{
+			get
+			{
+				return Path.Combine(UTY.gameProjectPath, ".__EDITWORK__");
+			}
+		}
+
+		public static string CREditSystemExePath
+		{
+			get
+			{
+				string text = Path.Combine(GameMain.Instance.CMSystem.CREditSystemPath, "CR EditSystem.exe");
+				return (!File.Exists(text)) ? string.Empty : text;
+			}
+		}
+
+		public static string CREditSystemLauncherExePath
+		{
+			get
+			{
+				string text = Path.Combine(GameMain.Instance.CMSystem.CREditSystemPath, "CR Launcher.exe");
+				return (!File.Exists(text)) ? string.Empty : text;
+			}
+		}
+
+		public static bool Import(Maid maid)
+		{
+			Action action = delegate()
+			{
+				if (Directory.Exists(EditBridge.EditWorkDirectory))
+				{
+					Directory.Delete(EditBridge.EditWorkDirectory, true);
+				}
+			};
+			if (maid != null && maid.ActiveSlotNo != 0)
+			{
+				GameMain.Instance.CharacterMgr.SetActiveMaid(maid, 0);
+			}
+			if (maid == null || !File.Exists(Path.Combine(EditBridge.EditWorkDirectory, "__finishfile__")))
+			{
+				action();
+				return false;
+			}
+			bool result = !GameMain.Instance.CharacterMgr.ImportBreadgeGP03(EditBridge.EditWorkDirectory, 0);
+			action();
+			return result;
+		}
+
+		public static bool StartEdit(Maid maid, Action onNewEditFinished)
+		{
+			return EditBridge.launcherProcess == null && EditBridge.editProcess == null && EditBridge.Initialize(maid, onNewEditFinished);
+		}
+
+		private static bool Initialize(Maid maid, Action onNewEditFinished)
+		{
+			if (DllBase.Win32.hWnd == IntPtr.Zero || maid == null || maid.body0 == null || GameMain.Instance.CharacterMgr.IsBusy())
+			{
+				return false;
+			}
+			try
+			{
+				string workDirectory = EditBridge.EditWorkDirectory;
+				if (Directory.Exists(workDirectory))
+				{
+					Directory.Delete(workDirectory, true);
+				}
+				Directory.CreateDirectory(workDirectory);
+				DllBase.Win32.ShowWindow(DllBase.Win32.hWnd, 6);
+				EditBridge.CallLauncher(delegate
+				{
+					EditBridge.CallEdit(workDirectory, maid, onNewEditFinished);
+				});
+			}
+			catch (Exception ex)
+			{
+				UnityEngine.Debug.LogError(ex.Message);
+				EditBridge.editProcess = null;
+				DllBase.Win32.ShowWindow(DllBase.Win32.hWnd, 1);
+				return false;
+			}
+			return true;
+		}
+
+		private static bool CallLauncher(Action onFinished)
+		{
+			string[] array = new string[]
+			{
+				"-batchmode",
+				"-clientid:com3d2",
+				"-clientpath:" + UTY.gameProjectPath,
+				"/dlcup"
+			};
+			string text = string.Empty;
+			foreach (string str in array)
+			{
+				text = text + str + " ";
+			}
+			EditBridge.launcherProcess = new Process
+			{
+				StartInfo = 
+				{
+					FileName = EditBridge.CREditSystemLauncherExePath,
+					Arguments = text,
+					WorkingDirectory = GameMain.Instance.CMSystem.CREditSystemPath
+				}
+			};
+			if (!File.Exists(EditBridge.launcherProcess.StartInfo.FileName))
+			{
+				UnityEngine.Debug.LogError("Launcher not existed. -> " + EditBridge.CREditSystemLauncherExePath);
+				return false;
+			}
+			EditBridge.onLauncherFinished = onFinished;
+			EditBridge.launcherProcess.Start();
+			GameMain.Instance.StartCoroutine(EditBridge.WaitLauncher());
+			return true;
+		}
+
+		private static IEnumerator WaitLauncher()
+		{
+			while (EditBridge.launcherProcess == null || !EditBridge.launcherProcess.HasExited)
+			{
+				yield return null;
+			}
+			EditBridge.launcherProcess = null;
+			if (EditBridge.onLauncherFinished != null)
+			{
+				EditBridge.onLauncherFinished();
+				EditBridge.onLauncherFinished = null;
+			}
+			yield break;
+		}
+
+		private static bool CallEdit(string workDirectory, Maid maid, Action onNewEditFinished)
+		{
+			GameMain.Instance.CharacterMgr.ExportBridgeGP03(workDirectory, maid);
+			string[] array = new string[]
+			{
+				"-workpath:" + workDirectory,
+				"-maidguid:" + maid.status.guid,
+				"-savemaidguid:" + maid.status.saveDataGuidGP03Temp,
+				"-clientid:com3d2",
+				"-clientpath:" + UTY.gameProjectPath,
+				"-usenetwork:" + GameMain.Instance.CMSystem.NetUse.ToString()
+			};
+			string text = string.Empty;
+			foreach (string str in array)
+			{
+				text = text + str + " ";
+			}
+			EditBridge.editProcess = new Process
+			{
+				StartInfo = 
+				{
+					FileName = EditBridge.CREditSystemExePath,
+					Arguments = text,
+					WorkingDirectory = GameMain.Instance.CMSystem.CREditSystemPath
+				}
+			};
+			if (!File.Exists(EditBridge.editProcess.StartInfo.FileName))
+			{
+				return false;
+			}
+			if (GameMain.Instance.Webs != null)
+			{
+				GameMain.Instance.Webs.Uninit();
+			}
+			EditBridge.editProcess.Start();
+			EditBridge.onNewEditFinished = onNewEditFinished;
+			GameMain.Instance.StartCoroutine(EditBridge.WaitEdit());
+			return true;
+		}
+
+		private static IEnumerator WaitEdit()
+		{
+			while (EditBridge.editProcess == null || !EditBridge.editProcess.HasExited)
+			{
+				yield return null;
+			}
+			if (GameMain.Instance.Webs != null)
+			{
+				GameMain.Instance.Webs.Init();
+			}
+			EditBridge.editProcess = null;
+			DllBase.Win32.ShowWindow(DllBase.Win32.hWnd, 1);
+			if (EditBridge.onNewEditFinished != null)
+			{
+				EditBridge.onNewEditFinished();
+				EditBridge.onNewEditFinished = null;
+			}
+			yield break;
+		}
+
+		public const string CrEditSystemLauncherExeName = "CR Launcher.exe";
+
+		public const string CrEditSystemExeName = "CR EditSystem.exe";
+
+		protected static Process editProcess;
+
+		protected static Process launcherProcess;
+
+		protected static Action onLauncherFinished;
+
+		protected static Action onNewEditFinished;
+	}
+}

+ 10 - 6
Assembly-CSharp/CacheBoneDataArray.cs

@@ -238,9 +238,13 @@ public class CacheBoneDataArray : MonoBehaviour
 		while (binaryReader.ReadByte() != 0)
 		{
 			string key = binaryReader.ReadString();
-			CacheBoneDataArray.BoneData boneData = this.path_dic_[key];
+			CacheBoneDataArray.BoneData boneData = null;
+			if (this.path_dic_.ContainsKey(key))
+			{
+				boneData = this.path_dic_[key];
+			}
 			float[] array = new float[4];
-			if (boneData.transform == this.bip_root_trans_)
+			if (boneData != null && boneData.transform == this.bip_root_trans_)
 			{
 				array = new float[7];
 			}
@@ -248,7 +252,7 @@ public class CacheBoneDataArray : MonoBehaviour
 			{
 				array[i] = binaryReader.ReadSingle();
 			}
-			if (flag && (boneData.transform == this.bust_trans_[0] || boneData.transform == this.bust_trans_[1]))
+			if (flag && boneData != null && (boneData.transform == this.bust_trans_[0] || boneData.transform == this.bust_trans_[1]))
 			{
 				int key2 = 0;
 				if (boneData.transform == this.bust_trans_[1])
@@ -258,7 +262,7 @@ public class CacheBoneDataArray : MonoBehaviour
 				KeyValuePair<Transform, float[]> value = new KeyValuePair<Transform, float[]>(boneData.transform, array);
 				dictionary.Add(key2, value);
 			}
-			else
+			else if (boneData != null)
 			{
 				boneData.transform.localRotation = new Quaternion(array[0], array[1], array[2], array[3]);
 				if (4 < array.Length)
@@ -274,11 +278,11 @@ public class CacheBoneDataArray : MonoBehaviour
 			flag2 = (binaryReader.ReadByte() != 0);
 			flag3 = (binaryReader.ReadByte() != 0);
 			List<KeyValuePair<Transform, float[]>> list = new List<KeyValuePair<Transform, float[]>>();
-			if (flag2)
+			if (flag2 && dictionary.ContainsKey(0))
 			{
 				list.Add(dictionary[0]);
 			}
-			if (flag3)
+			if (flag3 && dictionary.ContainsKey(1))
 			{
 				list.Add(dictionary[1]);
 			}

+ 267 - 28
Assembly-CSharp/CharacterMgr.cs

@@ -166,6 +166,11 @@ public class CharacterMgr : MonoBehaviour
 		return this.m_listStockMan.Count;
 	}
 
+	public string RenewSaveDataGUID()
+	{
+		return this.SaveDataGUID = Guid.NewGuid().ToString();
+	}
+
 	public static void CreateNpcData()
 	{
 		if (CharacterMgr.npcDatas != null)
@@ -225,7 +230,9 @@ public class CharacterMgr : MonoBehaviour
 	public void Init(GameMain f_gcGameMain)
 	{
 		CM3.Init();
+		this.SaveDataGUID = Guid.NewGuid().ToString();
 		BoneMorph.Init();
+		BoneMorphDefine.Init();
 		this.m_PlayerStatus = new PlayerStatus.Status();
 		this.m_goCharacter = new GameObject("Character");
 		this.m_goCharacter.transform.parent = f_gcGameMain.transform;
@@ -268,11 +275,6 @@ public class CharacterMgr : MonoBehaviour
 		return this.AddStock(false, true);
 	}
 
-	public Maid AddStockNpcMan()
-	{
-		return this.AddStock(true, true);
-	}
-
 	public Maid AddStockMan()
 	{
 		return this.AddStock(true, false);
@@ -286,7 +288,7 @@ public class CharacterMgr : MonoBehaviour
 		Maid maid = gameObject.AddComponent<Maid>();
 		maid.boNPC = f_bNpc;
 		((!f_bMan) ? ((!f_bNpc) ? this.m_listStockMaid : this.m_listStockNpcMaid) : ((!f_bNpc) ? this.m_listStockMan : this.m_listStockNpcMan)).Add(maid);
-		maid.Initialize((!f_bMan) ? "Maid" : "Man", f_bMan);
+		maid.Initialize((!f_bMan) ? "Maid" : "Man", f_bMan, false);
 		maid.Visible = false;
 		return maid;
 	}
@@ -487,7 +489,24 @@ public class CharacterMgr : MonoBehaviour
 		}
 		maid.Visible = false;
 		maid.ActiveSlotNo = -1;
+		if (maid.pairMan != null)
+		{
+			maid.pairMan.Visible = false;
+			maid.pairMan.ActiveSlotNo = -1;
+		}
 		maid.Uninit();
+		if (maid.body0 != null)
+		{
+			maid.body0.LastAnimeFN = string.Empty;
+		}
+		if (maid.pairMan != null)
+		{
+			maid.pairMan.Uninit();
+			if (maid.pairMan.body0 != null)
+			{
+				maid.pairMan.body0.LastAnimeFN = string.Empty;
+			}
+		}
 		maid.LipSyncEnabled(true);
 		gameObject.transform.SetParent(gameObject2.transform, false);
 		gameObject.name = ((!f_bMan) ? ((!maid.boNPC) ? "StockMaid" : "StockNpcMaid") : ((!maid.boNPC) ? "StockMan" : "StockNpcMan"));
@@ -504,6 +523,10 @@ public class CharacterMgr : MonoBehaviour
 				maid.status.lastName
 			});
 		}
+		if (f_bMan && maid.IsCrcBody)
+		{
+			gameObject.name = "NewMan";
+		}
 		array[f_nActiveSlotNo] = null;
 		array2[f_nActiveSlotNo] = null;
 	}
@@ -569,6 +592,89 @@ public class CharacterMgr : MonoBehaviour
 		return maid;
 	}
 
+	public void SwapNewManBody(int activeSlot, bool toNewBody)
+	{
+		Maid man = this.GetMan(activeSlot);
+		NDebug.Assert(man.boMAN, "can't swap maid body.");
+		if ((toNewBody && !man.IsCrcBody) || (!toNewBody && man.IsCrcBody))
+		{
+			Maid maid = this.m_gcActiveMan[activeSlot];
+			Maid pairMan = this.m_gcActiveMan[activeSlot].pairMan;
+			this.m_gcActiveMan[activeSlot] = pairMan;
+			this.m_objActiveMan[activeSlot] = pairMan.gameObject;
+			pairMan.ActiveSlotNo = activeSlot;
+			pairMan.gameObject.transform.SetParent(this.m_goAllOffset.transform, false);
+			pairMan.transform.localPosition = maid.transform.localPosition;
+			pairMan.transform.localRotation = maid.transform.localRotation;
+			pairMan.transform.localScale = maid.transform.localScale;
+			pairMan.baseOffset = maid.baseOffset;
+			pairMan.baseEulerAngles = maid.baseEulerAngles;
+			pairMan.motionOffset = maid.motionOffset;
+			pairMan.motionOffsetGP03 = maid.motionOffsetGP03;
+			pairMan.name = ((!pairMan.IsCrcBody) ? ("Man[" + activeSlot + "]") : ("NewMan[" + activeSlot + "]"));
+			pairMan.Visible = maid.Visible;
+			maid.gameObject.transform.SetParent(this.m_goStockMan.transform, false);
+			maid.name = ((!maid.IsCrcBody) ? "Man" : "NewStockMan");
+			maid.Visible = false;
+			if (pairMan.IsCrcBody)
+			{
+				string strFileName = maid.GetProp(MPN.head).strFileName;
+				string strFileName2 = pairMan.GetProp(MPN.head).strFileName;
+				if (!string.Equals(strFileName.Replace("crc_", string.Empty), strFileName2.Replace("crc_", string.Empty)))
+				{
+					Debug.LogWarning("男新旧Bodyでパーツが異なるので修正しました。-> " + strFileName + " : " + strFileName2);
+					pairMan.SetProp(MPN.head, strFileName, 0, false, false);
+					pairMan.AllProcProp();
+				}
+				if (pairMan.ManColor != maid.ManColor)
+				{
+					pairMan.ManColor = maid.ManColor;
+					pairMan.body0.ManColorUpdate();
+				}
+			}
+		}
+	}
+
+	public void SwapNewMaidBody(int activeSlot, bool toNewBody)
+	{
+		this.SwapNewMaidBody(this.GetMaid(activeSlot), toNewBody);
+	}
+
+	public void SwapNewMaidBody(Maid maid, bool toNewBody)
+	{
+		maid.SwapNewMaidProp(toNewBody);
+	}
+
+	public void ExportBridgeGP03(string tempPath, int activeSlot)
+	{
+		this.ExportBridgeGP03(tempPath, this.GetMaid(activeSlot));
+	}
+
+	public void ExportBridgeGP03(string tempPath, Maid maid)
+	{
+		maid.ExportBridgeGP03(tempPath);
+	}
+
+	public bool ImportBreadgeGP03(string tempPath, int activeSlot)
+	{
+		return this.ImportBreadgeGP03(tempPath, this.GetMaid(activeSlot));
+	}
+
+	public bool ImportBreadgeGP03(string tempPath, Maid maid)
+	{
+		bool result;
+		try
+		{
+			result = maid.ImportBreadgeGP03(tempPath);
+		}
+		catch (Exception ex)
+		{
+			Debug.LogError("ImportBreadgeGP03 Unexpected error : " + ex.Message);
+			result = false;
+		}
+		return result;
+	}
+
 	public void ManAlphaUpdate()
 	{
 		for (int i = 0; i < this.m_listStockMan.Count; i++)
@@ -592,6 +698,23 @@ public class CharacterMgr : MonoBehaviour
 				this.SetActiveMan(maid2, j);
 				maid2.Visible = false;
 			}
+			if (GameUty.IsExistFile("crc_mbluebody001_i_.menu", null))
+			{
+				for (int k = 0; k < 6; k++)
+				{
+					GameObject gameObject = new GameObject();
+					gameObject.name = "NewMan";
+					gameObject.transform.SetParent(this.m_goStockMan.transform, false);
+					Maid maid3 = gameObject.AddComponent<Maid>();
+					maid3.boNPC = false;
+					maid3.Initialize("Man", true, true);
+					maid3.Visible = false;
+					maid3.Visible = false;
+					(maid3.pairMan = this.GetMan(k)).pairMan = maid3;
+					maid3.ActiveSlotNo = this.GetMan(k).ActiveSlotNo;
+					maid3.SetProp(MPN.Hara, this.GetMan(k).GetProp(MPN.Hara).value, false);
+				}
+			}
 		}
 	}
 
@@ -681,6 +804,19 @@ public class CharacterMgr : MonoBehaviour
 			{
 				maid3.body0.SetBoneHitHeightY(0f);
 			}
+			if (maid3.pairMan && maid3.pairMan.IsCrcBody)
+			{
+				Maid pairMan = maid3.pairMan;
+				pairMan.SetPos(Vector3.zero);
+				pairMan.SetRot(Vector3.zero);
+				pairMan.baseOffset = (pairMan.baseEulerAngles = Vector3.zero);
+				pairMan.rotateLinkMaid = string.Empty;
+				pairMan.SetPosOffset(Vector3.zero);
+				if (pairMan.body0 != null)
+				{
+					pairMan.body0.SetBoneHitHeightY(0f);
+				}
+			}
 		}
 		for (int l = 0; l < this.m_listStockNpcMan.Count; l++)
 		{
@@ -694,6 +830,19 @@ public class CharacterMgr : MonoBehaviour
 			{
 				maid4.body0.SetBoneHitHeightY(0f);
 			}
+			if (maid4.pairMan && maid4.pairMan.IsCrcBody)
+			{
+				Maid pairMan2 = maid4.pairMan;
+				pairMan2.SetPos(Vector3.zero);
+				pairMan2.SetRot(Vector3.zero);
+				pairMan2.baseOffset = (pairMan2.baseEulerAngles = Vector3.zero);
+				pairMan2.rotateLinkMaid = string.Empty;
+				pairMan2.SetPosOffset(Vector3.zero);
+				if (pairMan2.body0 != null)
+				{
+					pairMan2.body0.SetBoneHitHeightY(0f);
+				}
+			}
 		}
 	}
 
@@ -1000,7 +1149,7 @@ public class CharacterMgr : MonoBehaviour
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		string result = string.Empty;
 		binaryWriter.Write("CM3D2_PRESET_S");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		binaryWriter.Write((char)presset_type);
 		maid.SerializePropLowCapacity(binaryWriter);
 		maid.SerializeMultiColor(binaryWriter);
@@ -1017,7 +1166,7 @@ public class CharacterMgr : MonoBehaviour
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("CM3D2_PRESET");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		binaryWriter.Write((int)f_type);
 		if (texture2D != null)
 		{
@@ -1062,7 +1211,7 @@ public class CharacterMgr : MonoBehaviour
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("CM3D2_PRESET");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		binaryWriter.Write((int)f_type);
 		if (texture2D != null)
 		{
@@ -1181,11 +1330,11 @@ public class CharacterMgr : MonoBehaviour
 			preset.texThum = null;
 		}
 		preset.listMprop = Maid.DeserializePropPre(brRead);
-		if (num >= 2)
+		if (num >= 2 && num < 2000)
 		{
 			preset.aryPartsColor = Maid.DeserializeMultiColorPre(brRead);
 		}
-		if (num >= 200)
+		if (num >= 200 && num < 2000)
 		{
 			Maid.DeserializeBodyPre(brRead);
 		}
@@ -1238,25 +1387,25 @@ public class CharacterMgr : MonoBehaviour
 		return GameUty.IsExistFile(f_strFileName, null);
 	}
 
-	public void PresetSet(Maid f_maid, CharacterMgr.Preset f_prest)
+	public void PresetSet(Maid f_maid, CharacterMgr.Preset f_prest, bool forceBody = false)
 	{
 		MaidProp[] array;
 		if (f_prest.ePreType == CharacterMgr.PresetType.Body)
 		{
 			array = (from mp in f_prest.listMprop
-			where (1 <= mp.idx && mp.idx <= 80) || (115 <= mp.idx && mp.idx <= 122)
+			where (1 <= mp.idx && mp.idx <= 166) || (207 <= mp.idx && mp.idx <= 214)
 			select mp).ToArray<MaidProp>();
 		}
 		else if (f_prest.ePreType == CharacterMgr.PresetType.Wear)
 		{
 			array = (from mp in f_prest.listMprop
-			where 81 <= mp.idx && mp.idx <= 110
+			where 167 <= mp.idx && mp.idx <= 201
 			select mp).ToArray<MaidProp>();
 		}
 		else
 		{
 			array = (from mp in f_prest.listMprop
-			where (1 <= mp.idx && mp.idx <= 110) || (115 <= mp.idx && mp.idx <= 122)
+			where (1 <= mp.idx && mp.idx <= 201) || (207 <= mp.idx && mp.idx <= 214)
 			select mp).ToArray<MaidProp>();
 		}
 		NDebug.Assert(array != null, "プリセットを実行する配列が空です。");
@@ -1278,7 +1427,7 @@ public class CharacterMgr : MonoBehaviour
 				}
 				if (this.IsEnableMenu(maidProp.strFileName))
 				{
-					f_maid.SetProp(maidProp);
+					f_maid.SetProp(maidProp, forceBody);
 				}
 				else
 				{
@@ -1321,10 +1470,35 @@ public class CharacterMgr : MonoBehaviour
 		f_maid.AllProcPropSeqStart();
 	}
 
+	public void CrcPresetCopy(Maid maid, CharacterMgr.Preset srcPreset)
+	{
+		maid.CreateProps();
+		for (int i = 207; i <= 214; i++)
+		{
+			maid.SetProp((MPN)i, string.Empty, 0, false, false);
+		}
+		foreach (MaidProp maidProp in srcPreset.listMprop)
+		{
+			MaidProp prop = maid.GetProp((MPN)maidProp.idx);
+			int type = prop.type;
+			maidProp.CopyTo(prop);
+			prop.type = type;
+		}
+		if (srcPreset.aryPartsColor != null)
+		{
+			for (int j = 0; j < srcPreset.aryPartsColor.Length; j++)
+			{
+				maid.Parts.SetPartsColor((MaidParts.PARTS_COLOR)j, srcPreset.aryPartsColor[j]);
+			}
+		}
+		maid.AllProcPropSeqStart();
+	}
+
 	public bool Serialize(BinaryWriter bwWrite)
 	{
 		bwWrite.Write("CM3D2_CHR_MGR");
-		bwWrite.Write(1550);
+		bwWrite.Write(2002);
+		bwWrite.Write("dummy");
 		this.m_PlayerStatus.Serialize(bwWrite);
 		bwWrite.Write(this.m_listStockMan.Count);
 		for (int i = 0; i < this.m_listStockMan.Count; i++)
@@ -1332,6 +1506,12 @@ public class CharacterMgr : MonoBehaviour
 			Maid maid = this.m_listStockMan[i];
 			maid.SerializeProp(bwWrite);
 			maid.SerializeMisc(bwWrite);
+			bwWrite.Write(maid.pairMan != null);
+			if (maid.pairMan != null)
+			{
+				maid.pairMan.SerializeProp(bwWrite);
+				maid.pairMan.SerializeMisc(bwWrite);
+			}
 		}
 		bwWrite.Write(this.m_listStockMaid.Count);
 		for (int j = 0; j < this.m_listStockMaid.Count; j++)
@@ -1342,6 +1522,7 @@ public class CharacterMgr : MonoBehaviour
 			maid2.status.Serialize(bwWrite);
 			maid2.SerializeMisc(bwWrite);
 			maid2.SerializeBody(bwWrite);
+			ImportCM.AddSaveDataReferenceToMaidGP03(this.SaveDataGUID, maid2.status.saveDataGuidGP03);
 		}
 		return true;
 	}
@@ -1372,6 +1553,10 @@ public class CharacterMgr : MonoBehaviour
 		string a = brRead.ReadString();
 		NDebug.Assert(a == "CM3D2_CHR_MGR", "セーブデータファイルのヘッダーが不正です。CHR_MGR");
 		int num = brRead.ReadInt32();
+		if (2002 <= num)
+		{
+			string text = brRead.ReadString();
+		}
 		this.m_PlayerStatus.Deserialize(brRead);
 		int num2 = brRead.ReadInt32();
 		int num3 = 0;
@@ -1380,6 +1565,25 @@ public class CharacterMgr : MonoBehaviour
 			Maid maid2 = this.m_listStockMan[k];
 			maid2.DeserializeProp(brRead);
 			maid2.DeserializeMisc(brRead);
+			if (2001 <= num && brRead.ReadBoolean())
+			{
+				if (maid2.pairMan == null)
+				{
+					GameObject gameObject = new GameObject("ManDummy");
+					gameObject.SetActive(false);
+					Maid maid3 = gameObject.AddComponent<Maid>();
+					maid3.Initialize("Man", true, true);
+					maid3.DeserializeProp(brRead);
+					maid3.DeserializeMisc(brRead);
+					maid3.Uninit();
+					UnityEngine.Object.Destroy(gameObject);
+				}
+				else
+				{
+					maid2.pairMan.DeserializeProp(brRead);
+					maid2.pairMan.DeserializeMisc(brRead);
+				}
+			}
 			if (maid2.ActiveSlotNo != -1)
 			{
 				this.SetActiveMan(maid2, maid2.ActiveSlotNo);
@@ -1392,22 +1596,53 @@ public class CharacterMgr : MonoBehaviour
 			this.SetActiveMan(this.GetStockMan(l), l);
 		}
 		int num5 = brRead.ReadInt32();
+		string text2 = string.Empty;
 		for (int m = 0; m < num5; m++)
 		{
-			Maid maid3 = this.AddStockMaid();
-			maid3.DeserializeProp(brRead);
-			maid3.DeserializeMultiColor(brRead);
-			maid3.status.Deserialize(brRead);
-			maid3.DeserializeMisc(brRead);
+			Maid maid4 = this.AddStockMaid();
+			maid4.DeserializeProp(brRead);
+			maid4.DeserializeMultiColor(brRead);
+			maid4.status.Deserialize(brRead);
+			maid4.DeserializeMisc(brRead);
 			if (num >= 200)
 			{
-				maid3.DeserializeBody(brRead);
+				maid4.DeserializeBody(brRead);
 			}
-			if (maid3.ActiveSlotNo != -1)
+			if (maid4.ActiveSlotNo != -1)
 			{
-				this.SetActiveMaid(maid3, maid3.ActiveSlotNo);
+				this.SetActiveMaid(maid4, maid4.ActiveSlotNo);
+			}
+			if (maid4.HasCrcBody)
+			{
+				if (maid4.IsCrcBody)
+				{
+					string strFileName;
+					if (!GameUty.IsExistFile(strFileName = maid4.GetProp(MPN.body).strFileName, null) || !GameUty.IsExistFile(strFileName = maid4.GetProp(MPN.head).strFileName, null))
+					{
+						text2 = text2 + maid4.status.fullNameJpStyle + "\n";
+						Debug.LogError("新Bodyエクスポート主要パーツ無し " + strFileName + " -> " + maid4.status.fullNameJpStyle);
+						this.SwapNewMaidBody(maid4, false);
+						maid4.RemoveCrcBodyProp();
+					}
+				}
+				else
+				{
+					string str = string.Empty;
+					MaidProp otherBodyProp = maid4.GetOtherBodyProp(MPN.body);
+					MaidProp otherBodyProp2 = maid4.GetOtherBodyProp(MPN.head);
+					if (otherBodyProp == null || (!GameUty.IsExistFile(str = otherBodyProp.strFileName, null) || otherBodyProp2 == null) || !GameUty.IsExistFile(str = otherBodyProp2.strFileName, null))
+					{
+						text2 = text2 + maid4.status.fullNameJpStyle + "\n";
+						Debug.LogError("新Bodyエクスポート主要パーツ無し " + str + " -> " + maid4.status.fullNameJpStyle);
+						maid4.RemoveCrcBodyProp();
+					}
+				}
 			}
 		}
+		if (!string.IsNullOrEmpty(text2))
+		{
+			NUty.WinMessageBox(NUty.GetWindowHandle(), "CRC新Bodyの主要パーツが見つからなかったのでCOM3D2旧Bodyに戻しました。再度CREditに行くと復旧します。\n" + text2, "情報", 48);
+		}
 		Maid.DeletedTmpThumCards();
 		GameMain.Instance.MsgWnd.ClearBackLogData();
 		if (this.status.isDaytime)
@@ -1481,6 +1716,10 @@ public class CharacterMgr : MonoBehaviour
 
 	public const int ActiveManSloatCount = 6;
 
+	public const int CHR_MGR_VERSION = 2002;
+
+	public string SaveDataGUID = string.Empty;
+
 	private static bool m_bEditMode;
 
 	public List<SubMaid.BackupStatus> subMaidBackupStatusList = new List<SubMaid.BackupStatus>();
@@ -1606,11 +1845,11 @@ public class CharacterMgr : MonoBehaviour
 				CharacterMgr.Preset preset = SaveData.GetPreset(this);
 				if (preset != null)
 				{
-					characterMgr.PresetSet(maid, preset);
+					characterMgr.PresetSet(maid, preset, false);
 				}
 				else if (this.isResourcesLoad)
 				{
-					characterMgr.PresetSet(maid, characterMgr.PresetLoadFromResources(this.presetFileName));
+					characterMgr.PresetSet(maid, characterMgr.PresetLoadFromResources(this.presetFileName), false);
 				}
 				else
 				{
@@ -1621,7 +1860,7 @@ public class CharacterMgr : MonoBehaviour
 							byte[] buffer = afileBase.ReadAll();
 							using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8))
 							{
-								characterMgr.PresetSet(maid, characterMgr.PresetLoad(binaryReader, this.presetFileName));
+								characterMgr.PresetSet(maid, characterMgr.PresetLoad(binaryReader, this.presetFileName), false);
 							}
 						}
 					}

+ 1 - 1
Assembly-CSharp/CompetitiveShowAPI.cs

@@ -46,7 +46,7 @@ public class CompetitiveShowAPI
 		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
 		ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
 		script_mgr.is_motion_blend = false;
-		script_mgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false);
+		script_mgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false, false);
 		script_mgr.is_motion_blend = true;
 		maid.FaceAnime("通常", 1f, 0);
 		maid.FaceBlend("無し");

+ 2 - 2
Assembly-CSharp/CompetitiveShowMgr.cs

@@ -202,7 +202,7 @@ public class CompetitiveShowMgr : BasePanelMgr
 				}
 				KeyValuePair<string, string> competitiveMotionFileVictory = maid.status.personal.competitiveMotionFileVictory;
 				this.ClassEffect.SetActive(true);
-				GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileVictory.Key, competitiveMotionFileVictory.Value, string.Empty, string.Empty, false, true, false);
+				GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileVictory.Key, competitiveMotionFileVictory.Value, string.Empty, string.Empty, false, true, false, false);
 			}
 			else
 			{
@@ -216,7 +216,7 @@ public class CompetitiveShowMgr : BasePanelMgr
 				}
 				KeyValuePair<string, string> competitiveMotionFileDefeat = maid.status.personal.competitiveMotionFileDefeat;
 				GameMain.Instance.SoundMgr.PlaySe("SE021.ogg", false);
-				GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileDefeat.Key, competitiveMotionFileDefeat.Value, string.Empty, string.Empty, false, true, false);
+				GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, competitiveMotionFileDefeat.Key, competitiveMotionFileDefeat.Value, string.Empty, string.Empty, false, true, false, false);
 			}
 			this.wait_time = Time.time + 3f;
 			this.phase_status_ = CompetitiveShowMgr.PhaseStatus.MotionPlay;

+ 15 - 2
Assembly-CSharp/ConfigManager.cs

@@ -45,10 +45,13 @@ public class ConfigManager : MonoBehaviour
 		{
 			key.repositionNow = true;
 		}
-		if (!Product.supportMultiLanguage)
+		if (Product.supportMultiLanguage)
 		{
-			this.systemFrame.height -= 72;
+			this.vSync.transform.parent.parent.SetParent(UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockLeft", false).gameObject.transform, true);
+			this.vSync.transform.parent.localPosition = new Vector3(598f, this.vSync.transform.parent.localPosition.y, 0f);
 		}
+		UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockLeft", false).GetComponent<UIGrid>().repositionNow = true;
+		UTY.GetChildObject(this.systemFrame.gameObject, "SystemBlockRight", false).GetComponent<UIGrid>().repositionNow = true;
 		EventDelegate.Add(this.closeButton.onClick, new EventDelegate.Callback(BaseMgr<ConfigMgr>.Instance.CloseConfigPanel));
 		EventDelegate.Add(this.vrConfigButton.onClick, delegate()
 		{
@@ -160,6 +163,11 @@ public class ConfigManager : MonoBehaviour
 			GameMain.Instance.CMSystem.TextureQuality = setValue;
 			GameMain.Instance.CMSystem.ConfigScreenApply();
 		});
+		this.CreateEnumPopupList<CMSystem.VSyncType>(this.vSync, delegate(CMSystem.VSyncType setValue)
+		{
+			GameMain.Instance.CMSystem.VSyncMode = setValue;
+			GameMain.Instance.CMSystem.ConfigScreenApply();
+		});
 		if (this.subtitleType != null)
 		{
 			if (Product.supportMultiLanguage)
@@ -374,6 +382,7 @@ public class ConfigManager : MonoBehaviour
 		this.antiAlias.value = GameMain.Instance.CMSystem.Antialias.ToString();
 		this.shadowQuality.value = GameMain.Instance.CMSystem.ShadowQuality.ToString();
 		this.textureQuality.value = GameMain.Instance.CMSystem.TextureQuality.ToString();
+		this.vSync.value = GameMain.Instance.CMSystem.VSyncMode.ToString();
 		this.subtitleType.value = SubtitleDisplayManager.EnumConvert.GetTerm(GameMain.Instance.CMSystem.SubtitleType);
 		this.systemLanguage.value = Product.EnumConvert.GetTerm(GameMain.Instance.CMSystem.SystemLanguage);
 	}
@@ -625,6 +634,10 @@ public class ConfigManager : MonoBehaviour
 	private UIPopupList systemLanguage;
 
 	[SerializeField]
+	[Header("垂直同期")]
+	private UIPopupList vSync;
+
+	[SerializeField]
 	[Header("翻訳版用-ADVの表示タイプ")]
 	private UIPopupList subtitleType;
 

+ 2 - 2
Assembly-CSharp/ControllerShortcutSettingData.cs

@@ -33,7 +33,7 @@ public static class ControllerShortcutSettingData
 	{
 		public void OnBeforeSerialize()
 		{
-			this.m_nVersion = 1550;
+			this.m_nVersion = 1570;
 		}
 
 		public void OnAfterDeserialize()
@@ -261,7 +261,7 @@ public static class ControllerShortcutSettingData
 		private const string CONF_NAME = "OvrControllerShortcutConfig.json";
 
 		[SerializeField]
-		private int m_nVersion = 1550;
+		private int m_nVersion = 1570;
 
 		[SerializeField]
 		private bool IsDirectShortcutMode = true;

+ 3 - 2
Assembly-CSharp/DailyCtrl.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using com.workman.cm3d2.button;
+using MaidStatus;
 using PlayerStatus;
 using PrivateMaidMode;
 using Schedule;
@@ -107,7 +108,7 @@ public class DailyCtrl : MonoBehaviour
 		{
 			this.GetMenuButton(type).active = false;
 		}
-		Status status = GameMain.Instance.CharacterMgr.status;
+		PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
 		if (!status.isAvailableDance)
 		{
 			this.GetMenuButton(DailyCtrl.ButtonType.Dance).active = false;
@@ -223,7 +224,7 @@ public class DailyCtrl : MonoBehaviour
 		bool result = false;
 		foreach (Maid maid in stockMaidList)
 		{
-			if (maid != null && maid.status.isCompatiblePersonality)
+			if (maid != null && maid.status.heroineType == HeroineType.Transfer && maid.status.personal.compatible)
 			{
 				result = true;
 			}

+ 51 - 0
Assembly-CSharp/DailyMgr.cs

@@ -5,6 +5,7 @@ using com.workman.cm3d2.scene.dailyEtc;
 using MaidStatus;
 using Schedule;
 using UnityEngine;
+using wf;
 
 public class DailyMgr : BaseCreatePanel
 {
@@ -154,6 +155,42 @@ public class DailyMgr : BaseCreatePanel
 					return;
 				}
 			}
+			if (PluginData.IsEnabled("GP003"))
+			{
+				for (int i = 0; i < 40; i++)
+				{
+					Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(i);
+					if (scheduleSlot != null)
+					{
+						ReadOnlyDictionary<int, ScheduleCSVData.ScheduleBase> allData = ScheduleCSVData.AllData;
+						foreach (int num2 in new int[]
+						{
+							scheduleSlot.status.noonWorkId,
+							scheduleSlot.status.nightWorkId
+						})
+						{
+							if (!allData.ContainsKey(num2))
+							{
+								Debug.LogError("ScheduleAPI:タスクID[" + num2 + "]のデータが見つかりませんでした");
+							}
+							else
+							{
+								bool flag2 = false;
+								ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[num2];
+								if (ScheduleCSVData.YotogiData.ContainsKey(scheduleBase.id))
+								{
+									flag2 = !ScheduleAPI.EnableNightWork(num2, scheduleSlot, false, true);
+								}
+								if (flag2)
+								{
+									GameMain.Instance.SysDlg.Show("実行できないスケジュールがセットされています。スケジュール設定を見直してください。", SystemDialog.TYPE.OK, null, null);
+									return;
+								}
+							}
+						}
+					}
+				}
+			}
 			this.m_pressingNext = true;
 			this.CloseDailyPanel();
 		}
@@ -183,6 +220,20 @@ public class DailyMgr : BaseCreatePanel
 			{
 				if (menuButton.type == DailyCtrl.ButtonType.LegacyMode)
 				{
+					bool flag3 = false;
+					foreach (Maid maid in GameMain.Instance.CharacterMgr.GetStockMaidList())
+					{
+						if (maid != null && maid.status.isCompatiblePersonality)
+						{
+							flag3 = true;
+							break;
+						}
+					}
+					if (!flag3)
+					{
+						GameMain.Instance.SysDlg.Show("旧ボディの移籍メイドが最低1人以上いないと実行する事はできません", SystemDialog.TYPE.OK, null, null);
+						return;
+					}
 					GameMain.Instance.CMSystem.SetTmpGenericFlag("AddAllOffset_Ignore", 0);
 				}
 				DailyAPI.EndType f_eEndType = DailyAPI.EndType.NormalSceneChange;

+ 52 - 10
Assembly-CSharp/Dance/UndressItem.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using UnityEngine;
+using wf;
 
 namespace Dance
 {
@@ -45,22 +46,53 @@ namespace Dance
 			{
 				return;
 			}
-			MaidProp prop = maid.GetProp(this.m_MyMpn);
-			SceneEdit.SMenuItem smenuItem = new SceneEdit.SMenuItem();
-			SceneEdit.InitMenuItemScript(smenuItem, prop.strFileName, false);
-			if (smenuItem.m_texIconRef)
+			if (maid.IsCrcBody)
 			{
-				this.m_MaidPartsiconPair.Add(maid, new UndressItem.MaidInfo(smenuItem.m_texIconRef, false));
+				this.m_MaidPartsiconPair[maid] = new UndressItem.MaidInfo(null, false);
+			}
+			else
+			{
+				MaidProp prop = maid.GetProp(this.m_MyMpn);
+				SceneEdit.SMenuItem smenuItem = new SceneEdit.SMenuItem();
+				SceneEdit.InitMenuItemScript(smenuItem, prop.strFileName, false);
+				if (smenuItem.m_texIconRef)
+				{
+					this.m_MaidPartsiconPair.Add(maid, new UndressItem.MaidInfo(smenuItem.m_texIconRef, false));
+				}
 			}
 		}
 
 		public void UpdateState(Maid maid)
 		{
-			string strFileName = maid.GetProp(this.m_MyMpn).strFileName;
-			this.m_MyButton.isEnabled = (!string.IsNullOrEmpty(strFileName) && strFileName.IndexOf("_del") < 0 && this.m_MaidPartsiconPair.ContainsKey(maid));
-			if (!this.m_MyButton.isEnabled)
+			if (maid.IsCrcBody)
+			{
+				this.m_MyButton.isEnabled = false;
+				foreach (MPN parentMpn in this.m_MyPartsData.Mpnlist)
+				{
+					if (maid.body0.GetSlotLoaded(parentMpn))
+					{
+						this.m_MyButton.isEnabled = true;
+						break;
+					}
+				}
+				if (this.m_MyPartsData.Mpnlist.Count <= 0 && this.m_MyButton.gameObject.activeSelf)
+				{
+					this.m_MyButton.gameObject.SetActive(false);
+					Utility.ResetNGUI(this.m_MyButton.transform.parent.GetComponent<UIGrid>());
+				}
+			}
+			else
+			{
+				string strFileName = maid.GetProp(this.m_MyMpn).strFileName;
+				this.m_MyButton.isEnabled = (!string.IsNullOrEmpty(strFileName) && strFileName.IndexOf("_del") < 0 && this.m_MaidPartsiconPair.ContainsKey(maid));
+			}
+			if (!this.m_MyButton.isEnabled || maid.IsCrcBody)
 			{
 				this.m_MyIcon.mainTexture = this.m_MyPartsData.DefaultIcon;
+				if (maid.IsCrcBody)
+				{
+					this.m_MyButton.defaultColor = (this.m_MyButton.hover = ((!this.m_MaidPartsiconPair[maid].IsUndress) ? this.m_DefaultColor : this.m_UndressColor));
+				}
 			}
 			else
 			{
@@ -84,9 +116,19 @@ namespace Dance
 				return;
 			}
 			this.m_MaidPartsiconPair[maid].IsUndress = is_mask_on;
-			foreach (TBody.SlotID f_eSlot in this.m_MyPartsData.SlotIDlist)
+			if (maid.IsCrcBody)
+			{
+				foreach (MPN parentMpn in this.m_MyPartsData.Mpnlist)
+				{
+					maid.body0.SetMask(parentMpn, !is_mask_on);
+				}
+			}
+			else
 			{
-				maid.body0.SetMask(f_eSlot, !is_mask_on);
+				foreach (TBody.SlotID f_eSlot in this.m_MyPartsData.SlotIDlist)
+				{
+					maid.body0.SetMask(f_eSlot, !is_mask_on);
+				}
 			}
 			this.UpdateState(maid);
 			UndressDance_Mgr.Instance.ChangeSexsualPoint(this.m_MyMpn);

+ 126 - 62
Assembly-CSharp/DanceMain.cs

@@ -234,7 +234,7 @@ public class DanceMain : MonoBehaviour
 		{
 			if (!RhythmAction_Mgr.Instance.FactOrderList.Any((Maid e) => !e) && DanceMain.SelectDanceData != null)
 			{
-				goto IL_AF3;
+				goto IL_AF4;
 			}
 		}
 		for (int num4 = 0; num4 < this.m_listTestPreset.Count; num4++)
@@ -280,7 +280,7 @@ public class DanceMain : MonoBehaviour
 				}
 				if (preset != null)
 				{
-					GameMain.Instance.CharacterMgr.PresetSet(maid2, preset);
+					GameMain.Instance.CharacterMgr.PresetSet(maid2, preset, false);
 				}
 				maid2.Visible = true;
 			}
@@ -309,7 +309,7 @@ public class DanceMain : MonoBehaviour
 				}
 			}
 		}
-		IL_AF3:
+		IL_AF4:
 		if (this.m_PresetCopyToDummyChara != null)
 		{
 			NDebug.Assert(this.m_PresetCopyToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "PresetCopyToDummyChara は listDummyAnimChara の数以下である必要があります。");
@@ -321,28 +321,48 @@ public class DanceMain : MonoBehaviour
 					Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num8);
 					if (maid3)
 					{
-						byte[] buffer2 = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(maid3, CharacterMgr.PresetType.All);
-						BinaryReader binaryReader2 = new BinaryReader(new MemoryStream(buffer2));
-						CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader2, string.Empty);
-						binaryReader2.Close();
 						Maid maidDest = GameMain.Instance.CharacterMgr.GetMaid(num7);
-						if (maidDest != null && this.m_listTempMaid.Find((Maid m) => m == maidDest) != null)
+						if (maid3.IsCrcBody)
 						{
-							GameMain.Instance.CharacterMgr.PresetSet(maidDest, f_prest);
-							maidDest.AllProcPropSeqStart();
+							for (int num9 = 1; num9 < 201; num9++)
+							{
+								MaidProp prop = maid3.GetProp((MPN)num9);
+								MaidProp prop2 = maidDest.GetProp((MPN)num9);
+								using (MemoryStream memoryStream2 = new MemoryStream())
+								{
+									BinaryWriter f_bwWrite = new BinaryWriter(memoryStream2);
+									prop.Serialize(f_bwWrite);
+									memoryStream2.Flush();
+									memoryStream2.Position = 0L;
+									BinaryReader f_brRead = new BinaryReader(memoryStream2);
+									prop2.Deserialize(f_brRead);
+								}
+							}
 						}
 						else
 						{
-							Debug.LogError("Presetコピー先メイドが居ないか、一時雇用メイドではありません。");
+							byte[] buffer2 = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(maid3, CharacterMgr.PresetType.All);
+							BinaryReader binaryReader2 = new BinaryReader(new MemoryStream(buffer2));
+							CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader2, string.Empty);
+							binaryReader2.Close();
+							if (maidDest != null && this.m_listTempMaid.Find((Maid m) => m == maidDest) != null)
+							{
+								GameMain.Instance.CharacterMgr.PresetSet(maidDest, f_prest, false);
+								maidDest.AllProcPropSeqStart();
+							}
+							else
+							{
+								Debug.LogError("Presetコピー先メイドが居ないか、一時雇用メイドではありません。");
+							}
 						}
 					}
 				}
 			}
 		}
 		this.m_KuchipakuAudioStartTimeAtMaid = new float[this.m_listDummyAnimChara.Count<GameObject>()];
-		for (int num9 = 0; num9 < this.m_KuchipakuAudioStartTimeAtMaid.Length; num9++)
+		for (int num10 = 0; num10 < this.m_KuchipakuAudioStartTimeAtMaid.Length; num10++)
 		{
-			this.m_KuchipakuAudioStartTimeAtMaid[num9] = 0f;
+			this.m_KuchipakuAudioStartTimeAtMaid[num10] = 0f;
 		}
 	}
 
@@ -447,6 +467,10 @@ public class DanceMain : MonoBehaviour
 		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
 		try
 		{
+			if (maid.IsCrcBody && animName.IndexOf("crc_") != 0)
+			{
+				animName = "crc_" + animName;
+			}
 			maid.CrossFade(animName + ".anm", false, false, false, fadeTime, 1f);
 		}
 		catch (Exception ex)
@@ -542,8 +566,8 @@ public class DanceMain : MonoBehaviour
 				this.m_listMaid[i].transform.localScale = Vector3.one;
 				this.m_listMaid[i].StopKuchipakuPattern();
 				this.m_listMaid[i].EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
-				this.m_listMaid[i].AllIKDetach(0f);
-				this.m_listMaid[i].body0.IKCtrl.SetPelvisPull(false);
+				this.m_listMaid[i].fullBodyIK.AllIKDetach(0f);
+				this.m_listMaid[i].body0.fullBodyIK.SetPelvisPull(false);
 				this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristL, true);
 				this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristR, true);
 				Transform[] componentsInChildren = this.m_listMaid[i].gameObject.GetComponentsInChildren<Transform>(true);
@@ -630,7 +654,34 @@ public class DanceMain : MonoBehaviour
 		ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
 		script_mgr.StopMotionScript();
 		script_mgr.is_motion_blend = true;
-		script_mgr.LoadMotionScript(0, false, this.m_AdjustScript, this.m_ScriptLabel, string.Empty, string.Empty, false, true, false);
+		bool is_exist_crc = this.m_listMaid.Any((Maid ch) => ch.IsCrcBody);
+		bool flag;
+		if (is_exist_crc)
+		{
+			flag = this.m_listMaid.Any((Maid ch) => !ch.IsCrcBody);
+		}
+		else
+		{
+			flag = false;
+		}
+		bool is_body_mix = flag;
+		if (is_body_mix)
+		{
+			for (int i = 0; i < this.m_listMaid.Count; i++)
+			{
+				Maid maid = this.m_listMaid[i];
+				string text = string.Format("{0}_{1}.ks", Path.GetFileNameWithoutExtension(this.m_AdjustScript), maid.ActiveSlotNo);
+				if (maid.IsCrcBody)
+				{
+					text = "crc_" + text;
+				}
+				script_mgr.LoadMotionScript(i, false, text, this.m_ScriptLabel, maid.status.guid, string.Empty, false, true, false, false);
+			}
+		}
+		else
+		{
+			script_mgr.LoadMotionScript(0, false, this.m_AdjustScript, this.m_ScriptLabel, string.Empty, string.Empty, false, true, false, false);
+		}
 		float timer = 0f;
 		while (timer <= this.m_LoadScriptTime)
 		{
@@ -738,7 +789,12 @@ public class DanceMain : MonoBehaviour
 				{
 					for (int k = 0; k < this.m_listAnimName.Count; k++)
 					{
-						this.m_listMaid.Add(GameMain.Instance.CharacterMgr.GetMaid(k));
+						Maid maid = GameMain.Instance.CharacterMgr.GetMaid(k);
+						this.m_listMaid.Add(maid);
+						if (maid.IsCrcBody && !string.IsNullOrEmpty(this.m_listAnimName[k]) && this.m_listAnimName[k].IndexOf("crc_") != 0)
+						{
+							this.m_listAnimName[k] = "crc_" + this.m_listAnimName[k];
+						}
 					}
 					for (int l = 0; l < this.m_listMaid.Count; l++)
 					{
@@ -772,14 +828,14 @@ public class DanceMain : MonoBehaviour
 							break;
 						}
 						int num2 = num - 1;
-						Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num2);
+						Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(num2);
 						IEnumerator enumerator5 = Enum.GetValues(typeof(Maid.AutoTwist)).GetEnumerator();
 						try
 						{
 							while (enumerator5.MoveNext())
 							{
 								object obj = enumerator5.Current;
-								maid.SetAutoTwist((Maid.AutoTwist)obj, true);
+								maid2.SetAutoTwist((Maid.AutoTwist)obj, true);
 							}
 						}
 						finally
@@ -790,59 +846,62 @@ public class DanceMain : MonoBehaviour
 								disposable.Dispose();
 							}
 						}
-						if (this.m_AutoTwistShoulderL != null && num2 < this.m_AutoTwistShoulderL.Length)
-						{
-							maid.SetAutoTwist(Maid.AutoTwist.ShoulderL, this.m_AutoTwistShoulderL[num2]);
-						}
-						if (this.m_AutoTwistShoulderR != null && num2 < this.m_AutoTwistShoulderR.Length)
-						{
-							maid.SetAutoTwist(Maid.AutoTwist.ShoulderR, this.m_AutoTwistShoulderR[num2]);
-						}
-						if (this.m_AutoTwistWristL != null && num2 < this.m_AutoTwistWristL.Length)
-						{
-							maid.SetAutoTwist(Maid.AutoTwist.WristL, this.m_AutoTwistWristL[num2]);
-						}
-						if (this.m_AutoTwistWristR != null && num2 < this.m_AutoTwistWristR.Length)
-						{
-							maid.SetAutoTwist(Maid.AutoTwist.WristR, this.m_AutoTwistWristR[num2]);
-						}
-						if (this.m_AutoTwistThighL != null && num2 < this.m_AutoTwistThighL.Length)
+						if (!maid2.IsCrcBody)
 						{
-							maid.SetAutoTwist(Maid.AutoTwist.ThighL, this.m_AutoTwistThighL[num2]);
-						}
-						if (this.m_AutoTwistThighR != null && num2 < this.m_AutoTwistThighR.Length)
-						{
-							maid.SetAutoTwist(Maid.AutoTwist.ThighR, this.m_AutoTwistThighR[num2]);
+							if (this.m_AutoTwistShoulderL != null && num2 < this.m_AutoTwistShoulderL.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.ShoulderL, this.m_AutoTwistShoulderL[num2]);
+							}
+							if (this.m_AutoTwistShoulderR != null && num2 < this.m_AutoTwistShoulderR.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.ShoulderR, this.m_AutoTwistShoulderR[num2]);
+							}
+							if (this.m_AutoTwistWristL != null && num2 < this.m_AutoTwistWristL.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.WristL, this.m_AutoTwistWristL[num2]);
+							}
+							if (this.m_AutoTwistWristR != null && num2 < this.m_AutoTwistWristR.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.WristR, this.m_AutoTwistWristR[num2]);
+							}
+							if (this.m_AutoTwistThighL != null && num2 < this.m_AutoTwistThighL.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.ThighL, this.m_AutoTwistThighL[num2]);
+							}
+							if (this.m_AutoTwistThighR != null && num2 < this.m_AutoTwistThighR.Length)
+							{
+								maid2.SetAutoTwist(Maid.AutoTwist.ThighR, this.m_AutoTwistThighR[num2]);
+							}
 						}
 						if (!string.IsNullOrEmpty(this.m_listAnimName[num2]))
 						{
-							string name = maid.CrossFade(this.m_listAnimName[num2] + ".anm", false, false, false, 0f, 1f);
-							Animation component = maid.body0.m_Bones.GetComponent<Animation>();
+							string name = maid2.CrossFade(this.m_listAnimName[num2] + ".anm", false, false, false, 0f, 1f);
+							Animation component = maid2.body0.m_Bones.GetComponent<Animation>();
 							component.Stop();
-							amanimationTrack.obj = maid.body0.m_Bones;
+							amanimationTrack.obj = maid2.body0.m_Bones;
 							foreach (AMAction amaction5 in amanimationTrack.cache)
 							{
 								AMAnimationAction amanimationAction = (AMAnimationAction)amaction5;
 								amanimationAction.amClip = component.GetClip(name);
-								amanimationAction.obj = maid.body0.m_Bones;
+								amanimationAction.obj = maid2.body0.m_Bones;
 							}
 						}
 						else
 						{
 							this.m_focePauseAnim.Add(new DanceMain.AnimTime
 							{
-								anim = maid.body0.m_Bones.GetComponent<Animation>()
+								anim = maid2.body0.m_Bones.GetComponent<Animation>()
 							});
 						}
 						if (this.UseFloorHitY)
 						{
-							maid.body0.SetBoneHitHeightY(this.m_fFloorY);
+							maid2.body0.SetBoneHitHeightY(this.m_fFloorY);
 						}
 						num++;
 					}
 					for (int n = 0; n < this.m_listDummyAnimChara.Count; n++)
 					{
-						Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(n);
+						Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(n);
 						for (int num3 = 0; num3 < this.m_listItemObject.Count; num3++)
 						{
 							Transform transform = CMT.SearchObjObj(this.m_listDummyAnimChara[n].transform, this.m_listItemObject[num3].transform);
@@ -850,7 +909,7 @@ public class DanceMain : MonoBehaviour
 							{
 								Transform transform2 = transform;
 								string name2 = transform2.parent.name;
-								Transform parent = CMT.SearchObjName(maid2.gameObject.transform, name2, true);
+								Transform parent = CMT.SearchObjName(maid3.gameObject.transform, name2, true);
 								transform2.SetParent(parent, false);
 							}
 						}
@@ -863,10 +922,10 @@ public class DanceMain : MonoBehaviour
 							if (this.m_MoveToDummyCharaPos[num4])
 							{
 								Vector3 position = this.m_listDummyAnimChara[num4].transform.position;
-								Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num4);
-								if (maid3 != null)
+								Maid maid4 = GameMain.Instance.CharacterMgr.GetMaid(num4);
+								if (maid4 != null)
 								{
-									maid3.SetPos(position);
+									maid4.SetPos(position);
 								}
 							}
 						}
@@ -879,10 +938,10 @@ public class DanceMain : MonoBehaviour
 							if (this.m_LayerChangeToDummyChara[num5])
 							{
 								int layer = this.m_listDummyAnimChara[num5].layer;
-								Maid maid4 = GameMain.Instance.CharacterMgr.GetMaid(num5);
-								if (maid4 != null)
+								Maid maid5 = GameMain.Instance.CharacterMgr.GetMaid(num5);
+								if (maid5 != null)
 								{
-									Transform[] componentsInChildren = maid4.gameObject.GetComponentsInChildren<Transform>(true);
+									Transform[] componentsInChildren = maid5.gameObject.GetComponentsInChildren<Transform>(true);
 									foreach (Transform transform3 in componentsInChildren)
 									{
 										transform3.gameObject.layer = layer;
@@ -898,11 +957,11 @@ public class DanceMain : MonoBehaviour
 						{
 							if (this.m_EyeTarget[num7] != null)
 							{
-								Maid maid5 = GameMain.Instance.CharacterMgr.GetMaid(num7);
-								if (maid5 != null)
+								Maid maid6 = GameMain.Instance.CharacterMgr.GetMaid(num7);
+								if (maid6 != null)
 								{
-									maid5.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
-									maid5.body0.trsLookTarget = this.m_EyeTarget[num7].transform;
+									maid6.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
+									maid6.body0.trsLookTarget = this.m_EyeTarget[num7].transform;
 								}
 							}
 						}
@@ -914,12 +973,17 @@ public class DanceMain : MonoBehaviour
 						{
 							if (this.m_MotionCacheEnable[num8])
 							{
-								Maid maid6 = GameMain.Instance.CharacterMgr.GetMaid(num8);
-								if (maid6 != null)
+								Maid maid7 = GameMain.Instance.CharacterMgr.GetMaid(num8);
+								if (maid7 != null)
 								{
 									for (int num9 = 0; num9 < this.m_MotionCacheFileName.Length; num9++)
 									{
-										maid6.CacheAnime(this.m_MotionCacheFileName[num9], false, false);
+										string text = this.m_MotionCacheFileName[num9];
+										if (maid7.IsCrcBody && !string.IsNullOrEmpty(text) && text.IndexOf("crc_") != 0)
+										{
+											text = "crc_" + text;
+										}
+										maid7.CacheAnime(text, false, false);
 									}
 								}
 							}

+ 1 - 1
Assembly-CSharp/DeskManager.cs

@@ -143,7 +143,7 @@ internal class DeskManager
 	public static void SerializeSingleSaveData(BinaryWriter binary)
 	{
 		binary.Write("CM3D2_DeskCustomize");
-		binary.Write(1550);
+		binary.Write(1570);
 		binary.Write(DeskManager.item_inst_data_.Count);
 		for (int i = 0; i < DeskManager.item_inst_data_.Count; i++)
 		{

+ 3 - 3
Assembly-CSharp/DynamicBone.cs

@@ -30,7 +30,7 @@ public class DynamicBone : MonoBehaviour
 			return false;
 		};
 		f_bw.Write("CM3D21_PHY");
-		f_bw.Write(1550);
+		f_bw.Write(1570);
 		if (this.m_Root == null)
 		{
 			NDebug.MessageBox("エラー", "×物理ルートボーンが設定されていません。");
@@ -94,7 +94,7 @@ public class DynamicBone : MonoBehaviour
 	public bool SerializeWriteCollider(BinaryWriter f_bw, string f_strFileName)
 	{
 		f_bw.Write("CM3D21_COL");
-		f_bw.Write(1550);
+		f_bw.Write(1570);
 		if (this.m_Colliders == null || this.m_Colliders.Count == 0)
 		{
 			NDebug.MessageBox("エラー", "×物理Collidersは空です。");
@@ -110,7 +110,7 @@ public class DynamicBone : MonoBehaviour
 			else
 			{
 				f_bw.Write(this.m_Colliders[i].TypeName);
-				this.m_Colliders[i].Serialize(f_bw, 1550);
+				this.m_Colliders[i].Serialize(f_bw, 1570);
 			}
 		}
 		this.m_ColliderFileName = f_strFileName;

+ 95 - 0
Assembly-CSharp/DynamicBoneColliderData.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using kt.Physics;
+using kt.Serialization;
+using UnityEngine;
+
+[Serializable]
+public class DynamicBoneColliderData : ASerializationVersionControl
+{
+	public override int FixVersion
+	{
+		get
+		{
+			return 1000;
+		}
+	}
+
+	public override void OnBeforeSerialize()
+	{
+		base.OnBeforeSerialize();
+		this.StatusJsonStrList = new List<string>();
+		for (int i = 0; i < this.colliderStatusList.Count; i++)
+		{
+			NativeColliderStatus nativeColliderStatus = this.colliderStatusList[i];
+			string text = string.Empty;
+			switch (nativeColliderStatus.colliderType)
+			{
+			case NativeColliderStatus.ColliderType.Plane:
+				text = JsonUtility.ToJson(nativeColliderStatus as NativePlaneColliderStatus);
+				break;
+			case NativeColliderStatus.ColliderType.Capsule:
+				text = JsonUtility.ToJson(nativeColliderStatus as NativeCapsuleColliderStatus);
+				break;
+			case NativeColliderStatus.ColliderType.Sphere:
+				text = JsonUtility.ToJson(nativeColliderStatus as NativeSphereColliderStatus);
+				break;
+			case NativeColliderStatus.ColliderType.MaidPropCol:
+				text = JsonUtility.ToJson(nativeColliderStatus as NativeMaidPropColliderStatus);
+				break;
+			}
+			if (!string.IsNullOrEmpty(text))
+			{
+				this.StatusJsonStrList.Add(text);
+			}
+		}
+	}
+
+	public override void OnAfterDeserialize()
+	{
+		base.OnAfterDeserialize();
+		this.colliderStatusList.Clear();
+		for (int i = 0; i < this.StatusJsonStrList.Count; i++)
+		{
+			string json = this.StatusJsonStrList[i];
+			NativeColliderStatus nativeColliderStatus = JsonUtility.FromJson<NativeColliderStatus>(json);
+			switch (nativeColliderStatus.colliderType)
+			{
+			case NativeColliderStatus.ColliderType.Plane:
+			{
+				NativePlaneColliderStatus item = JsonUtility.FromJson<NativePlaneColliderStatus>(json);
+				this.colliderStatusList.Add(item);
+				break;
+			}
+			case NativeColliderStatus.ColliderType.Capsule:
+			{
+				NativeCapsuleColliderStatus item2 = JsonUtility.FromJson<NativeCapsuleColliderStatus>(json);
+				this.colliderStatusList.Add(item2);
+				break;
+			}
+			case NativeColliderStatus.ColliderType.Sphere:
+			{
+				NativeSphereColliderStatus item3 = JsonUtility.FromJson<NativeSphereColliderStatus>(json);
+				this.colliderStatusList.Add(item3);
+				break;
+			}
+			case NativeColliderStatus.ColliderType.MaidPropCol:
+			{
+				NativeMaidPropColliderStatus item4 = JsonUtility.FromJson<NativeMaidPropColliderStatus>(json);
+				this.colliderStatusList.Add(item4);
+				break;
+			}
+			}
+		}
+		this.StatusJsonStrList.Clear();
+		this.StatusJsonStrList = null;
+	}
+
+	[NonSerialized]
+	public List<NativeColliderStatus> colliderStatusList = new List<NativeColliderStatus>();
+
+	[SerializeField]
+	private List<string> StatusJsonStrList;
+
+	public List<DynamicYureBone.LimbColliderInfo> limbEnableList = new List<DynamicYureBone.LimbColliderInfo>();
+}

+ 311 - 0
Assembly-CSharp/DynamicBoneMgr.cs

@@ -0,0 +1,311 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using kt.Utility;
+using UnityEngine;
+
+public class DynamicBoneMgr : IDynamicBone
+{
+	public DynamicBoneMgr(TBody body, TBodySkin body_skin)
+	{
+		this.Body = body;
+		this.BodySkin = body_skin;
+	}
+
+	public void UnInit()
+	{
+		foreach (IDynamicBone dynamicBone in this.DynamicBoneCompList)
+		{
+			dynamicBone.UnInit();
+		}
+		this.Body.RemoveDynamicBone(this);
+	}
+
+	public bool SetUpGameObject(GameObject root_object, MPN mpn)
+	{
+		if (mpn == MPN.body || mpn == MPN.set_body)
+		{
+			return false;
+		}
+		if (!this.Body.IsCrcBody)
+		{
+			return false;
+		}
+		this.DynamicBoneCompList.Clear();
+		string text = root_object.name.Replace("_SM_", string.Empty);
+		foreach (KeyValuePair<DynamicBoneMgr.BoneType, string> keyValuePair in DynamicBoneMgr.BoneTypeSearchNameDic)
+		{
+			DynamicBoneMgr.BoneType key = keyValuePair.Key;
+			string value = keyValuePair.Value;
+			Transform transform = this.SearchYureBone(root_object.transform, value, key);
+			if (transform)
+			{
+				if (key != DynamicBoneMgr.BoneType.Hair)
+				{
+					if (key != DynamicBoneMgr.BoneType.Skirt)
+					{
+						bool flag = mpn.ToString().Contains("acc");
+						Transform[] array = this.SearchYureBoneList(transform.parent, "_A_yure_", key).ToArray<Transform>();
+						if (array != null && array.Length > 0)
+						{
+							DynamicYureBone dynamicYureBone = root_object.AddComponent<DynamicYureBone>();
+							dynamicYureBone.Init(this.Body, !flag, array);
+							this.LoadDynamicYureBoneSetting(dynamicYureBone, text, mpn);
+						}
+					}
+					else
+					{
+						Transform parent = transform.parent;
+						DynamicSkirtBone dynamicSkirtBone = ImportCM.TryLoadDynamicSkirtBone(root_object, parent, text, this.Body);
+						if (dynamicSkirtBone == null)
+						{
+							dynamicSkirtBone = root_object.AddComponent<DynamicSkirtBone>();
+							this.LoadDefaultBinary("default_skirt.psk", new Action<BinaryReader>(dynamicSkirtBone.SerializeRead));
+						}
+						dynamicSkirtBone.InitGameObject(root_object, this.BodySkin, parent);
+						this.DynamicBoneCompList.Add(dynamicSkirtBone);
+					}
+				}
+				else
+				{
+					DynamicYureBone dynamicYureBone2 = root_object.gameObject.AddComponent<DynamicYureBone>();
+					Transform[] rootbones = this.SearchRootBoneList(transform.parent, "_yure_", key).ToArray<Transform>();
+					dynamicYureBone2.Init(this.Body, true, rootbones);
+					this.LoadDynamicYureBoneSetting(dynamicYureBone2, text, mpn);
+				}
+			}
+		}
+		if (this.DynamicBoneCompList.Count > 0)
+		{
+			this.Body.AddDynamicBone(this);
+			return true;
+		}
+		return false;
+	}
+
+	private Transform SearchYureBone(Transform bone_parent, string search_name, DynamicBoneMgr.BoneType bone_type)
+	{
+		return bone_parent.SearchChild((Transform bone) => this.IsBoneTypeNameMatch(bone, search_name, bone_type) && !bone.name.Contains("Mune"));
+	}
+
+	private ICollection<Transform> SearchRootBoneList(Transform bone_parent, string search_name, DynamicBoneMgr.BoneType bone_type)
+	{
+		HashSet<Transform> hashSet = new HashSet<Transform>();
+		for (int i = 0; i < bone_parent.childCount; i++)
+		{
+			Transform child = bone_parent.GetChild(i);
+			if (this.IsBoneTypeNameMatch(child, search_name, bone_type))
+			{
+				hashSet.Add(child);
+			}
+		}
+		return hashSet;
+	}
+
+	private ICollection<Transform> SearchYureBoneList(Transform bone_parent, string search_name, DynamicBoneMgr.BoneType bone_type)
+	{
+		HashSet<Transform> bone_list = new HashSet<Transform>();
+		Transform transform = bone_parent.SearchChild((Transform child) => this.IsBoneTypeNameMatch(child, search_name, bone_type) && !bone_list.Contains(child));
+		while (transform)
+		{
+			bone_list.Add(transform);
+			transform = bone_parent.SearchChild((Transform child) => this.IsBoneTypeNameMatch(child, search_name, bone_type) && !bone_list.Contains(child));
+		}
+		return bone_list;
+	}
+
+	private bool IsBoneTypeNameMatch(Transform bone, string match_name, DynamicBoneMgr.BoneType bone_type)
+	{
+		if (!bone.name.Contains(match_name))
+		{
+			return false;
+		}
+		if (bone_type == DynamicBoneMgr.BoneType.None)
+		{
+			return true;
+		}
+		string name = bone.name;
+		bool flag = name.Contains(DynamicBoneMgr.BoneTypeSearchNameDic[bone_type]);
+		if (flag)
+		{
+			string text = DynamicBoneMgr.BoneTypeSearchNameDic[bone_type];
+			foreach (KeyValuePair<DynamicBoneMgr.BoneType, string> keyValuePair in DynamicBoneMgr.BoneTypeSearchNameDic)
+			{
+				if (bone_type != keyValuePair.Key)
+				{
+					if (!text.Contains(keyValuePair.Value) && name.Contains(keyValuePair.Value))
+					{
+						return false;
+					}
+				}
+			}
+			return flag;
+		}
+		return flag;
+	}
+
+	private void LoadDynamicYureBoneSetting(DynamicYureBone yure_bone, string parts_name, MPN mpn)
+	{
+		string text = parts_name + ".dbconf";
+		string text2 = parts_name + "_col.dbcol";
+		if (!GameUty.FileSystem.IsExistentFile(text))
+		{
+			text = "default_" + mpn.ToString().ToLower() + ".dbconf";
+			if (!GameUty.FileSystem.IsExistentFile(text))
+			{
+				text = "default_yure.dbconf";
+			}
+			this.LoadDefaultBinary(text, new Action<StreamReader>(yure_bone.Load));
+		}
+		else
+		{
+			this.LoadFile(text, new Action<StreamReader>(yure_bone.Load));
+		}
+		if (!GameUty.FileSystem.IsExistentFile(text2))
+		{
+			text2 = "default_" + mpn.ToString().ToLower() + "_col.dbcol";
+			if (!GameUty.FileSystem.IsExistentFile(text2))
+			{
+				text2 = "default_yure_col.dbcol";
+			}
+			this.LoadDefaultBinary(text2, new Action<StreamReader>(yure_bone.LoadCollider));
+		}
+		else
+		{
+			this.LoadFile(text2, new Action<StreamReader>(yure_bone.LoadCollider));
+		}
+		yure_bone.floorPlaneColider = this.Body.crcHitFloorPlane;
+		yure_bone.loadConfigFile = text;
+		yure_bone.loadColliderFile = text2;
+		this.DynamicBoneCompList.Add(yure_bone);
+	}
+
+	private void LoadFile(string file_name, Action<StreamReader> on_load)
+	{
+		using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
+		{
+			if (afileBase.IsValid())
+			{
+				byte[] buffer = afileBase.ReadAll();
+				using (MemoryStream memoryStream = new MemoryStream(buffer))
+				{
+					using (StreamReader streamReader = new StreamReader(memoryStream))
+					{
+						on_load(streamReader);
+					}
+				}
+			}
+			else
+			{
+				Debug.LogErrorFormat("{0}はありませんでした", new object[]
+				{
+					file_name
+				});
+			}
+		}
+	}
+
+	private byte[] GetChacheBinary(string file_name)
+	{
+		byte[] array = null;
+		if (DynamicBoneMgr.DefaultFileNameBinaryPair.ContainsKey(file_name))
+		{
+			array = DynamicBoneMgr.DefaultFileNameBinaryPair[file_name];
+		}
+		else
+		{
+			using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
+			{
+				if (afileBase.IsValid())
+				{
+					array = afileBase.ReadAll();
+				}
+			}
+			if (array == null || array.Length == 0)
+			{
+				Debug.LogErrorFormat("{0}は存在しません", new object[]
+				{
+					file_name
+				});
+			}
+			else
+			{
+				DynamicBoneMgr.DefaultFileNameBinaryPair[file_name] = array;
+			}
+		}
+		return array;
+	}
+
+	private void LoadDefaultBinary(string file_name, Action<StreamReader> on_load)
+	{
+		byte[] chacheBinary = this.GetChacheBinary(file_name);
+		using (MemoryStream memoryStream = new MemoryStream(chacheBinary))
+		{
+			using (StreamReader streamReader = new StreamReader(memoryStream))
+			{
+				on_load(streamReader);
+			}
+		}
+	}
+
+	private void LoadDefaultBinary(string file_name, Action<BinaryReader> on_load)
+	{
+		byte[] chacheBinary = this.GetChacheBinary(file_name);
+		using (MemoryStream memoryStream = new MemoryStream(chacheBinary))
+		{
+			using (BinaryReader binaryReader = new BinaryReader(memoryStream))
+			{
+				on_load(binaryReader);
+			}
+		}
+	}
+
+	public void PhysicsReset()
+	{
+		foreach (IDynamicBone dynamicBone in this.DynamicBoneCompList)
+		{
+			dynamicBone.PhysicsReset();
+		}
+	}
+
+	public void DynamicUpdate()
+	{
+		foreach (IDynamicBone dynamicBone in this.DynamicBoneCompList)
+		{
+			dynamicBone.DynamicUpdate();
+		}
+	}
+
+	private static readonly Dictionary<DynamicBoneMgr.BoneType, string> BoneTypeSearchNameDic = new Dictionary<DynamicBoneMgr.BoneType, string>
+	{
+		{
+			DynamicBoneMgr.BoneType.Hair,
+			"_yure_hair_"
+		},
+		{
+			DynamicBoneMgr.BoneType.Skirt,
+			"_yure_skirt_"
+		},
+		{
+			DynamicBoneMgr.BoneType.Other,
+			"_yure_"
+		}
+	};
+
+	private TBody Body;
+
+	private TBodySkin BodySkin;
+
+	private List<IDynamicBone> DynamicBoneCompList = new List<IDynamicBone>();
+
+	private static Dictionary<string, byte[]> DefaultFileNameBinaryPair = new Dictionary<string, byte[]>();
+
+	private enum BoneType
+	{
+		None,
+		Hair,
+		Skirt,
+		Other
+	}
+}

+ 160 - 0
Assembly-CSharp/DynamicBoneStatus.cs

@@ -0,0 +1,160 @@
+using System;
+using kt.Serialization;
+using UnityEngine;
+
+[Serializable]
+public class DynamicBoneStatus : ASerializationVersionControl
+{
+	public override int FixVersion
+	{
+		get
+		{
+			return 1000;
+		}
+	}
+
+	public override void OnBeforeSerialize()
+	{
+		base.OnBeforeSerialize();
+		this.DampingKeyFrames = DynamicBoneStatus.CreateAnimationKeyFrames(this.dampingCurve);
+		this.ElasticityKeyFrames = DynamicBoneStatus.CreateAnimationKeyFrames(this.elasticityCurve);
+		this.StiffnessKeyFrames = DynamicBoneStatus.CreateAnimationKeyFrames(this.stiffnessCurve);
+		this.InertKeyFrames = DynamicBoneStatus.CreateAnimationKeyFrames(this.inertCurve);
+		this.RadiusKeyFrames = DynamicBoneStatus.CreateAnimationKeyFrames(this.radiusCurve);
+	}
+
+	public override void OnAfterDeserialize()
+	{
+		base.OnAfterDeserialize();
+		this.dampingCurve = DynamicBoneStatus.CreateAnimationCurve(this.DampingKeyFrames);
+		this.elasticityCurve = DynamicBoneStatus.CreateAnimationCurve(this.ElasticityKeyFrames);
+		this.stiffnessCurve = DynamicBoneStatus.CreateAnimationCurve(this.StiffnessKeyFrames);
+		this.inertCurve = DynamicBoneStatus.CreateAnimationCurve(this.InertKeyFrames);
+		this.radiusCurve = DynamicBoneStatus.CreateAnimationCurve(this.RadiusKeyFrames);
+	}
+
+	public static DynamicBoneStatus.AnimationKeyFrame[] CreateAnimationKeyFrames(AnimationCurve curve)
+	{
+		Keyframe[] array = (curve == null) ? null : curve.keys;
+		if (array == null)
+		{
+			return new DynamicBoneStatus.AnimationKeyFrame[0];
+		}
+		DynamicBoneStatus.AnimationKeyFrame[] array2 = new DynamicBoneStatus.AnimationKeyFrame[array.Length];
+		for (int i = 0; i < array.Length; i++)
+		{
+			array2[i] = new DynamicBoneStatus.AnimationKeyFrame
+			{
+				time = array[i].time,
+				value = array[i].value,
+				inTangent = array[i].inTangent,
+				outTangent = array[i].outTangent
+			};
+		}
+		return array2;
+	}
+
+	public static AnimationCurve CreateAnimationCurve(DynamicBoneStatus.AnimationKeyFrame[] keys)
+	{
+		if (keys == null)
+		{
+			return null;
+		}
+		Keyframe[] array = new Keyframe[keys.Length];
+		for (int i = 0; i < array.Length; i++)
+		{
+			array[i] = new Keyframe
+			{
+				time = keys[i].time,
+				value = keys[i].value,
+				inTangent = keys[i].inTangent,
+				outTangent = keys[i].outTangent
+			};
+		}
+		return new AnimationCurve(array);
+	}
+
+	[Header("減衰率。値が小さいと素早く小刻みに揺れる。大きいとゆっくり大振りで揺れる。")]
+	[Range(0f, 1f)]
+	public float damping = 0.6f;
+
+	[SerializeField]
+	[HideInInspector]
+	private DynamicBoneStatus.AnimationKeyFrame[] DampingKeyFrames;
+
+	public AnimationCurve dampingCurve;
+
+	[Header("復元率。値が大きいと素早く元の形状に戻る。小さいとゆっくりと元の形状に戻る。")]
+	[Range(0f, 1f)]
+	public float elasticity = 0.1f;
+
+	[SerializeField]
+	[HideInInspector]
+	private DynamicBoneStatus.AnimationKeyFrame[] ElasticityKeyFrames;
+
+	public AnimationCurve elasticityCurve;
+
+	[Header("剛性(揺れ幅)")]
+	[Range(0f, 1f)]
+	public float stiffness = 0.1f;
+
+	[SerializeField]
+	[HideInInspector]
+	private DynamicBoneStatus.AnimationKeyFrame[] StiffnessKeyFrames;
+
+	public AnimationCurve stiffnessCurve;
+
+	[Header("移動距離による物理無視率。値が大きいほど少しの移動では揺れなくなる。")]
+	[Range(0f, 1f)]
+	public float inert;
+
+	[SerializeField]
+	[HideInInspector]
+	private DynamicBoneStatus.AnimationKeyFrame[] InertKeyFrames;
+
+	public AnimationCurve inertCurve;
+
+	[Header("各ノードの当たり判定半径")]
+	public float radius;
+
+	[SerializeField]
+	[HideInInspector]
+	private DynamicBoneStatus.AnimationKeyFrame[] RadiusKeyFrames;
+
+	public AnimationCurve radiusCurve;
+
+	[Header("先端に余分ボーンの追加")]
+	public float endLength;
+
+	[Header("先端に余分ボーンのオフセット座標")]
+	public Vector3 endOffset;
+
+	[Header("重力の向き(形はある程度維持される)")]
+	public Vector3 gravity = Vector3.down * 0.05f;
+
+	[Header("力の向き(形は維持されない)")]
+	public Vector3 force;
+
+	[Header("揺れを「行わない」向きの指定。指定した場合はその向きには揺れなくなる")]
+	public DynamicBoneStatus.FreezeAxis freezeAxis;
+
+	public enum FreezeAxis
+	{
+		None,
+		X,
+		Y,
+		Z
+	}
+
+	[Serializable]
+	public class AnimationKeyFrame
+	{
+		public float time;
+
+		public float value;
+
+		public float inTangent;
+
+		public float outTangent;
+	}
+}

+ 491 - 0
Assembly-CSharp/DynamicMuneBone.cs

@@ -0,0 +1,491 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DynamicMuneBone : MonoBehaviour, IDynamicBone
+{
+	public bool isLeft { get; private set; }
+
+	private float MuneSize
+	{
+		get
+		{
+			return this.GetMaidPropRatio(MPN.MuneL);
+		}
+	}
+
+	public float muneSizeNormalized
+	{
+		get
+		{
+			return this.GetMaidPropNormalized(MPN.MuneL);
+		}
+	}
+
+	private float MuneUpDown
+	{
+		get
+		{
+			return Mathf.Lerp(30f, -30f, this.GetMaidPropNormalized(MPN.MuneUpDown)) * this.MuneSize;
+		}
+	}
+
+	private float MuneYori
+	{
+		get
+		{
+			float num = Mathf.Lerp(12.5f, -12.5f, this.GetMaidPropNormalized(MPN.MuneYori)) * (float)((!this.isLeft) ? -1 : 1);
+			return num * this.MuneSize;
+		}
+	}
+
+	private float MuneDir
+	{
+		get
+		{
+			return Mathf.Lerp(-25f, 25f, this.GetMaidPropNormalized(MPN.MuneDir));
+		}
+	}
+
+	private float MuneYawarakaNormalized
+	{
+		get
+		{
+			return this.GetMaidPropNormalized(MPN.MuneYawaraka);
+		}
+	}
+
+	private Transform Spine
+	{
+		get
+		{
+			return base.transform.parent;
+		}
+	}
+
+	public DynamicMuneYureBone muneYureBone
+	{
+		get
+		{
+			return this.MuneYureBone;
+		}
+	}
+
+	public bool isDynamicReset { get; private set; }
+
+	public float dynamicWeight
+	{
+		get
+		{
+			return this.DynamicWeight;
+		}
+		set
+		{
+			this.DynamicWeight = Mathf.Clamp01(value);
+		}
+	}
+
+	private bool IsSubYureEnable
+	{
+		get
+		{
+			return this.Maid.body0.boVisible_NIP;
+		}
+	}
+
+	public void Init(Maid maid, bool is_left)
+	{
+		this.Maid = maid;
+		this.isLeft = is_left;
+		this.SetUpMunePropValueDic(MPN.MuneL);
+		this.SetUpMunePropValueDic(MPN.MuneYori);
+		this.SetUpMunePropValueDic(MPN.MuneUpDown);
+		this.SetUpMunePropValueDic(MPN.MuneDir);
+		this.SetUpMunePropValueDic(MPN.MuneYawaraka);
+		this.SetUpMunePropValueDic(MPN.MuneLong);
+		this.NotDynamicRot = (this.DefaultLocalRot = base.transform.localRotation);
+		this.MuneSub = base.transform.Find(base.transform.name + "_sub");
+		this.NotDynamicMuneSubRot = (this.DefaultMuneSubLocalRot = this.MuneSub.localRotation);
+		this.DynamicPos = this.GetTargetPos();
+		this.LastMuneYawarakaVal = this.MuneYawarakaNormalized;
+		Transform transform = this.MuneSub.Find(base.transform.name + "_scale");
+		this.MuneYureBone = transform.gameObject.AddComponent<DynamicMuneYureBone>();
+		this.MuneYureBone.Init(this);
+		base.enabled = false;
+		this.isDynamicReset = false;
+	}
+
+	private void SetUpMunePropValueDic(MPN mpn)
+	{
+		this.MunePropValueDic[mpn] = this.Maid.GetProp(mpn).value;
+	}
+
+	private void OnDestroy()
+	{
+		this.UnInit();
+	}
+
+	public void UnInit()
+	{
+		if (this.Maid && this.Maid.body0)
+		{
+			this.Maid.body0.RemoveDynamicBone(this);
+		}
+		this.MuneYureBone.UnInit();
+	}
+
+	public void ApplyMuneProp(MPN mpn, float val)
+	{
+		if (!this.MunePropValueDic.ContainsKey(mpn))
+		{
+			return;
+		}
+		this.MunePropValueDic[mpn] = Mathf.FloorToInt(val * 100f);
+	}
+
+	public void PreUpdate()
+	{
+		if (!base.enabled)
+		{
+			return;
+		}
+		base.transform.localRotation = this.NotDynamicRot;
+		this.MuneSub.localRotation = this.NotDynamicMuneSubRot;
+		Transform transform = base.transform;
+		Vector3 one = Vector3.one;
+		this.MuneSub.localScale = one;
+		transform.localScale = one;
+		this.MuneYureBone.PreUpdate();
+		base.transform.localRotation = this.DefaultLocalRot;
+		base.transform.Rotate(0f, this.MuneYori, this.MuneUpDown);
+		this.NotDynamicRot = base.transform.localRotation;
+		if (this.isDynamicOn)
+		{
+			float a = Mathf.Lerp(180f, 120f, this.muneSizeNormalized);
+			float b = Mathf.Lerp(180f, 160f, Mathf.Clamp01(this.muneSizeNormalized / 0.5f));
+			float num = Mathf.Lerp(a, b, this.GetMaidPropNormalized(MPN.MuneUpDown));
+			num += 40f * Mathf.Abs(Vector3.Dot(this.Spine.up, Vector3.down)) * this.muneSizeNormalized;
+			this.MuneSub.localRotation = Quaternion.Euler(Vector3.forward * (num + this.MuneDir));
+		}
+		else
+		{
+			this.MuneSub.localRotation = this.DefaultMuneSubLocalRot;
+		}
+		this.NotDynamicMuneSubRot = this.MuneSub.localRotation;
+		this.MuneYureBone.CalcMuneEditMove();
+		this.MuneYureBone.SetWeight((float)((!this.IsSubYureEnable) ? 0 : 1));
+	}
+
+	public void PhysicsReset()
+	{
+		this.isDynamicReset = true;
+		this.MuneYureBone.PhysicsReset();
+	}
+
+	public void DynamicUpdate()
+	{
+		if (!base.enabled)
+		{
+			return;
+		}
+		if (this.isDynamicOn)
+		{
+			this.Stiffness = this.GetStiffness();
+			this.Mass = this.MassLerp.GetValue(Mathf.Clamp01((this.MuneYawarakaNormalized - 0.5f) / 0.5f));
+			this.Mass = Mathf.Lerp(1f, this.Mass, Mathf.Clamp01(this.muneSizeNormalized / 0.5f));
+			this.Damping = this.DampingLerp.GetValue(Mathf.Clamp01((this.MuneYawarakaNormalized - 0.5f) / 0.5f));
+			this.Damping = Mathf.Lerp(1f, this.Damping, Mathf.Clamp01(this.muneSizeNormalized / 0.5f));
+			if (this.IsGravityVariable)
+			{
+				float value = Vector3.Dot(this.Spine.right, Vector3.down);
+				float num = Vector3.Dot(this.Spine.up, Vector3.down);
+				bool flag = num < 0f;
+				float d = Mathf.Lerp(this.GravityYLandScape, this.GravityYFaceUpDown, Mathf.Abs(num));
+				float a = Mathf.Sin(180f * this.GetMaidPropNormalized(MPN.MuneYori) * 0.017453292f);
+				float num2;
+				if (flag)
+				{
+					num2 = Mathf.Clamp01(this.GetMaidPropNormalized(MPN.MuneYori) / 0.5f);
+				}
+				else
+				{
+					num2 = 1f - Mathf.Clamp01(this.GetMaidPropNormalized(MPN.MuneYori) / 0.5f);
+				}
+				float num3 = Mathf.Lerp(a, num2, Mathf.Abs(num));
+				this.Gravity = Vector3.Lerp(Vector3.down * this.GravityYMin, Vector3.down * d, (1f - Mathf.Clamp01(value)) * num3);
+				if (flag)
+				{
+					Vector3 vector = Vector3.zero;
+					if (this.isLeft)
+					{
+						vector = this.Spine.rotation * Vector3.forward;
+					}
+					else
+					{
+						vector = this.Spine.rotation * Vector3.back;
+					}
+					vector.y = 0f;
+					vector *= this.GravityXSupine * Mathf.Abs(num) * num2;
+					this.Gravity += vector;
+				}
+			}
+			else
+			{
+				this.Gravity = Vector3.down * 0.01f;
+			}
+			Vector3 targetPos = this.GetTargetPos();
+			Vector3 vector2 = (targetPos - this.DynamicPos) * this.Stiffness;
+			vector2 += this.Gravity;
+			Vector3 a2 = vector2 / this.Mass;
+			this.Velocity += a2 * (1f - this.Damping);
+			if (this.MuneYawarakaNormalized != this.LastMuneYawarakaVal || this.dynamicWeight != this.LastDynamicWeight || this.isDynamicReset)
+			{
+				vector2 = Vector3.zero;
+				a2 = Vector3.zero;
+				this.Velocity = Vector3.zero;
+				if (this.isDynamicReset)
+				{
+					this.DynamicPos = targetPos;
+				}
+				this.isDynamicReset = true;
+			}
+			Vector3 a3 = this.DynamicPos + vector2 + this.Velocity;
+			if (Vector3.Dot((a3 - base.transform.position).normalized, base.transform.rotation * Vector3.left) < Mathf.Cos(this.RimmitAngle * 0.017453292f))
+			{
+				vector2 *= this.RimmitOverBias;
+				this.Velocity *= this.RimmitOverBias;
+			}
+			this.DynamicPos += vector2;
+			this.DynamicPos += this.Velocity;
+			float num4 = (this.MuneYawarakaNormalized < 0.5f) ? (this.MuneYawarakaNormalized / 0.5f) : 1f;
+			this.DynamicPos = Vector3.Lerp(targetPos, this.DynamicPos, num4 * this.dynamicWeight * Mathf.Clamp01(this.muneSizeNormalized / 0.5f));
+			base.transform.rotation = Quaternion.FromToRotation(base.transform.rotation * Vector3.left, this.DynamicPos - base.transform.position) * base.transform.rotation;
+			float magnitude = (this.DynamicPos - targetPos).magnitude;
+			float num5 = -0.2f;
+			float num6 = 0.3f;
+			Vector3 zero = Vector3.zero;
+			zero.x = 1f + magnitude * num6;
+			zero.y = 1f + -magnitude * num5;
+			zero.z = 1f + -magnitude * num5;
+			base.transform.localScale = zero;
+			if (this.MuneXScaling)
+			{
+				Vector3 localScale = base.transform.localScale;
+				Vector3 localScale2 = this.MuneSub.localScale;
+				float num7 = Vector3.Dot(this.Spine.rotation * Vector3.down, Vector3.down) * this.muneSizeNormalized;
+				float num8;
+				float num9;
+				float b;
+				if (num7 > 0f)
+				{
+					num8 = num7 * Vector3.Dot(base.transform.rotation * Vector3.right, Vector3.down);
+					num9 = num7 * Vector3.Dot(this.MuneSub.rotation * Vector3.left, Vector3.down);
+					b = this.GravityXScalingSupine;
+				}
+				else
+				{
+					num7 = Mathf.Abs(num7);
+					num8 = num7 * Vector3.Dot(base.transform.rotation * Vector3.left, Vector3.down);
+					num9 = num7 * Vector3.Dot(this.MuneSub.rotation * Vector3.right, Vector3.down);
+					b = this.GravityXScalingProne;
+				}
+				float num10 = Mathf.Sin(180f * this.GetMaidPropNormalized(MPN.MuneLong) * 0.017453292f);
+				localScale.x *= Mathf.Lerp(1f, b, num8 * num10);
+				localScale2.x *= Mathf.Lerp(1f, b, num9 * num10);
+				base.transform.localScale = localScale;
+				this.MuneSub.localScale = localScale2;
+			}
+			if (this.isDynamicReset)
+			{
+				this.isDynamicReset = false;
+			}
+		}
+		else
+		{
+			this.isDynamicReset = true;
+		}
+		this.MuneYureBone.DynamicUpdate();
+		this.LastDynamicWeight = this.dynamicWeight;
+		this.LastMuneYawarakaVal = this.MuneYawarakaNormalized;
+	}
+
+	private float GetStiffness()
+	{
+		DynamicMuneBone.MathLerpPair mathLerpPair = (!this.IsSubYureEnable) ? this.StiffnessBraLerp : this.StiffnessLerp;
+		float t = Mathf.Pow(this.muneSizeNormalized, (!this.IsSubYureEnable) ? 0.7f : 0.5f);
+		return mathLerpPair.GetValue(t);
+	}
+
+	private Vector3 GetTargetPos()
+	{
+		return base.transform.position + base.transform.rotation * Vector3.left * this.TargetDistance;
+	}
+
+	private float GetMaidPropNormalized(MPN mpn)
+	{
+		if (!this.MunePropValueDic.ContainsKey(mpn))
+		{
+			Debug.LogErrorFormat("MPN:{0}は不正です。胸に関するMPNのみ指定してください", new object[]
+			{
+				mpn
+			});
+			return 0f;
+		}
+		int min = this.Maid.GetProp(mpn).min;
+		int max = this.Maid.GetProp(mpn).max;
+		return Mathf.InverseLerp((float)min, (float)max, (float)this.MunePropValueDic[mpn]);
+	}
+
+	private float GetMaidPropRatio(MPN mpn)
+	{
+		if (!this.MunePropValueDic.ContainsKey(mpn))
+		{
+			Debug.LogErrorFormat("MPN:{0}は不正です。胸に関するMPNのみ指定してください", new object[]
+			{
+				mpn
+			});
+			return 0f;
+		}
+		return (float)this.MunePropValueDic[mpn] / 100f;
+	}
+
+	private const float MUNE_YORI_VAL = 12.5f;
+
+	private const float MUNE_UPDAWN_VAL = 30f;
+
+	private const float MUNE_DIR_VAL = 25f;
+
+	private const float MUNESUB_FALLDOWN_ROT = 40f;
+
+	private Dictionary<MPN, int> MunePropValueDic = new Dictionary<MPN, int>();
+
+	private Maid Maid;
+
+	private float LastMuneYawarakaVal;
+
+	private Quaternion DefaultLocalRot;
+
+	private Transform MuneSub;
+
+	private Quaternion DefaultMuneSubLocalRot;
+
+	private Quaternion NotDynamicRot;
+
+	private Quaternion NotDynamicMuneSubRot;
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float TargetDistance = 0.7f;
+
+	private Vector3 DynamicPos;
+
+	private Vector3 Velocity = Vector3.zero;
+
+	[Header("剛性(揺れ幅)に関するパラメータ")]
+	[SerializeField]
+	private DynamicMuneBone.MathLerpPair StiffnessLerp = new DynamicMuneBone.MathLerpPair(0.22f, 0.055f);
+
+	[SerializeField]
+	private DynamicMuneBone.MathLerpPair StiffnessBraLerp = new DynamicMuneBone.MathLerpPair(0.27f, 0.07f);
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float Stiffness;
+
+	[Header("振り子運動の質量に関するパラメータ")]
+	[SerializeField]
+	private DynamicMuneBone.MathLerpPair MassLerp = new DynamicMuneBone.MathLerpPair(0.4f, 1.5f);
+
+	[SerializeField]
+	[Range(0.4f, 1.5f)]
+	private float Mass = 0.4f;
+
+	[Header("減衰力(揺れを抑制する力)に関するパラメータ")]
+	[SerializeField]
+	private DynamicMuneBone.MathLerpPair DampingLerp = new DynamicMuneBone.MathLerpPair(0.3f, 0.01f);
+
+	[SerializeField]
+	[Range(0.01f, 1f)]
+	private float Damping = 0.3f;
+
+	[SerializeField]
+	[Header("重量可変か")]
+	private bool IsGravityVariable = true;
+
+	[SerializeField]
+	[Header("下にかかる重力の最小値")]
+	[Range(0f, 0.1f)]
+	private float GravityYMin = 0.01f;
+
+	[SerializeField]
+	[Header("体を横にしたときに下にかかる重力")]
+	[Range(0f, 0.1f)]
+	private float GravityYLandScape = 0.03f;
+
+	[SerializeField]
+	[Header("体を仰向けorうつ伏せにしたときに下にかかる重力")]
+	[Range(0f, 0.1f)]
+	private float GravityYFaceUpDown = 0.02f;
+
+	[SerializeField]
+	[Header("仰向けになったとき横方向にかかる重力の値")]
+	[Range(0f, 0.1f)]
+	private float GravityXSupine = 0.02f;
+
+	[SerializeField]
+	[Space]
+	private Vector3 Gravity = Vector3.down * 0.01f;
+
+	[Space]
+	[SerializeField]
+	[Range(0f, 90f)]
+	private float RimmitAngle = 72f;
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float RimmitOverBias = 0.8f;
+
+	private DynamicMuneYureBone MuneYureBone;
+
+	[SerializeField]
+	[Header("物理が有効か")]
+	public bool isDynamicOn = true;
+
+	[SerializeField]
+	[Header("物理の適用度")]
+	[Range(0f, 1f)]
+	private float DynamicWeight = 1f;
+
+	private float LastDynamicWeight = 1f;
+
+	[Header("重力による胸潰れのパラメータ")]
+	[SerializeField]
+	private bool MuneXScaling = true;
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float GravityXScalingSupine = 0.75f;
+
+	[SerializeField]
+	[Range(1f, 2f)]
+	private float GravityXScalingProne = 1.15f;
+
+	[Serializable]
+	private struct MathLerpPair
+	{
+		public MathLerpPair(float t0, float t1)
+		{
+			this.t0Value = t0;
+			this.t1Value = t1;
+		}
+
+		public float GetValue(float t)
+		{
+			return Mathf.Lerp(this.t0Value, this.t1Value, t);
+		}
+
+		public float t0Value;
+
+		public float t1Value;
+	}
+}

+ 836 - 0
Assembly-CSharp/DynamicMuneYureBone.cs

@@ -0,0 +1,836 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DynamicMuneYureBone : MonoBehaviour, IDynamicBone
+{
+	public void Init(DynamicMuneBone mune_bone)
+	{
+		this.m_Exclusions = new List<Transform>();
+		this.m_Root = base.transform;
+		this.MuneBone = mune_bone;
+		Transform transform = null;
+		for (int i = 0; i < base.transform.childCount; i++)
+		{
+			Transform child = base.transform.GetChild(i);
+			if (!child.name.Contains("Mune_") || !child.name.Contains("_yure_"))
+			{
+				this.m_Exclusions.Add(child);
+			}
+			else
+			{
+				for (int j = 0; j < child.childCount; j++)
+				{
+					this.m_Exclusions.Add(child.GetChild(j));
+				}
+				float value = Mathf.Cos((float)(this.BoneYureDataDic.Count * 45) * 0.017453292f);
+				if (this.BoneYureDataDic.Count == 0)
+				{
+					transform = child;
+				}
+				this.BoneYureDataDic[child] = new DynamicMuneYureBone.YureBoneData();
+				this.BoneYureDataDic[child].baseWeight = Mathf.InverseLerp(-1f, 1f, value);
+				this.BoneYureDataDic[child].muneSizeWeight = this.MuneBone.muneSizeNormalized;
+			}
+		}
+		this.CurCenterPos = this.m_Root.position + this.m_Root.rotation * Vector3.left * Vector3.Dot(transform.position - this.m_Root.position, this.m_Root.rotation * Vector3.left);
+		this.LocalCenterPos = this.m_Root.InverseTransformPoint(this.CurCenterPos);
+		this.NotDynamicCenter = (this.LastCenterPos = this.CurCenterPos);
+		this.LastMuneBonePos = this.MuneBone.transform.position;
+		this.SetupParticles();
+		base.enabled = false;
+	}
+
+	public void UnInit()
+	{
+	}
+
+	private void SetupParticles()
+	{
+		this.m_Particles.Clear();
+		if (this.m_Root == null)
+		{
+			return;
+		}
+		this.m_LocalGravity = this.m_Root.InverseTransformDirection(this.m_Gravity);
+		this.m_ObjectScale = Mathf.Abs(base.transform.lossyScale.x);
+		this.m_ObjectPrevPosition = base.transform.position;
+		this.m_ObjectMove = Vector3.zero;
+		this.m_BoneTotalLength = 0f;
+		this.AppendParticles(this.m_Root, -1, 0f);
+		this.UpdateParameters();
+	}
+
+	private void AppendParticles(Transform b, int parentIndex, float boneLength)
+	{
+		DynamicMuneYureBone.Particle particle = new DynamicMuneYureBone.Particle();
+		particle.m_Transform = b;
+		particle.m_ParentIndex = parentIndex;
+		if (b != null)
+		{
+			particle.m_Position = (particle.m_PrevPosition = b.position);
+			particle.m_InitLocalPosition = b.localPosition;
+			particle.m_InitLocalRotation = b.localRotation;
+		}
+		else
+		{
+			Transform transform = this.m_Particles[parentIndex].m_Transform;
+			if (this.m_EndLength > 0f)
+			{
+				Transform parent = transform.parent;
+				if (parent != null)
+				{
+					particle.m_EndOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * this.m_EndLength;
+				}
+				else
+				{
+					particle.m_EndOffset = new Vector3(this.m_EndLength, 0f, 0f);
+				}
+			}
+			else
+			{
+				particle.m_EndOffset = transform.InverseTransformPoint(base.transform.TransformDirection(this.m_EndOffset) + transform.position);
+			}
+			particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset));
+		}
+		if (parentIndex >= 0)
+		{
+			boneLength += (this.m_Particles[parentIndex].m_Transform.position - particle.m_Position).magnitude;
+			particle.m_BoneLength = boneLength;
+			this.m_BoneTotalLength = Mathf.Max(this.m_BoneTotalLength, boneLength);
+		}
+		int count = this.m_Particles.Count;
+		this.m_Particles.Add(particle);
+		if (particle.m_Transform && this.BoneYureDataDic.ContainsKey(particle.m_Transform))
+		{
+			this.BoneYureDataDic[particle.m_Transform].particle = particle;
+		}
+		if (b != null)
+		{
+			for (int i = 0; i < b.childCount; i++)
+			{
+				bool flag = false;
+				if (this.m_Exclusions != null)
+				{
+					for (int j = 0; j < this.m_Exclusions.Count; j++)
+					{
+						Transform x = this.m_Exclusions[j];
+						if (x == b.GetChild(i))
+						{
+							flag = true;
+							break;
+						}
+					}
+				}
+				if (!flag)
+				{
+					this.AppendParticles(b.GetChild(i), count, boneLength);
+				}
+				else if (this.m_EndLength > 0f || this.m_EndOffset != Vector3.zero)
+				{
+					this.AppendParticles(null, count, boneLength);
+				}
+			}
+			if (b.childCount == 0 && (this.m_EndLength > 0f || this.m_EndOffset != Vector3.zero))
+			{
+				this.AppendParticles(null, count, boneLength);
+			}
+		}
+	}
+
+	public void UpdateParameters()
+	{
+		if (this.m_Root == null)
+		{
+			return;
+		}
+		this.m_LocalGravity = this.m_Root.InverseTransformDirection(this.m_Gravity);
+		for (int i = 0; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			particle.m_Damping = ((!this.BoneYureDataDic.ContainsKey(particle.m_Transform)) ? this.m_Damping : this.BoneYureDataDic[particle.m_Transform].damping);
+			particle.m_Elasticity = this.m_Elasticity;
+			particle.m_Stiffness = ((!this.BoneYureDataDic.ContainsKey(particle.m_Transform)) ? this.m_Stiffness : this.BoneYureDataDic[particle.m_Transform].stiffness);
+			particle.m_Inert = ((!this.BoneYureDataDic.ContainsKey(particle.m_Transform)) ? this.m_Inert : this.BoneYureDataDic[particle.m_Transform].inert);
+			particle.m_Radius = this.m_Radius;
+			if (this.m_BoneTotalLength > 0f)
+			{
+				float time = particle.m_BoneLength / this.m_BoneTotalLength;
+				if (this.m_DampingDistrib != null && this.m_DampingDistrib.keys.Length > 0)
+				{
+					particle.m_Damping *= this.m_DampingDistrib.Evaluate(time);
+				}
+				if (this.m_ElasticityDistrib != null && this.m_ElasticityDistrib.keys.Length > 0)
+				{
+					particle.m_Elasticity *= this.m_ElasticityDistrib.Evaluate(time);
+				}
+				if (this.m_StiffnessDistrib != null && this.m_StiffnessDistrib.keys.Length > 0)
+				{
+					particle.m_Stiffness *= this.m_StiffnessDistrib.Evaluate(time);
+				}
+				if (this.m_InertDistrib != null && this.m_InertDistrib.keys.Length > 0)
+				{
+					particle.m_Inert *= this.m_InertDistrib.Evaluate(time);
+				}
+				if (this.m_RadiusDistrib != null && this.m_RadiusDistrib.keys.Length > 0)
+				{
+					particle.m_Radius *= this.m_RadiusDistrib.Evaluate(time);
+				}
+			}
+			particle.m_Damping = Mathf.Clamp01(particle.m_Damping);
+			particle.m_Elasticity = Mathf.Clamp01(particle.m_Elasticity);
+			particle.m_Stiffness = Mathf.Clamp01(particle.m_Stiffness);
+			particle.m_Inert = Mathf.Clamp01(particle.m_Inert);
+			particle.m_Radius = Mathf.Max(particle.m_Radius, 0f);
+		}
+	}
+
+	public void PhysicsReset()
+	{
+		this.ResetParticlesPosition();
+	}
+
+	private void ResetParticlesPosition()
+	{
+		for (int i = 0; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			if (particle.m_Transform != null)
+			{
+				particle.m_Position = (particle.m_PrevPosition = particle.m_Transform.position);
+			}
+			else
+			{
+				Transform transform = this.m_Particles[particle.m_ParentIndex].m_Transform;
+				particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset));
+			}
+		}
+		this.m_ObjectPrevPosition = base.transform.position;
+	}
+
+	public void PreUpdate()
+	{
+		if (this.m_Weight > 0f && (!this.m_DistantDisable || !this.m_DistantDisabled))
+		{
+			this.InitTransforms();
+		}
+	}
+
+	private void InitTransforms()
+	{
+		for (int i = 0; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			if (particle.m_Transform != null)
+			{
+				particle.m_Transform.localPosition = particle.m_InitLocalPosition;
+				particle.m_Transform.localRotation = particle.m_InitLocalRotation;
+			}
+		}
+		if (this.m_Root)
+		{
+			this.NotDynamicCenter = this.GetCenterPos();
+		}
+	}
+
+	public void CalcMuneEditMove()
+	{
+		Vector3 centerPos = this.GetCenterPos();
+		this.MuneEditMove = this.m_Root.InverseTransformVector(this.NotDynamicCenter - centerPos);
+	}
+
+	public void DynamicUpdate()
+	{
+		this.CurCenterPos = this.GetCenterPos();
+		if (this.isDynamicOn)
+		{
+			if (!this.MuneBone.isDynamicReset)
+			{
+				this.m_Force = this.LastCenterPos - this.CurCenterPos;
+				this.m_Force -= this.LastMuneBonePos - this.MuneBone.transform.position;
+			}
+			else
+			{
+				this.m_Force = Vector3.zero;
+			}
+			foreach (DynamicMuneYureBone.YureBoneData yureBoneData in this.BoneYureDataDic.Values)
+			{
+				yureBoneData.muneSizeWeight = this.MuneBone.muneSizeNormalized;
+			}
+			if (this.m_DistantDisable)
+			{
+				this.CheckDistance();
+			}
+			if (this.m_Weight > 0f && (!this.m_DistantDisable || !this.m_DistantDisabled))
+			{
+				float t = (this.m_UpdateMode != DynamicMuneYureBone.UpdateMode.UnscaledTime) ? Time.deltaTime : Time.unscaledDeltaTime;
+				this.UpdateDynamicBones(t);
+			}
+		}
+		this.LastMuneBonePos = this.MuneBone.transform.position;
+		this.LastCenterPos = this.CurCenterPos;
+	}
+
+	private void CheckDistance()
+	{
+		Transform transform = this.m_ReferenceObject;
+		if (transform == null && Camera.main != null)
+		{
+			transform = Camera.main.transform;
+		}
+		if (transform != null)
+		{
+			float sqrMagnitude = (transform.position - base.transform.position).sqrMagnitude;
+			bool flag = sqrMagnitude > this.m_DistanceToObject * this.m_DistanceToObject;
+			if (flag != this.m_DistantDisabled)
+			{
+				if (!flag)
+				{
+					this.ResetParticlesPosition();
+				}
+				this.m_DistantDisabled = flag;
+			}
+		}
+	}
+
+	private void UpdateDynamicBones(float t)
+	{
+		if (this.m_Root == null)
+		{
+			return;
+		}
+		this.m_ObjectScale = Mathf.Abs(base.transform.lossyScale.x);
+		this.m_ObjectMove = base.transform.position - this.m_ObjectPrevPosition;
+		this.m_ObjectPrevPosition = base.transform.position;
+		int num = 1;
+		if (this.m_UpdateRate > 0f)
+		{
+			float num2 = 1f / this.m_UpdateRate;
+			this.m_Time += t;
+			num = 0;
+			while (this.m_Time >= num2)
+			{
+				this.m_Time -= num2;
+				if (++num >= 3)
+				{
+					this.m_Time = 0f;
+					break;
+				}
+			}
+		}
+		if (num > 0)
+		{
+			for (int i = 0; i < num; i++)
+			{
+				this.UpdateParticles1();
+				this.UpdateParticles2();
+				this.m_ObjectMove = Vector3.zero;
+			}
+		}
+		else
+		{
+			this.SkipUpdateParticles();
+		}
+		this.ApplyParticlesToTransforms();
+	}
+
+	private void UpdateParticles1()
+	{
+		Vector3 a = this.m_Gravity;
+		Vector3 normalized = this.m_Gravity.normalized;
+		Vector3 lhs = this.m_Root.TransformDirection(this.m_LocalGravity);
+		Vector3 b = normalized * Mathf.Max(Vector3.Dot(lhs, normalized), 0f);
+		a -= b;
+		Transform parent = this.m_Root.parent;
+		Vector3 normalized2 = this.m_Force.normalized;
+		Vector3 b2 = this.m_Root.TransformVector(this.MuneEditMove);
+		for (int i = 0; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			if (particle.m_ParentIndex >= 0)
+			{
+				Vector3 a2 = particle.m_Position - particle.m_PrevPosition;
+				Vector3 b3 = this.m_ObjectMove * particle.m_Inert;
+				particle.m_PrevPosition = particle.m_Position + b3;
+				float d = (!this.BoneYureDataDic.ContainsKey(particle.m_Transform)) ? 1f : this.BoneYureDataDic[particle.m_Transform].baseWeight;
+				Vector3 vector = (a + this.m_Force * d) * this.m_ObjectScale;
+				if (this.BoneYureDataDic.ContainsKey(particle.m_Transform))
+				{
+					float f = Vector3.Dot(normalized2, (particle.m_Transform.position - this.CurCenterPos).normalized);
+					f = Mathf.Abs(f);
+					float num = Mathf.Acos(f) * 57.29578f;
+					if (float.IsNaN(num))
+					{
+						num = 0f;
+					}
+					vector *= Mathf.Clamp01(num / this.RimmitAngle);
+					vector -= b2;
+				}
+				particle.m_Position += a2 * (1f - particle.m_Damping) + vector + b3;
+			}
+			else
+			{
+				particle.m_PrevPosition = particle.m_Position;
+				particle.m_Position = particle.m_Transform.position;
+			}
+		}
+	}
+
+	private void UpdateParticles2()
+	{
+		Plane plane = default(Plane);
+		for (int i = 1; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			DynamicMuneYureBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
+			float magnitude;
+			if (particle.m_Transform != null)
+			{
+				magnitude = (particle2.m_Transform.position - particle.m_Transform.position).magnitude;
+			}
+			else
+			{
+				magnitude = particle2.m_Transform.localToWorldMatrix.MultiplyVector(particle.m_EndOffset).magnitude;
+			}
+			float num = Mathf.Lerp(1f, particle.m_Stiffness, this.m_Weight);
+			if (num > 0f || particle.m_Elasticity > 0f)
+			{
+				Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix;
+				localToWorldMatrix.SetColumn(3, particle2.m_Position);
+				Vector3 a;
+				if (particle.m_Transform != null)
+				{
+					a = localToWorldMatrix.MultiplyPoint3x4(particle.m_Transform.localPosition);
+				}
+				else
+				{
+					a = localToWorldMatrix.MultiplyPoint3x4(particle.m_EndOffset);
+				}
+				Vector3 a2 = a - particle.m_Position;
+				particle.m_Position += a2 * particle.m_Elasticity;
+				if (num > 0f)
+				{
+					a2 = a - particle.m_Position;
+					float magnitude2 = a2.magnitude;
+					float num2 = magnitude * (1f - num) * 2f;
+					if (magnitude2 > num2)
+					{
+						particle.m_Position += a2 * ((magnitude2 - num2) / magnitude2);
+					}
+				}
+			}
+			if (this.m_Colliders != null)
+			{
+				float particleRadius = particle.m_Radius * this.m_ObjectScale;
+				for (int j = 0; j < this.m_Colliders.Count; j++)
+				{
+					DynamicBoneColliderBase dynamicBoneColliderBase = this.m_Colliders[j];
+					if (dynamicBoneColliderBase != null && dynamicBoneColliderBase.enabled)
+					{
+						dynamicBoneColliderBase.Collide(ref particle.m_Position, particleRadius);
+					}
+				}
+			}
+			if (this.m_FreezeAxis != DynamicMuneYureBone.FreezeAxis.None)
+			{
+				DynamicMuneYureBone.FreezeAxis freezeAxis = this.m_FreezeAxis;
+				if (freezeAxis != DynamicMuneYureBone.FreezeAxis.X)
+				{
+					if (freezeAxis != DynamicMuneYureBone.FreezeAxis.Y)
+					{
+						if (freezeAxis == DynamicMuneYureBone.FreezeAxis.Z)
+						{
+							plane.SetNormalAndPosition(particle2.m_Transform.forward, particle2.m_Position);
+						}
+					}
+					else
+					{
+						plane.SetNormalAndPosition(particle2.m_Transform.up, particle2.m_Position);
+					}
+				}
+				else
+				{
+					plane.SetNormalAndPosition(particle2.m_Transform.right, particle2.m_Position);
+				}
+				particle.m_Position -= plane.normal * plane.GetDistanceToPoint(particle.m_Position);
+			}
+			if (this.BoneYureDataDic.ContainsKey(particle.m_Transform))
+			{
+				Vector3 vector = base.transform.rotation * Vector3.left;
+				Vector3 b = vector * Vector3.Dot(particle.m_Position - this.CurCenterPos, vector);
+				particle.m_Position -= b;
+				float magnitude3 = (particle.m_Transform.position - this.CurCenterPos).magnitude;
+				float magnitude4 = (particle.m_Position - this.CurCenterPos).magnitude;
+				float num3 = magnitude4 / magnitude3;
+				if (num3 > 1f + this.LengthRimmitRange)
+				{
+					particle.m_Position = this.CurCenterPos + (particle.m_Position - this.CurCenterPos) / num3 * (1f + this.LengthRimmitRange);
+				}
+				else if (num3 < 1f - this.LengthRimmitRange)
+				{
+					particle.m_Position = this.CurCenterPos + (particle.m_Position - this.CurCenterPos) / num3 * (1f - this.LengthRimmitRange);
+				}
+			}
+		}
+	}
+
+	private void SkipUpdateParticles()
+	{
+		for (int i = 0; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			if (particle.m_ParentIndex >= 0)
+			{
+				particle.m_PrevPosition += this.m_ObjectMove;
+				particle.m_Position += this.m_ObjectMove;
+				DynamicMuneYureBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
+				float magnitude;
+				if (particle.m_Transform != null)
+				{
+					magnitude = (particle2.m_Transform.position - particle.m_Transform.position).magnitude;
+				}
+				else
+				{
+					magnitude = particle2.m_Transform.localToWorldMatrix.MultiplyVector(particle.m_EndOffset).magnitude;
+				}
+				float num = Mathf.Lerp(1f, particle.m_Stiffness, this.m_Weight);
+				if (num > 0f)
+				{
+					Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix;
+					localToWorldMatrix.SetColumn(3, particle2.m_Position);
+					Vector3 a;
+					if (particle.m_Transform != null)
+					{
+						a = localToWorldMatrix.MultiplyPoint3x4(particle.m_Transform.localPosition);
+					}
+					else
+					{
+						a = localToWorldMatrix.MultiplyPoint3x4(particle.m_EndOffset);
+					}
+					Vector3 a2 = a - particle.m_Position;
+					float magnitude2 = a2.magnitude;
+					float num2 = magnitude * (1f - num) * 2f;
+					if (magnitude2 > num2)
+					{
+						particle.m_Position += a2 * ((magnitude2 - num2) / magnitude2);
+					}
+				}
+				Vector3 a3 = particle2.m_Position - particle.m_Position;
+				float magnitude3 = a3.magnitude;
+				if (magnitude3 > 0f)
+				{
+					particle.m_Position += a3 * ((magnitude3 - magnitude) / magnitude3);
+				}
+			}
+			else
+			{
+				particle.m_PrevPosition = particle.m_Position;
+				particle.m_Position = particle.m_Transform.position;
+			}
+		}
+	}
+
+	private void ApplyParticlesToTransforms()
+	{
+		for (int i = 1; i < this.m_Particles.Count; i++)
+		{
+			DynamicMuneYureBone.Particle particle = this.m_Particles[i];
+			DynamicMuneYureBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
+			if (particle2.m_Transform.childCount <= 1)
+			{
+				Vector3 direction;
+				if (particle.m_Transform != null)
+				{
+					direction = particle.m_Transform.localPosition;
+				}
+				else
+				{
+					direction = particle.m_EndOffset;
+				}
+				Vector3 toDirection = particle.m_Position - particle2.m_Position;
+				Quaternion lhs = Quaternion.FromToRotation(particle2.m_Transform.TransformDirection(direction), toDirection);
+				particle2.m_Transform.rotation = lhs * particle2.m_Transform.rotation;
+			}
+			if (particle.m_Transform != null)
+			{
+				particle.m_Transform.position = particle.m_Position;
+			}
+		}
+	}
+
+	private static Vector3 MirrorVector(Vector3 v, Vector3 axis)
+	{
+		return v - axis * (Vector3.Dot(v, axis) * 2f);
+	}
+
+	public float GetWeight()
+	{
+		return this.m_Weight;
+	}
+
+	public void SetWeight(float w)
+	{
+		if (this.m_Weight != w)
+		{
+			if (w == 0f)
+			{
+				this.InitTransforms();
+			}
+			else if (this.m_Weight == 0f)
+			{
+				this.ResetParticlesPosition();
+			}
+			this.m_Weight = w;
+		}
+	}
+
+	private Vector3 GetCenterPos()
+	{
+		return this.m_Root.TransformPoint(this.LocalCenterPos);
+	}
+
+	private const float YURE_PARAM_MIN = 0.1f;
+
+	private const float YURE_PARAM_MAX = 0.9f;
+
+	[Header("揺れ有効")]
+	public bool isDynamicOn = true;
+
+	[Tooltip("The root of the transform hierarchy to apply physics.")]
+	public Transform m_Root;
+
+	[Tooltip("Internal physics simulation rate.")]
+	public float m_UpdateRate;
+
+	public DynamicMuneYureBone.UpdateMode m_UpdateMode;
+
+	[Tooltip("How much the bones slowed down.")]
+	[Range(0f, 1f)]
+	public float m_Damping = 0.1f;
+
+	public AnimationCurve m_DampingDistrib;
+
+	[Tooltip("How much the force applied to return each bone to original orientation.")]
+	[Range(0f, 1f)]
+	public float m_Elasticity = 0.1f;
+
+	public AnimationCurve m_ElasticityDistrib;
+
+	[Tooltip("How much bone's original orientation are preserved.")]
+	[Range(0f, 1f)]
+	public float m_Stiffness = 0.1f;
+
+	public AnimationCurve m_StiffnessDistrib;
+
+	[Tooltip("How much character's position change is ignored in physics simulation.")]
+	[Range(0f, 1f)]
+	public float m_Inert;
+
+	public AnimationCurve m_InertDistrib;
+
+	[Tooltip("Each bone can be a sphere to collide with colliders. Radius describe sphere's size.")]
+	public float m_Radius;
+
+	public AnimationCurve m_RadiusDistrib;
+
+	[Tooltip("If End Length is not zero, an extra bone is generated at the end of transform hierarchy.")]
+	public float m_EndLength;
+
+	[Tooltip("If End Offset is not zero, an extra bone is generated at the end of transform hierarchy.")]
+	public Vector3 m_EndOffset = Vector3.zero;
+
+	[Tooltip("The force apply to bones. Partial force apply to character's initial pose is cancelled out.")]
+	public Vector3 m_Gravity = Vector3.zero;
+
+	[Tooltip("The force apply to bones.")]
+	public Vector3 m_Force = Vector3.zero;
+
+	[Tooltip("Collider objects interact with the bones.")]
+	public List<DynamicBoneColliderBase> m_Colliders;
+
+	[Tooltip("Bones exclude from physics simulation.")]
+	public List<Transform> m_Exclusions;
+
+	[Tooltip("Constrain bones to move on specified plane.")]
+	public DynamicMuneYureBone.FreezeAxis m_FreezeAxis;
+
+	[Tooltip("Disable physics simulation automatically if character is far from camera or player.")]
+	public bool m_DistantDisable;
+
+	public Transform m_ReferenceObject;
+
+	public float m_DistanceToObject = 20f;
+
+	private Vector3 m_LocalGravity = Vector3.zero;
+
+	private Vector3 m_ObjectMove = Vector3.zero;
+
+	private Vector3 m_ObjectPrevPosition = Vector3.zero;
+
+	private float m_BoneTotalLength;
+
+	private float m_ObjectScale = 1f;
+
+	private float m_Time;
+
+	private float m_Weight = 1f;
+
+	private bool m_DistantDisabled;
+
+	private List<DynamicMuneYureBone.Particle> m_Particles = new List<DynamicMuneYureBone.Particle>();
+
+	private Vector3 LocalCenterPos;
+
+	private Vector3 CurCenterPos;
+
+	private Vector3 LastCenterPos;
+
+	private Dictionary<Transform, DynamicMuneYureBone.YureBoneData> BoneYureDataDic = new Dictionary<Transform, DynamicMuneYureBone.YureBoneData>();
+
+	[SerializeField]
+	[Range(1f, 90f)]
+	private float RimmitAngle = 90f;
+
+	private DynamicMuneBone MuneBone;
+
+	private Vector3 LastMuneBonePos;
+
+	private Vector3 NotDynamicCenter;
+
+	[SerializeField]
+	private Vector3 MuneEditMove;
+
+	[SerializeField]
+	[Range(0f, 1f)]
+	private float LengthRimmitRange = 0.15f;
+
+	public enum UpdateMode
+	{
+		Normal,
+		AnimatePhysics,
+		UnscaledTime
+	}
+
+	public enum FreezeAxis
+	{
+		None,
+		X,
+		Y,
+		Z
+	}
+
+	[Serializable]
+	private class Particle
+	{
+		public Transform m_Transform;
+
+		public int m_ParentIndex = -1;
+
+		public float m_Damping;
+
+		public float m_Elasticity;
+
+		public float m_Stiffness;
+
+		public float m_Inert;
+
+		public float m_Radius;
+
+		public float m_BoneLength;
+
+		public Vector3 m_Position = Vector3.zero;
+
+		public Vector3 m_PrevPosition = Vector3.zero;
+
+		public Vector3 m_EndOffset = Vector3.zero;
+
+		public Vector3 m_InitLocalPosition = Vector3.zero;
+
+		public Quaternion m_InitLocalRotation = Quaternion.identity;
+	}
+
+	private class YureBoneData
+	{
+		public DynamicMuneYureBone.Particle particle
+		{
+			get
+			{
+				return this.Particle;
+			}
+			set
+			{
+				this.Particle = value;
+				this.UpdateParticleParam();
+			}
+		}
+
+		public float baseWeight
+		{
+			get
+			{
+				return this.BaseWeight;
+			}
+			set
+			{
+				this.BaseWeight = Mathf.Clamp01(value);
+				this.UpdateParticleParam();
+			}
+		}
+
+		public float muneSizeWeight
+		{
+			get
+			{
+				return this.MuneSizeWeight;
+			}
+			set
+			{
+				this.MuneSizeWeight = Mathf.Clamp01(value);
+				this.UpdateParticleParam();
+			}
+		}
+
+		public float damping
+		{
+			get
+			{
+				float b = Mathf.Lerp(0.1f, 0.9f, 1f - this.baseWeight);
+				return Mathf.Lerp(1f, b, this.MuneSizeWeight);
+			}
+		}
+
+		public float stiffness
+		{
+			get
+			{
+				float b = Mathf.Lerp(0.1f, 0.9f, 1f - this.baseWeight);
+				return Mathf.Lerp(1f, b, this.MuneSizeWeight);
+			}
+		}
+
+		public float inert
+		{
+			get
+			{
+				float b = Mathf.Lerp(0.1f, 0.9f, 1f - this.baseWeight);
+				return Mathf.Lerp(1f, b, this.MuneSizeWeight);
+			}
+		}
+
+		private void UpdateParticleParam()
+		{
+			if (this.particle != null)
+			{
+				this.particle.m_Stiffness = this.stiffness;
+				this.particle.m_Damping = this.damping;
+				this.particle.m_Inert = this.inert;
+			}
+		}
+
+		private DynamicMuneYureBone.Particle Particle;
+
+		private float BaseWeight;
+
+		private float MuneSizeWeight;
+	}
+}

File diff suppressed because it is too large
+ 26 - 11
Assembly-CSharp/DynamicSkirtBone.cs


+ 927 - 0
Assembly-CSharp/DynamicYureBone.cs

@@ -0,0 +1,927 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using kt.Physics;
+using kt.Serialization;
+using kt.Utility;
+using UnityEngine;
+
+public class DynamicYureBone : MonoBehaviour, IDynamicBone
+{
+	public DynamicBoneStatus status
+	{
+		get
+		{
+			return this.Status;
+		}
+	}
+
+	private string ColliderRootName
+	{
+		get
+		{
+			return base.name.Replace("_SM_", string.Empty) + " Collider";
+		}
+	}
+
+	public void Init(TBody body, bool particle_setup, params Transform[] rootbones)
+	{
+		this.isEventExecAuto = false;
+		foreach (Transform root_bone in rootbones)
+		{
+			this.AddRootBone(root_bone);
+		}
+		this.Body = body;
+		this.ColliderSearchRoot = this.Body.m_trBones;
+		this.InitLimbColiders();
+		if (particle_setup)
+		{
+			this.SetupParticles();
+		}
+	}
+
+	private void InitLimbColiders()
+	{
+		foreach (LimbColliderMgr.LimbType limbType in (LimbColliderMgr.LimbType[])Enum.GetValues(typeof(LimbColliderMgr.LimbType)))
+		{
+			DynamicYureBone.LimbColliderInfo limbColliderInfo = new DynamicYureBone.LimbColliderInfo();
+			limbColliderInfo.isEnable = true;
+			limbColliderInfo.limbType = limbType;
+			limbColliderInfo.collider = this.Body.limbColliderMgr.GetCollider(limbType);
+			this.LimbColliderInfoList.Add(limbColliderInfo);
+		}
+	}
+
+	private void Start()
+	{
+		if (this.NodeDataList.Count == 0)
+		{
+			this.AddRootBone(base.transform);
+		}
+		if (!this.IsParticleSetUped && this.isEventExecAuto)
+		{
+			this.SetupParticles();
+		}
+	}
+
+	public void Save(StreamWriter writer)
+	{
+		string value = JsonUtility.ToJson(this.Status, true);
+		writer.Write(value);
+	}
+
+	public void SaveCollider(StreamWriter writer)
+	{
+		DynamicBoneColliderData dynamicBoneColliderData = new DynamicBoneColliderData();
+		dynamicBoneColliderData.colliderStatusList = (from col in this.colliderList
+		where col != null
+		select col.status).ToList<NativeColliderStatus>();
+		dynamicBoneColliderData.limbEnableList = this.LimbColliderInfoList;
+		Dictionary<Transform, Transform> dictionary = new Dictionary<Transform, Transform>();
+		foreach (ANativeColliderBase anativeColliderBase in this.colliderList)
+		{
+			Transform parent = anativeColliderBase.transform.parent;
+			Transform parent2 = parent.parent;
+			dictionary[parent2] = parent;
+			anativeColliderBase.transform.SetParent(parent2, true);
+		}
+		string value = JsonUtility.ToJson(dynamicBoneColliderData, true);
+		writer.Write(value);
+		foreach (ANativeColliderBase anativeColliderBase2 in this.colliderList)
+		{
+			Transform parent3 = anativeColliderBase2.transform.parent;
+			anativeColliderBase2.transform.SetParent(dictionary[parent3], true);
+		}
+	}
+
+	public void Load(StreamReader reader)
+	{
+		string json = reader.ReadToEnd();
+		this.Status = JsonUtility.FromJson<DynamicBoneStatus>(json);
+		this.UpdateParameters();
+	}
+
+	public void LoadCollider(StreamReader reader)
+	{
+		if (!this.ColliderSearchRoot)
+		{
+			DebugUtility.Assert.Call("DynamicYureBone:コライダーの親が設定されてません");
+		}
+		string json = reader.ReadToEnd();
+		DynamicBoneColliderData dynamicBoneColliderData = JsonUtility.FromJson<DynamicBoneColliderData>(json);
+		if (this.colliderList == null)
+		{
+			this.colliderList = new List<ANativeColliderBase>();
+		}
+		else
+		{
+			for (int i = 0; i < this.colliderList.Count; i++)
+			{
+				UnityEngine.Object.DestroyImmediate(this.colliderList[i].gameObject);
+			}
+			this.colliderList.Clear();
+		}
+		List<NativeColliderStatus> colliderStatusList = dynamicBoneColliderData.colliderStatusList;
+		for (int j = 0; j < colliderStatusList.Count; j++)
+		{
+			GameObject gameObject = new GameObject("Collider");
+			NativeColliderStatus nativeColliderStatus = colliderStatusList[j];
+			ANativeColliderBase anativeColliderBase = null;
+			switch (nativeColliderStatus.colliderType)
+			{
+			case NativeColliderStatus.ColliderType.Plane:
+				anativeColliderBase = gameObject.AddComponent<NativePlaneCollider>();
+				break;
+			case NativeColliderStatus.ColliderType.Capsule:
+				anativeColliderBase = gameObject.AddComponent<NativeCapsuleCollider>();
+				break;
+			case NativeColliderStatus.ColliderType.Sphere:
+				anativeColliderBase = gameObject.AddComponent<NativeSphereCollider>();
+				break;
+			case NativeColliderStatus.ColliderType.MaidPropCol:
+			{
+				NativeMaidPropCollider nativeMaidPropCollider = gameObject.AddComponent<NativeMaidPropCollider>();
+				if (this.Body)
+				{
+					nativeMaidPropCollider.SetChara(this.Body.maid);
+				}
+				anativeColliderBase = nativeMaidPropCollider;
+				break;
+			}
+			}
+			if (anativeColliderBase)
+			{
+				anativeColliderBase.SetStatus(nativeColliderStatus, this.Body);
+				this.colliderList.Add(anativeColliderBase);
+				this.CreateColliderRoot(anativeColliderBase);
+			}
+		}
+		this.LimbColliderInfoList = dynamicBoneColliderData.limbEnableList;
+		for (int k = 0; k < this.LimbColliderInfoList.Count; k++)
+		{
+			LimbColliderMgr.LimbType limbType = this.LimbColliderInfoList[k].limbType;
+			this.LimbColliderInfoList[k].collider = this.Body.limbColliderMgr.GetCollider(limbType);
+		}
+	}
+
+	private void CreateColliderRoot(ANativeColliderBase collider)
+	{
+		Transform parent = collider.transform.parent;
+		Transform transform = parent.Find(this.ColliderRootName);
+		if (!transform)
+		{
+			transform = new GameObject(this.ColliderRootName).transform;
+			transform.SetParent(parent, false);
+			this.ColliderRoots.Add(transform);
+		}
+		collider.transform.SetParent(transform, true);
+	}
+
+	private void AddRootBone(Transform root_bone)
+	{
+		if (!this.RootBones.Contains(root_bone))
+		{
+			this.NodeDataList.Add(new DynamicYureBone.NodeData(root_bone));
+			this.RootBones.Add(root_bone);
+		}
+	}
+
+	private void SetupParticles()
+	{
+		this.ObjectScale = Mathf.Abs(base.transform.lossyScale.x);
+		this.ObjectPrevPosition = base.transform.position;
+		this.ObjectMove = Vector3.zero;
+		this.MaxParticleCount = 0;
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			nodeData.particles.Clear();
+			nodeData.defaultRotation = nodeData.rootBone.rotation;
+			nodeData.localGravity = nodeData.rootBone.InverseTransformDirection(this.status.gravity);
+			this.AppendParticles(nodeData, nodeData.rootBone, -1, 0f);
+		}
+		this.UpdateParameters();
+		this.IsParticleSetUped = true;
+	}
+
+	private void AppendParticles(DynamicYureBone.NodeData data, Transform b, int parentIndex, float boneLength)
+	{
+		DynamicYureBone.Particle particle = new DynamicYureBone.Particle();
+		particle.transform = b;
+		particle.parentIndex = parentIndex;
+		List<DynamicYureBone.Particle> particles = data.particles;
+		if (b != null)
+		{
+			particle.position = (particle.prevPosition = b.position);
+			particle.initLocalPosition = b.localPosition;
+			particle.initLocalRotation = b.localRotation;
+		}
+		else
+		{
+			Transform transform = particles[parentIndex].transform;
+			if (this.status.endLength > 0f)
+			{
+				Transform parent = transform.parent;
+				if (parent != null)
+				{
+					particle.endOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * this.status.endLength;
+				}
+				else
+				{
+					particle.endOffset = new Vector3(this.status.endLength, 0f, 0f);
+				}
+			}
+			else
+			{
+				particle.endOffset = transform.InverseTransformPoint(base.transform.TransformDirection(this.status.endOffset) + transform.position);
+			}
+			particle.position = (particle.prevPosition = transform.TransformPoint(particle.endOffset));
+		}
+		if (parentIndex >= 0)
+		{
+			boneLength += (particles[parentIndex].transform.position - particle.position).magnitude;
+			particle.boneLength = boneLength;
+			data.boneTotalLength = Mathf.Max(data.boneTotalLength, boneLength);
+		}
+		int count = particles.Count;
+		particles.Add(particle);
+		this.MaxParticleCount = Mathf.Max(this.MaxParticleCount, particles.Count);
+		if (b != null)
+		{
+			for (int i = 0; i < b.childCount; i++)
+			{
+				bool flag = false;
+				if (this.exclusions != null)
+				{
+					for (int j = 0; j < this.exclusions.Count; j++)
+					{
+						Transform x = this.exclusions[j];
+						if (x == b.GetChild(i))
+						{
+							flag = true;
+							break;
+						}
+					}
+				}
+				if (!flag)
+				{
+					this.AppendParticles(data, b.GetChild(i), count, boneLength);
+				}
+				else if (this.status.endLength > 0f || this.status.endOffset != Vector3.zero)
+				{
+					this.AppendParticles(data, null, count, boneLength);
+				}
+			}
+			if (b.childCount == 0 && (this.status.endLength > 0f || this.status.endOffset != Vector3.zero))
+			{
+				this.AppendParticles(data, null, count, boneLength);
+			}
+		}
+	}
+
+	public void UpdateParameters()
+	{
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			nodeData.localGravity = Quaternion.Inverse(nodeData.defaultRotation) * this.status.gravity;
+			for (int i = 0; i < nodeData.particles.Count; i++)
+			{
+				DynamicYureBone.Particle particle = nodeData.particles[i];
+				particle.damping = this.status.damping;
+				particle.elasticity = this.status.elasticity;
+				particle.stiffness = this.status.stiffness;
+				particle.inert = this.status.inert;
+				particle.radius = this.status.radius;
+				if (nodeData.boneTotalLength > 0f)
+				{
+					float time = particle.boneLength / nodeData.boneTotalLength;
+					if (this.status.dampingCurve != null && this.status.dampingCurve.keys.Length > 0)
+					{
+						particle.damping *= this.status.dampingCurve.Evaluate(time);
+					}
+					if (this.status.elasticityCurve != null && this.status.elasticityCurve.keys.Length > 0)
+					{
+						particle.elasticity *= this.status.elasticityCurve.Evaluate(time);
+					}
+					if (this.status.stiffnessCurve != null && this.status.stiffnessCurve.keys.Length > 0)
+					{
+						particle.stiffness *= this.status.stiffnessCurve.Evaluate(time);
+					}
+					if (this.status.inertCurve != null && this.status.inertCurve.keys.Length > 0)
+					{
+						particle.inert *= this.status.inertCurve.Evaluate(time);
+					}
+					if (this.status.radiusCurve != null && this.status.radiusCurve.keys.Length > 0)
+					{
+						particle.radius *= this.status.radiusCurve.Evaluate(time);
+					}
+				}
+				particle.damping = Mathf.Clamp01(particle.damping);
+				particle.elasticity = Mathf.Clamp01(particle.elasticity);
+				particle.stiffness = Mathf.Clamp01(particle.stiffness);
+				particle.inert = Mathf.Clamp01(particle.inert);
+				particle.radius = Mathf.Max(particle.radius, 0f);
+			}
+		}
+	}
+
+	private void OnDestroy()
+	{
+		this.UnInit();
+	}
+
+	public void UnInit()
+	{
+		for (int i = 0; i < this.ColliderRoots.Count; i++)
+		{
+			if (this.ColliderRoots[i])
+			{
+				UnityEngine.Object.DestroyImmediate(this.ColliderRoots[i].gameObject);
+			}
+		}
+		this.ColliderRoots.Clear();
+		this.colliderList.Clear();
+		this.LimbColliderInfoList.Clear();
+	}
+
+	private void OnEnable()
+	{
+		this.ResetParticlesPosition();
+	}
+
+	private void OnDisable()
+	{
+		this.InitTransforms();
+	}
+
+	public void PhysicsReset()
+	{
+		this.ResetParticlesPosition();
+	}
+
+	private void ResetParticlesPosition()
+	{
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			List<DynamicYureBone.Particle> particles = nodeData.particles;
+			for (int i = 0; i < particles.Count; i++)
+			{
+				DynamicYureBone.Particle particle = particles[i];
+				if (particle.transform != null)
+				{
+					particle.position = (particle.prevPosition = particle.transform.position);
+				}
+				else
+				{
+					Transform transform = particles[particle.parentIndex].transform;
+					particle.position = (particle.prevPosition = transform.TransformPoint(particle.endOffset));
+				}
+			}
+		}
+		this.ObjectPrevPosition = base.transform.position;
+	}
+
+	private void FixedUpdate()
+	{
+		if (this.isEventExecAuto && this.updateMode == DynamicYureBone.UpdateMode.AnimatePhysics)
+		{
+			this.PreUpdate();
+		}
+	}
+
+	private void Update()
+	{
+		if (this.isEventExecAuto && this.updateMode != DynamicYureBone.UpdateMode.AnimatePhysics)
+		{
+			this.PreUpdate();
+		}
+	}
+
+	public void PreUpdate()
+	{
+		if (this.Weight > 0f && (!this.distantDisable || !this.DistantDisabled))
+		{
+			this.InitTransforms();
+		}
+	}
+
+	private void InitTransforms()
+	{
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			for (int i = 0; i < nodeData.particles.Count; i++)
+			{
+				DynamicYureBone.Particle particle = nodeData.particles[i];
+				if (particle.transform != null)
+				{
+					particle.transform.localPosition = particle.initLocalPosition;
+					particle.transform.localRotation = particle.initLocalRotation;
+				}
+			}
+		}
+	}
+
+	private void LateUpdate()
+	{
+		if (!this.isEventExecAuto)
+		{
+			return;
+		}
+		this.DynamicUpdate();
+	}
+
+	public void DynamicUpdate()
+	{
+		if (!base.enabled)
+		{
+			return;
+		}
+		if (!this.IsParticleSetUped)
+		{
+			this.SetupParticles();
+		}
+		if (!this.isEventExecAuto)
+		{
+			this.PreUpdate();
+		}
+		if (this.distantDisable)
+		{
+			this.CheckDistance();
+		}
+		if (this.Weight > 0f && (!this.distantDisable || !this.DistantDisabled))
+		{
+			float t = (this.updateMode != DynamicYureBone.UpdateMode.UnscaledTime) ? Time.deltaTime : Time.unscaledDeltaTime;
+			this.UpdateDynamicBones(t);
+		}
+	}
+
+	private void CheckDistance()
+	{
+		Transform transform = this.referenceObject;
+		if (transform == null && Camera.main != null)
+		{
+			transform = Camera.main.transform;
+		}
+		if (transform != null)
+		{
+			float sqrMagnitude = (transform.position - base.transform.position).sqrMagnitude;
+			bool flag = sqrMagnitude > this.distanceToObject * this.distanceToObject;
+			if (flag != this.DistantDisabled)
+			{
+				if (!flag)
+				{
+					this.ResetParticlesPosition();
+				}
+				this.DistantDisabled = flag;
+			}
+		}
+	}
+
+	private void UpdateDynamicBones(float t)
+	{
+		this.ObjectScale = Mathf.Abs(base.transform.lossyScale.x);
+		this.ObjectMove = base.transform.position - this.ObjectPrevPosition;
+		this.ObjectPrevPosition = base.transform.position;
+		int num = 1;
+		if (this.updateRate > 0f)
+		{
+			float num2 = 1f / this.updateRate;
+			this.Timer += t;
+			num = 0;
+			while (this.Timer >= num2)
+			{
+				this.Timer -= num2;
+				if (++num >= 3)
+				{
+					this.Timer = 0f;
+					break;
+				}
+			}
+		}
+		for (int i = 0; i < this.MaxParticleCount; i++)
+		{
+			if (num > 0)
+			{
+				this.UpdateParticles1(i);
+				this.UpdateParticles2(i);
+			}
+			else
+			{
+				this.SkipUpdateParticles(i);
+			}
+		}
+		this.ObjectMove = Vector3.zero;
+		this.ApplyParticlesToTransforms();
+	}
+
+	private void UpdateParticles1(int index)
+	{
+		Vector3 normalized = this.status.gravity.normalized;
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			List<DynamicYureBone.Particle> particles = nodeData.particles;
+			if (index < particles.Count)
+			{
+				DynamicYureBone.Particle particle = particles[index];
+				Vector3 vector = this.status.gravity;
+				Vector3 lhs = nodeData.rootBone.TransformDirection(nodeData.localGravity);
+				Vector3 b = normalized * Mathf.Max(Vector3.Dot(lhs, normalized), 0f);
+				vector -= b;
+				vector = (vector + this.status.force) * this.ObjectScale;
+				if (particle.parentIndex >= 0)
+				{
+					Vector3 a = particle.position - particle.prevPosition;
+					Vector3 b2 = this.ObjectMove * particle.inert;
+					particle.prevPosition = particle.position + b2;
+					particle.position += a * (1f - particle.damping) + vector + b2;
+				}
+				else
+				{
+					particle.prevPosition = particle.position;
+					particle.position = particle.transform.position;
+				}
+			}
+		}
+	}
+
+	private void UpdateParticles2(int index)
+	{
+		if (index == 0)
+		{
+			return;
+		}
+		Plane plane = default(Plane);
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			List<DynamicYureBone.Particle> particles = nodeData.particles;
+			if (index < particles.Count)
+			{
+				DynamicYureBone.Particle particle = particles[index];
+				DynamicYureBone.Particle particle2 = particles[particle.parentIndex];
+				float magnitude;
+				if (particle.transform != null)
+				{
+					magnitude = (particle2.transform.position - particle.transform.position).magnitude;
+				}
+				else
+				{
+					magnitude = particle2.transform.localToWorldMatrix.MultiplyVector(particle.endOffset).magnitude;
+				}
+				float num = Mathf.Lerp(1f, particle.stiffness, this.Weight);
+				if (num > 0f || particle.elasticity > 0f)
+				{
+					Matrix4x4 localToWorldMatrix = particle2.transform.localToWorldMatrix;
+					localToWorldMatrix.SetColumn(3, particle2.position);
+					Vector3 a;
+					if (particle.transform != null)
+					{
+						a = localToWorldMatrix.MultiplyPoint3x4(particle.transform.localPosition);
+					}
+					else
+					{
+						a = localToWorldMatrix.MultiplyPoint3x4(particle.endOffset);
+					}
+					Vector3 a2 = a - particle.position;
+					particle.position += a2 * particle.elasticity;
+					if (num > 0f)
+					{
+						a2 = a - particle.position;
+						float magnitude2 = a2.magnitude;
+						float num2 = magnitude * (1f - num) * 2f;
+						if (magnitude2 > num2)
+						{
+							particle.position += a2 * ((magnitude2 - num2) / magnitude2);
+						}
+					}
+				}
+				float radius = particle.radius * this.ObjectScale;
+				if (this.colliderList != null)
+				{
+					for (int i = 0; i < this.colliderList.Count; i++)
+					{
+						ANativeColliderBase anativeColliderBase = this.colliderList[i];
+						if (anativeColliderBase != null && anativeColliderBase.enabled)
+						{
+							anativeColliderBase.Collide(ref particle.position, radius);
+						}
+					}
+				}
+				if (this.floorPlaneColider)
+				{
+					this.floorPlaneColider.Collide(ref particle.position, radius);
+				}
+				for (int j = 0; j < this.LimbColliderInfoList.Count; j++)
+				{
+					if (this.LimbColliderInfoList[j].isEnable)
+					{
+						this.LimbColliderInfoList[j].collider.Collide(ref particle.position, radius);
+					}
+				}
+				if (this.status.freezeAxis != DynamicBoneStatus.FreezeAxis.None)
+				{
+					DynamicBoneStatus.FreezeAxis freezeAxis = this.status.freezeAxis;
+					if (freezeAxis != DynamicBoneStatus.FreezeAxis.X)
+					{
+						if (freezeAxis != DynamicBoneStatus.FreezeAxis.Y)
+						{
+							if (freezeAxis == DynamicBoneStatus.FreezeAxis.Z)
+							{
+								plane.SetNormalAndPosition(particle2.transform.forward, particle2.position);
+							}
+						}
+						else
+						{
+							plane.SetNormalAndPosition(particle2.transform.up, particle2.position);
+						}
+					}
+					else
+					{
+						plane.SetNormalAndPosition(particle2.transform.right, particle2.position);
+					}
+					particle.position -= plane.normal * plane.GetDistanceToPoint(particle.position);
+				}
+				Vector3 a3 = particle2.position - particle.position;
+				float magnitude3 = a3.magnitude;
+				if (magnitude3 > 0f)
+				{
+					particle.position += a3 * ((magnitude3 - magnitude) / magnitude3);
+				}
+			}
+		}
+	}
+
+	private static Vector3 MirrorVector(Vector3 v, Vector3 axis)
+	{
+		return v - axis * (Vector3.Dot(v, axis) * 2f);
+	}
+
+	private void SkipUpdateParticles(int index)
+	{
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			List<DynamicYureBone.Particle> particles = nodeData.particles;
+			if (index < particles.Count)
+			{
+				DynamicYureBone.Particle particle = particles[index];
+				if (particle.parentIndex >= 0)
+				{
+					particle.prevPosition += this.ObjectMove;
+					particle.position += this.ObjectMove;
+					DynamicYureBone.Particle particle2 = particles[particle.parentIndex];
+					float magnitude;
+					if (particle.transform != null)
+					{
+						magnitude = (particle2.transform.position - particle.transform.position).magnitude;
+					}
+					else
+					{
+						magnitude = particle2.transform.localToWorldMatrix.MultiplyVector(particle.endOffset).magnitude;
+					}
+					float num = Mathf.Lerp(1f, particle.stiffness, this.Weight);
+					if (num > 0f)
+					{
+						Matrix4x4 localToWorldMatrix = particle2.transform.localToWorldMatrix;
+						localToWorldMatrix.SetColumn(3, particle2.position);
+						Vector3 a;
+						if (particle.transform != null)
+						{
+							a = localToWorldMatrix.MultiplyPoint3x4(particle.transform.localPosition);
+						}
+						else
+						{
+							a = localToWorldMatrix.MultiplyPoint3x4(particle.endOffset);
+						}
+						Vector3 a2 = a - particle.position;
+						float magnitude2 = a2.magnitude;
+						float num2 = magnitude * (1f - num) * 2f;
+						if (magnitude2 > num2)
+						{
+							particle.position += a2 * ((magnitude2 - num2) / magnitude2);
+						}
+					}
+					Vector3 a3 = particle2.position - particle.position;
+					float magnitude3 = a3.magnitude;
+					if (magnitude3 > 0f)
+					{
+						particle.position += a3 * ((magnitude3 - magnitude) / magnitude3);
+					}
+				}
+				else
+				{
+					particle.prevPosition = particle.position;
+					particle.position = particle.transform.position;
+				}
+			}
+		}
+	}
+
+	private void ApplyParticlesToTransforms()
+	{
+		foreach (DynamicYureBone.NodeData nodeData in this.NodeDataList)
+		{
+			List<DynamicYureBone.Particle> particles = nodeData.particles;
+			for (int i = 1; i < particles.Count; i++)
+			{
+				DynamicYureBone.Particle particle = particles[i];
+				DynamicYureBone.Particle particle2 = particles[particle.parentIndex];
+				if (particle2.transform.childCount <= 1)
+				{
+					Vector3 direction;
+					if (particle.transform != null)
+					{
+						direction = particle.transform.localPosition;
+					}
+					else
+					{
+						direction = particle.endOffset;
+					}
+					Vector3 toDirection = particle.position - particle2.position;
+					Quaternion lhs = Quaternion.FromToRotation(particle2.transform.TransformDirection(direction), toDirection);
+					particle2.transform.rotation = lhs * particle2.transform.rotation;
+				}
+				if (particle.transform != null)
+				{
+					particle.transform.position = particle.position;
+				}
+			}
+		}
+	}
+
+	public float GetWeight()
+	{
+		return this.Weight;
+	}
+
+	public void SetWeight(float w)
+	{
+		if (this.Weight != w)
+		{
+			if (w == 0f)
+			{
+				this.InitTransforms();
+			}
+			else if (this.Weight == 0f)
+			{
+				this.ResetParticlesPosition();
+			}
+			this.Weight = w;
+		}
+	}
+
+	public const string STATUS_FILE_EXTENTION = "dbconf";
+
+	public const string COLLIDER_FILE_EXTENTION = "dbcol";
+
+	[SerializeField]
+	private TBody Body;
+
+	[SerializeField]
+	private Transform ColliderSearchRoot;
+
+	[SerializeField]
+	[Header("揺れボーンリスト")]
+	[ReadOnly]
+	[Space]
+	private List<Transform> RootBones = new List<Transform>();
+
+	[Header("更新頻度。0だと現在のFPSに依存する")]
+	[Tooltip("Internal physics simulation rate.")]
+	public float updateRate;
+
+	public DynamicYureBone.UpdateMode updateMode;
+
+	[Header("適用してるパラメータ設定ファイル")]
+	[ReadOnly]
+	public string loadConfigFile = string.Empty;
+
+	[SerializeField]
+	private DynamicBoneStatus Status = new DynamicBoneStatus();
+
+	[Header("適用してる当たり判定設定ファイル")]
+	[ReadOnly]
+	public string loadColliderFile = string.Empty;
+
+	[SerializeField]
+	private List<DynamicYureBone.LimbColliderInfo> LimbColliderInfoList = new List<DynamicYureBone.LimbColliderInfo>();
+
+	[Tooltip("Collider objects interact with the bones.")]
+	public List<ANativeColliderBase> colliderList;
+
+	[Header("床コライダー")]
+	public NativePlaneCollider floorPlaneColider;
+
+	private List<Transform> ColliderRoots = new List<Transform>();
+
+	[Header("物理計算から特別に除外するノード(子供も動かなくなる)")]
+	[Tooltip("Bones exclude from physics simulation.")]
+	public List<Transform> exclusions;
+
+	[Header("距離による物理自動無効化")]
+	[Tooltip("Disable physics simulation automatically if character is far from camera or player.")]
+	public bool distantDisable;
+
+	public Transform referenceObject;
+
+	public float distanceToObject = 20f;
+
+	private Vector3 ObjectMove = Vector3.zero;
+
+	private Vector3 ObjectPrevPosition = Vector3.zero;
+
+	private float ObjectScale = 1f;
+
+	private float Timer;
+
+	private float Weight = 1f;
+
+	private bool DistantDisabled;
+
+	private List<DynamicYureBone.NodeData> NodeDataList = new List<DynamicYureBone.NodeData>();
+
+	[Header("自動で物理処理を更新するか")]
+	public bool isEventExecAuto = true;
+
+	private int MaxParticleCount;
+
+	private bool IsParticleSetUped;
+
+	[Serializable]
+	public class LimbColliderInfo : ASerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		[ReadOnly]
+		public LimbColliderMgr.LimbType limbType;
+
+		public bool isEnable;
+
+		[NonSerialized]
+		public NativeCapsuleCollider collider;
+	}
+
+	public enum UpdateMode
+	{
+		Normal,
+		AnimatePhysics,
+		UnscaledTime
+	}
+
+	public class Particle
+	{
+		public Transform transform;
+
+		public int parentIndex = -1;
+
+		public float damping;
+
+		public float elasticity;
+
+		public float stiffness;
+
+		public float inert;
+
+		public float radius;
+
+		public float boneLength;
+
+		public Vector3 position = Vector3.zero;
+
+		public Vector3 prevPosition = Vector3.zero;
+
+		public Vector3 endOffset = Vector3.zero;
+
+		public Vector3 initLocalPosition = Vector3.zero;
+
+		public Quaternion initLocalRotation = Quaternion.identity;
+	}
+
+	private class NodeData
+	{
+		public NodeData(Transform root)
+		{
+			this.rootBone = root;
+			this.defaultRotation = root.rotation;
+		}
+
+		public DynamicYureBone.Particle GetParticle(int index)
+		{
+			return this.particles[index];
+		}
+
+		public readonly Transform rootBone;
+
+		public List<DynamicYureBone.Particle> particles = new List<DynamicYureBone.Particle>();
+
+		public Vector3 localGravity;
+
+		public float boneTotalLength;
+
+		public Quaternion defaultRotation;
+	}
+}

+ 1 - 1
Assembly-CSharp/EditMod.cs

@@ -303,7 +303,7 @@ public class EditMod : MonoBehaviour
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("CM3D2_MOD");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		binaryWriter.Write(value);
 		binaryWriter.Write(text2.ToLower());
 		binaryWriter.Write(value2);

+ 173 - 0
Assembly-CSharp/ElbowKneeIKCtrl.cs

@@ -0,0 +1,173 @@
+using System;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class ElbowKneeIKCtrl : ALimbIKCtrl
+{
+	public ElbowKneeIKCtrl(FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKMgr ik_ctrl, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_ctrl, chain, ik_mapping, effector_type)
+	{
+		this.chain.bendConstraint.bendGoal = base.constraintTarget;
+		base.isUpperBody = (effector_type == FullBodyIKMgr.IKEffectorType.Forearm_L || effector_type == FullBodyIKMgr.IKEffectorType.Forearm_R);
+		this.FABRIK = base.constraintTarget.parent.gameObject.AddComponent<FABRIK>();
+		this.FABRIK.solver.SetChain(new Transform[]
+		{
+			base.chainBones[0],
+			base.chainBones[1]
+		}, base.chainBones[0]);
+		this.FABRIK.solver.target = base.constraintTarget;
+		this.FABRIK.enabled = false;
+		if (!base.isUpperBody)
+		{
+			if (this.isLeft)
+			{
+				base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Thigh_L);
+			}
+			else
+			{
+				base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Thigh_R);
+			}
+		}
+		else if (this.isLeft)
+		{
+			base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.UpperArm_L);
+		}
+		else
+		{
+			base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.UpperArm_R);
+		}
+	}
+
+	public override bool isLeft
+	{
+		get
+		{
+			return this.effectorType == FullBodyIKMgr.IKEffectorType.Forearm_L || this.effectorType == FullBodyIKMgr.IKEffectorType.Calf_L;
+		}
+	}
+
+	public override ALimbIKCtrl pairIK
+	{
+		get
+		{
+			FullBodyIKMgr.IKEffectorType effector_type;
+			if (base.isUpperBody)
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.Forearm_L : FullBodyIKMgr.IKEffectorType.Forearm_R);
+			}
+			else
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.Calf_L : FullBodyIKMgr.IKEffectorType.Calf_R);
+			}
+			return this.myIKMgr.GetIKCtrl<ALimbIKCtrl>(effector_type);
+		}
+	}
+
+	public ShoulderThighIKCtrl shoulderThighCtrl { get; private set; }
+
+	public HandFootIKCtrl handFootCtrl { get; private set; }
+
+	public void SetChain(HandFootIKCtrl handfoot_data, ShoulderThighIKCtrl shoulderthigh_data)
+	{
+		this.handFootCtrl = handfoot_data;
+		this.ChainChildCtrl = handfoot_data;
+		this.shoulderThighCtrl = shoulderthigh_data;
+		this.ChainParentCtrl = shoulderthigh_data;
+	}
+
+	public override void TargetTransCpy()
+	{
+		base.TargetTransCpy();
+		this.chain.bendConstraint.weight = 0f;
+		this.FABRIK.solver.IKPositionWeight = 0f;
+	}
+
+	public override void ApplyIKSetting()
+	{
+		this.BoneLocalRot = base.bone.localRotation;
+		this.HandFootLocalRot = this.handFootCtrl.bone.localRotation;
+		base.ApplyIKSetting();
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		base.SetTargetTransform(data, pos, rot);
+		Vector3 vector = this.shoulderThighCtrl.bone.InverseTransformPoint(base.bone.position);
+		Transform constraintTarget = this.shoulderThighCtrl.constraintTarget;
+		if (data.isPointAttach)
+		{
+			constraintTarget.rotation = Quaternion.FromToRotation(base.bone.position - constraintTarget.position, base.constraintTarget.position - constraintTarget.position) * constraintTarget.rotation;
+			if (!this.shoulderThighCtrl.pointIKData.isIKExecNotWeight0)
+			{
+				this.shoulderThighCtrl.positionWeight = Mathf.Max(base.positionWeight, this.shoulderThighCtrl.positionWeight);
+				Vector3 position = base.bone.InverseTransformPoint(this.shoulderThighCtrl.bone.position);
+				constraintTarget.position = base.constraintTarget.TransformPoint(position);
+			}
+		}
+		else
+		{
+			Vector3 axis = base.constraintTarget.position - constraintTarget.position;
+			Quaternion rotation = base.constraintTarget.rotation;
+			Vector3 lhs = rotation * Vector3.forward;
+			Vector3 rhs = base.bone.rotation * Vector3.forward;
+			float f = Vector3.Dot(lhs, rhs);
+			float num = Mathf.Acos(f) * 57.29578f;
+			if (float.IsNaN(num))
+			{
+				num = 0f;
+			}
+			constraintTarget.rotation = Quaternion.AngleAxis(num, axis) * constraintTarget.rotation;
+		}
+	}
+
+	protected override void DoPlaneCorrect(Vector3 normal)
+	{
+		base.DoPlaneCorrect(normal);
+		if (this.correctType == ALimbIKCtrl.BorderCorrectType.HalfBody)
+		{
+			Transform constraintTarget = this.shoulderThighCtrl.constraintTarget;
+			constraintTarget.position += normal;
+			if (!this.shoulderThighCtrl.pointIKData.isIKExec)
+			{
+				this.shoulderThighCtrl.positionWeight = base.positionWeight;
+			}
+		}
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (!base.isIKExec || this.handFootCtrl.isIKExecNotWeight0)
+		{
+			base.OnPostFullBodySolverUpdate();
+			return;
+		}
+		if (base.rotateIKData.isIKExec)
+		{
+			this.shoulderThighCtrl.bone.rotation = Quaternion.Slerp(this.shoulderThighCtrl.bone.rotation, this.shoulderThighCtrl.constraintTarget.rotation, base.rotationWeight);
+			base.bone.localRotation = this.BoneLocalRot;
+			this.handFootCtrl.bone.localRotation = this.HandFootLocalRot;
+		}
+		Quaternion rotation = base.bone.rotation;
+		if (base.pointIKData.isIKExec)
+		{
+			this.FABRIK.solver.Update();
+			base.bone.rotation = rotation;
+		}
+		base.OnPostFullBodySolverUpdate();
+	}
+
+	protected override void OnPostSetPositionWeight(float val)
+	{
+		if (this.IsPullBody)
+		{
+			this.chain.bendConstraint.weight = val;
+		}
+		this.FABRIK.solver.IKPositionWeight = val;
+	}
+
+	private FABRIK FABRIK;
+
+	private Quaternion HandFootLocalRot = Quaternion.identity;
+
+	private Quaternion BoneLocalRot = Quaternion.identity;
+}

+ 0 - 121
Assembly-CSharp/ElbowKneeIKData.cs

@@ -1,121 +0,0 @@
-using System;
-using RootMotion.FinalIK;
-using UnityEngine;
-
-[Serializable]
-public class ElbowKneeIKData : LimbIKData
-{
-	public ElbowKneeIKData(FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKCtrl ik_ctrl, Transform tgt_bone) : base(ik_ctrl, chain, ik_mapping, tgt_bone, false)
-	{
-		this.Chain.bendConstraint.bendGoal = base.IKTarget;
-		this.m_IsUpperBody = (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_L) || this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_R));
-		this.m_ForceIKEnable = true;
-		this.m_FABRIK = base.IKTarget.parent.gameObject.AddComponent<FABRIK>();
-		this.m_FABRIK.solver.SetChain(new Transform[]
-		{
-			base.ChainBones[0],
-			base.ChainBones[1]
-		}, base.ChainBones[0]);
-		this.m_FABRIK.solver.target = base.IKTarget;
-		this.m_FABRIK.enabled = false;
-	}
-
-	public ShoulderThighIKData ShoulderThighData
-	{
-		get
-		{
-			return this.m_ShoulderThighData;
-		}
-	}
-
-	public HandFootIKData HandFootData
-	{
-		get
-		{
-			return this.m_HandFootData;
-		}
-	}
-
-	public override void TagetTransCpy()
-	{
-		base.TagetTransCpy();
-		this.Chain.bendConstraint.weight = 0f;
-		this.m_FABRIK.solver.IKPositionWeight = 0f;
-	}
-
-	public override void ApplyIKSetting()
-	{
-		this.m_TargetBoneLocalRot = this.TargetBone.localRotation;
-		this.m_HandFootLocalRot = this.HandFootData.TargetBone.localRotation;
-		base.ApplyIKSetting();
-	}
-
-	protected override void SetTargetTransform(IKCtrlData.IKSettingData data, Vector3 pos, Quaternion rot)
-	{
-		base.SetTargetTransform(data, pos, rot);
-		Transform iktarget = this.m_ShoulderThighData.IKTarget;
-		if (data.IsPointAttach)
-		{
-			iktarget.rotation = Quaternion.FromToRotation(this.TargetBone.position - iktarget.position, base.IKTarget.position - iktarget.position) * iktarget.rotation;
-		}
-		else
-		{
-			Vector3 axis = base.IKTarget.position - iktarget.position;
-			Quaternion rotation = base.IKTarget.rotation;
-			Vector3 lhs = rotation * Vector3.forward;
-			Vector3 rhs = this.TargetBone.rotation * Vector3.forward;
-			float f = Vector3.Dot(lhs, rhs);
-			float num = Mathf.Acos(f) * 57.29578f;
-			if (float.IsNaN(num))
-			{
-				num = 0f;
-			}
-			iktarget.rotation = Quaternion.AngleAxis(num, axis) * iktarget.rotation;
-		}
-	}
-
-	public void SetChainData(HandFootIKData handfoot_data, ShoulderThighIKData shoulderthigh_data)
-	{
-		this.m_HandFootData = handfoot_data;
-		this.m_ShoulderThighData = shoulderthigh_data;
-	}
-
-	public override void Update()
-	{
-		if (this.HandFootData.IsIKExecTruth)
-		{
-			return;
-		}
-		if (base.RotateIK.IsIKExec)
-		{
-			this.ShoulderThighData.TargetBone.rotation = Quaternion.Slerp(this.ShoulderThighData.TargetBone.rotation, this.ShoulderThighData.IKTarget.rotation, base.RotationWeight);
-			this.TargetBone.localRotation = this.m_TargetBoneLocalRot;
-			this.HandFootData.TargetBone.localRotation = this.m_HandFootLocalRot;
-		}
-		Quaternion rotation = this.TargetBone.rotation;
-		if (base.PointIK.IsIKExec)
-		{
-			this.m_FABRIK.solver.Update();
-			this.TargetBone.rotation = rotation;
-		}
-	}
-
-	protected override void OnPostSetPositionWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.Chain.bendConstraint.weight = val;
-		}
-		this.m_FABRIK.solver.IKPositionWeight = val;
-	}
-
-	private ShoulderThighIKData m_ShoulderThighData;
-
-	private HandFootIKData m_HandFootData;
-
-	private FABRIK m_FABRIK;
-
-	private Quaternion m_HandFootLocalRot = Quaternion.identity;
-
-	private Quaternion m_TargetBoneLocalRot = Quaternion.identity;
-}

+ 12 - 0
Assembly-CSharp/EmpireLifeModeData.cs

@@ -186,6 +186,8 @@ public static class EmpireLifeModeData
 					this.rawDataMaidSeikeikenNoYes = csv.GetCellAsString(num++, i);
 					this.rawDataMaidSeikeikenYesYes = csv.GetCellAsString(num++, i);
 					this.rawDataGP002PersonalCheck = csv.GetCellAsString(num++, i);
+					this.rawRequestBodyTypeEquals = csv.GetCellAsString(num++, i);
+					this.rawNewBodyBlock = csv.GetCellAsString(num++, i);
 					NDebug.Assert(!string.IsNullOrEmpty(this.rawDataScenarioType), "エンパイアライフモード.csv\n項目「種類」が指定されていません。\n\n表:" + text);
 					NDebug.Assert(!string.IsNullOrEmpty(this.rawDataScenarioAnyNumberPlay), "エンパイアライフモード.csv\n項目「何度でも再生できるか」が指定されていません。\n\n表:" + text);
 					NDebug.Assert(!string.IsNullOrEmpty(this.rawDataScenarioFileName), "エンパイアライフモード.csv\n項目「シナリオファイル」が指定されていません。\n\n表:" + text);
@@ -434,6 +436,8 @@ public static class EmpireLifeModeData
 					}
 					this.dataMaidSeikeiken = list.ToArray();
 					this.dataGP002PersonalCheck = (this.rawDataGP002PersonalCheck == "○" || this.rawDataGP002PersonalCheck == "◯");
+					this.dataRequestBodyTypeEquals = (this.rawRequestBodyTypeEquals == "○" || this.rawRequestBodyTypeEquals == "◯");
+					this.dataNewBodyBlock = (this.rawNewBodyBlock == "○" || this.rawNewBodyBlock == "◯");
 					break;
 				}
 			}
@@ -618,6 +622,10 @@ public static class EmpireLifeModeData
 
 		public readonly string rawDataGP002PersonalCheck;
 
+		public readonly string rawRequestBodyTypeEquals;
+
+		public readonly string rawNewBodyBlock;
+
 		public readonly EmpireLifeModeData.ScenarioType dataScenarioType;
 
 		public readonly bool dataScenarioAnyNumberPlay;
@@ -652,6 +660,10 @@ public static class EmpireLifeModeData
 
 		public readonly bool dataGP002PersonalCheck;
 
+		public readonly bool dataRequestBodyTypeEquals;
+
+		public readonly bool dataNewBodyBlock;
+
 		private bool? m_IsEnableGP002PersonalCheck;
 
 		private static Dictionary<string, string> m_PersonalUniqueNameDic;

+ 29 - 7
Assembly-CSharp/EmpireLifeModeManager.cs

@@ -98,7 +98,7 @@ public class EmpireLifeModeManager : MonoBehaviour
 					if (correctFacilityList != null && correctFacilityList.Count > 0)
 					{
 						List<Maid> list;
-						if (EmpireLifeModeManager.TryGetMaidListOfEventData(data, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
+						if (EmpireLifeModeManager.TryGetMaidListOfEventDataBodyTypeEquals(data, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
 						{
 							Facility facility = correctFacilityList[UnityEngine.Random.Range(0, correctFacilityList.Count)];
 							this.CreateAndCacheEvent(data, facility, list);
@@ -135,7 +135,7 @@ public class EmpireLifeModeManager : MonoBehaviour
 			if (correctFacilityList != null && correctFacilityList.Count > 0)
 			{
 				List<Maid> list;
-				if (EmpireLifeModeManager.TryGetMaidListOfEventData(data2, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
+				if (EmpireLifeModeManager.TryGetMaidListOfEventDataBodyTypeEquals(data2, this.GetNotAllocatedMaidList(this.lifeModeAllMaidList), out list))
 				{
 					Facility facility = correctFacilityList[UnityEngine.Random.Range(0, correctFacilityList.Count)];
 					this.CreateAndCacheEvent(data2, facility, list);
@@ -144,12 +144,10 @@ public class EmpireLifeModeManager : MonoBehaviour
 						this.nowMaidAllocationDic.Add(facility, new List<Maid>());
 					}
 					this.nowMaidAllocationDic[facility].AddRange(list);
-					Debug.Log("イベントの作成に成功");
-					return;
+					break;
 				}
 			}
 		}
-		Debug.Log("イベントの作成に失敗");
 	}
 
 	public void AllMaidRandomAllocate()
@@ -236,7 +234,7 @@ public class EmpireLifeModeManager : MonoBehaviour
 				foreach (EmpireLifeModeData.Data data2 in orderedEnumerable.ThenBy((EmpireLifeModeData.Data d) => eventSelectCountDic[d.ID]).ThenBy((EmpireLifeModeData.Data d) => UnityEngine.Random.Range(0, 10)))
 				{
 					List<Maid> list2;
-					if (EmpireLifeModeManager.TryGetMaidListOfEventData(data2, list, out list2))
+					if (EmpireLifeModeManager.TryGetMaidListOfEventDataBodyTypeEquals(data2, list, out list2))
 					{
 						this.CreateAndCacheEvent(data2, facility, list2);
 						Dictionary<int, int> eventSelectCountDic2;
@@ -390,6 +388,30 @@ public class EmpireLifeModeManager : MonoBehaviour
 		return false;
 	}
 
+	private static bool TryGetMaidListOfEventDataBodyTypeEquals(EmpireLifeModeData.Data data, IEnumerable<Maid> maidList, out List<Maid> resultList)
+	{
+		List<Maid> list = new List<Maid>(from d in maidList
+		where !data.dataNewBodyBlock || (data.dataNewBodyBlock && !d.IsCrcBody)
+		select d);
+		if (!data.dataRequestBodyTypeEquals)
+		{
+			return EmpireLifeModeManager.TryGetMaidListOfEventData(data, list, out resultList);
+		}
+		if (data.dataMaidPersonalUniqueNameAndActiveSlotDic.Count == 1)
+		{
+			return EmpireLifeModeManager.TryGetMaidListOfEventData(data, list, out resultList);
+		}
+		if (EmpireLifeModeManager.TryGetMaidListOfEventData(data, from d in list
+		where d.IsCrcBody
+		select d, out resultList))
+		{
+			return true;
+		}
+		return EmpireLifeModeManager.TryGetMaidListOfEventData(data, from d in list
+		where !d.IsCrcBody
+		select d, out resultList);
+	}
+
 	public List<Maid> GetNotAllocatedMaidList(List<Maid> maidList)
 	{
 		List<Maid> list = new List<Maid>();
@@ -477,7 +499,7 @@ public class EmpireLifeModeManager : MonoBehaviour
 	public bool Serialize(BinaryWriter brWrite)
 	{
 		brWrite.Write("CM3D21_LIFE_MODE_MGR");
-		brWrite.Write(1550);
+		brWrite.Write(1570);
 		brWrite.Write("2");
 		DataArray<int, byte> saveDataScenarioExecuteCountArray = this.m_SaveDataScenarioExecuteCountArray;
 		if (EmpireLifeModeManager.<>f__mg$cache1 == null)

+ 55 - 0
Assembly-CSharp/FABRIKCtrl.cs

@@ -0,0 +1,55 @@
+using System;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class FABRIKCtrl : AIKCtrl
+{
+	public FABRIKCtrl(FullBodyIKMgr ik_mgr, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_mgr, effector_type)
+	{
+		this.IK = base.constraintTarget.parent.gameObject.AddComponent<FABRIK>();
+		this.IK.solver.target = base.constraintTarget;
+		this.IK.fixTransforms = false;
+		this.IK.solver.SetChain(this.ChainBones, this.ChainBones[0]);
+		this.IK.enabled = false;
+		for (int i = 0; i < this.ChainBones.Length - 1; i++)
+		{
+			Transform transform = this.ChainBones[i];
+			Transform transform2 = base.chainBones[i + 1];
+			this.BoneLengthSum += Vector3.Distance(transform.position, transform2.position);
+		}
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (base.pointIKData.isIKExec)
+		{
+			if (base.pointIKData.isBlendNow)
+			{
+				float num = Vector3.Distance(this.ChainBones[0].position, base.constraintTarget.position);
+				if (num > this.BoneLengthSum)
+				{
+					Vector3 a = this.ChainBones[0].position - base.constraintTarget.position;
+					base.constraintTarget.position += a / num * (num - this.BoneLengthSum);
+					float num2 = 1f - Mathf.Clamp01((num - this.BoneLengthSum) / this.BoneLengthSum);
+					base.positionWeight *= num2;
+				}
+			}
+			this.IK.solver.Update();
+		}
+		if (base.rotateIKData.isIKExec)
+		{
+			base.bone.rotation = Quaternion.Slerp(base.bone.rotation, base.constraintTarget.rotation, base.rotationWeight);
+		}
+	}
+
+	protected override void OnPostSetPositionWeight(float val)
+	{
+		this.IK.solver.IKPositionWeight = val;
+	}
+
+	[SerializeField]
+	protected FABRIK IK;
+
+	protected readonly float BoneLengthSum;
+}

+ 23 - 2
Assembly-CSharp/FaceWindow.cs

@@ -333,9 +333,16 @@ public class FaceWindow : BaseMaidPhotoWindow
 				maidStoreData.Add(keyValuePair.Key, false.ToString());
 			}
 		}
-		else if (!maidStoreData.ContainsKey("open_mouse"))
+		else
 		{
-			maidStoreData.Add("open_mouse", false.ToString());
+			if (!maidStoreData.ContainsKey("open_mouse"))
+			{
+				maidStoreData.Add("open_mouse", false.ToString());
+			}
+			if (maid.IsCrcBody && !maidStoreData.ContainsKey("morph_val_tanga"))
+			{
+				maidStoreData.Add("morph_val_tanga", "0");
+			}
 		}
 		this.FaceMorphInput.OnMaidAddEvent(maid, is_deserialize_load, maidStoreData);
 		maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
@@ -496,6 +503,17 @@ public class FaceWindow : BaseMaidPhotoWindow
 				sliderFaceToX.enabled = flag;
 			}
 			this.Apply(base.mgr.select_maid);
+			if (maid.IsCrcBody)
+			{
+				if (!this.tangaSlider.enabled)
+				{
+					this.tangaSlider.enabled = true;
+				}
+			}
+			else if (this.tangaSlider.enabled)
+			{
+				this.tangaSlider.enabled = false;
+			}
 		}
 	}
 
@@ -717,6 +735,9 @@ public class FaceWindow : BaseMaidPhotoWindow
 
 	public UIWFTabPanel BodyItemTabPanel;
 
+	[SerializeField]
+	private PhotoSliderAndInput tangaSlider;
+
 	private PhotoNoCharaActive noCharaActive;
 
 	private PlacementWindow placement_window_;

+ 7 - 3
Assembly-CSharp/Facility.cs

@@ -34,7 +34,7 @@ public class Facility : MonoBehaviour
 			}
 		}
 		this.m_EditCostumeArray = new Dictionary<MPN, KeyValuePair<bool, string>>();
-		Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(facilityTypeID, true);
+		Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(facilityTypeID, true, false);
 		if (facilityDefaultCostume != null && 0 < facilityDefaultCostume.Count)
 		{
 			List<MPN> list = new List<MPN>(facilityDefaultCostume.Keys);
@@ -163,7 +163,7 @@ public class Facility : MonoBehaviour
 		}
 		else
 		{
-			Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(this.param.typeID, true);
+			Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(this.param.typeID, true, false);
 			if (facilityDefaultCostume != null)
 			{
 				key = facilityDefaultCostume[mpn].Key;
@@ -485,7 +485,7 @@ public class Facility : MonoBehaviour
 
 	public void UpdateMaidCostumeToDefaultCostume(Maid maid)
 	{
-		Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(this.param.typeID, true);
+		Dictionary<MPN, KeyValuePair<bool, string>> facilityDefaultCostume = FacilityDataTable.GetFacilityDefaultCostume(this.param.typeID, true, maid.IsCrcBody);
 		if (facilityDefaultCostume == null)
 		{
 			Debug.LogWarning(string.Format("[Facility]施設『{0}』のデフォルトコスチュームの取得に失敗しました\n施設の種類ID:{1}", this.facilityName, this.param.typeID));
@@ -542,6 +542,10 @@ public class Facility : MonoBehaviour
 			Debug.LogWarning(string.Format("[Facility]施設『{0}』のコスチュームにするメイドにnullが指定されました", this.facilityName));
 			return;
 		}
+		if (maid.IsCrcBody)
+		{
+			return;
+		}
 		int count = editCostumeArray.Count;
 		List<MPN> list = new List<MPN>(editCostumeArray.Keys);
 		List<KeyValuePair<bool, string>> list2 = new List<KeyValuePair<bool, string>>(editCostumeArray.Values);

+ 62 - 1
Assembly-CSharp/FacilityDataTable.cs

@@ -695,7 +695,7 @@ public static class FacilityDataTable
 		return sprite;
 	}
 
-	public static Dictionary<MPN, KeyValuePair<bool, string>> GetFacilityDefaultCostume(int facilityTypeID, bool enableDataOnly = true)
+	public static Dictionary<MPN, KeyValuePair<bool, string>> GetFacilityDefaultCostume(int facilityTypeID, bool enableDataOnly = true, bool newBody = false)
 	{
 		if (!FacilityDataTable.m_FacilityDefaultCostumeArray.ContainsKey(facilityTypeID))
 		{
@@ -708,6 +708,27 @@ public static class FacilityDataTable
 		}
 		Dictionary<MPN, KeyValuePair<bool, string>> dictionary = FacilityDataTable.m_FacilityDefaultCostumeArray[facilityTypeID];
 		MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
+		if (newBody)
+		{
+			if (!dictionary.ContainsKey(MPN.acchead) || dictionary[MPN.acchead].Value.Contains("_del"))
+			{
+				dictionary[MPN.acchead] = new KeyValuePair<bool, string>(true, CM3.dicDelItem[MPN.acchead]);
+				if (Array.FindIndex<MPN>(facilityCostumeEnableMPN, (MPN m) => m == MPN.acchead) == -1)
+				{
+					Array.Resize<MPN>(ref facilityCostumeEnableMPN, facilityCostumeEnableMPN.Length + 1);
+					facilityCostumeEnableMPN[facilityCostumeEnableMPN.Length - 1] = MPN.acchead;
+				}
+			}
+			if (!dictionary.ContainsKey(MPN.acckubi) || dictionary[MPN.acckubi].Value.Contains("_del"))
+			{
+				dictionary[MPN.acckubi] = new KeyValuePair<bool, string>(true, CM3.dicDelItem[MPN.acckubi]);
+				if (Array.FindIndex<MPN>(facilityCostumeEnableMPN, (MPN m) => m == MPN.acckubi) == -1)
+				{
+					Array.Resize<MPN>(ref facilityCostumeEnableMPN, facilityCostumeEnableMPN.Length + 1);
+					facilityCostumeEnableMPN[facilityCostumeEnableMPN.Length - 1] = MPN.acckubi;
+				}
+			}
+		}
 		Dictionary<MPN, KeyValuePair<bool, string>> dictionary2 = new Dictionary<MPN, KeyValuePair<bool, string>>();
 		foreach (MPN key in facilityCostumeEnableMPN)
 		{
@@ -1026,6 +1047,46 @@ public static class FacilityDataTable
 				}
 			}
 			num++;
+			if (num < csv.max_cell_x)
+			{
+				string cellAsString10 = csv.GetCellAsString(num, y);
+				this.workData.isNewBodyBlock = (cellAsString10 == "〇" || cellAsString10 == "○");
+			}
+			num++;
+			if (num < csv.max_cell_x)
+			{
+				this.workData.mainHeroineBodyTypeMatchCheckList = new HashSet<string>();
+				string cellAsString11 = csv.GetCellAsString(num, y);
+				foreach (string text in cellAsString11.Split(new char[]
+				{
+					','
+				}))
+				{
+					if (!string.IsNullOrEmpty(text))
+					{
+						string text2 = text.Trim();
+						if (text2 != null)
+						{
+							if (text2 == "無垢" || text2 == "真面目" || text2 == "凜デレ")
+							{
+								this.workData.mainHeroineBodyTypeMatchCheckList.Add(text.Trim());
+								goto IL_912;
+							}
+						}
+						Debug.LogError(string.Concat(new object[]
+						{
+							"ID[",
+							this.ID,
+							"]",
+							this.name,
+							"のメインキャラとのボディ一致チェック項目で不正な文字列が指定されています=>",
+							text.Trim()
+						}));
+					}
+					IL_912:;
+				}
+			}
+			num++;
 			this.workData.condPackage = new List<string>();
 			if (this.workData.id > 0)
 			{

+ 1 - 1
Assembly-CSharp/FacilityManager.cs

@@ -657,7 +657,7 @@ public class FacilityManager : MonoBehaviour
 		Stopwatch stopwatch = new Stopwatch();
 		stopwatch.Start();
 		brWrite.Write("CM3D21_FACILITY_MGR");
-		brWrite.Write(1550);
+		brWrite.Write(1570);
 		brWrite.Write("5");
 		int num = 0;
 		for (int i = 0; i < this.m_FacilityArray.Count; i++)

+ 88 - 0
Assembly-CSharp/FaderEventDriven.cs

@@ -0,0 +1,88 @@
+using System;
+
+public class FaderEventDriven : BaseFader
+{
+	protected override void ApplyFadeValue(float value)
+	{
+		if (this.onApplyFadeValue != null)
+		{
+			this.onApplyFadeValue(value);
+		}
+	}
+
+	protected override float GetFadeValue()
+	{
+		return (this.onGetFadeValue == null) ? 0f : this.onGetFadeValue();
+	}
+
+	protected override bool CheckSkipState()
+	{
+		return this.onCheckSkipState != null && this.onCheckSkipState();
+	}
+
+	protected override void OnBeforeFadeIn()
+	{
+		if (this.onBeforeFadeIn != null)
+		{
+			this.onBeforeFadeIn();
+		}
+	}
+
+	protected override void OnAfterFadeIn()
+	{
+		if (this.onAfterFadeIn != null)
+		{
+			this.onAfterFadeIn();
+		}
+	}
+
+	protected override void OnBeforeFadeOut()
+	{
+		if (this.onBeforeFadeOut != null)
+		{
+			this.onBeforeFadeOut();
+		}
+	}
+
+	protected override void OnAfterFadeOut()
+	{
+		if (this.onAfterFadeOut != null)
+		{
+			this.onAfterFadeOut();
+		}
+	}
+
+	protected override void OnAbortFadeIn()
+	{
+		if (this.onAbortFadeIn != null)
+		{
+			this.onAbortFadeIn();
+		}
+	}
+
+	protected override void OnAbortFadeOut()
+	{
+		if (this.onAbortFadeOut != null)
+		{
+			this.onAbortFadeOut();
+		}
+	}
+
+	public Action<float> onApplyFadeValue;
+
+	public Func<float> onGetFadeValue;
+
+	public Func<bool> onCheckSkipState;
+
+	public Action onBeforeFadeIn;
+
+	public Action onAfterFadeIn;
+
+	public Action onBeforeFadeOut;
+
+	public Action onAfterFadeOut;
+
+	public Action onAbortFadeIn;
+
+	public Action onAbortFadeOut;
+}

+ 144 - 0
Assembly-CSharp/FreeFBIKCtrl.cs

@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using kt.ik;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class FreeFBIKCtrl : AIKCtrl
+{
+	public FreeFBIKCtrl(FullBodyIKMgr ik_mgr, FullBodyIKMgr.IKEffectorType effector_type, bool is_upper, FullBodyIKMgr.IKBoneType bend_bone = FullBodyIKMgr.IKBoneType.None) : base(ik_mgr, effector_type)
+	{
+		base.isUpperBody = is_upper;
+		this.Effector = new FreeFBIKEffector(ik_mgr.ik, base.bone, base.constraintTarget, base.isUpperBody);
+		this.FABRIK = base.constraintTarget.parent.gameObject.AddComponent<FABRIK>();
+		this.FABRIK.solver.target = base.constraintTarget;
+		this.FABRIK.fixTransforms = false;
+		this.FABRIK.solver.SetChain(this.ChainBones, this.ChainBones[0]);
+		this.FABRIK.enabled = false;
+		if (bend_bone == FullBodyIKMgr.IKBoneType.None)
+		{
+			return;
+		}
+		Transform[] chainBonesToInit = this.myIKMgr.GetChainBonesToInit(bend_bone);
+		List<FreeFBIKEffector.BendBone> list = new List<FreeFBIKEffector.BendBone>();
+		for (int i = 0; i < chainBonesToInit.Length; i++)
+		{
+			list.Add(new FreeFBIKEffector.BendBone(chainBonesToInit[i], 1f - (float)i / (float)(chainBonesToInit.Length - 1)));
+		}
+		this.Effector.bendBones = list.ToArray();
+		this.Effector.CCDBones = chainBonesToInit;
+		this.Effector.bodyClampWeight = 1f;
+		this.Effector.boneClampWeight = 0f;
+		this.Effector.CCDWeight = 0f;
+	}
+
+	public FreeFBIKEffector effector
+	{
+		get
+		{
+			return this.Effector;
+		}
+	}
+
+	public override bool isNeedFullbodySolverUpdate
+	{
+		get
+		{
+			return base.isIKExec && this.IsPullOn;
+		}
+	}
+
+	public override void SetIKSetting(IKAttachParam param)
+	{
+		this.Effector.bodyClampWeight = 1f;
+		base.SetIKSetting(param);
+	}
+
+	public override void SetPullState(bool pull_on)
+	{
+		this.IsPullOn = pull_on;
+	}
+
+	public override void ApplyIKSetting()
+	{
+		this.BoneRotChache = base.bone.rotation;
+		base.ApplyIKSetting();
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		base.SetTargetTransform(data, pos, rot);
+		if (!this.IsPullOn)
+		{
+			return;
+		}
+		if (!data.isPointAttach)
+		{
+			return;
+		}
+		if (this.myIKMgr.bodyEffector.positionWeight < base.positionWeight)
+		{
+			this.myIKMgr.bodyEffector.positionWeight = base.positionWeight;
+		}
+		if (this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.UpperArm_L).positionWeight < base.positionWeight)
+		{
+			this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.UpperArm_L).positionWeight = base.positionWeight;
+		}
+		if (this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.UpperArm_R).positionWeight < base.positionWeight)
+		{
+			this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.UpperArm_R).positionWeight = base.positionWeight;
+		}
+		if (this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Thigh_L).positionWeight < base.positionWeight)
+		{
+			this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Thigh_L).positionWeight = base.positionWeight;
+		}
+		if (this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Thigh_R).positionWeight < base.positionWeight)
+		{
+			this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Thigh_R).positionWeight = base.positionWeight;
+		}
+		if (this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Hand_L).isIKExec || this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Hand_R).isIKExec || this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Foot_L).isIKExec || this.myIKMgr.GetIKCtrl(FullBodyIKMgr.IKEffectorType.Foot_R).isIKExec)
+		{
+			this.Effector.bodyClampWeight = 0f;
+		}
+		this.effector.OnPreRead();
+		this.effector.Iterate();
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (base.GetIKSettingData(AIKCtrl.IKAttachType.NewPoint).isIKExec && !base.GetIKSettingData(AIKCtrl.IKAttachType.NewPoint).isBlendNow)
+		{
+			this.FABRIK.solver.Update();
+		}
+		if (base.GetIKSettingData(AIKCtrl.IKAttachType.Rotate).isIKExec)
+		{
+			base.bone.rotation = Quaternion.Lerp(this.BoneRotChache, base.constraintTarget.rotation, base.rotationWeight);
+		}
+	}
+
+	public override void Detach()
+	{
+		this.Effector.bodyClampWeight = 1f;
+		base.Detach();
+	}
+
+	protected override void OnPostSetPositionWeight(float val)
+	{
+		IKSolver solver = this.FABRIK.solver;
+		this.effector.positionWeight = val;
+		solver.IKPositionWeight = val;
+	}
+
+	[SerializeField]
+	[Header("最終的に位置を合わせるIKコンポーネント")]
+	protected FABRIK FABRIK;
+
+	[SerializeField]
+	[Header("エフェクターデータ")]
+	private FreeFBIKEffector Effector;
+
+	private Quaternion BoneRotChache = Quaternion.identity;
+
+	private bool IsPullOn = true;
+}

+ 506 - 0
Assembly-CSharp/FreeFBIKEffector.cs

@@ -0,0 +1,506 @@
+using System;
+using RootMotion;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class FreeFBIKEffector
+{
+	public FreeFBIKEffector(FullBodyBipedIK ik_ctrl, Transform bone, Transform ik_target, bool is_upper)
+	{
+		this.ik = ik_ctrl;
+		this.Bone = bone;
+		this.Target = ik_target;
+		this.IsUpperBody = is_upper;
+		IKSolverFullBodyBiped solver = this.ik.solver;
+		solver.OnStoreDefaultLocalState = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnStoreDefaultLocalState, new IKSolver.UpdateDelegate(this.OnStoreDefaultLocalState));
+		IKSolverFullBodyBiped solver2 = this.ik.solver;
+		solver2.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Combine(solver2.OnFixTransforms, new IKSolver.UpdateDelegate(this.OnFixTransforms));
+		this.boneRotationRelativeToRoot = Quaternion.Inverse(this.ik.references.root.rotation) * this.Bone.rotation;
+	}
+
+	public Vector3 TargetPos
+	{
+		get
+		{
+			return this.Target.position;
+		}
+	}
+
+	private Transform m_leftNearBone
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.references.leftThigh : this.ik.references.leftUpperArm;
+		}
+	}
+
+	private Transform m_rightNearBone
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.references.rightThigh : this.ik.references.rightUpperArm;
+		}
+	}
+
+	private IKEffector m_leftNearEffector
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.solver.leftThighEffector : this.ik.solver.leftShoulderEffector;
+		}
+	}
+
+	private IKEffector m_rightNearEffector
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.solver.rightThighEffector : this.ik.solver.rightShoulderEffector;
+		}
+	}
+
+	private Transform m_leftFarBone
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.references.leftUpperArm : this.ik.references.leftThigh;
+		}
+	}
+
+	private Transform m_rightFarBone
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.references.rightUpperArm : this.ik.references.rightThigh;
+		}
+	}
+
+	private IKEffector m_leftFarEffector
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.solver.leftShoulderEffector : this.ik.solver.leftThighEffector;
+		}
+	}
+
+	private IKEffector m_rightFarEffector
+	{
+		get
+		{
+			return (!this.IsUpperBody) ? this.ik.solver.rightShoulderEffector : this.ik.solver.rightThighEffector;
+		}
+	}
+
+	private void OnStoreDefaultLocalState()
+	{
+		if (this.positionWeight <= 0f)
+		{
+			return;
+		}
+		foreach (FreeFBIKEffector.BendBone bendBone in this.bendBones)
+		{
+			if (bendBone != null)
+			{
+				bendBone.StoreDefaultLocalState();
+			}
+		}
+		this.ccdDefaultLocalRotations = new Quaternion[this.CCDBones.Length];
+		for (int j = 0; j < this.CCDBones.Length; j++)
+		{
+			if (this.CCDBones[j] != null)
+			{
+				this.ccdDefaultLocalRotations[j] = this.CCDBones[j].localRotation;
+			}
+		}
+		this.boneLocalPosition = this.Bone.localPosition;
+		this.boneLocalRotation = this.Bone.localRotation;
+		this.stretchLocalPositions = new Vector3[this.stretchBones.Length];
+		this.stretchLocalRotations = new Quaternion[this.stretchBones.Length];
+		for (int k = 0; k < this.stretchBones.Length; k++)
+		{
+			if (this.stretchBones[k] != null)
+			{
+				this.stretchLocalPositions[k] = this.stretchBones[k].localPosition;
+				this.stretchLocalRotations[k] = this.stretchBones[k].localRotation;
+			}
+		}
+		this.chestLocalPositions = new Vector3[this.chestBones.Length];
+		this.chestLocalRotations = new Quaternion[this.chestBones.Length];
+		for (int l = 0; l < this.chestBones.Length; l++)
+		{
+			if (this.chestBones[l] != null)
+			{
+				this.chestLocalPositions[l] = this.chestBones[l].localPosition;
+				this.chestLocalRotations[l] = this.chestBones[l].localRotation;
+			}
+		}
+		this.bendBonesCount = this.bendBones.Length;
+		this.ccdBonesCount = this.CCDBones.Length;
+		this.stretchBonesCount = this.stretchBones.Length;
+		this.chestBonesCount = this.chestBones.Length;
+	}
+
+	private void OnFixTransforms()
+	{
+		if (this.positionWeight <= 0f)
+		{
+			return;
+		}
+		foreach (FreeFBIKEffector.BendBone bendBone in this.bendBones)
+		{
+			if (bendBone != null)
+			{
+				bendBone.FixTransforms();
+			}
+		}
+		for (int j = 0; j < this.CCDBones.Length; j++)
+		{
+			if (this.CCDBones[j] != null)
+			{
+				this.CCDBones[j].localRotation = this.ccdDefaultLocalRotations[j];
+			}
+		}
+		this.Bone.localPosition = this.boneLocalPosition;
+		this.Bone.localRotation = this.boneLocalRotation;
+		for (int k = 0; k < this.stretchBones.Length; k++)
+		{
+			if (this.stretchBones[k] != null)
+			{
+				this.stretchBones[k].localPosition = this.stretchLocalPositions[k];
+				this.stretchBones[k].localRotation = this.stretchLocalRotations[k];
+			}
+		}
+		for (int l = 0; l < this.chestBones.Length; l++)
+		{
+			if (this.chestBones[l] != null)
+			{
+				this.chestBones[l].localPosition = this.chestLocalPositions[l];
+				this.chestBones[l].localRotation = this.chestLocalRotations[l];
+			}
+		}
+	}
+
+	public void OnPreRead()
+	{
+		if (this.positionWeight <= 0f)
+		{
+			return;
+		}
+		if (this.bendBonesCount != this.bendBones.Length || this.ccdBonesCount != this.CCDBones.Length || this.stretchBonesCount != this.stretchBones.Length || this.chestBonesCount != this.chestBones.Length)
+		{
+			this.OnStoreDefaultLocalState();
+		}
+		this.ChestDirection();
+		this.SpineBend();
+		this.CCDPass();
+		this.offset = this.TargetPos - this.Bone.position;
+		this.nearBoneDist = Vector3.Distance(this.m_leftNearBone.position, this.m_rightNearBone.position);
+		this.leftNearBoneDist = Vector3.Distance(this.Bone.position, this.m_leftNearBone.position);
+		this.rightNearBoneDist = Vector3.Distance(this.Bone.position, this.m_rightNearBone.position);
+		this.boneToBody = this.ik.solver.rootNode.position - this.Bone.position;
+		this.boneToLeftFarBone = this.m_leftFarBone.position - this.Bone.position;
+		this.boneToRightFarBone = this.m_rightFarBone.position - this.Bone.position;
+		this.leftNearBonePos = this.m_leftNearBone.position + this.offset * this.bodyWeight;
+		this.rightNearBonePos = this.m_rightNearBone.position + this.offset * this.bodyWeight;
+		this.chestRotation = Quaternion.LookRotation(this.Bone.position - this.m_leftNearBone.position, this.m_rightNearBone.position - this.m_leftNearBone.position);
+	}
+
+	private void SpineBend()
+	{
+		float num = this.bendWeight * this.ik.solver.IKPositionWeight;
+		if (num <= 0f)
+		{
+			return;
+		}
+		if (this.bendBones.Length == 0)
+		{
+			return;
+		}
+		Quaternion quaternion = this.Target.rotation * Quaternion.Inverse(this.ik.references.root.rotation * this.boneRotationRelativeToRoot);
+		quaternion = QuaTools.ClampRotation(quaternion, this.bodyClampWeight, 2);
+		float num2 = 1f / (float)this.bendBones.Length;
+		for (int i = 0; i < this.bendBones.Length; i++)
+		{
+			if (this.bendBones[i].transform != null)
+			{
+				this.bendBones[i].transform.rotation = Quaternion.Lerp(Quaternion.identity, quaternion, num2 * this.bendBones[i].weight * num) * this.bendBones[i].transform.rotation;
+			}
+		}
+	}
+
+	private void CCDPass()
+	{
+		float num = this.CCDWeight * this.ik.solver.IKPositionWeight;
+		if (num <= 0f)
+		{
+			return;
+		}
+		for (int i = this.CCDBones.Length - 1; i > -1; i--)
+		{
+			Quaternion quaternion = Quaternion.FromToRotation(this.Bone.position - this.CCDBones[i].position, this.TargetPos - this.CCDBones[i].position) * this.CCDBones[i].rotation;
+			float num2 = Mathf.Lerp((float)((this.CCDBones.Length - i) / this.CCDBones.Length), 1f, this.roll);
+			float num3 = Quaternion.Angle(Quaternion.identity, quaternion);
+			num3 = Mathf.Lerp(0f, num3, (this.damper - num3) / this.damper);
+			this.CCDBones[i].rotation = Quaternion.RotateTowards(this.CCDBones[i].rotation, quaternion, num3 * num * num2);
+		}
+	}
+
+	public void Iterate()
+	{
+		if (this.positionWeight <= 0f)
+		{
+			return;
+		}
+		this.leftNearBonePos = this.TargetPos + (this.leftNearBonePos - this.TargetPos).normalized * this.leftNearBoneDist;
+		this.rightNearBonePos = this.TargetPos + (this.rightNearBonePos - this.TargetPos).normalized * this.rightNearBoneDist;
+		this.Solve(ref this.leftNearBonePos, ref this.rightNearBonePos, this.nearBoneDist);
+		this.LerpSolverPosition(this.m_leftNearEffector, this.leftNearBonePos, this.positionWeight * this.ik.solver.IKPositionWeight, this.m_leftNearEffector.positionOffset);
+		this.LerpSolverPosition(this.m_rightNearEffector, this.rightNearBonePos, this.positionWeight * this.ik.solver.IKPositionWeight, this.m_rightNearEffector.positionOffset);
+		Quaternion to = Quaternion.LookRotation(this.TargetPos - this.leftNearBonePos, this.rightNearBonePos - this.leftNearBonePos);
+		Quaternion quaternion = QuaTools.FromToRotation(this.chestRotation, to);
+		Vector3 b = quaternion * this.boneToBody;
+		this.LerpSolverPosition(this.ik.solver.bodyEffector, this.TargetPos + b, this.positionWeight * this.ik.solver.IKPositionWeight, this.ik.solver.bodyEffector.positionOffset - this.ik.solver.pullBodyOffset);
+		Quaternion rotation = Quaternion.Lerp(Quaternion.identity, quaternion, this.farBoneWeight);
+		Vector3 b2 = rotation * this.boneToLeftFarBone;
+		Vector3 b3 = rotation * this.boneToRightFarBone;
+		this.LerpSolverPosition(this.m_leftFarEffector, this.TargetPos + b2, this.positionWeight * this.ik.solver.IKPositionWeight, this.ik.solver.bodyEffector.positionOffset - this.ik.solver.pullBodyOffset + this.ik.solver.leftThighEffector.positionOffset);
+		this.LerpSolverPosition(this.m_rightFarEffector, this.TargetPos + b3, this.positionWeight * this.ik.solver.IKPositionWeight, this.ik.solver.bodyEffector.positionOffset - this.ik.solver.pullBodyOffset + this.m_rightFarEffector.positionOffset);
+	}
+
+	private void ChestDirection()
+	{
+		float num = this.chestDirectionWeight * this.ik.solver.IKPositionWeight;
+		if (num <= 0f)
+		{
+			return;
+		}
+		bool flag = false;
+		this.chestDirection = V3Tools.ClampDirection(this.chestDirection, this.ik.references.root.forward, 0.45f, 2, out flag);
+		if (this.chestDirection == Vector3.zero)
+		{
+			return;
+		}
+		Quaternion quaternion = Quaternion.FromToRotation(this.ik.references.root.forward, this.chestDirection);
+		quaternion = Quaternion.Lerp(Quaternion.identity, quaternion, num * (1f / (float)this.chestBones.Length));
+		foreach (Transform transform in this.chestBones)
+		{
+			transform.rotation = quaternion * transform.rotation;
+		}
+	}
+
+	private void PostStretching()
+	{
+		float num = this.postStretchWeight * this.ik.solver.IKPositionWeight;
+		if (num > 0f)
+		{
+			Vector3 a = Vector3.ClampMagnitude(this.TargetPos - this.Bone.position, this.maxStretch);
+			a *= num;
+			this.stretchDamper = Mathf.Max(this.stretchDamper, 0f);
+			if (this.stretchDamper > 0f)
+			{
+				a /= (1f + a.magnitude) * (1f + this.stretchDamper);
+			}
+			for (int i = 0; i < this.stretchBones.Length; i++)
+			{
+				if (this.stretchBones[i] != null)
+				{
+					this.stretchBones[i].position += a / (float)this.stretchBones.Length;
+				}
+			}
+		}
+		if (this.fixBone && this.ik.solver.IKPositionWeight > 0f)
+		{
+			this.Bone.position = this.TargetPos;
+		}
+	}
+
+	private void LerpSolverPosition(IKEffector effector, Vector3 position, float weight, Vector3 offset)
+	{
+		if (effector.target)
+		{
+			Vector3 position2 = effector.target.position;
+			effector.target.position = Vector3.Lerp(effector.target.position, position + offset, weight);
+		}
+		else
+		{
+			effector.GetNode(this.ik.solver).solverPosition = Vector3.Lerp(effector.bone.position, position + offset, weight);
+		}
+	}
+
+	private void Solve(ref Vector3 pos1, ref Vector3 pos2, float nominalDistance)
+	{
+		Vector3 a = pos2 - pos1;
+		float magnitude = a.magnitude;
+		if (magnitude == nominalDistance)
+		{
+			return;
+		}
+		if (magnitude == 0f)
+		{
+			return;
+		}
+		float num = 1f;
+		num *= 1f - nominalDistance / magnitude;
+		Vector3 b = a * num * 0.5f;
+		pos1 += b;
+		pos2 -= b;
+	}
+
+	[Tooltip("Reference to the FBBIK component.")]
+	public FullBodyBipedIK ik;
+
+	[LargeHeader("Position")]
+	[Tooltip("Master weight for positioning the head.")]
+	[Range(0f, 1f)]
+	public float positionWeight = 1f;
+
+	[Tooltip("The weight of moving the body along with the head")]
+	[Range(0f, 1f)]
+	public float bodyWeight = 1f;
+
+	[Tooltip("The weight of moving the thighs along with the head")]
+	[Range(0f, 1f)]
+	public float farBoneWeight = 1f;
+
+	[LargeHeader("Rotation")]
+	[Tooltip("Clamping the rotation of the body")]
+	[Range(0f, 1f)]
+	public float bodyClampWeight = 0.5f;
+
+	[Tooltip("Clamping the rotation of the head")]
+	[Range(0f, 1f)]
+	public float boneClampWeight = 0.5f;
+
+	[Tooltip("The master weight of bending/twisting the spine to the rotation of the head effector. This is similar to CCD, but uses the rotation of the head effector not the position.")]
+	[Range(0f, 1f)]
+	public float bendWeight = 1f;
+
+	[Tooltip("The bones to use for bending.")]
+	public FreeFBIKEffector.BendBone[] bendBones = new FreeFBIKEffector.BendBone[0];
+
+	[LargeHeader("CCD")]
+	[Tooltip("Optional. The master weight of the CCD (Cyclic Coordinate Descent) IK effect that bends the spine towards the head effector before FBBIK solves.")]
+	[Range(0f, 1f)]
+	public float CCDWeight = 1f;
+
+	[Tooltip("The weight of rolling the bones in towards the target")]
+	[Range(0f, 1f)]
+	public float roll;
+
+	[Tooltip("Smoothing the CCD effect.")]
+	[Range(0f, 1000f)]
+	public float damper = 500f;
+
+	[Tooltip("Bones to use for the CCD pass. Assign spine and/or neck bones.")]
+	public Transform[] CCDBones = new Transform[0];
+
+	[LargeHeader("Stretching")]
+	[Tooltip("Stretching the spine/neck to help reach the target. This is useful for making sure the head stays locked relative to the VR headset. NB! Stretching is done after FBBIK has solved so if you have the hand effectors pinned and spine bones included in the 'Stretch Bones', the hands might become offset from their target positions.")]
+	[Range(0f, 1f)]
+	public float postStretchWeight = 1f;
+
+	[Tooltip("Stretch magnitude limit.")]
+	public float maxStretch = 0.1f;
+
+	[Tooltip("If > 0, dampers the stretching effect.")]
+	public float stretchDamper;
+
+	[Tooltip("If true, will fix head position to this Transform no matter what. Good for making sure the head will not budge away from the VR headset")]
+	public bool fixBone;
+
+	[Tooltip("Bones to use for stretching. The more bones you add, the less noticable the effect.")]
+	public Transform[] stretchBones = new Transform[0];
+
+	[LargeHeader("Chest Direction")]
+	public Vector3 chestDirection = Vector3.forward;
+
+	[Range(0f, 1f)]
+	public float chestDirectionWeight = 1f;
+
+	public Transform[] chestBones = new Transform[0];
+
+	private Vector3 offset;
+
+	private Vector3 boneToBody;
+
+	private Vector3 nearCenterToBone;
+
+	private Vector3 boneToLeftFarBone;
+
+	private Vector3 boneToRightFarBone;
+
+	private Vector3 leftNearBonePos;
+
+	private Vector3 rightNearBonePos;
+
+	private float nearBoneDist;
+
+	private float leftNearBoneDist;
+
+	private float rightNearBoneDist;
+
+	private Quaternion chestRotation;
+
+	private Quaternion boneRotationRelativeToRoot;
+
+	private Quaternion[] ccdDefaultLocalRotations = new Quaternion[0];
+
+	private Vector3 boneLocalPosition;
+
+	private Quaternion boneLocalRotation;
+
+	private Vector3[] stretchLocalPositions = new Vector3[0];
+
+	private Quaternion[] stretchLocalRotations = new Quaternion[0];
+
+	private Vector3[] chestLocalPositions = new Vector3[0];
+
+	private Quaternion[] chestLocalRotations = new Quaternion[0];
+
+	private int bendBonesCount;
+
+	private int ccdBonesCount;
+
+	private int stretchBonesCount;
+
+	private int chestBonesCount;
+
+	public readonly bool IsUpperBody;
+
+	public readonly Transform Target;
+
+	public readonly Transform Bone;
+
+	[Serializable]
+	public class BendBone
+	{
+		public BendBone()
+		{
+		}
+
+		public BendBone(Transform transform, float weight)
+		{
+			this.transform = transform;
+			this.weight = weight;
+		}
+
+		public void StoreDefaultLocalState()
+		{
+			this.defaultLocalRotation = this.transform.localRotation;
+		}
+
+		public void FixTransforms()
+		{
+			this.transform.localRotation = this.defaultLocalRotation;
+		}
+
+		[Tooltip("Assign spine and/or neck bones.")]
+		public Transform transform;
+
+		[Tooltip("The weight of rotating this bone.")]
+		[Range(0f, 1f)]
+		public float weight = 0.5f;
+
+		private Quaternion defaultLocalRotation = Quaternion.identity;
+	}
+}

+ 80 - 9
Assembly-CSharp/FreeModeItemEveryday.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using MaidStatus;
 using PlayerStatus;
+using Schedule;
 
 public class FreeModeItemEveryday : AbstractFreeModeItem
 {
@@ -167,12 +168,9 @@ public class FreeModeItemEveryday : AbstractFreeModeItem
 		}
 	}
 
-	public override bool is_enabled
+	public override bool isEnabled(Maid maid)
 	{
-		get
-		{
-			return this.is_enabled_;
-		}
+		return !(maid == null) && this.everyday_event_data_ != null && (!this.everyday_event_data_.isNewBodyBlock || !maid.IsCrcBody) && this.everyday_event_data_.CheckMainHeroineBodyTypeMatch(maid) && this.is_enabled;
 	}
 
 	public override string play_file_name
@@ -195,6 +193,14 @@ public class FreeModeItemEveryday : AbstractFreeModeItem
 		}
 	}
 
+	protected override bool is_enabled
+	{
+		get
+		{
+			return this.is_enabled_;
+		}
+	}
+
 	private static void CreateCsvData(FreeModeItemEveryday.ScnearioType type)
 	{
 		string fileName = string.Empty;
@@ -293,11 +299,67 @@ public class FreeModeItemEveryday : AbstractFreeModeItem
 								everydayEventData.subHerionID = csvParser.GetCellAsInteger(num++, i);
 								while (csvParser.IsCellToExistData(num, 0))
 								{
-									if (csvParser.GetCellAsString(num, i) == "○")
+									string cellAsString = csvParser.GetCellAsString(num, 0);
+									string cellAsString2 = csvParser.GetCellAsString(num, i);
+									if (cellAsString == "新ボディブロック" || cellAsString == "メインキャラとのボディ一致チェック")
 									{
-										string cellAsString = csvParser.GetCellAsString(num, 0);
-										Personal.Data data = Personal.GetData(cellAsString);
-										everydayEventData.personalIdList.Add(data.id);
+										if (cellAsString == "新ボディブロック")
+										{
+											everydayEventData.isNewBodyBlock = (cellAsString2 == "○" || cellAsString2 == "◯");
+										}
+										else
+										{
+											everydayEventData.mainHeroineBodyTypeMatchCheckList = new HashSet<string>();
+											foreach (string text in cellAsString2.Split(new char[]
+											{
+												','
+											}))
+											{
+												if (!string.IsNullOrEmpty(text))
+												{
+													string text2 = text.Trim();
+													if (text2 != null)
+													{
+														if (text2 == "無垢" || text2 == "真面目" || text2 == "凜デレ")
+														{
+															everydayEventData.mainHeroineBodyTypeMatchCheckList.Add(text.Trim());
+															goto IL_371;
+														}
+													}
+													NDebug.Assert(string.Concat(new object[]
+													{
+														fileName,
+														"の",
+														num,
+														"列目の項目名「",
+														cellAsString,
+														"」を処理できません\nのメインキャラとのボディ一致チェック項目で不正な文字列が指定されています=>",
+														text.Trim()
+													}), false);
+												}
+												IL_371:;
+											}
+										}
+									}
+									else if (cellAsString2 == "○" || cellAsString2 == "◯")
+									{
+										if (Personal.Contains(cellAsString))
+										{
+											Personal.Data data = Personal.GetData(cellAsString);
+											everydayEventData.personalIdList.Add(data.id);
+										}
+										else
+										{
+											NDebug.Assert(string.Concat(new object[]
+											{
+												fileName,
+												"の",
+												num,
+												"列目の項目名「",
+												cellAsString,
+												"」を処理できません"
+											}), false);
+										}
 									}
 									num++;
 								}
@@ -370,6 +432,11 @@ public class FreeModeItemEveryday : AbstractFreeModeItem
 
 	private class EverydayEventData
 	{
+		public bool CheckMainHeroineBodyTypeMatch(Maid maid)
+		{
+			return ScheduleCSVData.ScheduleBase.CheckMainHeroineBodyTypeMatch(this.mainHeroineBodyTypeMatchCheckList, maid);
+		}
+
 		public AbstractFreeModeItem.GameMode gameMode;
 
 		public int id;
@@ -389,5 +456,9 @@ public class FreeModeItemEveryday : AbstractFreeModeItem
 		public string[] condition_texts;
 
 		public List<int> personalIdList = new List<int>();
+
+		public bool isNewBodyBlock;
+
+		public HashSet<string> mainHeroineBodyTypeMatchCheckList;
 	}
 }

+ 38 - 6
Assembly-CSharp/FreeModeItemLifeMode.cs

@@ -148,7 +148,7 @@ public class FreeModeItemLifeMode : AbstractFreeModeItem
 		}
 	}
 
-	public override bool is_enabled
+	protected override bool is_enabled
 	{
 		get
 		{
@@ -157,18 +157,34 @@ public class FreeModeItemLifeMode : AbstractFreeModeItem
 				return false;
 			}
 			List<Maid> lifeModeAllMaidList = GameMain.Instance.LifeModeMgr.lifeModeAllMaidList;
-			using (Dictionary<int, string>.Enumerator enumerator = this.m_LifeModeData.dataMaidPersonalUniqueNameAndActiveSlotDic.GetEnumerator())
+			if (this.m_LifeModeData.dataRequestBodyTypeEquals)
 			{
-				while (enumerator.MoveNext())
+				bool result;
+				if (!this.IsCorrectMaidPersonal(from m in lifeModeAllMaidList
+				where m.IsCrcBody
+				select m))
 				{
-					KeyValuePair<int, string> personalSlotPair = enumerator.Current;
-					if (!lifeModeAllMaidList.Any((Maid maid) => maid.status.personal.uniqueName == personalSlotPair.Value))
+					result = this.IsCorrectMaidPersonal(from m in lifeModeAllMaidList
+					where !m.IsCrcBody
+					select m);
+				}
+				else
+				{
+					result = true;
+				}
+				return result;
+			}
+			if (this.m_LifeModeData.dataNewBodyBlock && lifeModeAllMaidList != null)
+			{
+				foreach (Maid maid in lifeModeAllMaidList)
+				{
+					if (maid.IsCrcBody)
 					{
 						return false;
 					}
 				}
 			}
-			return true;
+			return this.IsCorrectMaidPersonal(lifeModeAllMaidList);
 		}
 	}
 
@@ -188,6 +204,22 @@ public class FreeModeItemLifeMode : AbstractFreeModeItem
 		}
 	}
 
+	private bool IsCorrectMaidPersonal(IEnumerable<Maid> maidList)
+	{
+		using (Dictionary<int, string>.Enumerator enumerator = this.m_LifeModeData.dataMaidPersonalUniqueNameAndActiveSlotDic.GetEnumerator())
+		{
+			while (enumerator.MoveNext())
+			{
+				KeyValuePair<int, string> personalSlotPair = enumerator.Current;
+				if (!maidList.Any((Maid maid) => maid.status.personal.uniqueName == personalSlotPair.Value))
+				{
+					return false;
+				}
+			}
+		}
+		return true;
+	}
+
 	public bool IsDisplayable
 	{
 		get

+ 3 - 3
Assembly-CSharp/FreeModeItemList.cs

@@ -20,7 +20,7 @@ public class FreeModeItemList : MonoBehaviour
 		}
 	}
 
-	public bool SetList(AbstractFreeModeItem[] item_list)
+	public bool SetList(AbstractFreeModeItem[] item_list, Maid maid)
 	{
 		if (0 < this.grid_.gameObject.transform.childCount || item_list == null || item_list.Length <= 0)
 		{
@@ -51,8 +51,8 @@ public class FreeModeItemList : MonoBehaviour
 			eventDelegate.parameters[0].value = component3;
 			EventDelegate.Add(component4.onHoverOver, eventDelegate);
 			EventDelegate.Add(component4.onHoverOut, new EventDelegate.Callback(this.OnMouseHoverOut));
-			bool is_enabled = item_list[i].is_enabled;
-			if (is_enabled)
+			bool flag = item_list[i].isEnabled(maid);
+			if (flag)
 			{
 				component3.isEnabled = true;
 				UTY.GetChildObject(gameObject, "HitRect", false).SetActive(false);

+ 8 - 8
Assembly-CSharp/FreeModeItemVip.cs

@@ -99,14 +99,6 @@ public class FreeModeItemVip : AbstractFreeModeItem
 		}
 	}
 
-	public override bool is_enabled
-	{
-		get
-		{
-			return this.is_enabled_;
-		}
-	}
-
 	public override string play_file_name
 	{
 		get
@@ -131,6 +123,14 @@ public class FreeModeItemVip : AbstractFreeModeItem
 		}
 	}
 
+	protected override bool is_enabled
+	{
+		get
+		{
+			return this.is_enabled_;
+		}
+	}
+
 	private static void CreateCsvData()
 	{
 		if (FreeModeItemVip.vip_data_dic_ != null)

+ 4 - 4
Assembly-CSharp/FreeModeSceneSelectBase.cs

@@ -37,15 +37,15 @@ public class FreeModeSceneSelectBase : WfScreenChildren
 		bool isEnabled;
 		if (this.mode == FreeModeSceneSelectBase.SelectMode.Story)
 		{
-			isEnabled = this.freemode_item_list_.SetList(FreeModeItemEveryday.CreateItemEverydayList(FreeModeItemEveryday.ScnearioType.Story, null).ToArray());
+			isEnabled = this.freemode_item_list_.SetList(FreeModeItemEveryday.CreateItemEverydayList(FreeModeItemEveryday.ScnearioType.Story, null).ToArray(), this.maid_);
 		}
 		else if (this.mode == FreeModeSceneSelectBase.SelectMode.Everyday)
 		{
-			isEnabled = this.freemode_item_list_.SetList(FreeModeItemEveryday.CreateItemEverydayList(FreeModeItemEveryday.ScnearioType.Nitijyou, this.maid_.status).ToArray());
+			isEnabled = this.freemode_item_list_.SetList(FreeModeItemEveryday.CreateItemEverydayList(FreeModeItemEveryday.ScnearioType.Nitijyou, this.maid_.status).ToArray(), this.maid_);
 		}
 		else if (this.mode == FreeModeSceneSelectBase.SelectMode.LifeMode)
 		{
-			isEnabled = this.freemode_item_list_.SetList(FreeModeItemLifeMode.CreateItemList(true).ToArray());
+			isEnabled = this.freemode_item_list_.SetList(FreeModeItemLifeMode.CreateItemList(true).ToArray(), this.maid_);
 		}
 		else
 		{
@@ -59,7 +59,7 @@ public class FreeModeSceneSelectBase : WfScreenChildren
 			foreach (FreeModeItemVip freeModeItemVip in this.vip_list_)
 			{
 				ScheduleTaskViewer.ViewData item = default(ScheduleTaskViewer.ViewData);
-				item.is_enabled = freeModeItemVip.is_enabled;
+				item.is_enabled = freeModeItemVip.isEnabled(this.maid_);
 				item.schedule = freeModeItemVip.vip_data;
 				if (!GameMain.Instance.CharacterMgr.status.lockNTRPlay || !ScheduleCSVData.NetorareFlag.Contains(item.schedule.id))
 				{

+ 0 - 717
Assembly-CSharp/FullBodyIKCtrl.cs

@@ -1,717 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using RootMotion.FinalIK;
-using UnityEngine;
-
-public class FullBodyIKCtrl : MonoBehaviour
-{
-	public TBody TgtBody
-	{
-		get
-		{
-			return this.m_TgtBody;
-		}
-	}
-
-	public Maid TgtChara
-	{
-		get
-		{
-			return this.m_TgtBody.maid;
-		}
-	}
-
-	public Transform IKTgtRoot
-	{
-		get
-		{
-			return this.m_IKTgtRoot;
-		}
-	}
-
-	public FullBodyBipedIK FullbodyIK
-	{
-		get
-		{
-			return this.m_FullbodyIK;
-		}
-	}
-
-	public IKEffector BodyEffector
-	{
-		get
-		{
-			return this.m_FullbodyIK.solver.bodyEffector;
-		}
-	}
-
-	public BodyCtrlData BodyCtrlData
-	{
-		get
-		{
-			return this.m_BodyCtrlData;
-		}
-	}
-
-	public Transform BodyTarget { get; private set; }
-
-	public bool IsUpdateEnd { get; private set; }
-
-	public Dictionary<string, IKCtrlData> strIKDataPair
-	{
-		get
-		{
-			return this.m_StrIKDataPair;
-		}
-	}
-
-	public bool IsIKExec
-	{
-		get
-		{
-			return this.m_StrIKDataPair.Any((KeyValuePair<string, IKCtrlData> ik) => ik.Value.IsIKExec) && this.IKActive;
-		}
-	}
-
-	public bool IsSelfIKAttach
-	{
-		get
-		{
-			return this.m_StrIKDataPair.Any((KeyValuePair<string, IKCtrlData> ik) => ik.Value.IsSelfIKAttach) && this.IKActive;
-		}
-	}
-
-	public void Init()
-	{
-		this.m_TgtBody = base.GetComponent<TBody>();
-		if (!this.m_IKTgtRoot)
-		{
-			this.m_IKTgtRoot = new GameObject("IK Target Root").transform;
-			this.m_IKTgtRoot.SetParent(this.m_TgtBody.m_trBones, false);
-		}
-		if (!this.TgtChara.boMAN)
-		{
-			this.m_STRoot = this.m_TgtBody.m_trBones.Find("ST_Root");
-		}
-		if (this.m_FullbodyIK)
-		{
-			UnityEngine.Object.DestroyImmediate(this.m_FullbodyIK);
-		}
-		this.m_FullbodyIK = this.m_IKTgtRoot.gameObject.AddComponent<FullBodyBipedIK>();
-		if (this.m_Mouth)
-		{
-			UnityEngine.Object.DestroyImmediate(this.m_Mouth);
-		}
-		this.m_Mouth = new GameObject("Mouth").transform;
-		this.m_Mouth.SetParent(this.TgtBody.trsHead, false);
-		this.m_Mouth.localEulerAngles = new Vector3(-90f, 90f, 0f);
-		if (!this.TgtChara.boMAN)
-		{
-			if (this.m_NippleL)
-			{
-				UnityEngine.Object.DestroyImmediate(this.m_NippleL);
-			}
-			if (this.m_NippleR)
-			{
-				UnityEngine.Object.DestroyImmediate(this.m_NippleR);
-			}
-			this.m_NippleL = new GameObject("Nipple_L").transform;
-			this.m_NippleL.SetParent(CMT.SearchObjName(this.TgtBody.m_trBones, "Mune_L_sub", true), false);
-			this.m_NippleR = new GameObject("Nipple_R").transform;
-			this.m_NippleR.SetParent(CMT.SearchObjName(this.TgtBody.m_trBones, "Mune_R_sub", true), false);
-		}
-		this.m_NameFlagObjpair.Clear();
-		this.m_IKBoneDic = FullBodyIKCtrl.GetAllIKBoneDic(this.TgtChara);
-		this.m_FullbodyIK.references.root = this.m_TgtBody.m_trBones;
-		this.m_FullbodyIK.references.pelvis = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Root);
-		if (!this.TgtChara.boMAN)
-		{
-			this.m_FullbodyIK.references.spine = new Transform[]
-			{
-				this.m_IKBoneDic[FullBodyIKCtrl.IKBoneType.Spine0],
-				this.m_IKBoneDic[FullBodyIKCtrl.IKBoneType.Spine3]
-			};
-		}
-		else
-		{
-			this.m_FullbodyIK.references.spine = new Transform[]
-			{
-				this.m_IKBoneDic[FullBodyIKCtrl.IKBoneType.Spine0],
-				this.m_IKBoneDic[FullBodyIKCtrl.IKBoneType.Spine2]
-			};
-		}
-		this.m_FullbodyIK.references.head = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Head);
-		this.m_FullbodyIK.references.leftUpperArm = this.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_L);
-		this.m_FullbodyIK.references.leftForearm = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_L);
-		this.m_FullbodyIK.references.leftHand = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_L);
-		this.m_FullbodyIK.references.rightUpperArm = this.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_R);
-		this.m_FullbodyIK.references.rightForearm = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_R);
-		this.m_FullbodyIK.references.rightHand = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_R);
-		this.m_FullbodyIK.references.leftThigh = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Thigh_L);
-		this.m_FullbodyIK.references.leftCalf = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Calf_L);
-		this.m_FullbodyIK.references.leftFoot = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_L);
-		this.m_FullbodyIK.references.rightThigh = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Thigh_R);
-		this.m_FullbodyIK.references.rightCalf = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Calf_R);
-		this.m_FullbodyIK.references.rightFoot = this.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_R);
-		this.m_FullbodyIK.solver.SetToReferences(this.m_FullbodyIK.references, null);
-		this.m_FullbodyIK.fixTransforms = false;
-		foreach (IKEffector ikeffector in this.m_FullbodyIK.solver.effectors)
-		{
-			ikeffector.positionWeight = 0f;
-			ikeffector.rotationWeight = 0f;
-		}
-		foreach (FBIKChain fbikchain in this.m_FullbodyIK.solver.chain)
-		{
-			fbikchain.bendConstraint.weight = 0f;
-		}
-		this.m_BodyCtrlData = this.SafeAddBodyCtrlData("体全体");
-		this.FullbodyIK.solver.GetChain(FullBodyBipedChain.LeftLeg).pull = 0f;
-		this.FullbodyIK.solver.GetChain(FullBodyBipedChain.RightLeg).pull = 0f;
-		this.AddLimbIKData(FullBodyIKCtrl.IKBoneType.Hand_L, FullBodyIKCtrl.IKBoneType.Forearm_L, FullBodyIKCtrl.IKBoneType.UpperArm_L, FullBodyBipedEffector.LeftHand, FullBodyBipedEffector.LeftShoulder, true);
-		this.AddLimbIKData(FullBodyIKCtrl.IKBoneType.Hand_R, FullBodyIKCtrl.IKBoneType.Forearm_R, FullBodyIKCtrl.IKBoneType.UpperArm_R, FullBodyBipedEffector.RightHand, FullBodyBipedEffector.RightShoulder, true);
-		this.AddLimbIKData(FullBodyIKCtrl.IKBoneType.Foot_L, FullBodyIKCtrl.IKBoneType.Calf_L, FullBodyIKCtrl.IKBoneType.Thigh_L, FullBodyBipedEffector.LeftFoot, FullBodyBipedEffector.LeftThigh, false);
-		this.AddLimbIKData(FullBodyIKCtrl.IKBoneType.Foot_R, FullBodyIKCtrl.IKBoneType.Calf_R, FullBodyIKCtrl.IKBoneType.Thigh_R, FullBodyBipedEffector.RightFoot, FullBodyBipedEffector.RightThigh, false);
-		if (!this.BodyTarget)
-		{
-			Transform transform = this.m_IKTgtRoot.Find(this.BodyEffector.bone.name);
-			if (!transform)
-			{
-				transform = new GameObject(this.BodyEffector.bone.name).transform;
-			}
-			transform.SetParent(this.m_IKTgtRoot, false);
-			this.BodyTarget = new GameObject("IKTarget").transform;
-			this.BodyTarget.SetParent(transform, false);
-		}
-		this.BodyEffector.target = this.BodyTarget;
-		this.BodyEffector.effectChildNodes = false;
-		this.FullbodyIK.solver.spineStiffness = 0f;
-		this.m_FullbodyIK.enabled = false;
-	}
-
-	private BodyCtrlData SafeAddBodyCtrlData(string key_str)
-	{
-		BodyCtrlData bodyCtrlData = new BodyCtrlData(this);
-		if (this.m_StrIKDataPair.ContainsKey(key_str))
-		{
-			this.m_StrIKDataPair[key_str] = bodyCtrlData;
-		}
-		else
-		{
-			this.m_StrIKDataPair.Add(key_str, bodyCtrlData);
-		}
-		this.m_BodyCtrlData = bodyCtrlData;
-		return (BodyCtrlData)this.m_StrIKDataPair[key_str];
-	}
-
-	private LimbIKData[] AddLimbIKData(FullBodyIKCtrl.IKBoneType hand_foot, FullBodyIKCtrl.IKBoneType elbow_knee, FullBodyIKCtrl.IKBoneType shoulder_thigh, FullBodyBipedEffector handfoot_effector, FullBodyBipedEffector shoulderthigh_effector, bool use_old = false)
-	{
-		IKSolverFullBodyBiped solver = this.FullbodyIK.solver;
-		IKMappingLimb limbMapping = solver.GetLimbMapping(handfoot_effector);
-		FBIKChain chain = solver.GetChain(handfoot_effector);
-		ShoulderThighIKData shoulderThighIKData = new ShoulderThighIKData(solver.GetEffector(shoulderthigh_effector), chain, limbMapping, this, this.GetIKBone(shoulder_thigh));
-		this.m_StrIKDataPair[FullBodyIKCtrl.IKBoneTypeStrDic[shoulder_thigh]] = shoulderThighIKData;
-		ElbowKneeIKData elbowKneeIKData = new ElbowKneeIKData(chain, limbMapping, this, this.GetIKBone(elbow_knee));
-		this.m_StrIKDataPair[FullBodyIKCtrl.IKBoneTypeStrDic[elbow_knee]] = elbowKneeIKData;
-		HandFootIKData handFootIKData = new HandFootIKData(solver.GetEffector(handfoot_effector), chain, limbMapping, this, this.GetIKBone(hand_foot), use_old);
-		this.m_StrIKDataPair[FullBodyIKCtrl.IKBoneTypeStrDic[hand_foot]] = handFootIKData;
-		shoulderThighIKData.SetChainData(handFootIKData, elbowKneeIKData);
-		elbowKneeIKData.SetChainData(handFootIKData, shoulderThighIKData);
-		handFootIKData.SetChainData(elbowKneeIKData, shoulderThighIKData);
-		return new LimbIKData[]
-		{
-			shoulderThighIKData,
-			elbowKneeIKData,
-			handFootIKData
-		};
-	}
-
-	private void Update()
-	{
-		this.IsUpdateEnd = false;
-		if (this.IKActive)
-		{
-			this.BodyCtrlData.CharaPosReset();
-		}
-	}
-
-	private void OnDestroy()
-	{
-		if (this.m_IKTgtRoot)
-		{
-			UnityEngine.Object.Destroy(this.m_IKTgtRoot);
-		}
-	}
-
-	public void IKUpdate()
-	{
-		if (!this.m_IsPelvisPull)
-		{
-			this.BodyEffector.positionWeight = 1f;
-		}
-		else
-		{
-			this.BodyEffector.positionWeight = 0f;
-		}
-		this.BodyTarget.position = this.BodyEffector.bone.position;
-		this.IsUpdateLate = false;
-		foreach (IKCtrlData ikctrlData in this.m_StrIKDataPair.Values)
-		{
-			ikctrlData.TagetTransCpy();
-		}
-		this.BodyCtrlData.ApplyIKSetting();
-		if (this.IsUpdateLate)
-		{
-			return;
-		}
-		if (this.BodyCtrlData.IsIKExec)
-		{
-			this.BodyCtrlData.Update();
-		}
-		foreach (IKCtrlData ikctrlData2 in this.m_StrIKDataPair.Values)
-		{
-			if (!(ikctrlData2 is BodyCtrlData))
-			{
-				ikctrlData2.ApplyIKSetting();
-			}
-		}
-		if (!this.IsUpdateLate)
-		{
-			if (this.IsIKExec || this.AllForceIK)
-			{
-				this.SolverUpdate();
-			}
-			else
-			{
-				foreach (IKCtrlData ikctrlData3 in this.m_StrIKDataPair.Values)
-				{
-					ikctrlData3.SaveLastBonePosRot();
-				}
-			}
-		}
-	}
-
-	public void AttachPointTransCpy(Transform trans, string slot_name, string attach_name, bool scale_cpy = false)
-	{
-		int slotNo = this.TgtBody.GetSlotNo(slot_name);
-		if (this.TgtBody.goSlot[slotNo].morph == null)
-		{
-			return;
-		}
-		Vector3 position;
-		Quaternion rotation;
-		Vector3 localScale;
-		this.TgtBody.goSlot[slotNo].morph.GetAttachPoint(attach_name, out position, out rotation, out localScale, false);
-		trans.position = position;
-		trans.rotation = rotation;
-		if (scale_cpy)
-		{
-			trans.localScale = localScale;
-		}
-	}
-
-	public void SolverUpdate()
-	{
-		this.IsUpdateEnd = true;
-		Action postSolverUpdate = this.PostSolverUpdate;
-		this.PostSolverUpdate = null;
-		if (this.IKActive)
-		{
-			bool flag = false;
-			foreach (IKCtrlData ikctrlData in this.m_StrIKDataPair.Values)
-			{
-				if (!(ikctrlData is BodyCtrlData))
-				{
-					if (ikctrlData.NeedFullbodySolverUpdate)
-					{
-						flag = true;
-						break;
-					}
-				}
-			}
-			if (flag)
-			{
-				Vector3 localPosition = this.m_FullbodyIK.references.spine[1].localPosition;
-				this.m_FullbodyIK.solver.Update();
-				this.m_FullbodyIK.references.spine[1].localPosition = localPosition;
-			}
-			foreach (IKCtrlData ikctrlData2 in this.m_StrIKDataPair.Values)
-			{
-				if (!(ikctrlData2 is BodyCtrlData))
-				{
-					if (ikctrlData2.IsIKExec)
-					{
-						ikctrlData2.Update();
-					}
-				}
-			}
-		}
-		foreach (IKCtrlData ikctrlData3 in this.m_StrIKDataPair.Values)
-		{
-			ikctrlData3.LateUpdate();
-		}
-		if (this.IKActive && postSolverUpdate != null)
-		{
-			postSolverUpdate();
-		}
-	}
-
-	public void LateIKUpdate()
-	{
-		this.IKUpdate();
-		this.TgtBody.AutoTwist();
-		this.TgtBody.SkinMeshUpdate();
-	}
-
-	public Transform GetIKBone(FullBodyIKCtrl.IKBoneType boneType)
-	{
-		return (!this.m_IKBoneDic.ContainsKey(boneType)) ? null : this.m_IKBoneDic[boneType];
-	}
-
-	public Transform[] GetChainBonesToInit(FullBodyIKCtrl.IKBoneType boneType)
-	{
-		Transform[] result = new Transform[0];
-		switch (boneType)
-		{
-		case FullBodyIKCtrl.IKBoneType.UpperArm_R:
-		case FullBodyIKCtrl.IKBoneType.Forearm_R:
-		case FullBodyIKCtrl.IKBoneType.Hand_R:
-			result = new Transform[]
-			{
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_R),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_R),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_R)
-			};
-			break;
-		case FullBodyIKCtrl.IKBoneType.UpperArm_L:
-		case FullBodyIKCtrl.IKBoneType.Forearm_L:
-		case FullBodyIKCtrl.IKBoneType.Hand_L:
-			result = new Transform[]
-			{
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_L),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Forearm_L),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_L)
-			};
-			break;
-		case FullBodyIKCtrl.IKBoneType.Thigh_R:
-		case FullBodyIKCtrl.IKBoneType.Calf_R:
-		case FullBodyIKCtrl.IKBoneType.Foot_R:
-			result = new Transform[]
-			{
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Thigh_R),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Calf_R),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_R)
-			};
-			break;
-		case FullBodyIKCtrl.IKBoneType.Thigh_L:
-		case FullBodyIKCtrl.IKBoneType.Calf_L:
-		case FullBodyIKCtrl.IKBoneType.Foot_L:
-			result = new Transform[]
-			{
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Thigh_L),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Calf_L),
-				this.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_L)
-			};
-			break;
-		}
-		return result;
-	}
-
-	public IKCtrlData GetIKData(string tag_name, bool flagcheck = false)
-	{
-		return this.GetIKData(tag_name);
-	}
-
-	public IKCtrlData GetIKData(string tag_name)
-	{
-		if (this.m_StrIKDataPair.ContainsKey(tag_name))
-		{
-			return this.m_StrIKDataPair[tag_name];
-		}
-		return null;
-	}
-
-	public T GetIKData<T>(string tag_name) where T : IKCtrlData
-	{
-		IKCtrlData ikdata = this.GetIKData(tag_name);
-		if (ikdata != null && ikdata is T)
-		{
-			return ikdata as T;
-		}
-		return (T)((object)null);
-	}
-
-	public IKCtrlData GetIKData(FullBodyIKCtrl.IKBoneType bone_type)
-	{
-		if (FullBodyIKCtrl.IKBoneTypeStrDic.ContainsKey(bone_type))
-		{
-			return this.GetIKData(FullBodyIKCtrl.IKBoneTypeStrDic[bone_type]);
-		}
-		return null;
-	}
-
-	public T GetIKData<T>(FullBodyIKCtrl.IKBoneType bone_type) where T : IKCtrlData
-	{
-		IKCtrlData ikdata = this.GetIKData(bone_type);
-		if (ikdata != null && ikdata is T)
-		{
-			return ikdata as T;
-		}
-		return (T)((object)null);
-	}
-
-	public Transform GetSTFlagObj(string name)
-	{
-		if (this.m_NameFlagObjpair.ContainsKey(name))
-		{
-			return this.m_NameFlagObjpair[name];
-		}
-		Transform transform = this.m_STRoot.Find(name);
-		if (!transform)
-		{
-			transform = this.TgtBody.GetBone(name);
-			if (!transform)
-			{
-				Debug.LogErrorFormat("{0}は存在しません", new object[]
-				{
-					name
-				});
-				return null;
-			}
-		}
-		this.m_NameFlagObjpair.Add(name, transform);
-		return transform;
-	}
-
-	public bool IsCharaIKAttach(Maid chara)
-	{
-		if (!this.IKActive || !this.IsIKExec)
-		{
-			return false;
-		}
-		foreach (IKCtrlData ikctrlData in this.strIKDataPair.Values)
-		{
-			if (ikctrlData.IsIKTargetChara(chara))
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public bool IsTargetIKAttachSelf(bool check_ikend = true)
-	{
-		if (!this.IKActive || !this.IsIKExec)
-		{
-			return false;
-		}
-		using (Dictionary<string, IKCtrlData>.ValueCollection.Enumerator enumerator = this.strIKDataPair.Values.GetEnumerator())
-		{
-			while (enumerator.MoveNext())
-			{
-				IKCtrlData ik_data = enumerator.Current;
-				Func<IKCtrlData.IKAttachType, bool> func = delegate(IKCtrlData.IKAttachType attach_type)
-				{
-					IKCtrlData.IKSettingData iksettingData = ik_data.GetIKSettingData(attach_type);
-					foreach (IKCtrlData.IKExecTiming exec_timing in (IKCtrlData.IKExecTiming[])Enum.GetValues(typeof(IKCtrlData.IKExecTiming)))
-					{
-						IKCtrlData.IKTargetData targetData = ik_data.GetTargetData(attach_type, exec_timing);
-						if (targetData.TgtChara)
-						{
-							bool flag;
-							if (check_ikend)
-							{
-								flag = (targetData.TgtChara.IKCtrl.IsCharaIKAttach(this.TgtChara) && !targetData.TgtChara.IKCtrl.IsUpdateEnd && !targetData.TgtChara.IKCtrl.IsUpdateLate);
-							}
-							else
-							{
-								flag = targetData.TgtChara.IKCtrl.IsCharaIKAttach(this.TgtChara);
-							}
-							if (flag)
-							{
-								return true;
-							}
-						}
-					}
-					return false;
-				};
-				if (func(IKCtrlData.IKAttachType.NewPoint) || func(IKCtrlData.IKAttachType.Rotate))
-				{
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	public void SetPelvisPull(bool pull_on)
-	{
-		this.m_IsPelvisPull = pull_on;
-	}
-
-	public static Dictionary<FullBodyIKCtrl.IKBoneType, Transform> GetAllIKBoneDic(Maid chara)
-	{
-		if (chara == null)
-		{
-			return null;
-		}
-		NDebug.Assert(chara.body0 != null, "[body0] it does not end load.");
-		string text = (!chara.boMAN) ? "Bip01" : "ManBip";
-		Dictionary<FullBodyIKCtrl.IKBoneType, Transform> dictionary = new Dictionary<FullBodyIKCtrl.IKBoneType, Transform>();
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.TopFixed, chara.body0.GetBone(text).parent);
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Root, chara.body0.GetBone(text));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Pelvis, chara.body0.GetBone(text + " Pelvis"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine0, chara.body0.GetBone(text + " Spine"));
-		if (!chara.boMAN)
-		{
-			dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine1, chara.body0.GetBone(text + " Spine0a"));
-			dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine2, chara.body0.GetBone(text + " Spine1"));
-			dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine3, chara.body0.GetBone(text + " Spine1a"));
-		}
-		else
-		{
-			dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine1, chara.body0.GetBone(text + " Spine1"));
-			dictionary.Add(FullBodyIKCtrl.IKBoneType.Spine2, chara.body0.GetBone(text + " Spine2"));
-		}
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Head, chara.body0.GetBone(text + " Head"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Neck, chara.body0.GetBone(text + " Neck"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.UpperArm_R, chara.body0.GetBone(text + " R UpperArm"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Forearm_R, chara.body0.GetBone(text + " R Forearm"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Hand_R, chara.body0.GetBone(text + " R Hand"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.UpperArm_L, chara.body0.GetBone(text + " L UpperArm"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Forearm_L, chara.body0.GetBone(text + " L Forearm"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Hand_L, chara.body0.GetBone(text + " L Hand"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Thigh_R, chara.body0.GetBone(text + " R Thigh"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Calf_R, chara.body0.GetBone(text + " R Calf"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Foot_R, chara.body0.GetBone(text + " R Foot"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Thigh_L, chara.body0.GetBone(text + " L Thigh"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Calf_L, chara.body0.GetBone(text + " L Calf"));
-		dictionary.Add(FullBodyIKCtrl.IKBoneType.Foot_L, chara.body0.GetBone(text + " L Foot"));
-		return dictionary;
-	}
-
-	public const float PULL_MIN_VALUE = 0.1f;
-
-	public static readonly Dictionary<FullBodyIKCtrl.IKBoneType, string> IKBoneTypeStrDic = new Dictionary<FullBodyIKCtrl.IKBoneType, string>
-	{
-		{
-			FullBodyIKCtrl.IKBoneType.Root,
-			"体全体"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Hand_R,
-			"右手"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Forearm_R,
-			"右肘"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.UpperArm_R,
-			"右肩"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Hand_L,
-			"左手"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Forearm_L,
-			"左肘"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.UpperArm_L,
-			"左肩"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Foot_R,
-			"右足"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Calf_R,
-			"右膝"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Thigh_R,
-			"右腿"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Foot_L,
-			"左足"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Calf_L,
-			"左膝"
-		},
-		{
-			FullBodyIKCtrl.IKBoneType.Thigh_L,
-			"左腿"
-		}
-	};
-
-	[SerializeField]
-	private TBody m_TgtBody;
-
-	[SerializeField]
-	private Transform m_IKTgtRoot;
-
-	[SerializeField]
-	private Transform m_STRoot;
-
-	[SerializeField]
-	private FullBodyBipedIK m_FullbodyIK;
-
-	private Dictionary<FullBodyIKCtrl.IKBoneType, Transform> m_IKBoneDic = new Dictionary<FullBodyIKCtrl.IKBoneType, Transform>();
-
-	[SerializeField]
-	private BodyCtrlData m_BodyCtrlData;
-
-	private Transform m_NippleL;
-
-	private Transform m_NippleR;
-
-	private Transform m_Mouth;
-
-	private Dictionary<string, IKCtrlData> m_StrIKDataPair = new Dictionary<string, IKCtrlData>();
-
-	private Dictionary<string, Transform> m_NameFlagObjpair = new Dictionary<string, Transform>();
-
-	public bool IKActive = true;
-
-	[HideInInspector]
-	public bool IsUpdateLate;
-
-	public Action PostSolverUpdate;
-
-	public bool AllForceIK;
-
-	public float BlendTime = 0.5f;
-
-	private bool m_IsPelvisPull;
-
-	public enum IKBoneType
-	{
-		TopFixed,
-		Root,
-		Spine0,
-		Spine1,
-		Spine2,
-		Spine3,
-		Neck,
-		Head,
-		Clavicle_R,
-		UpperArm_R,
-		Forearm_R,
-		Hand_R,
-		Clavicle_L,
-		UpperArm_L,
-		Forearm_L,
-		Hand_L,
-		Pelvis,
-		Thigh_R,
-		Calf_R,
-		Foot_R,
-		Thigh_L,
-		Calf_L,
-		Foot_L
-	}
-}

File diff suppressed because it is too large
+ 1500 - 0
Assembly-CSharp/FullBodyIKMgr.cs


+ 32 - 14
Assembly-CSharp/GameInShopMain.cs

@@ -102,25 +102,43 @@ public class GameInShopMain : WfScreenChildren
 		this.labelMoney.text = GameMain.Instance.CharacterMgr.status.moneyText;
 		this.item_info_window_.transform.localPosition = new Vector3(7f, -600f, 0f);
 		this.CheckCardSet();
-		this.maid_ = GameMain.Instance.CharacterMgr.GetMaid(0);
-		if (this.maid_ == null || !this.maid_.status.leader)
+		if (!PluginData.IsEnabled("GP003"))
 		{
-			Maid x = null;
-			for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
+			this.maid_ = GameMain.Instance.CharacterMgr.GetMaid(0);
+			if (this.maid_ == null || !this.maid_.status.leader)
 			{
-				Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
-				if (stockMaid.status.leader)
+				Maid x = null;
+				for (int i = 0; i < GameMain.Instance.CharacterMgr.GetStockMaidCount(); i++)
 				{
-					x = stockMaid;
-					break;
+					Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(i);
+					if (stockMaid.status.leader)
+					{
+						x = stockMaid;
+						break;
+					}
+				}
+				if (x == null)
+				{
+					x = GameMain.Instance.CharacterMgr.GetStockMaid(0);
 				}
+				this.maid_ = x;
+				GameMain.Instance.CharacterMgr.SetActiveMaid(this.maid_, 0);
 			}
-			if (x == null)
+		}
+		else
+		{
+			this.maid_ = GameMain.Instance.CharacterMgr.ActivateNpc(0);
+			string text = "pre_game_in_shop";
+			TextAsset textAsset = Resources.Load("Preset/" + text) as TextAsset;
+			using (MemoryStream memoryStream = new MemoryStream(textAsset.bytes))
 			{
-				x = GameMain.Instance.CharacterMgr.GetStockMaid(0);
+				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
+				{
+					CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, text);
+					GameMain.Instance.CharacterMgr.PresetSet(this.maid_, f_prest, false);
+				}
 			}
-			this.maid_ = x;
-			GameMain.Instance.CharacterMgr.SetActiveMaid(this.maid_, 0);
+			Resources.UnloadAsset(textAsset);
 		}
 		this.maid_.Visible = true;
 		SceneEdit.AllProcPropSeqStart(this.maid_);
@@ -230,7 +248,7 @@ public class GameInShopMain : WfScreenChildren
 			{
 				this.wait_check_time_ = GameMain.tick_count;
 				ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
-				scriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false);
+				scriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false, false);
 				this.maid_.FaceAnime("通常", 1f, 0);
 				this.maid_.FaceBlend("無し");
 				return false;
@@ -644,7 +662,7 @@ public class GameInShopMain : WfScreenChildren
 			this.backup_maid_prop_.Add(this.CreateData(maid, MPN.eye));
 			this.backup_maid_prop_.Add(this.CreateData(maid, MPN.eye_hi));
 			this.backup_maid_prop_.Add(this.CreateData(maid, MPN.eye_hi_r));
-			for (int i = 81; i <= 110; i++)
+			for (int i = 167; i <= 201; i++)
 			{
 				this.backup_maid_prop_.Add(this.CreateData(maid, (MPN)i));
 			}

+ 64 - 13
Assembly-CSharp/GameMain.cs

@@ -385,6 +385,18 @@ public class GameMain : MonoSingleton<GameMain>
 		NDebug.Assert(this.m_camMainCamera != null, "GameMainにメインカメラが設定されていません。");
 		NDebug.Assert(this.m_camThumCamera != null, "GameMainにサムネイル用カメラが設定されていません。");
 		NDebug.Assert(this.m_camMainLight != null, "GameMainにメインライトが設定されていません。");
+		if (File.Exists(Path.Combine(UTY.gameProjectPath, "__cr_edit_system_first_update__")))
+		{
+			string path = Path.Combine(UTY.gameProjectPath, "__cr_edit_system_first_update__");
+			try
+			{
+				File.Delete(path);
+			}
+			catch
+			{
+			}
+			NUty.WinMessageBox(NUty.GetWindowHandle(), "CR EditSystem対応へのアップデートを開始します\nDLCの導入状況等によりゲーム起動まで時間がかかる場合がございます", "ご注意", 64);
+		}
 		UTY.InitDll();
 		base.transform.position = Vector3.zero;
 		Transform transform = base.transform.Find("BG");
@@ -424,7 +436,11 @@ public class GameMain : MonoSingleton<GameMain>
 		if (this.CMSystem.NetUse)
 		{
 			this.m_Webs = base.gameObject.AddComponent<Webs>();
-			this.m_Webs.Init();
+			if (!this.m_Webs.Init())
+			{
+				UnityEngine.Object.Destroy(this.m_Webs);
+				this.m_Webs = null;
+			}
 		}
 		this.m_ScenarioSelectMgr.InitScenarioData();
 		CasinoDataMgr.Instance.InitShopData();
@@ -683,9 +699,10 @@ public class GameMain : MonoSingleton<GameMain>
 		serializeHeader.nMaidNum = this.m_CharacterMgr.GetStockMaidCount();
 		serializeHeader.strComment = f_strComment;
 		serializeHeader.productTypeID = (int)Product.type;
+		serializeHeader.saveDataGUID = this.m_CharacterMgr.RenewSaveDataGUID();
 		binaryWriter.Write("COM3D2_SAVE");
-		binaryWriter.Write(1550);
-		this.SerializeWriteHeader(binaryWriter, serializeHeader);
+		binaryWriter.Write(2000);
+		this.SerializeWriteHeader(binaryWriter, serializeHeader, 2000);
 		binaryWriter.Write("bookmark_kk_01");
 		GameMain.BinaryBookmark binaryBookmark = new GameMain.BinaryBookmark(binaryWriter);
 		binaryWriter.Write("bookmark_kk_02");
@@ -723,7 +740,7 @@ public class GameMain : MonoSingleton<GameMain>
 		CasinoDataMgr.Instance.Serialize(binaryWriter);
 		VsDanceDataMgr.Instance.Serialize(binaryWriter);
 		SaveData.Serialize(binaryWriter);
-		binaryWriter.Write(1003);
+		binaryWriter.Write(2000);
 		PrivateModeMgr.Instance.Serialize(binaryWriter);
 		this.m_CharacterMgr.SerializeAddition(binaryWriter);
 		ScoutManager.Instance.Serialize(binaryWriter);
@@ -734,10 +751,11 @@ public class GameMain : MonoSingleton<GameMain>
 		memoryStream = null;
 		ScoutManager.Instance.FixThumbnail();
 		this.UpdateSaveDataDay();
+		ImportCM.CleanupFileMaidGP03();
 		return true;
 	}
 
-	private bool SerializeWriteHeader(BinaryWriter bwWrite, GameMain.SerializeHeader f_head)
+	private bool SerializeWriteHeader(BinaryWriter bwWrite, GameMain.SerializeHeader f_head, int ver)
 	{
 		bwWrite.Write(f_head.strSaveTime);
 		bwWrite.Write(f_head.nGameDay);
@@ -745,6 +763,10 @@ public class GameMain : MonoSingleton<GameMain>
 		bwWrite.Write(f_head.nMaidNum);
 		bwWrite.Write(f_head.strComment);
 		bwWrite.Write(f_head.productTypeID);
+		if (2000 <= ver)
+		{
+			bwWrite.Write(f_head.saveDataGUID);
+		}
 		return true;
 	}
 
@@ -758,6 +780,16 @@ public class GameMain : MonoSingleton<GameMain>
 		return text + "/" + string.Format("SaveData{0:D3}", f_nSaveNo) + ".save";
 	}
 
+	public string[] EnumSavePathFileName()
+	{
+		string path = Path.Combine(this.SerializeStorageManager.StoreDirectoryPath, "SaveData");
+		if (!Directory.Exists(path))
+		{
+			return null;
+		}
+		return Directory.GetFiles(path, "SaveData*.save", SearchOption.AllDirectories);
+	}
+
 	public int GetSaveFileNameToSaveNo(string f_strFileName)
 	{
 		string text = Path.GetFileName(f_strFileName);
@@ -806,8 +838,8 @@ public class GameMain : MonoSingleton<GameMain>
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("COM3D2_SAVE");
-		binaryWriter.Write(1550);
-		this.SerializeWriteHeader(binaryWriter, saveDataHeader);
+		binaryWriter.Write(saveDataHeader.nVer);
+		this.SerializeWriteHeader(binaryWriter, saveDataHeader, saveDataHeader.nVer);
 		binaryWriter.Write(array, (int)saveDataHeader.lHeaderSize, (int)((long)array.Length - saveDataHeader.lHeaderSize));
 		File.WriteAllBytes(path, memoryStream.ToArray());
 		memoryStream.Close();
@@ -860,7 +892,7 @@ public class GameMain : MonoSingleton<GameMain>
 				binaryWriter.Write(binaryReader.ReadString());
 				int num = binaryReader.ReadInt32();
 				binaryWriter.Write(num);
-				this.SerializeWriteHeader(binaryWriter, this.DeserializeReadHeader(binaryReader, num));
+				this.SerializeWriteHeader(binaryWriter, this.DeserializeReadHeader(binaryReader, num), num);
 				GameMain.BinaryBookmark binaryBookmark;
 				if (this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_01"))
 				{
@@ -973,6 +1005,14 @@ public class GameMain : MonoSingleton<GameMain>
 		}
 		int num = binaryReader.ReadInt32();
 		GameMain.SerializeHeader serializeHeader = this.DeserializeReadHeader(binaryReader, num);
+		if (string.IsNullOrEmpty(serializeHeader.saveDataGUID))
+		{
+			this.CharacterMgr.RenewSaveDataGUID();
+		}
+		else
+		{
+			this.CharacterMgr.SaveDataGUID = serializeHeader.saveDataGUID;
+		}
 		if (this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_01"))
 		{
 			GameMain.BinaryBookmark binaryBookmark = new GameMain.BinaryBookmark(binaryReader);
@@ -1159,16 +1199,25 @@ public class GameMain : MonoSingleton<GameMain>
 		{
 			serializeHeader.productTypeID = 0;
 		}
+		if (2000 <= gameVersion)
+		{
+			serializeHeader.saveDataGUID = brRead.ReadString();
+		}
 		return serializeHeader;
 	}
 
 	public GameMain.SerializeHeader GetSaveDataHeader(int f_nSaveNo)
 	{
-		string path = this.MakeSavePathFileName(f_nSaveNo);
-		if (File.Exists(path))
+		string pathFileName = this.MakeSavePathFileName(f_nSaveNo);
+		return this.GetSaveDataHeader(pathFileName);
+	}
+
+	public GameMain.SerializeHeader GetSaveDataHeader(string pathFileName)
+	{
+		GameMain.SerializeHeader serializeHeader = null;
+		if (File.Exists(pathFileName))
 		{
-			GameMain.SerializeHeader serializeHeader;
-			using (FileStream fileStream = new FileStream(path, FileMode.Open))
+			using (FileStream fileStream = new FileStream(pathFileName, FileMode.Open))
 			{
 				if (fileStream == null)
 				{
@@ -1413,7 +1462,7 @@ public class GameMain : MonoSingleton<GameMain>
 		Product.OnApplicationQuit();
 	}
 
-	private const int SaveDataVersion = 1003;
+	private const int SAVE_DATA_VER = 2000;
 
 	private static GameMain m_objInstance;
 
@@ -1533,6 +1582,8 @@ public class GameMain : MonoSingleton<GameMain>
 		public int nVer;
 
 		public long lHeaderSize;
+
+		public string saveDataGUID = string.Empty;
 	}
 
 	private struct BinaryBookmark

+ 1 - 1
Assembly-CSharp/GameModeManager.cs

@@ -32,7 +32,7 @@ public static class GameModeManager
 	public static bool Serialize(BinaryWriter brWrite)
 	{
 		brWrite.Write("CM3D21_GAME_MODE_MGR");
-		brWrite.Write(1550);
+		brWrite.Write(1570);
 		brWrite.Write(1);
 		brWrite.Write((int)GameModeManager.m_NowGameModeType);
 		return true;

+ 66 - 19
Assembly-CSharp/GameUty.cs

@@ -179,6 +179,11 @@ public class GameUty
 			GameUty.m_ModFileSystem.Dispose();
 			GameUty.m_ModFileSystem = null;
 		}
+		if (GameUty.m_CrcFileSystem != null)
+		{
+			GameUty.m_CrcFileSystem.Dispose();
+			GameUty.m_CrcFileSystem = null;
+		}
 	}
 
 	public static Dictionary<string, HashSet<string>> GetGameDataResourceList(string gameDataPath)
@@ -247,7 +252,7 @@ public class GameUty
 			return null;
 		}
 		List<string> list = new List<string>();
-		using (FileStream fileStream = new FileStream(filePath, FileMode.Open))
+		using (FileStream fileStream = File.OpenRead(filePath))
 		{
 			using (BinaryReader binaryReader = new BinaryReader(fileStream))
 			{
@@ -276,8 +281,8 @@ public class GameUty
 		Func<string, bool> AddFolderOrArchive = delegate(string name)
 		{
 			NDebug.Assert(name != "parts_cas", "CC危険。" + name);
-			bool flag4 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
-			if (flag4)
+			bool flag5 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
+			if (flag5)
 			{
 				Debug.Log(string.Concat(new string[]
 				{
@@ -288,11 +293,11 @@ public class GameUty
 					".arc]を読み込みました"
 				}));
 			}
-			if (flag4)
+			if (flag5)
 			{
 				GameUty.loadArchiveList.Add(name.ToLower());
 			}
-			return flag4;
+			return flag5;
 		};
 		HashSet<string> addedLegacyArchives = new HashSet<string>();
 		Action<string> action = delegate(string name)
@@ -300,12 +305,12 @@ public class GameUty
 			foreach (string text32 in GameUty.PathList)
 			{
 				string text33 = name + "_" + text32;
-				bool flag4 = AddFolderOrArchive(text33);
-				if (flag4 && !addedLegacyArchives.Contains(text33))
+				bool flag5 = AddFolderOrArchive(text33);
+				if (flag5 && !addedLegacyArchives.Contains(text33))
 				{
 					addedLegacyArchives.Add(text33);
 				}
-				if (flag4)
+				if (flag5)
 				{
 					if (name == "csv")
 					{
@@ -323,12 +328,12 @@ public class GameUty
 			foreach (string text32 in GameUty.PathList)
 			{
 				string text33 = name + "_" + text32;
-				bool flag4 = AddFolderOrArchive(text33);
-				if (!flag4 && addedLegacyArchives.Contains(text33))
+				bool flag5 = AddFolderOrArchive(text33);
+				if (!flag5 && addedLegacyArchives.Contains(text33))
 				{
-					flag4 = true;
+					flag5 = true;
 				}
-				if (flag4)
+				if (flag5)
 				{
 					if (name == "csv")
 					{
@@ -501,6 +506,7 @@ public class GameUty
 				NDebug.Assert("paths.datを読み込めませんでした", false);
 			}
 			GameUty.PathList.Add("jp");
+			bool flag3 = !string.IsNullOrEmpty(GameUty.PathList.Find((string x) => string.Equals(x, "gp003", StringComparison.CurrentCultureIgnoreCase)));
 			AddFolderOrArchive("csv");
 			foreach (string text7 in GameUty.PathList)
 			{
@@ -527,6 +533,10 @@ public class GameUty
 				string text10 = "motion";
 				if (AddFolderOrArchive(text10 + "_" + text9))
 				{
+					if (flag3)
+					{
+						AddFolderOrArchive(text10 + "_" + text9 + "_gp003");
+					}
 					for (int l = 2; l <= check_ver_no; l++)
 					{
 						AddFolderOrArchive(string.Concat(new object[]
@@ -731,7 +741,7 @@ public class GameUty
 								fileSystemArchive.AddArchive(Path.Combine(gameDataPath, text29));
 								fileSystemArchive.AddArchive(Path.Combine(gameDataPath, path));
 								fileSystemArchive.Dispose();
-								bool flag3 = true;
+								bool flag4 = true;
 								using (FileStream fileStream = File.OpenRead(Path.Combine(UTY.gameDataPath, path)))
 								{
 									using (BinaryReader binaryReader = new BinaryReader(fileStream))
@@ -747,13 +757,13 @@ public class GameUty
 											byte b = binaryReader.ReadByte();
 											if ((int)b != num10)
 											{
-												flag3 = false;
+												flag4 = false;
 												break;
 											}
 										}
 									}
 								}
-								if (flag3)
+								if (flag4)
 								{
 									File.Delete(text30);
 									File.WriteAllBytes(text30, bytes);
@@ -764,6 +774,10 @@ public class GameUty
 				}
 				if (AddFolderOrArchive(text27 + "_" + text28))
 				{
+					if (flag3)
+					{
+						AddFolderOrArchive(text27 + "_" + text28 + "_gp003");
+					}
 					for (int num11 = 2; num11 <= check_ver_no; num11++)
 					{
 						AddFolderOrArchive(string.Concat(new object[]
@@ -847,6 +861,8 @@ public class GameUty
 				}
 			}
 		}
+		Directory.CreateDirectory(text + "SaveData\\_gp03_import");
+		GameUty.ReloadCrcImportPath();
 		if (GameUty.m_ModFileSystem != null)
 		{
 			string[] list3 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
@@ -1015,6 +1031,7 @@ public class GameUty
 			string text7 = "motion";
 			if (AddFolderOrArchive(text7 + "_" + text6))
 			{
+				AddFolderOrArchive(text7 + "_" + text6 + "_gp003");
 				for (int k = 2; k <= check_ver_no; k++)
 				{
 					AddFolderOrArchive(string.Concat(new object[]
@@ -1360,6 +1377,30 @@ public class GameUty
 		Debug.Log("■■■■■■■■■■■■■■■■■■■■");
 	}
 
+	public static void ReloadCrcImportPath()
+	{
+		string text = UTY.gameProjectPath + "\\";
+		if (GameUty.m_CrcFileSystem != null)
+		{
+			GameUty.m_CrcFileSystem.Dispose();
+			GameUty.m_CrcFileSystem = null;
+		}
+		if (Directory.Exists(text + "SaveData\\_gp03_import"))
+		{
+			GameUty.m_CrcFileSystem = new FileSystemWindows();
+			GameUty.m_CrcFileSystem.SetBaseDirectory(text);
+			GameUty.m_CrcFileSystem.AddFolder("SaveData\\_gp03_import");
+			string[] list = GameUty.m_CrcFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFolder);
+			foreach (string text2 in list)
+			{
+				if (!GameUty.m_CrcFileSystem.AddAutoPath(text2))
+				{
+					Debug.Log("m_CrcFileSystemのAddAutoPathには既に " + text2 + " がありました。");
+				}
+			}
+		}
+	}
+
 	public static AFileBase FileOpen(string fileName, AFileSystemBase priorityFileSystem = null)
 	{
 		if (priorityFileSystem == null)
@@ -1372,7 +1413,8 @@ public class GameUty
 			array = new AFileSystemBase[]
 			{
 				GameUty.m_ModFileSystem,
-				priorityFileSystem
+				priorityFileSystem,
+				GameUty.m_CrcFileSystem
 			};
 		}
 		else
@@ -1380,6 +1422,7 @@ public class GameUty
 			array = new AFileSystemBase[]
 			{
 				priorityFileSystem,
+				GameUty.m_CrcFileSystem,
 				GameUty.m_ModFileSystem
 			};
 		}
@@ -1407,7 +1450,8 @@ public class GameUty
 			array = new AFileSystemBase[]
 			{
 				GameUty.m_ModFileSystem,
-				priorityFileSystem
+				priorityFileSystem,
+				GameUty.m_CrcFileSystem
 			};
 		}
 		else
@@ -1415,6 +1459,7 @@ public class GameUty
 			array = new AFileSystemBase[]
 			{
 				priorityFileSystem,
+				GameUty.m_CrcFileSystem,
 				GameUty.m_ModFileSystem
 			};
 		}
@@ -1430,14 +1475,14 @@ public class GameUty
 
 	public static string GetBuildVersionText()
 	{
-		int num = 1550;
+		int num = 1570;
 		return (num >= 1000) ? ((float)num / 1000f).ToString("F2") : ((float)num / 100f).ToString("F2");
 	}
 
 	public static string GetGameVersionText()
 	{
 		string text = "COM3D2x64.exe";
-		int num = 1550;
+		int num = 1570;
 		string path = UTY.gameProjectPath + "\\update.lst";
 		string[] array = new string[0];
 		if (File.Exists(path))
@@ -1526,6 +1571,8 @@ public class GameUty
 
 	private static FileSystemWindows m_ModFileSystem = null;
 
+	private static FileSystemWindows m_CrcFileSystem = null;
+
 	public static List<string> PathList = new List<string>();
 
 	public static List<string> ExistCsvPathList = new List<string>();

+ 23 - 5
Assembly-CSharp/GravityTransformControl.cs

@@ -25,7 +25,7 @@ public class GravityTransformControl : MonoBehaviour
 	{
 		get
 		{
-			return (this.dynamickirtBones != null && this.dynamickirtBones.Count != 0) || (this.dynamicBones != null && this.dynamicBones.Count != 0);
+			return (this.dynamickirtBones != null && this.dynamickirtBones.Count != 0) || (this.dynamicBones != null && this.dynamicBones.Count != 0) || (this.dynamicYureBones != null && this.dynamicYureBones.Count != 0);
 		}
 	}
 
@@ -68,20 +68,26 @@ public class GravityTransformControl : MonoBehaviour
 		this.targetSloatIds = slotIds;
 		this.dynamickirtBones.Clear();
 		this.dynamicBones.Clear();
-		foreach (TBody.SlotID index in slotIds)
+		this.dynamicYureBones.Clear();
+		foreach (TBody.SlotID i2 in slotIds)
 		{
-			if (this.maidBody.goSlot[(int)index] != null && !(this.maidBody.goSlot[(int)index].obj == null))
+			if (this.maidBody.goSlot[(int)i2] != null && !(this.maidBody.goSlot[(int)i2].obj == null))
 			{
-				DynamicSkirtBone component = this.maidBody.goSlot[(int)index].obj.GetComponent<DynamicSkirtBone>();
+				DynamicSkirtBone component = this.maidBody.goSlot[(int)i2].obj.GetComponent<DynamicSkirtBone>();
 				if (component != null)
 				{
 					this.dynamickirtBones.Add(new KeyValuePair<DynamicSkirtBone, Vector3>(component, component.m_vGravity));
 				}
-				DynamicBone component2 = this.maidBody.goSlot[(int)index].obj.GetComponent<DynamicBone>();
+				DynamicBone component2 = this.maidBody.goSlot[(int)i2].obj.GetComponent<DynamicBone>();
 				if (component2 != null)
 				{
 					this.dynamicBones.Add(new KeyValuePair<DynamicBone, Vector3>(component2, component2.m_Force));
 				}
+				DynamicYureBone component3 = this.maidBody.goSlot[(int)i2].obj.GetComponent<DynamicYureBone>();
+				if (component3 != null)
+				{
+					this.dynamicYureBones.Add(new KeyValuePair<DynamicYureBone, Vector3>(component3, component3.status.force));
+				}
 			}
 		}
 	}
@@ -149,6 +155,16 @@ public class GravityTransformControl : MonoBehaviour
 				key2.UpdateParameters();
 			}
 		}
+		foreach (KeyValuePair<DynamicYureBone, Vector3> keyValuePair3 in this.dynamicYureBones)
+		{
+			DynamicYureBone key3 = keyValuePair3.Key;
+			Vector3 vector4 = keyValuePair3.Value + b;
+			if (!wf.Math.Approximately(key3.status.force, vector4))
+			{
+				key3.status.force = vector4;
+				key3.UpdateParameters();
+			}
+		}
 	}
 
 	public float forceRate = 1f;
@@ -163,5 +179,7 @@ public class GravityTransformControl : MonoBehaviour
 
 	private List<KeyValuePair<DynamicBone, Vector3>> dynamicBones = new List<KeyValuePair<DynamicBone, Vector3>>();
 
+	private List<KeyValuePair<DynamicYureBone, Vector3>> dynamicYureBones = new List<KeyValuePair<DynamicYureBone, Vector3>>();
+
 	private bool isEnabled_;
 }

+ 401 - 0
Assembly-CSharp/HandFootIKCtrl.cs

@@ -0,0 +1,401 @@
+using System;
+using System.Collections.Generic;
+using kt.Physics;
+using kt.Utility;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class HandFootIKCtrl : ALimbIKCtrl
+{
+	public HandFootIKCtrl(IKEffector effector, FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKMgr ik_ctrl, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_ctrl, chain, ik_mapping, effector_type)
+	{
+		this.effector = effector;
+		this.effector.target = base.constraintTarget;
+		base.isUpperBody = (effector_type == FullBodyIKMgr.IKEffectorType.Hand_L || effector_type == FullBodyIKMgr.IKEffectorType.Hand_R);
+		this.NoPullBodyIK = base.constraintTarget.parent.gameObject.AddComponent<LimbIK>();
+		this.NoPullBodyIK.solver.SetChain(base.chainBones[0], base.chainBones[1], base.chainBones[2], base.chainBones[0]);
+		this.NoPullBodyIK.solver.target = base.constraintTarget;
+		this.NoPullBodyIK.solver.bendModifier = IKSolverLimb.BendModifier.Goal;
+		this.NoPullBodyIK.solver.maintainRotationWeight = ik_mapping.maintainRotationWeight;
+		this.NoPullBodyIK.enabled = false;
+		switch (effector_type)
+		{
+		case FullBodyIKMgr.IKEffectorType.Hand_R:
+			this.NoPullBodyIK.solver.goal = AvatarIKGoal.RightHand;
+			break;
+		default:
+			switch (effector_type)
+			{
+			case FullBodyIKMgr.IKEffectorType.Foot_R:
+				this.NoPullBodyIK.solver.goal = AvatarIKGoal.RightFoot;
+				break;
+			case FullBodyIKMgr.IKEffectorType.Foot_L:
+				this.NoPullBodyIK.solver.goal = AvatarIKGoal.LeftFoot;
+				break;
+			}
+			break;
+		case FullBodyIKMgr.IKEffectorType.Hand_L:
+			this.NoPullBodyIK.solver.goal = AvatarIKGoal.LeftHand;
+			break;
+		}
+		if (!base.isUpperBody)
+		{
+			if (!this.myIKMgr.body.IsCrcBody && this.myIKMgr.chara.boMAN)
+			{
+				return;
+			}
+			string str = (this.effectorType != FullBodyIKMgr.IKEffectorType.Foot_L) ? "Bip01 R " : "Bip01 L ";
+			Transform bone = this.myIKMgr.body.GetBone(str + "Toe0");
+			Transform bone2 = this.myIKMgr.body.GetBone(str + "Toe1");
+			Transform bone3 = this.myIKMgr.body.GetBone(str + "Toe2");
+			this.ToeBoneLocalAngleDic = new Dictionary<Transform, Vector3>();
+			this.ToeBoneLocalAngleDic[bone] = bone.localEulerAngles;
+			this.ToeBoneLocalAngleDic[bone2] = bone2.localEulerAngles;
+			this.ToeBoneLocalAngleDic[bone3] = bone3.localEulerAngles;
+			if (this.isLeft)
+			{
+				base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Calf_L);
+			}
+			else
+			{
+				base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Calf_R);
+			}
+		}
+		else if (this.isLeft)
+		{
+			base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Forearm_L);
+		}
+		else
+		{
+			base.limbCapsule = this.myIKMgr.body.limbColliderMgr.GetCollider(LimbColliderMgr.LimbType.Forearm_R);
+		}
+	}
+
+	public override ALimbIKCtrl pairIK
+	{
+		get
+		{
+			FullBodyIKMgr.IKEffectorType effector_type;
+			if (base.isUpperBody)
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.Hand_L : FullBodyIKMgr.IKEffectorType.Hand_R);
+			}
+			else
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.Foot_L : FullBodyIKMgr.IKEffectorType.Foot_R);
+			}
+			return this.myIKMgr.GetIKCtrl<ALimbIKCtrl>(effector_type);
+		}
+	}
+
+	public override bool isLeft
+	{
+		get
+		{
+			return this.effectorType == FullBodyIKMgr.IKEffectorType.Hand_L || this.effectorType == FullBodyIKMgr.IKEffectorType.Foot_L;
+		}
+	}
+
+	protected override bool IsUseOldIK
+	{
+		get
+		{
+			return this.effectorType == FullBodyIKMgr.IKEffectorType.Hand_L || this.effectorType == FullBodyIKMgr.IKEffectorType.Hand_R;
+		}
+	}
+
+	public override bool isNeedFullbodySolverUpdate
+	{
+		get
+		{
+			return base.isNeedFullbodySolverUpdate && base.pointIKData.attachType != AIKCtrl.IKAttachType.Point;
+		}
+	}
+
+	public ShoulderThighIKCtrl shoulderThighCtrl { get; private set; }
+
+	public ElbowKneeIKCtrl elbowKneeCtrl { get; private set; }
+
+	public void SetChain(ElbowKneeIKCtrl elbowknee_data, ShoulderThighIKCtrl shoulderthigh_data)
+	{
+		this.elbowKneeCtrl = elbowknee_data;
+		this.ChainParentCtrl = elbowknee_data;
+		this.shoulderThighCtrl = shoulderthigh_data;
+		this.NoPullBodyIK.solver.bendGoal = elbowknee_data.constraintTarget;
+	}
+
+	public override void TargetTransCpy()
+	{
+		base.TargetTransCpy();
+		this.effector.positionWeight = 0f;
+		this.effector.rotationWeight = 0f;
+		this.NoPullBodyIK.solver.IKPositionWeight = 0f;
+		this.NoPullBodyIK.solver.IKRotationWeight = 0f;
+		this.NoPullBodyIK.solver.bendModifierWeight = 0f;
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		base.SetTargetTransform(data, pos, rot);
+		if (!data.isPointAttach || data.attachType == AIKCtrl.IKAttachType.Point)
+		{
+			return;
+		}
+		this.CalcElbowKneeTgtPosRot();
+	}
+
+	private void CalcElbowKneeTgtPosRot()
+	{
+		Transform constraintTarget = this.shoulderThighCtrl.constraintTarget;
+		Transform constraintTarget2 = this.elbowKneeCtrl.constraintTarget;
+		this.elbowKneeCtrl.rotationWeight = base.positionWeight;
+		Vector3 fromDirection = base.bone.position - this.elbowKneeCtrl.bone.position;
+		Vector3 toDirection = base.constraintTarget.position - constraintTarget2.position;
+		constraintTarget2.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * constraintTarget2.rotation;
+		if (this.elbowKneeCtrl.pointIKData.isIKExecNotWeight0)
+		{
+			return;
+		}
+		Vector3 position = base.bone.InverseTransformPoint(this.elbowKneeCtrl.bone.position);
+		Vector3 vector = base.constraintTarget.TransformPoint(position);
+		Vector3 vector2 = base.constraintTarget.position - vector;
+		Vector3 vector3 = vector - constraintTarget.position;
+		float f = Vector3.Dot(vector2.normalized, vector3.normalized);
+		float num = Mathf.Acos(f) * 57.29578f;
+		if (float.IsNaN(num))
+		{
+			num = 0f;
+		}
+		float t = Mathf.Clamp01(num / this.BendFadeBorder);
+		Vector3 vector4 = base.constraintTarget.position - constraintTarget.position;
+		float num2 = Vector3.Dot(vector - constraintTarget.position, vector4.normalized);
+		if (float.IsNaN(num2))
+		{
+			num2 = 0f;
+		}
+		Vector3 vector5 = constraintTarget.position + vector4.normalized * num2;
+		Vector3 a = constraintTarget2.rotation * Vector3.up * 0.01f;
+		Vector3 b = (vector - vector5) * this.BendStlength;
+		Vector3 b2 = Vector3.Lerp(a, b, t);
+		if (base.pointIKData.blendType == AIKCtrl.IKBlendType.IK_To_Detach)
+		{
+			constraintTarget2.position = Vector3.Lerp(this.elbowKneeCtrl.bone.position, vector5 + b2, base.positionWeight);
+		}
+		else
+		{
+			constraintTarget2.position = vector5 + b2;
+		}
+		this.SetElbowKneePositionWeight(base.positionWeight);
+	}
+
+	private void SetElbowKneePositionWeight(float val)
+	{
+		if (this.IsPullBody)
+		{
+			this.elbowKneeCtrl.positionWeight = val;
+		}
+		else
+		{
+			this.NoPullBodyIK.solver.bendModifierWeight = val;
+		}
+	}
+
+	protected override void SetTargetTransformNoExec()
+	{
+		if (this.elbowKneeCtrl.positionWeight > 0f)
+		{
+			base.positionWeight = this.elbowKneeCtrl.positionWeight;
+			base.constraintTarget.position += this.elbowKneeCtrl.constraintTarget.position - this.elbowKneeCtrl.bone.position;
+		}
+		if (this.elbowKneeCtrl.rotationWeight > 0f)
+		{
+			base.constraintTarget.position = this.elbowKneeCtrl.constraintTarget.TransformPoint(base.bone.localPosition);
+			base.constraintTarget.rotation = this.elbowKneeCtrl.constraintTarget.rotation * base.bone.localRotation;
+		}
+	}
+
+	protected override void DoPlaneCorrect(Vector3 normal)
+	{
+		ALimbIKCtrl.BorderCorrectType correctType = this.correctType;
+		if (correctType != ALimbIKCtrl.BorderCorrectType.Bone)
+		{
+			if (correctType != ALimbIKCtrl.BorderCorrectType.HalfBody)
+			{
+				base.DoPlaneCorrect(normal);
+			}
+			else
+			{
+				base.DoPlaneCorrect(normal);
+				this.shoulderThighCtrl.constraintTarget.position += normal;
+				this.shoulderThighCtrl.positionWeight = base.positionWeight;
+				this.elbowKneeCtrl.constraintTarget.position += normal;
+				this.elbowKneeCtrl.positionWeight = base.positionWeight;
+			}
+		}
+		else
+		{
+			Vector3 position = this.elbowKneeCtrl.bone.position;
+			this.CorrectByElbowKnee(normal);
+			if (this.elbowKneeCtrl.isNeedCorrect)
+			{
+				Vector3 position2 = base.bone.position;
+				Vector3 fromDirection = this.elbowKneeCtrl.bone.position - this.shoulderThighCtrl.bone.position;
+				Vector3 toDirection = position - this.shoulderThighCtrl.bone.position;
+				this.shoulderThighCtrl.bone.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * this.shoulderThighCtrl.bone.rotation;
+				fromDirection = base.bone.position - this.elbowKneeCtrl.bone.position;
+				toDirection = position2 - this.elbowKneeCtrl.bone.position;
+				this.elbowKneeCtrl.bone.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * this.elbowKneeCtrl.bone.rotation;
+			}
+		}
+	}
+
+	private void CorrectByElbowKnee(Vector3 normal)
+	{
+		Transform bone = this.shoulderThighCtrl.bone;
+		Transform bone2 = this.elbowKneeCtrl.bone;
+		Vector3 vector = base.bone.position + normal;
+		Debug.DrawLine(base.bone.position, vector);
+		float t = Mathf.Clamp01(Vector3.Dot(-bone.right, -bone2.right));
+		Vector3 bend_pos = Vector3.Lerp(bone2.position, bone2.position + normal, t);
+		this.ForceNoPullBodyIKSolve(vector, base.bone.rotation, bend_pos);
+	}
+
+	private void ForceNoPullBodyIKSolve(Vector3 target_pos, Quaternion target_rot, Vector3 bend_pos)
+	{
+		AIKCtrl.PosRotPair posRotPair = default(AIKCtrl.PosRotPair);
+		posRotPair.Copy(this.NoPullBodyIK.solver.target);
+		IKSolverLimb solver = this.NoPullBodyIK.solver;
+		solver.IKPositionWeight = (solver.IKRotationWeight = 1f);
+		solver.target.position = target_pos;
+		solver.target.rotation = target_rot;
+		solver.bendModifierWeight = 1f;
+		Vector3 position = solver.bendGoal.position;
+		solver.bendGoal.position = bend_pos;
+		solver.Update();
+		solver.target.position = posRotPair.pos;
+		solver.target.rotation = posRotPair.rot;
+		solver.bendGoal.position = position;
+	}
+
+	public override void HitCheck()
+	{
+		base.HitCheck();
+		if (this.pairIK.colliderEnable && this.myIKMgr.body.IsCrcBody)
+		{
+			NativePlaneCollider nativePlaneCollider;
+			if (base.isUpperBody)
+			{
+				nativePlaneCollider = ((!this.isLeft) ? this.myIKMgr.upperCrossBorder.right : this.myIKMgr.upperCrossBorder.left);
+			}
+			else
+			{
+				nativePlaneCollider = ((!this.isLeft) ? this.myIKMgr.lowerCrossBorder.right : this.myIKMgr.lowerCrossBorder.left);
+			}
+			Vector3 position = base.bone.position;
+			if (this.elbowKneeCtrl.ForceCollidePlaneCollider(ALimbIKCtrl.BorderCorrectType.Bone, nativePlaneCollider))
+			{
+				Vector3 vector = position - base.bone.position;
+				vector -= nativePlaneCollider.worldDirection * Vector3.Dot(vector, nativePlaneCollider.worldDirection);
+				this.ForceNoPullBodyIKSolve(position, base.bone.rotation, this.elbowKneeCtrl.bone.position);
+			}
+		}
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (base.pointIKData.attachType == AIKCtrl.IKAttachType.Point)
+		{
+			return;
+		}
+		if (!base.isIKExec || this.IsPullBody)
+		{
+			base.OnPostFullBodySolverUpdate();
+			return;
+		}
+		this.NoPullBodyIK.solver.Update();
+		base.OnPostFullBodySolverUpdate();
+	}
+
+	public override void OnPostIKUpdate()
+	{
+		if (!base.isUpperBody)
+		{
+			this.SetHighHeelAngle();
+		}
+		base.OnPostIKUpdate();
+	}
+
+	private void SetHighHeelAngle()
+	{
+		if (!this.myIKMgr.body.IsHiheel)
+		{
+			return;
+		}
+		float num = Mathf.Clamp01(Vector3.Dot(Vector3.up, base.bone.right));
+		float d = 25f * num;
+		Vector3 localEulerAngles = base.bone.localEulerAngles;
+		base.bone.localEulerAngles += Vector3.forward * d;
+		if (MathUtility.AngleClamp180(base.bone.localEulerAngles.z) > 45f)
+		{
+			base.bone.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles.y, 45f);
+		}
+		foreach (KeyValuePair<Transform, Vector3> keyValuePair in this.ToeBoneLocalAngleDic)
+		{
+			Transform key = keyValuePair.Key;
+			Vector3 value = keyValuePair.Value;
+			key.localEulerAngles = value - Vector3.forward * 25f;
+		}
+	}
+
+	protected override void OnPostSetPositionWeight(float val)
+	{
+		if (base.pointIKData.attachType == AIKCtrl.IKAttachType.Point)
+		{
+			return;
+		}
+		if (this.IsPullBody)
+		{
+			this.effector.positionWeight = val;
+		}
+		else
+		{
+			this.NoPullBodyIK.solver.IKPositionWeight = val;
+		}
+	}
+
+	protected override void OnPostSetRotationWeight(float val)
+	{
+		if (base.IsOldIKExec)
+		{
+			return;
+		}
+		if (this.IsPullBody)
+		{
+			this.effector.rotationWeight = val;
+		}
+		else
+		{
+			this.NoPullBodyIK.solver.IKRotationWeight = val;
+		}
+	}
+
+	private const float HIGHHEEL_ANGLE = 25f;
+
+	private const float ANGLEZ_RIMMIT = 45f;
+
+	[SerializeField]
+	[Space]
+	[Range(1f, 90f)]
+	private float BendFadeBorder = 30f;
+
+	[SerializeField]
+	[Range(1f, 2f)]
+	private float BendStlength = 1.01f;
+
+	public readonly IKEffector effector;
+
+	private LimbIK NoPullBodyIK;
+
+	private readonly Dictionary<Transform, Vector3> ToeBoneLocalAngleDic;
+}

+ 0 - 285
Assembly-CSharp/HandFootIKData.cs

@@ -1,285 +0,0 @@
-using System;
-using RootMotion.FinalIK;
-using UnityEngine;
-
-[Serializable]
-public class HandFootIKData : LimbIKData
-{
-	public HandFootIKData(IKEffector effector, FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKCtrl ik_ctrl, Transform tgt_bone, bool use_old = false) : base(ik_ctrl, chain, ik_mapping, tgt_bone, use_old)
-	{
-		this.Effector = effector;
-		this.Effector.target = base.IKTarget;
-		this.m_IsUpperBody = (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_L) || this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_R));
-		this.m_ForceIKEnable = true;
-		this.NoPullBodyIK = base.IKTarget.parent.gameObject.AddComponent<LimbIK>();
-		this.NoPullBodyIK.solver.SetChain(base.ChainBones[0], base.ChainBones[1], base.ChainBones[2], base.ChainBones[0]);
-		this.NoPullBodyIK.solver.target = base.IKTarget;
-		this.NoPullBodyIK.solver.bendModifier = IKSolverLimb.BendModifier.Goal;
-		this.NoPullBodyIK.solver.maintainRotationWeight = effector.maintainRelativePositionWeight;
-		this.NoPullBodyIK.enabled = false;
-		if (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_L))
-		{
-			this.NoPullBodyIK.solver.goal = AvatarIKGoal.LeftHand;
-		}
-		else if (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Hand_R))
-		{
-			this.NoPullBodyIK.solver.goal = AvatarIKGoal.RightHand;
-		}
-		else if (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_L))
-		{
-			this.NoPullBodyIK.solver.goal = AvatarIKGoal.LeftFoot;
-		}
-		else if (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.Foot_R))
-		{
-			this.NoPullBodyIK.solver.goal = AvatarIKGoal.RightFoot;
-		}
-		this.ToCorrectBone = this.TargetBone;
-	}
-
-	public ShoulderThighIKData ShoulderThighData
-	{
-		get
-		{
-			return this.m_ShoulderThighData;
-		}
-	}
-
-	public ElbowKneeIKData ElbowKneeData
-	{
-		get
-		{
-			return this.m_ElbowKneeData;
-		}
-	}
-
-	private void CheckBorder(HandFootIKData.BorderCorrectData correctData)
-	{
-		if (!correctData.Enable)
-		{
-			return;
-		}
-		float d = 0f;
-		Vector3 position = this.ToCorrectBone.position;
-		if (correctData.CheckBorder(position, ref d))
-		{
-			if (!base.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).IsIKExec)
-			{
-				base.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).IsIKExec = true;
-			}
-			switch (this.CorrectType)
-			{
-			case HandFootIKData.BorderCorrectType.Bone:
-				base.IKTarget.position += correctData.Axis * d;
-				this.m_ElbowKneeData.IKTarget.position += correctData.Axis * d;
-				break;
-			case HandFootIKData.BorderCorrectType.HalfBody:
-				base.IKTarget.position += correctData.Axis * d;
-				this.m_ElbowKneeData.IKTarget.position += correctData.Axis * d;
-				this.m_ShoulderThighData.IKTarget.position += correctData.Axis * d;
-				break;
-			case HandFootIKData.BorderCorrectType.Chara:
-				this.MyIKCtrl.BodyCtrlData.SetPosOffset(correctData.Axis * d);
-				break;
-			}
-		}
-	}
-
-	public override void TagetTransCpy()
-	{
-		base.TagetTransCpy();
-		this.Effector.positionWeight = 0f;
-		this.Effector.rotationWeight = 0f;
-		this.NoPullBodyIK.solver.IKPositionWeight = 0f;
-		this.NoPullBodyIK.solver.IKRotationWeight = 0f;
-		this.NoPullBodyIK.solver.bendModifierWeight = 0f;
-	}
-
-	protected override void SetTargetTransform(IKCtrlData.IKSettingData data, Vector3 pos, Quaternion rot)
-	{
-		base.SetTargetTransform(data, pos, rot);
-		if (!data.IsPointAttach)
-		{
-			return;
-		}
-		Transform iktarget = this.m_ShoulderThighData.IKTarget;
-		Transform iktarget2 = this.m_ElbowKneeData.IKTarget;
-		if (!this.ElbowKneeData.GetIKExecTruth(IKCtrlData.IKAttachType.NewPoint))
-		{
-			Vector3 position = this.TargetBone.InverseTransformPoint(this.m_ElbowKneeData.TargetBone.position);
-			Vector3 vector = base.IKTarget.TransformPoint(position);
-			Vector3 vector2 = base.IKTarget.position - vector;
-			Vector3 vector3 = vector - iktarget.position;
-			float f = Mathf.Clamp(Vector3.Dot(vector2.normalized, vector3.normalized), -1f, 1f);
-			float num = Mathf.Abs(Mathf.Acos(f) * 57.29578f);
-			float t = Mathf.Clamp01(num / this.m_BendFadeBorder);
-			Vector3 vector4 = base.IKTarget.position - iktarget.position;
-			float num2 = Vector3.Dot(vector - iktarget.position, vector4.normalized);
-			if (float.IsNaN(num2))
-			{
-				num2 = 0f;
-			}
-			Vector3 vector5 = iktarget.position + vector4.normalized * num2;
-			Vector3 a = iktarget2.rotation * Vector3.up * 0.01f;
-			Vector3 b = (vector - vector5) * this.m_BendStlength;
-			Vector3 b2 = Vector3.Slerp(a, b, t);
-			iktarget2.position = vector5 + b2;
-			this.SetElbowKneePositionWeight(base.PositionWeight);
-		}
-		this.ElbowKneeData.RotationWeight = base.PositionWeight;
-		iktarget2.rotation = Quaternion.FromToRotation(this.TargetBone.position - this.ElbowKneeData.TargetBone.position, base.IKTarget.position - iktarget2.position) * iktarget2.rotation;
-	}
-
-	private void SetElbowKneePositionWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.ElbowKneeData.PositionWeight = val;
-		}
-		else
-		{
-			this.NoPullBodyIK.solver.bendModifierWeight = val;
-		}
-	}
-
-	public override void ApplyIKSetting()
-	{
-		if (!base.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).IsIKExec && !base.GetFlagData(IKCtrlData.IKAttachType.NewPoint).IsEnable && (this.FloorCorrect.Enable || this.WallCorrect.Enable))
-		{
-			base.ForceIK = true;
-		}
-		base.ApplyIKSetting();
-		if (!base.IsIKExecTruth)
-		{
-			if (this.ElbowKneeData.RotationWeight > 0f)
-			{
-				base.PositionWeight = this.ElbowKneeData.RotationWeight;
-				base.RotationWeight = this.ElbowKneeData.RotationWeight;
-				base.IKTarget.position = this.ElbowKneeData.IKTarget.TransformPoint(this.TargetBone.localPosition);
-			}
-			else
-			{
-				base.PositionWeight = this.ElbowKneeData.PositionWeight;
-				base.IKTarget.position += this.ElbowKneeData.IKTarget.position - this.ElbowKneeData.TargetBone.position;
-			}
-		}
-		this.CheckBorder(this.WallCorrect);
-		this.CheckBorder(this.FloorCorrect);
-	}
-
-	public override void Detach(IKCtrlData.IKAttachType attachType)
-	{
-		base.Detach(attachType);
-		this.WallCorrect.Reset();
-		this.FloorCorrect.Reset();
-		this.ToCorrectBone = this.TargetBone;
-		this.CorrectType = HandFootIKData.BorderCorrectType.Bone;
-	}
-
-	public void SetChainData(ElbowKneeIKData elbowknee_data, ShoulderThighIKData shoulderthigh_data)
-	{
-		this.m_ElbowKneeData = elbowknee_data;
-		this.m_ShoulderThighData = shoulderthigh_data;
-		this.NoPullBodyIK.solver.bendGoal = elbowknee_data.IKTarget;
-	}
-
-	protected override void OnPostSetPositionWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.Effector.positionWeight = val;
-		}
-		else
-		{
-			this.NoPullBodyIK.solver.IKPositionWeight = val;
-		}
-	}
-
-	protected override void OnPostSetRotationWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.Effector.rotationWeight = val;
-		}
-		else
-		{
-			this.NoPullBodyIK.solver.IKRotationWeight = val;
-		}
-	}
-
-	public override void Update()
-	{
-		if (this.m_IsPullBody)
-		{
-			return;
-		}
-		this.NoPullBodyIK.solver.Update();
-	}
-
-	[Header("壁・床補正情報")]
-	public HandFootIKData.BorderCorrectData WallCorrect = new HandFootIKData.BorderCorrectData(Vector3.forward);
-
-	public HandFootIKData.BorderCorrectData FloorCorrect = new HandFootIKData.BorderCorrectData(Vector3.up);
-
-	public HandFootIKData.BorderCorrectType CorrectType;
-
-	public Transform ToCorrectBone;
-
-	[SerializeField]
-	[Space]
-	[Range(1f, 90f)]
-	private float m_BendFadeBorder = 30f;
-
-	[SerializeField]
-	[Range(1f, 2f)]
-	private float m_BendStlength = 1.01f;
-
-	public readonly IKEffector Effector;
-
-	private ShoulderThighIKData m_ShoulderThighData;
-
-	private ElbowKneeIKData m_ElbowKneeData;
-
-	private LimbIK NoPullBodyIK;
-
-	public enum BorderCorrectType
-	{
-		Bone,
-		HalfBody,
-		Chara,
-		All
-	}
-
-	[Serializable]
-	public class BorderCorrectData
-	{
-		public BorderCorrectData(Vector3 axis)
-		{
-			this.Axis = axis;
-		}
-
-		public void Reset()
-		{
-			this.Border = 0f;
-			this.Enable = false;
-		}
-
-		public float GetValue(Vector3 pos)
-		{
-			pos = KasaiUtility.Vec3Multiply(pos, this.Axis);
-			return pos.magnitude * Vector3.Dot(this.Axis, pos.normalized);
-		}
-
-		public bool CheckBorder(Vector3 check_pos, ref float diff)
-		{
-			float value = this.GetValue(check_pos);
-			diff = this.Border - value;
-			return value < this.Border;
-		}
-
-		public float Border;
-
-		public bool Enable;
-
-		public Vector3 Axis;
-	}
-}

+ 2 - 2
Assembly-CSharp/HandSignShortcut.cs

@@ -506,7 +506,7 @@ public class HandSignShortcut : MonoBehaviour
 	{
 		public void OnBeforeSerialize()
 		{
-			this.m_nVersion = 1550;
+			this.m_nVersion = 1570;
 		}
 
 		public void OnAfterDeserialize()
@@ -815,7 +815,7 @@ public class HandSignShortcut : MonoBehaviour
 		private const string CONF_NAME = "MaidFingerDataList.json";
 
 		[SerializeField]
-		private int m_nVersion = 1550;
+		private int m_nVersion = 1570;
 
 		[SerializeField]
 		private List<HandSignShortcut.MaidFingerData> MaidFingerDataList = new List<HandSignShortcut.MaidFingerData>();

+ 10 - 0
Assembly-CSharp/IDynamicBone.cs

@@ -0,0 +1,10 @@
+using System;
+
+public interface IDynamicBone
+{
+	void PhysicsReset();
+
+	void DynamicUpdate();
+
+	void UnInit();
+}

+ 20 - 0
Assembly-CSharp/IFade.cs

@@ -0,0 +1,20 @@
+using System;
+
+public interface IFade
+{
+	float defaultFadeTime { get; }
+
+	BaseFader.FadeState state { get; }
+
+	bool isShow { get; }
+
+	bool isHide { get; }
+
+	bool isFadeNow { get; }
+
+	bool StartFade(BaseFader.FadeType type, bool skippable = true, Func<float, bool> onUpdate = null, Action onCompleted = null);
+
+	bool StartFade(BaseFader.FadeType type, float time, bool skippable = true, Func<float, bool> onUpdate = null, Action onCompleted = null);
+
+	void FadeComplete();
+}

+ 201 - 0
Assembly-CSharp/IKBodyOffsetCtrl.cs

@@ -0,0 +1,201 @@
+using System;
+using kt.ik;
+using kt.Utility;
+using UnityEngine;
+
+[Serializable]
+public class IKBodyOffsetCtrl : AIKCtrl
+{
+	public IKBodyOffsetCtrl(FullBodyIKMgr ik_mgr) : base(ik_mgr, FullBodyIKMgr.IKEffectorType.Body)
+	{
+		this.posBaseBone = base.bone;
+		this.ChainBones = new Transform[]
+		{
+			base.bone
+		};
+		this.IsIgnoreLateUpdateEnd = true;
+	}
+
+	public bool isCharaPosSetEnd { get; private set; }
+
+	public override void SetIKSetting(IKAttachParam param)
+	{
+		BodyOffsetIKParam bodyOffsetIKParam = param as BodyOffsetIKParam;
+		bodyOffsetIKParam.attachType = AIKCtrl.IKAttachType.NewPoint;
+		bodyOffsetIKParam.posOffsetType = AIKCtrl.PosOffsetType.OffsetTarget;
+		this.heightFit = bodyOffsetIKParam.heightFitType;
+		this.posBaseBone = bodyOffsetIKParam.posBaseBone;
+		this.AddOffset = bodyOffsetIKParam.addOffset;
+		this.BlendPosOffset = this.lastPosOffset;
+		base.SetIKSetting(param);
+	}
+
+	public void CheckBlendType()
+	{
+		if (!base.pointIKData.isIKExec)
+		{
+			return;
+		}
+		if (!base.pointIKData.isSetFirstFramePosRot)
+		{
+			if (base.pointIKData.blendType == AIKCtrl.IKBlendType.Not_Blend)
+			{
+				base.pointIKData.SetBlendType(AIKCtrl.IKBlendType.IK_To_IK);
+			}
+		}
+		else
+		{
+			base.pointIKData.SetBlendType(AIKCtrl.IKBlendType.Not_Blend);
+		}
+	}
+
+	public override void ApplyIKSetting()
+	{
+		this.PosOffset = Vector3.zero;
+		if (base.isIKExec)
+		{
+			Maid targetChara = base.pointIKData.curTargetData.targetChara;
+			if (targetChara && !targetChara.isOffsetUpdateEnd)
+			{
+				targetChara.OffsetUpdate();
+			}
+		}
+		base.ApplyIKSetting();
+	}
+
+	private bool CheckDoIK()
+	{
+		if (!base.isIKExec)
+		{
+			return false;
+		}
+		if (this.heightFit == IKBodyOffsetCtrl.HeightFitType.None)
+		{
+			return true;
+		}
+		int num = this.myIKMgr.chara.GetProp(MPN.sintyou).value + this.myIKMgr.chara.GetProp(MPN.DouPer).value;
+		Maid targetChara = base.pointIKData.curTargetData.targetChara;
+		if (!targetChara)
+		{
+			return true;
+		}
+		int num2 = targetChara.GetProp(MPN.sintyou).value + targetChara.GetProp(MPN.DouPer).value;
+		if (this.heightFit == IKBodyOffsetCtrl.HeightFitType.Higher)
+		{
+			return num > num2;
+		}
+		return num < num2;
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		if (!data.isPointAttach || !this.CheckDoIK())
+		{
+			return;
+		}
+		Vector3 vector = data.curTargetData.tgtOffset + this.AddOffset;
+		Transform transform;
+		if (data.curTargetData.targetChara)
+		{
+			transform = data.curTargetData.targetChara.transform;
+		}
+		else if (data.curTargetData.lastTgtChara)
+		{
+			transform = data.curTargetData.lastTgtChara.transform;
+		}
+		else if (data.curTargetData.lastTarget)
+		{
+			transform = data.curTargetData.lastTarget;
+		}
+		else
+		{
+			transform = data.curTargetData.target;
+		}
+		Transform transform2 = this.myIKMgr.chara.transform;
+		if (data.isFirstFrame && !data.isSetFirstFramePosRot)
+		{
+			this.FirstBaseBonePos = transform2.InverseTransformPoint(this.posBaseBone.position);
+			this.FirstLocalTgtPos = transform.InverseTransformPoint(this.FirstTgtPosRot.pos);
+		}
+		Vector3 vector2 = (!data.isBlendNow) ? transform2.TransformPoint(this.FirstBaseBonePos) : this.posBaseBone.position;
+		pos = ((!data.isBlendNow) ? transform.TransformPoint(this.FirstLocalTgtPos) : pos);
+		DebugUtility.DrawAxis(pos, rot, 0.0625f);
+		vector = transform.TransformDirection(vector);
+		base.constraintTarget.position = pos + vector;
+		Vector3 vector3 = data.offsetEnable.GetEnable(base.constraintTarget.position - vector2, false);
+		DebugUtility.DrawAxis(vector2, rot, 0.0125f);
+		Debug.DrawLine(vector2, base.constraintTarget.position, Color.black);
+		Debug.DrawRay(pos, vector, Color.gray);
+		vector3 = this.myIKMgr.chara.transform.InverseTransformDirection(vector3);
+		if (data.blendType == AIKCtrl.IKBlendType.IK_To_IK)
+		{
+			this.PosOffset = Vector3.Lerp(this.BlendPosOffset, vector3, data.blendWeight);
+		}
+		else if (data.blendType == AIKCtrl.IKBlendType.IK_To_Detach)
+		{
+			this.PosOffset = Vector3.Lerp(Vector3.zero, this.BlendPosOffset, base.positionWeight);
+		}
+		else
+		{
+			this.PosOffset = Vector3.Lerp(Vector3.zero, vector3, base.positionWeight);
+		}
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (!this.CheckDoIK())
+		{
+			return;
+		}
+		this.AddPosOffset(this.PosOffset);
+	}
+
+	public void AddPosOffset(Vector3 offset)
+	{
+		this.isCharaPosSetEnd = true;
+		this.myIKMgr.chara.AddPosOffset(offset);
+	}
+
+	protected override void SaveLastTargetPosRot()
+	{
+		base.SaveLastTargetPosRot();
+		this.LastIKPosRot.Copy((!(this.posBaseBone != null)) ? base.bone : this.posBaseBone);
+		this.lastPosOffset = this.PosOffset;
+	}
+
+	public void CharaPosReset()
+	{
+		this.isCharaPosSetEnd = false;
+	}
+
+	public override void Detach()
+	{
+		this.BlendPosOffset = this.lastPosOffset;
+		base.Detach();
+		this.heightFit = IKBodyOffsetCtrl.HeightFitType.None;
+	}
+
+	[SerializeField]
+	private Vector3 PosOffset = Vector3.zero;
+
+	private Vector3 AddOffset = Vector3.zero;
+
+	private Vector3 FirstBaseBonePos;
+
+	private Vector3 FirstLocalTgtPos;
+
+	private Vector3 lastPosOffset = Vector3.zero;
+
+	private Vector3 BlendPosOffset = Vector3.zero;
+
+	public Transform posBaseBone;
+
+	public IKBodyOffsetCtrl.HeightFitType heightFit = IKBodyOffsetCtrl.HeightFitType.None;
+
+	public enum HeightFitType
+	{
+		Higher,
+		Lower,
+		None
+	}
+}

+ 51 - 0
Assembly-CSharp/IKColliderMeta.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using kt.Physics;
+using UnityEngine;
+
+public class IKColliderMeta : MonoBehaviour
+{
+	private void OnDestroy()
+	{
+		this.AllColliderAction(delegate(ANativeColliderBase col)
+		{
+			UnityEngine.Object.Destroy(col);
+		});
+	}
+
+	private void OnEnable()
+	{
+		this.AllColliderAction(delegate(ANativeColliderBase col)
+		{
+			col.enabled = true;
+		});
+	}
+
+	private void OnDisable()
+	{
+		this.AllColliderAction(delegate(ANativeColliderBase col)
+		{
+			col.enabled = false;
+		});
+	}
+
+	private void AllColliderAction(Action<ANativeColliderBase> action)
+	{
+		if (this.colliderList == null)
+		{
+			return;
+		}
+		foreach (ANativeColliderBase anativeColliderBase in this.colliderList)
+		{
+			if (anativeColliderBase && action != null)
+			{
+				action(anativeColliderBase);
+			}
+		}
+	}
+
+	[ReadOnly]
+	public FullBodyIKMgr.IKEffectorType effectorType;
+
+	public List<ANativeColliderBase> colliderList = new List<ANativeColliderBase>();
+}

File diff suppressed because it is too large
+ 0 - 1418
Assembly-CSharp/IKCtrlData.cs


+ 28 - 0
Assembly-CSharp/IKTargetBoneCtrl.cs

@@ -0,0 +1,28 @@
+using System;
+using UnityEngine;
+
+public class IKTargetBoneCtrl
+{
+	public IKTargetBoneCtrl(Transform target_bone, Transform virtual_parent)
+	{
+		this.bone = target_bone;
+		this.realParent = this.bone.parent;
+		this.virtualParent = virtual_parent;
+	}
+
+	public void Update()
+	{
+		Vector3 localScale = this.virtualParent.localScale;
+		this.virtualParent.localScale = Vector3.one;
+		Vector3 position = this.virtualParent.InverseTransformPoint(this.realParent.position);
+		this.virtualParent.localScale = localScale;
+		this.bone.position = this.virtualParent.TransformPoint(position);
+		this.bone.rotation = this.realParent.rotation;
+	}
+
+	public readonly Transform bone;
+
+	public readonly Transform realParent;
+
+	public readonly Transform virtualParent;
+}

+ 533 - 81
Assembly-CSharp/ImportCM.cs

@@ -64,6 +64,7 @@ public class ImportCM : MonoBehaviour
 		{
 			NDebug.Assert("ファイルが開けませんでした。" + filename + "\n" + ex.Message, false);
 		}
+		bool flag = filename.Contains("crc_") || filename.Contains("crx_") || filename.Contains("gp03_");
 		BinaryReader binaryReader = new BinaryReader(new MemoryStream(ImportCM.m_skinTempFile), Encoding.UTF8);
 		TBodySkin.OriVert oriVert = bodyskin.m_OriVert;
 		GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("seed")) as GameObject;
@@ -94,8 +95,8 @@ public class ImportCM : MonoBehaviour
 			}
 			hashtable[gameObject3.name] = gameObject3;
 			dictionary[gameObject3.name] = new ImportCM.BoneUse(gameObject3.name, -1, gameObject3.transform);
-			bool flag = binaryReader.ReadByte() != 0;
-			if (flag)
+			bool flag2 = binaryReader.ReadByte() != 0;
+			if (flag2)
 			{
 				GameObject gameObject4 = UnityEngine.Object.Instantiate(Resources.Load("seed")) as GameObject;
 				gameObject4.name = gameObject3.name + "_SCL_";
@@ -130,8 +131,8 @@ public class ImportCM : MonoBehaviour
 			transform.localRotation = new Quaternion(x2, y2, z2, w);
 			if (2001 <= num)
 			{
-				bool flag2 = binaryReader.ReadBoolean();
-				if (flag2)
+				bool flag3 = binaryReader.ReadBoolean();
+				if (flag3)
 				{
 					float x3 = binaryReader.ReadSingle();
 					float y3 = binaryReader.ReadSingle();
@@ -212,7 +213,36 @@ public class ImportCM : MonoBehaviour
 		Vector3[] array5 = new Vector3[num4];
 		Vector3[] array6 = new Vector3[num4];
 		Vector2[] array7 = new Vector2[num4];
-		BoneWeight[] array8 = new BoneWeight[num4];
+		Vector2[] array8 = null;
+		Vector2[] array9 = null;
+		Vector2[] array10 = null;
+		BoneWeight[] array11 = new BoneWeight[num4];
+		bool flag4 = false;
+		bool flag5 = false;
+		bool flag6 = false;
+		bool flag7 = false;
+		bool flag8 = false;
+		bool flag9 = false;
+		bool flag10 = false;
+		if (2101 <= num)
+		{
+			if (flag4 = binaryReader.ReadBoolean())
+			{
+				array8 = new Vector2[num4];
+			}
+			if (flag5 = binaryReader.ReadBoolean())
+			{
+				array9 = new Vector2[num4];
+			}
+			if (flag6 = binaryReader.ReadBoolean())
+			{
+				array10 = new Vector2[num4];
+			}
+			flag7 = binaryReader.ReadBoolean();
+			flag8 = binaryReader.ReadBoolean();
+			flag9 = binaryReader.ReadBoolean();
+			flag10 = binaryReader.ReadBoolean();
+		}
 		for (int num8 = 0; num8 < num4; num8++)
 		{
 			float num9 = binaryReader.ReadSingle();
@@ -226,78 +256,123 @@ public class ImportCM : MonoBehaviour
 			num9 = binaryReader.ReadSingle();
 			num10 = binaryReader.ReadSingle();
 			array7[num8].Set(num9, num10);
+			if (flag4)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+				array8[num8].Set(num9, num10);
+			}
+			if (flag5)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+				array9[num8].Set(num9, num10);
+			}
+			if (flag6)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+				array10[num8].Set(num9, num10);
+			}
+			if (flag7)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+			}
+			if (flag8)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+			}
+			if (flag9)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+			}
+			if (flag10)
+			{
+				num9 = binaryReader.ReadSingle();
+				num10 = binaryReader.ReadSingle();
+			}
 		}
 		mesh2.vertices = array5;
 		mesh2.normals = array6;
 		mesh2.uv = array7;
+		mesh2.uv2 = array8;
+		mesh2.uv3 = array9;
+		mesh2.uv4 = array10;
 		oriVert.vOriVert = array5;
 		oriVert.vOriNorm = array6;
+		if (bodyskin.SlotId == TBody.SlotID.body)
+		{
+			oriVert.vOriUV = mesh2.uv;
+		}
 		int num11 = binaryReader.ReadInt32();
 		if (num11 > 0)
 		{
-			Vector4[] array9 = new Vector4[num11];
+			Vector4[] array12 = new Vector4[num11];
 			for (int num12 = 0; num12 < num11; num12++)
 			{
 				float x4 = binaryReader.ReadSingle();
 				float y4 = binaryReader.ReadSingle();
 				float z4 = binaryReader.ReadSingle();
 				float w2 = binaryReader.ReadSingle();
-				array9[num12] = new Vector4(x4, y4, z4, w2);
+				array12[num12] = new Vector4(x4, y4, z4, w2);
 			}
-			mesh2.tangents = array9;
+			mesh2.tangents = array12;
 		}
 		for (int num13 = 0; num13 < num4; num13++)
 		{
 			int num14 = (int)binaryReader.ReadUInt16();
-			array8[num13].boneIndex0 = num14;
+			array11[num13].boneIndex0 = num14;
 			int num15 = num14;
 			num14 = (int)binaryReader.ReadUInt16();
-			array8[num13].boneIndex1 = num14;
+			array11[num13].boneIndex1 = num14;
 			int num16 = num14;
 			num14 = (int)binaryReader.ReadUInt16();
-			array8[num13].boneIndex2 = num14;
+			array11[num13].boneIndex2 = num14;
 			int num17 = num14;
 			num14 = (int)binaryReader.ReadUInt16();
-			array8[num13].boneIndex3 = num14;
+			array11[num13].boneIndex3 = num14;
 			int num18 = num14;
 			array[num15].use = true;
 			array[num16].use = true;
 			array[num17].use = true;
 			array[num18].use = true;
-			array8[num13].weight0 = binaryReader.ReadSingle();
-			array8[num13].weight1 = binaryReader.ReadSingle();
-			array8[num13].weight2 = binaryReader.ReadSingle();
-			array8[num13].weight3 = binaryReader.ReadSingle();
+			array11[num13].weight0 = binaryReader.ReadSingle();
+			array11[num13].weight1 = binaryReader.ReadSingle();
+			array11[num13].weight2 = binaryReader.ReadSingle();
+			array11[num13].weight3 = binaryReader.ReadSingle();
 		}
 		ImportCM.BoneUse boneUse2;
-		if (dictionary.TryGetValue("Bip01", out boneUse2))
+		if (!flag && dictionary.TryGetValue("Bip01", out boneUse2))
 		{
 			ImportCM.RemoveNoWeightBone(dictionary, boneUse2.bone);
 		}
-		mesh2.boneWeights = array8;
+		mesh2.boneWeights = array11;
 		mesh2.subMeshCount = num5;
-		oriVert.bwWeight = array8;
+		oriVert.bwWeight = array11;
 		oriVert.nSubMeshCount = num5;
 		oriVert.nSubMeshOriTri = new int[num5][];
 		for (int num19 = 0; num19 < num5; num19++)
 		{
 			int num20 = binaryReader.ReadInt32();
-			int[] array10 = new int[num20];
+			int[] array13 = new int[num20];
 			for (int num21 = 0; num21 < num20; num21++)
 			{
-				array10[num21] = (int)binaryReader.ReadUInt16();
+				array13[num21] = (int)binaryReader.ReadUInt16();
 			}
-			oriVert.nSubMeshOriTri[num19] = array10;
-			mesh2.SetTriangles(array10, num19);
+			oriVert.nSubMeshOriTri[num19] = array13;
+			mesh2.SetTriangles(array13, num19);
 		}
 		int num22 = binaryReader.ReadInt32();
-		Material[] array11 = new Material[num22];
+		Material[] array14 = new Material[num22];
 		for (int num23 = 0; num23 < num22; num23++)
 		{
-			Material material = ImportCM.ReadMaterial(binaryReader, bodyskin, null);
-			array11[num23] = material;
+			Material material = ImportCM.ReadMaterial(binaryReader, bodyskin, null, num);
+			array14[num23] = material;
 		}
-		skinnedMeshRenderer.materials = array11;
+		skinnedMeshRenderer.materials = array14;
 		for (;;)
 		{
 			string a = binaryReader.ReadString();
@@ -307,7 +382,16 @@ public class ImportCM : MonoBehaviour
 			}
 			if (a == "morph")
 			{
-				morph.LoadMoprhData2(binaryReader);
+				morph.LoadMoprhData2(binaryReader, num);
+			}
+		}
+		if (2100 <= num)
+		{
+			int num24 = binaryReader.ReadInt32();
+			if (num24 != 0)
+			{
+				oriVert.skinThick = new SkinThickness();
+				oriVert.skinThick.Deserialize(binaryReader);
 			}
 		}
 		binaryReader.Close();
@@ -351,14 +435,14 @@ public class ImportCM : MonoBehaviour
 		{
 			NDebug.Assert("ProcScriptBin 例外 : ヘッダーファイルが不正です。" + text, false);
 		}
-		int num = binaryReader.ReadInt32();
+		int parentVer = binaryReader.ReadInt32();
 		string text2 = binaryReader.ReadString();
-		Material result = ImportCM.ReadMaterial(binaryReader, bodyskin, existmat);
+		Material result = ImportCM.ReadMaterial(binaryReader, bodyskin, existmat, parentVer);
 		binaryReader.Close();
 		return result;
 	}
 
-	public static Material ReadMaterial(BinaryReader r, TBodySkin bodyskin = null, Material existmat = null)
+	public static Material ReadMaterial(BinaryReader r, TBodySkin bodyskin = null, Material existmat = null, int parentVer = 0)
 	{
 		if (ImportCM.m_hashPriorityMaterials == null)
 		{
@@ -394,71 +478,96 @@ public class ImportCM : MonoBehaviour
 				}
 			}
 		}
-		string name = r.ReadString();
 		string text2 = r.ReadString();
 		string text3 = r.ReadString();
-		Material material2;
-		if (existmat == null)
+		string text4 = r.ReadString();
+		Material material;
+		if (text2.IndexOf("gp03_") == 0)
 		{
-			Material material;
-			if (!ImportCM.m_dicCacheMaterial.TryGetValue(text3, out material))
+			text3 = text3.Replace("CM3D2", "GP03").Replace("/", "_");
+			Shader shader = Resources.Load("Shaders/GP03/" + text3) as Shader;
+			NDebug.Assert(shader != null, "GP03 Shader not found. -> " + text3);
+			if (existmat == null)
 			{
-				string text4 = "DefMaterial/" + text3;
-				material = (Resources.Load(text4, typeof(Material)) as Material);
-				if (material == null)
-				{
-					NDebug.Assert("DefMaterialが見つかりません。" + text4, false);
-				}
-				ImportCM.m_dicCacheMaterial[text3] = material;
+				material = new Material(shader);
+			}
+			else
+			{
+				material = existmat;
+				material.shader = shader;
 			}
-			material2 = UnityEngine.Object.Instantiate<Material>(material);
-			if (bodyskin != null)
+			material.name = text2;
+			if (r.ReadBoolean())
 			{
-				bodyskin.listDEL.Add(material2);
+				float num2 = r.ReadSingle();
+				material.SetFloat("_SetManualRenderQueue", num2);
+				material.renderQueue = (int)num2;
 			}
 		}
 		else
 		{
-			material2 = existmat;
-			if (material2.shader.name != text2)
+			if (existmat == null)
 			{
-				NDebug.Warning("マテリアル入れ替えエラー。違うシェーダーに入れようとしました。 " + text2 + " -> " + material2.shader.name);
+				Material material2;
+				if (!ImportCM.m_dicCacheMaterial.TryGetValue(text4, out material2))
+				{
+					string text5 = "DefMaterial/" + text4;
+					material2 = (Resources.Load(text5, typeof(Material)) as Material);
+					if (material2 == null)
+					{
+						NDebug.Assert("DefMaterialが見つかりません。" + text5, false);
+					}
+					ImportCM.m_dicCacheMaterial[text4] = material2;
+				}
+				material = UnityEngine.Object.Instantiate<Material>(material2);
+				if (bodyskin != null)
+				{
+					bodyskin.listDEL.Add(material);
+				}
 			}
-		}
-		material2.name = name;
-		int hashCode = material2.name.GetHashCode();
-		if (ImportCM.m_hashPriorityMaterials != null && ImportCM.m_hashPriorityMaterials.ContainsKey(hashCode))
-		{
-			KeyValuePair<string, float> keyValuePair = ImportCM.m_hashPriorityMaterials[hashCode];
-			if (keyValuePair.Key == material2.name)
+			else
 			{
-				material2.SetFloat("_SetManualRenderQueue", keyValuePair.Value);
-				material2.renderQueue = (int)keyValuePair.Value;
+				material = existmat;
+				if (material.shader.name != text3)
+				{
+					NDebug.Warning("マテリアル入れ替えエラー。違うシェーダーに入れようとしました。 " + text3 + " -> " + material.shader.name);
+				}
+			}
+			material.name = text2;
+			int hashCode = material.name.GetHashCode();
+			if (ImportCM.m_hashPriorityMaterials != null && ImportCM.m_hashPriorityMaterials.ContainsKey(hashCode))
+			{
+				KeyValuePair<string, float> keyValuePair = ImportCM.m_hashPriorityMaterials[hashCode];
+				if (keyValuePair.Key == material.name)
+				{
+					material.SetFloat("_SetManualRenderQueue", keyValuePair.Value);
+					material.renderQueue = (int)keyValuePair.Value;
+				}
 			}
 		}
 		for (;;)
 		{
-			string text5 = r.ReadString();
-			if (text5 == "end")
+			string text6 = r.ReadString();
+			if (text6 == "end")
 			{
 				break;
 			}
-			string name2 = r.ReadString();
-			if (text5 == "tex")
+			string name = r.ReadString();
+			if (text6 == "tex")
 			{
 				string a2 = r.ReadString();
 				if (a2 == "null")
 				{
-					material2.SetTexture(name2, null);
+					material.SetTexture(name, null);
 				}
 				else if (a2 == "tex2d")
 				{
-					string text6 = r.ReadString();
 					string text7 = r.ReadString();
-					Texture2D texture2D = ImportCM.CreateTexture(text6 + ".tex");
-					texture2D.name = text6;
+					string text8 = r.ReadString();
+					Texture2D texture2D = ImportCM.CreateTexture(text7 + ".tex");
+					texture2D.name = text7;
 					texture2D.wrapMode = TextureWrapMode.Clamp;
-					material2.SetTexture(name2, texture2D);
+					material.SetTexture(name, texture2D);
 					if (bodyskin != null)
 					{
 						bodyskin.listDEL.Add(texture2D);
@@ -466,47 +575,83 @@ public class ImportCM : MonoBehaviour
 					Vector2 value2;
 					value2.x = r.ReadSingle();
 					value2.y = r.ReadSingle();
-					material2.SetTextureOffset(name2, value2);
+					material.SetTextureOffset(name, value2);
 					Vector2 value3;
 					value3.x = r.ReadSingle();
 					value3.y = r.ReadSingle();
-					material2.SetTextureScale(name2, value3);
+					material.SetTextureScale(name, value3);
 				}
 				else if (a2 == "texRT")
 				{
-					string text8 = r.ReadString();
 					string text9 = r.ReadString();
+					string text10 = r.ReadString();
 				}
 			}
-			else if (text5 == "col")
+			else if (text6 == "col")
 			{
 				Color value4;
 				value4.r = r.ReadSingle();
 				value4.g = r.ReadSingle();
 				value4.b = r.ReadSingle();
 				value4.a = r.ReadSingle();
-				material2.SetColor(name2, value4);
+				material.SetColor(name, value4);
 			}
-			else if (text5 == "vec")
+			else if (text6 == "vec")
 			{
 				Vector4 value5;
 				value5.x = r.ReadSingle();
 				value5.y = r.ReadSingle();
 				value5.z = r.ReadSingle();
 				value5.w = r.ReadSingle();
-				material2.SetVector(name2, value5);
+				material.SetVector(name, value5);
 			}
-			else if (text5 == "f")
+			else if (text6 == "f")
 			{
 				float value6 = r.ReadSingle();
-				material2.SetFloat(name2, value6);
+				material.SetFloat(name, value6);
+			}
+			else if (text6 == "range")
+			{
+				float value7 = r.ReadSingle();
+				material.SetFloat(name, value7);
+			}
+			else if (text6 == "tex_offset")
+			{
+				Vector2 value8;
+				value8.x = r.ReadSingle();
+				value8.y = r.ReadSingle();
+				material.SetTextureOffset(name, value8);
+			}
+			else if (text6 == "tex_scale")
+			{
+				Vector2 value9;
+				value9.x = r.ReadSingle();
+				value9.y = r.ReadSingle();
+				material.SetTextureScale(name, value9);
+			}
+			else if (text6 == "keyword")
+			{
+				int num3 = r.ReadInt32();
+				for (int j = 0; j < num3; j++)
+				{
+					string keyword = r.ReadString();
+					bool flag = r.ReadBoolean();
+					if (flag)
+					{
+						material.EnableKeyword(keyword);
+					}
+					else
+					{
+						material.DisableKeyword(keyword);
+					}
+				}
 			}
 			else
 			{
-				Debug.LogError("マテリアルが読み込めません。不正なマテリアルプロパティ型です " + text5);
+				Debug.LogError("マテリアルが読み込めません。不正なマテリアルプロパティ型です " + text6);
 			}
 		}
-		return material2;
+		return material;
 	}
 
 	public static GameObject LoadOnlyBone_R(byte[] bs)
@@ -632,7 +777,10 @@ public class ImportCM : MonoBehaviour
 		{
 			using (AFileBase afileBase = GameUty.FileOpen(f_strFileName, f_fileSystem))
 			{
-				NDebug.Assert(afileBase.IsValid(), "LoadTexture テクスチャコンテナが読めません。 :" + f_strFileName);
+				if (!afileBase.IsValid())
+				{
+					NDebug.Assert("LoadTexture テクスチャコンテナが読めません。 :" + f_strFileName, false);
+				}
 				if (ImportCM.m_texTempFile == null)
 				{
 					ImportCM.m_texTempFile = new byte[Math.Max(500000, afileBase.GetSize())];
@@ -794,7 +942,7 @@ public class ImportCM : MonoBehaviour
 				string text3 = text2 + "*";
 				if (!no_chara)
 				{
-					if (b >= 104 && b <= 106 && !text3.Contains("Bip01*") && !text3.Contains("_IK_") && !text3.Contains("ManBip*") && !text3.Contains("Hip_L") && !text3.Contains("Hip_R"))
+					if (b >= 104 && b <= 106 && !text3.Contains("Bip01*") && !text3.Contains("_IK_") && !text3.Contains("ManBip*") && !text3.Contains("Hip_L") && !text3.Contains("Hip_R") && !text2.Contains("Bone_Face"))
 					{
 						flag = false;
 					}
@@ -875,7 +1023,7 @@ public class ImportCM : MonoBehaviour
 				string text3 = text2 + "*";
 				if (!no_chara)
 				{
-					if (!no_chara && b >= 104 && b <= 106 && !text3.Contains("Bip01*") && !text3.Contains("_IK_") && !text3.Contains("ManBip*") && !text3.Contains("Hip_L") && !text3.Contains("Hip_R"))
+					if (b >= 104 && b <= 106 && !text3.Contains("Bip01*") && !text3.Contains("_IK_") && !text3.Contains("ManBip*") && !text3.Contains("Hip_L") && !text3.Contains("Hip_R") && !text2.Contains("Bone_Face"))
 					{
 						flag = false;
 					}
@@ -1075,6 +1223,310 @@ public class ImportCM : MonoBehaviour
 		return result;
 	}
 
+	public static CharacterMgr.Preset ImportPresetGP03(Maid maid, out byte[] preCrc, string fileName = null)
+	{
+		if (string.IsNullOrEmpty(fileName))
+		{
+			fileName = "gp03_export_" + maid.status.saveDataGuidGP03 + ".brd";
+		}
+		CharacterMgr.Preset result;
+		using (AFileBase afileBase = GameUty.FileOpen(fileName, null))
+		{
+			if (afileBase == null || !afileBase.IsValid())
+			{
+				NDebug.MessageBox("Import Error", "GP03_BRIDGE import gp03 error! -> " + fileName);
+				preCrc = null;
+				result = null;
+			}
+			else
+			{
+				byte[] buffer = afileBase.ReadAll();
+				using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer)))
+				{
+					string a = binaryReader.ReadString();
+					if (a != "GP03_BRIDGE")
+					{
+						NDebug.MessageBox("Import Error", "import gp03 preset header error!");
+						preCrc = null;
+						result = null;
+					}
+					else
+					{
+						int num = binaryReader.ReadInt32();
+						string text = binaryReader.ReadString();
+						int count = binaryReader.ReadInt32();
+						byte[] buffer2 = binaryReader.ReadBytes(count);
+						int count2 = binaryReader.ReadInt32();
+						preCrc = binaryReader.ReadBytes(count2);
+						using (BinaryReader binaryReader2 = new BinaryReader(new MemoryStream(buffer2)))
+						{
+							CharacterMgr.Preset preset = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader2, fileName);
+							foreach (MaidProp maidProp in preset.listMprop)
+							{
+								if (string.IsNullOrEmpty(maidProp.strFileName))
+								{
+									maidProp.nFileNameRID = 0;
+									string strFileName;
+									if (CM3.dicDelItem.TryGetValue((MPN)maidProp.idx, out strFileName))
+									{
+										maidProp.strFileName = strFileName;
+										maidProp.nFileNameRID = maidProp.strFileName.ToLower().GetHashCode();
+										maidProp.boDut = true;
+									}
+								}
+							}
+							result = preset;
+						}
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	public static int CheckBrdVerGP03(string saveMaidGuid)
+	{
+		string fileName = "gp03_export_" + saveMaidGuid + ".brd";
+		int result;
+		using (AFileBase afileBase = GameUty.FileOpen(fileName, null))
+		{
+			if (afileBase == null || !afileBase.IsValid())
+			{
+				Debug.Log("GP03_BRIDGE ver check gp03 error! -> " + saveMaidGuid);
+				result = 0;
+			}
+			else
+			{
+				byte[] buffer = afileBase.ReadAll();
+				using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer)))
+				{
+					string a = binaryReader.ReadString();
+					if (a != "GP03_BRIDGE")
+					{
+						Debug.LogError("import gp03 preset header error!");
+						result = 0;
+					}
+					else
+					{
+						int num = binaryReader.ReadInt32();
+						result = num;
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	public static void ImportSavedAttachDataGP03(string fileName, TBodySkin tbskin)
+	{
+		using (AFileBase afileBase = GameUty.FileOpen(fileName, null))
+		{
+			if (afileBase == null || !afileBase.IsValid())
+			{
+				NDebug.MessageBox("Import Error", "SAVED_ATTACH_DATA import gp03 error! -> " + fileName);
+			}
+			else
+			{
+				byte[] buffer = afileBase.ReadAll();
+				using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer)))
+				{
+					string a = binaryReader.ReadString();
+					if (a != "SAVED_ATTACH_DATA")
+					{
+						NDebug.MessageBox("Import Error", "import gp03 saved attach data header error!");
+					}
+					int num = binaryReader.ReadInt32();
+					int num2 = binaryReader.ReadInt32();
+					for (int i = 0; i < num2; i++)
+					{
+						SavedAttachData savedAttachData = new SavedAttachData();
+						savedAttachData.Deserialize(binaryReader);
+						if (tbskin.m_savedAttachPos == null)
+						{
+							tbskin.m_savedAttachPos = new List<SavedAttachData>();
+						}
+						tbskin.m_savedAttachPos.Add(savedAttachData);
+					}
+				}
+			}
+		}
+	}
+
+	public static void AddSaveDataReferenceToMaidGP03(string addSaveDataGuid, string saveMaidGuid)
+	{
+		HashSet<string> hashSet = ImportCM.ReadSaveDataReferenceMaidGP03(saveMaidGuid);
+		hashSet.Add(addSaveDataGuid);
+		ImportCM.WriteSaveDataReferenceMaidGP03(saveMaidGuid, hashSet);
+	}
+
+	public static void RemoveSaveDataReferenceToMaidGP03(string addSaveDataGuid, string saveMaidGuid)
+	{
+		HashSet<string> hashSet = ImportCM.ReadSaveDataReferenceMaidGP03(saveMaidGuid);
+		hashSet.Remove(addSaveDataGuid);
+		if (!ImportCM.WriteSaveDataReferenceMaidGP03(saveMaidGuid, hashSet))
+		{
+		}
+	}
+
+	public static void DeleteSaveDataNoReferenceMaidGP03(string saveMaidGuid)
+	{
+		HashSet<string> hashSet = ImportCM.ReadSaveDataReferenceMaidGP03(saveMaidGuid);
+		if (hashSet.Count == 0)
+		{
+			ImportCM.DeleteSaveDataMaidGP03(saveMaidGuid);
+		}
+	}
+
+	private static void DeleteSaveDataMaidGP03(string saveMaidGuid)
+	{
+		string path = UTY.gameProjectPath + "\\SaveData\\_gp03_import\\" + saveMaidGuid;
+		UTY.DirectorySafeDelete(path, new string[]
+		{
+			"brd",
+			"model",
+			"menu",
+			"tex",
+			"mat",
+			"sad",
+			"dbcol",
+			"dbconf",
+			"sref"
+		}, SearchOption.TopDirectoryOnly);
+	}
+
+	private static HashSet<string> ReadSaveDataReferenceMaidGP03(string saveMaidGuid)
+	{
+		HashSet<string> hashSet = new HashSet<string>();
+		string text = UTY.gameProjectPath + "\\SaveData\\_gp03_import\\" + saveMaidGuid;
+		if (!Directory.Exists(text))
+		{
+			return hashSet;
+		}
+		string path = text + "\\gp03_" + saveMaidGuid + ".sref";
+		if (File.Exists(path))
+		{
+			byte[] buffer = File.ReadAllBytes(path);
+			using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer)))
+			{
+				string a = binaryReader.ReadString();
+				if (a == "GP03_MAID_REF_DATA")
+				{
+					int num = binaryReader.ReadInt32();
+					int num2 = binaryReader.ReadInt32();
+					for (int i = 0; i < num2; i++)
+					{
+						hashSet.Add(binaryReader.ReadString());
+					}
+				}
+				else
+				{
+					NDebug.Assert("reference add error.", true);
+				}
+			}
+		}
+		return hashSet;
+	}
+
+	private static bool WriteSaveDataReferenceMaidGP03(string saveMaidGuid, HashSet<string> savedGuids)
+	{
+		string text = UTY.gameProjectPath + "\\SaveData\\_gp03_import\\" + saveMaidGuid;
+		if (!Directory.Exists(text))
+		{
+			return false;
+		}
+		string path = text + "\\gp03_" + saveMaidGuid + ".sref";
+		using (MemoryStream memoryStream = new MemoryStream())
+		{
+			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
+			binaryWriter.Write("GP03_MAID_REF_DATA");
+			binaryWriter.Write(2000);
+			binaryWriter.Write(savedGuids.Count);
+			foreach (string value in savedGuids)
+			{
+				binaryWriter.Write(value);
+			}
+			File.WriteAllBytes(path, memoryStream.ToArray());
+		}
+		return savedGuids.Count != 0;
+	}
+
+	public static void CleanupFileMaidGP03()
+	{
+		try
+		{
+			string[] array = GameMain.Instance.EnumSavePathFileName();
+			if (array != null)
+			{
+				List<string> list = new List<string>();
+				foreach (string pathFileName in array)
+				{
+					GameMain.SerializeHeader saveDataHeader = GameMain.Instance.GetSaveDataHeader(pathFileName);
+					if (saveDataHeader != null)
+					{
+						if (!string.IsNullOrEmpty(saveDataHeader.saveDataGUID))
+						{
+							list.Add(saveDataHeader.saveDataGUID);
+						}
+					}
+				}
+				DirectoryInfo directoryInfo = new DirectoryInfo(UTY.gameProjectPath + "\\SaveData\\_gp03_import");
+				if (directoryInfo != null)
+				{
+					DirectoryInfo[] directories = directoryInfo.GetDirectories();
+					DirectoryInfo[] array3 = directories;
+					for (int j = 0; j < array3.Length; j++)
+					{
+						DirectoryInfo directoryInfo2 = array3[j];
+						int num = directoryInfo2.FullName.LastIndexOf('\\');
+						string saveMaidGuid = directoryInfo2.FullName.Remove(0, num + 1);
+						if (ImportCM.CheckBrdVerGP03(saveMaidGuid) >= 2001)
+						{
+							HashSet<string> guidsInMaid = ImportCM.ReadSaveDataReferenceMaidGP03(saveMaidGuid);
+							if (guidsInMaid.Count == 0)
+							{
+								ImportCM.DeleteSaveDataMaidGP03(saveMaidGuid);
+								GameUty.ReloadCrcImportPath();
+							}
+							else if (list.Find((string a) => guidsInMaid.Contains(a)) == null)
+							{
+								ImportCM.DeleteSaveDataMaidGP03(saveMaidGuid);
+								GameUty.ReloadCrcImportPath();
+							}
+							else
+							{
+								int count = guidsInMaid.Count;
+								List<string> list2 = new List<string>();
+								using (HashSet<string>.Enumerator enumerator = guidsInMaid.GetEnumerator())
+								{
+									while (enumerator.MoveNext())
+									{
+										string sg = enumerator.Current;
+										if (list.Find((string a) => string.Compare(a, sg, true) == 0) == null)
+										{
+											list2.Add(sg);
+										}
+									}
+								}
+								foreach (string item in list2)
+								{
+									guidsInMaid.Remove(item);
+								}
+								if (count != guidsInMaid.Count)
+								{
+									ImportCM.WriteSaveDataReferenceMaidGP03(saveMaidGuid, guidsInMaid);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogError("error gp03 maid cleanup.");
+		}
+	}
+
 	private static byte[] m_skinTempFile = null;
 
 	private static byte[] m_matTempFile = null;

+ 8 - 0
Assembly-CSharp/KaraokeDataManager.cs

@@ -812,6 +812,14 @@ public class KaraokeDataManager : MonoBehaviour
 			}
 		}
 
+		public bool isNewBodyBlock
+		{
+			get
+			{
+				return this.ID == 150;
+			}
+		}
+
 		private void GetFlagAndValue(string strCellData, ref string strFlag, ref int value)
 		{
 			if (string.IsNullOrEmpty(strCellData))

+ 283 - 0
Assembly-CSharp/KasaiUtility.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using UnityEngine;
 
 public class KasaiUtility
@@ -421,4 +422,286 @@ public class KasaiUtility
 		orijin_angle.z = func(orijin_angle.z);
 		return orijin_angle;
 	}
+
+	public static void BinarySave(string file_path, string header, int version, Action<BinaryWriter> on_save)
+	{
+		string directoryName = Path.GetDirectoryName(file_path);
+		if (!Directory.Exists(directoryName))
+		{
+			Directory.CreateDirectory(directoryName);
+		}
+		try
+		{
+			using (MemoryStream memoryStream = new MemoryStream())
+			{
+				using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
+				{
+					binaryWriter.Write(header);
+					binaryWriter.Write(version);
+					if (on_save != null)
+					{
+						on_save(binaryWriter);
+					}
+				}
+				if (File.Exists(file_path))
+				{
+					File.Delete(file_path);
+				}
+				File.WriteAllBytes(file_path, memoryStream.ToArray());
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("BinarySaveエラー:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void BinarySave(string file_path, Action<BinaryWriter> on_save)
+	{
+		string directoryName = Path.GetDirectoryName(file_path);
+		if (!Directory.Exists(directoryName))
+		{
+			Directory.CreateDirectory(directoryName);
+		}
+		try
+		{
+			using (MemoryStream memoryStream = new MemoryStream())
+			{
+				using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
+				{
+					on_save(binaryWriter);
+				}
+				if (File.Exists(file_path))
+				{
+					File.Delete(file_path);
+				}
+				File.WriteAllBytes(file_path, memoryStream.ToArray());
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("BinarySaveエラー。ファイル名:{0}", new object[]
+			{
+				file_path
+			});
+			Debug.LogErrorFormat("BinarySaveエラー。エラー種別:{0}", new object[]
+			{
+				ex.Message
+			});
+			Debug.LogErrorFormat("BinarySaveエラー。エラー箇所:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void BinaryLoad(string file_path, string header, Action<BinaryReader, int> on_load, Action on_notexist = null)
+	{
+		if (!File.Exists(file_path))
+		{
+			if (on_notexist != null)
+			{
+				on_notexist();
+			}
+			return;
+		}
+		try
+		{
+			using (FileStream fileStream = new FileStream(file_path, FileMode.Open, FileAccess.Read))
+			{
+				using (BinaryReader binaryReader = new BinaryReader(fileStream))
+				{
+					string text = binaryReader.ReadString();
+					if (text != header)
+					{
+						Debug.LogErrorFormat("ヘッダーが違います。正しいヘッダー:{0} 実際のヘッダー:{1}", new object[]
+						{
+							header,
+							text
+						});
+					}
+					else
+					{
+						int arg = binaryReader.ReadInt32();
+						if (on_load != null)
+						{
+							on_load(binaryReader, arg);
+						}
+					}
+				}
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("BinaryLoadエラー:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void BinaryLoad(string file_path, Action<BinaryReader> on_load, Action on_notexist = null)
+	{
+		if (!File.Exists(file_path))
+		{
+			if (on_notexist != null)
+			{
+				on_notexist();
+			}
+			return;
+		}
+		try
+		{
+			using (FileStream fileStream = new FileStream(file_path, FileMode.Open, FileAccess.Read))
+			{
+				using (BinaryReader binaryReader = new BinaryReader(fileStream))
+				{
+					on_load(binaryReader);
+				}
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("BinaryLoadエラー。ファイル名:{0}", new object[]
+			{
+				file_path
+			});
+			Debug.LogErrorFormat("BinaryLoadエラー。エラー種別:{0}", new object[]
+			{
+				ex.Message
+			});
+			Debug.LogErrorFormat("BinaryLoadエラー。エラー箇所:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void FileSave(string file_path, Action<StreamWriter> on_save)
+	{
+		string directoryName = Path.GetDirectoryName(file_path);
+		if (!Directory.Exists(directoryName))
+		{
+			Directory.CreateDirectory(directoryName);
+		}
+		try
+		{
+			using (MemoryStream memoryStream = new MemoryStream())
+			{
+				using (StreamWriter streamWriter = new StreamWriter(memoryStream))
+				{
+					on_save(streamWriter);
+				}
+				if (File.Exists(file_path))
+				{
+					File.Delete(file_path);
+				}
+				File.WriteAllBytes(file_path, memoryStream.ToArray());
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("FileSaveエラー。ファイル名:{0}", new object[]
+			{
+				file_path
+			});
+			Debug.LogErrorFormat("FileSaveエラー。エラー種別:{0}", new object[]
+			{
+				ex.Message
+			});
+			Debug.LogErrorFormat("FileSaveエラー。エラー箇所:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void FileLoad(string file_path, Action<StreamReader> on_load, Action on_notexist = null)
+	{
+		if (!File.Exists(file_path))
+		{
+			if (on_notexist != null)
+			{
+				on_notexist();
+			}
+			return;
+		}
+		try
+		{
+			using (FileStream fileStream = new FileStream(file_path, FileMode.Open, FileAccess.Read))
+			{
+				using (StreamReader streamReader = new StreamReader(fileStream))
+				{
+					on_load(streamReader);
+				}
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("FileLoadエラー。ファイル名:{0}", new object[]
+			{
+				file_path
+			});
+			Debug.LogErrorFormat("FileLoadエラー。エラー種別:{0}", new object[]
+			{
+				ex.Message
+			});
+			Debug.LogErrorFormat("FileLoadエラー。エラー箇所:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
+
+	public static void FileLoadGameData(string file_name, Action<StreamReader> on_load, Action on_notexist = null)
+	{
+		if (!GameUty.FileSystem.IsExistentFile(file_name))
+		{
+			if (on_notexist != null)
+			{
+				on_notexist();
+			}
+			return;
+		}
+		try
+		{
+			byte[] buffer = null;
+			using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
+			{
+				if (afileBase.IsValid())
+				{
+					buffer = afileBase.ReadAll();
+				}
+				else
+				{
+					NDebug.Assert(string.Format("{0}の読み込みに失敗しました。", file_name), false);
+				}
+			}
+			using (MemoryStream memoryStream = new MemoryStream(buffer))
+			{
+				using (StreamReader streamReader = new StreamReader(memoryStream))
+				{
+					on_load(streamReader);
+				}
+			}
+		}
+		catch (Exception ex)
+		{
+			Debug.LogErrorFormat("FileLoadGameDataエラー。ファイル名:{0}", new object[]
+			{
+				file_name
+			});
+			Debug.LogErrorFormat("FileLoadGameDataエラー。エラー種別:{0}", new object[]
+			{
+				ex.Message
+			});
+			Debug.LogErrorFormat("FileLoadGameDataエラー。エラー箇所:{0}", new object[]
+			{
+				ex.StackTrace
+			});
+		}
+	}
 }

+ 3 - 3
Assembly-CSharp/Kasizuki/KasizukiManager.cs

@@ -459,7 +459,7 @@ namespace Kasizuki
 			PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
 			target.status.lastName = this.m_CachedOriginPlayerName;
 			status.playerName = this.m_CachedOriginPlayerName;
-			for (int i = 0; i < 131; i++)
+			for (int i = 0; i < 223; i++)
 			{
 				MPN mpn = (MPN)i;
 				if (mpn != MPN.null_mpn)
@@ -476,7 +476,7 @@ namespace Kasizuki
 		{
 			this.m_CachedOriginPlayerDataDic = new Dictionary<MPN, MaidProp>();
 			Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
-			for (int i = 0; i < 131; i++)
+			for (int i = 0; i < 223; i++)
 			{
 				MPN mpn = (MPN)i;
 				MaidProp maidProp = new MaidProp();
@@ -872,7 +872,7 @@ namespace Kasizuki
 		public void Serialize(BinaryWriter bw)
 		{
 			bw.Write("COM3D2_KASIZUKI");
-			bw.Write(1550);
+			bw.Write(1570);
 			this.SerializeOriginHeader(bw);
 			foreach (KeyValuePair<int, KasizukiManager.SaveData> keyValuePair in this.m_SaveDataArray)
 			{

+ 2 - 40
Assembly-CSharp/KupaCtrl.cs

@@ -94,11 +94,6 @@ public class KupaCtrl
 		{
 			if (this.m_morphId[i] != -1)
 			{
-				this.m_morph.SetBlendValues(this.m_morphId[i], 0f);
-				if (this.m_morphMoza != null && this.m_morphMozaId[i] != -1)
-				{
-					this.m_morphMoza.SetBlendValues(this.m_morphMozaId[i], 0f);
-				}
 			}
 		}
 		this.m_taskList.Clear();
@@ -187,11 +182,6 @@ public class KupaCtrl
 	{
 		if (this.m_morphId[(int)reg] != -1)
 		{
-			this.m_morph.SetBlendValues(this.m_morphId[(int)reg], 0f);
-			if (this.m_morphMoza != null && this.m_morphMozaId[(int)reg] != -1)
-			{
-				this.m_morphMoza.SetBlendValues(this.m_morphMozaId[(int)reg], 0f);
-			}
 		}
 		this.m_taskList.RemoveAll((KupaCtrl.ATask i) => i.m_reg == reg);
 	}
@@ -315,11 +305,6 @@ public class KupaCtrl
 
 		public override void ForceFinish()
 		{
-			this.m_morph.SetBlendValues(this.m_id, this.m_distVal);
-			if (this.m_morphMoza != null && this.m_mozaId != -1)
-			{
-				this.m_morphMoza.SetBlendValues(this.m_mozaId, this.m_distVal);
-			}
 			this.m_visible = false;
 		}
 
@@ -357,16 +342,7 @@ public class KupaCtrl
 				this.m_visible = false;
 			}
 			float num4 = Mathf.Clamp01(num3);
-			if (num4 != this.m_morph.GetBlendValues(this.m_id))
-			{
-				this.m_morph.SetBlendValues(this.m_id, num4);
-				if (this.m_morphMoza != null && this.m_mozaId != -1)
-				{
-					this.m_morphMoza.SetBlendValues(this.m_mozaId, num4);
-				}
-				return true;
-			}
-			return false;
+			return num4 != this.m_morph.GetBlendValues(this.m_id);
 		}
 
 		private float m_transTime;
@@ -409,11 +385,6 @@ public class KupaCtrl
 
 		public override void ForceReset()
 		{
-			this.m_morph.SetBlendValues(this.m_id, 0f);
-			if (this.m_morphMoza != null && this.m_mozaId != -1)
-			{
-				this.m_morphMoza.SetBlendValues(this.m_mozaId, 0f);
-			}
 			this.m_visible = false;
 		}
 
@@ -499,16 +470,7 @@ public class KupaCtrl
 			this.m_nowRatio += (num11 - this.m_nowRatio) * (Time.deltaTime * this.m_sppedNow);
 			this.m_befRatio = num11;
 			float num13 = Mathf.Clamp01(this.m_nowRatio);
-			if (num13 != this.m_morph.GetBlendValues(this.m_id))
-			{
-				this.m_morph.SetBlendValues(this.m_id, num13);
-				if (this.m_morphMoza != null && this.m_mozaId != -1)
-				{
-					this.m_morphMoza.SetBlendValues(this.m_mozaId, num13);
-				}
-				return true;
-			}
-			return false;
+			return num13 != this.m_morph.GetBlendValues(this.m_id);
 		}
 
 		public Transform m_src;

+ 315 - 0
Assembly-CSharp/LimbColliderMgr.cs

@@ -0,0 +1,315 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using kt.Physics;
+using kt.Serialization;
+using kt.Utility;
+using UnityEngine;
+
+public class LimbColliderMgr : MonoBehaviour
+{
+	public void Init(TBody body)
+	{
+		this.Body = body;
+		this.DestroyCollider();
+		foreach (KeyValuePair<LimbColliderMgr.LimbType, string[]> keyValuePair in LimbColliderMgr.LimbTypeBoneNamePairDic)
+		{
+			LimbColliderMgr.LimbColliderData limbColliderData = new LimbColliderMgr.LimbColliderData();
+			limbColliderData.limbType = keyValuePair.Key;
+			limbColliderData.parent = body.GetBone(keyValuePair.Value[0]);
+			limbColliderData.child = body.GetBone(keyValuePair.Value[1]);
+			GameObject gameObject = new GameObject(string.Format("{0} LimbCollider", keyValuePair.Key));
+			gameObject.transform.SetParent(limbColliderData.parent, false);
+			limbColliderData.collider = gameObject.AddComponent<NativeMaidPropCollider>();
+			limbColliderData.collider.capsuleStatus.direction = MathUtility.VectorType.X;
+			limbColliderData.collider.capsuleStatus.isDirectionInverse = true;
+			limbColliderData.collider.capsuleStatus.startRadius = (limbColliderData.collider.capsuleStatus.endRadius = 0.05f);
+			limbColliderData.collider.SetChara(body.maid);
+			limbColliderData.relatedMPNList.Add(MPN.sintyou);
+			if (LimbColliderMgr.IsUpperBodyLimb(keyValuePair.Key))
+			{
+				limbColliderData.relatedMPNList.Add(MPN.UdeScl);
+			}
+			else
+			{
+				limbColliderData.relatedMPNList.Add(MPN.DouPer);
+			}
+			this.LimbTypeColliderDataDic[keyValuePair.Key] = limbColliderData;
+			limbColliderData.CalcCapsuleHeight();
+		}
+		foreach (KeyValuePair<MPN, LimbColliderMgr.MaidPropInfo> keyValuePair2 in this.MaidPropMetaDic)
+		{
+			MPN key = keyValuePair2.Key;
+			LimbColliderMgr.MaidPropInfo value = keyValuePair2.Value;
+			MaidProp prop = body.maid.GetProp(key);
+			if (prop != null)
+			{
+				value.Value = (float)prop.value;
+			}
+		}
+		body.onBoneMorphApply.Add(new Action<string, float>(this.SetPropValue), false);
+		KasaiUtility.FileLoadGameData("limbconf.limbcol", new Action<StreamReader>(this.Load), null);
+	}
+
+	private void OnDestroy()
+	{
+		this.DestroyCollider();
+	}
+
+	private void DestroyCollider()
+	{
+		foreach (LimbColliderMgr.LimbColliderData limbColliderData in this.LimbTypeColliderDataDic.Values)
+		{
+			if (limbColliderData.collider)
+			{
+				UnityEngine.Object.Destroy(limbColliderData.collider);
+			}
+		}
+		this.LimbTypeColliderDataDic.Clear();
+	}
+
+	private void SetPropValue(string tag, float val)
+	{
+		foreach (KeyValuePair<MPN, LimbColliderMgr.MaidPropInfo> keyValuePair in this.MaidPropMetaDic)
+		{
+			MPN key = keyValuePair.Key;
+			LimbColliderMgr.MaidPropInfo value = keyValuePair.Value;
+			if (key.ToString() == tag)
+			{
+				value.isValChange = (value.Value != val);
+				value.Value = val;
+				break;
+			}
+		}
+	}
+
+	public void UpdateColliderTransform()
+	{
+		foreach (LimbColliderMgr.LimbColliderData limbColliderData in this.LimbTypeColliderDataDic.Values)
+		{
+			foreach (MPN key in limbColliderData.relatedMPNList)
+			{
+				if (this.MaidPropMetaDic[key].isValChange)
+				{
+					limbColliderData.CalcCapsuleHeight();
+					break;
+				}
+			}
+		}
+		foreach (LimbColliderMgr.MaidPropInfo maidPropInfo in this.MaidPropMetaDic.Values)
+		{
+			maidPropInfo.isValChange = false;
+		}
+	}
+
+	public NativeMaidPropCollider GetCollider(LimbColliderMgr.LimbType limb_type)
+	{
+		if (this.LimbTypeColliderDataDic.ContainsKey(limb_type))
+		{
+			return this.LimbTypeColliderDataDic[limb_type].collider;
+		}
+		return null;
+	}
+
+	public void Save(StreamWriter writer)
+	{
+		LimbColliderMgr.LimbColliderPackage limbColliderPackage = new LimbColliderMgr.LimbColliderPackage();
+		foreach (KeyValuePair<LimbColliderMgr.LimbType, LimbColliderMgr.LimbColliderData> keyValuePair in this.LimbTypeColliderDataDic)
+		{
+			LimbColliderMgr.LimbColliderData limbColliderData = new LimbColliderMgr.LimbColliderData();
+			limbColliderData.limbType = keyValuePair.Key;
+			limbColliderData.colliderStatus = keyValuePair.Value.collider.maidPropStatus;
+			limbColliderPackage.colliderDataList.Add(limbColliderData);
+		}
+		string value = JsonUtility.ToJson(limbColliderPackage, true);
+		writer.Write(value);
+	}
+
+	public void Load(StreamReader reader)
+	{
+		string json = reader.ReadToEnd();
+		LimbColliderMgr.LimbColliderPackage limbColliderPackage = JsonUtility.FromJson<LimbColliderMgr.LimbColliderPackage>(json);
+		foreach (LimbColliderMgr.LimbColliderData limbColliderData in limbColliderPackage.colliderDataList)
+		{
+			if (this.LimbTypeColliderDataDic.ContainsKey(limbColliderData.limbType))
+			{
+				this.LimbTypeColliderDataDic[limbColliderData.limbType].collider.SetStatus(limbColliderData.colliderStatus, this.Body);
+			}
+		}
+	}
+
+	private static bool IsUpperBodyLimb(LimbColliderMgr.LimbType limb_type)
+	{
+		return limb_type == LimbColliderMgr.LimbType.UpperArm_L || limb_type == LimbColliderMgr.LimbType.UpperArm_R || limb_type == LimbColliderMgr.LimbType.Forearm_L || limb_type == LimbColliderMgr.LimbType.Forearm_R;
+	}
+
+	public const string COLLIDER_FILE_NAME = "limbconf.limbcol";
+
+	private static Dictionary<LimbColliderMgr.LimbType, string[]> LimbTypeBoneNamePairDic = new Dictionary<LimbColliderMgr.LimbType, string[]>
+	{
+		{
+			LimbColliderMgr.LimbType.UpperArm_L,
+			new string[]
+			{
+				"Bip01 L UpperArm",
+				"Bip01 L Forearm"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Forearm_L,
+			new string[]
+			{
+				"Bip01 L Forearm",
+				"Bip01 L Hand"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.UpperArm_R,
+			new string[]
+			{
+				"Bip01 R UpperArm",
+				"Bip01 R Forearm"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Forearm_R,
+			new string[]
+			{
+				"Bip01 R Forearm",
+				"Bip01 R Hand"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Thigh_L,
+			new string[]
+			{
+				"Bip01 L Thigh",
+				"Bip01 L Calf"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Calf_L,
+			new string[]
+			{
+				"Bip01 L Calf",
+				"Bip01 L Foot"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Thigh_R,
+			new string[]
+			{
+				"Bip01 R Thigh",
+				"Bip01 R Calf"
+			}
+		},
+		{
+			LimbColliderMgr.LimbType.Calf_R,
+			new string[]
+			{
+				"Bip01 R Calf",
+				"Bip01 R Foot"
+			}
+		}
+	};
+
+	[SerializeField]
+	[ReadOnly]
+	private TBody Body;
+
+	private Dictionary<LimbColliderMgr.LimbType, LimbColliderMgr.LimbColliderData> LimbTypeColliderDataDic = new Dictionary<LimbColliderMgr.LimbType, LimbColliderMgr.LimbColliderData>();
+
+	private readonly Dictionary<MPN, LimbColliderMgr.MaidPropInfo> MaidPropMetaDic = new Dictionary<MPN, LimbColliderMgr.MaidPropInfo>
+	{
+		{
+			MPN.sintyou,
+			new LimbColliderMgr.MaidPropInfo()
+		},
+		{
+			MPN.UdeScl,
+			new LimbColliderMgr.MaidPropInfo()
+		},
+		{
+			MPN.DouPer,
+			new LimbColliderMgr.MaidPropInfo()
+		}
+	};
+
+	public enum LimbType
+	{
+		UpperArm_L,
+		Forearm_L,
+		UpperArm_R,
+		Forearm_R,
+		Thigh_L,
+		Calf_L,
+		Thigh_R,
+		Calf_R
+	}
+
+	[Serializable]
+	public class LimbColliderPackage : ASerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public List<LimbColliderMgr.LimbColliderData> colliderDataList = new List<LimbColliderMgr.LimbColliderData>();
+	}
+
+	[Serializable]
+	public class LimbColliderData : ASerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public void CalcCapsuleHeight()
+		{
+			this.collider.capsuleStatus.height = Vector3.Distance(this.parent.position, this.child.position);
+			this.collider.status.center = this.collider.localDirection * this.collider.capsuleStatus.height / 2f;
+		}
+
+		public override void OnBeforeSerialize()
+		{
+			base.OnBeforeSerialize();
+			if (this.collider)
+			{
+				this.colliderStatus = this.collider.maidPropStatus;
+			}
+		}
+
+		public LimbColliderMgr.LimbType limbType;
+
+		[HideInInspector]
+		public NativeMaidPropColliderStatus colliderStatus = new NativeMaidPropColliderStatus();
+
+		[NonSerialized]
+		public Transform parent;
+
+		[NonSerialized]
+		public Transform child;
+
+		[NonSerialized]
+		public NativeMaidPropCollider collider;
+
+		[HideInInspector]
+		[NonSerialized]
+		public List<MPN> relatedMPNList = new List<MPN>();
+	}
+
+	private class MaidPropInfo
+	{
+		public float Value;
+
+		public bool isValChange;
+	}
+}

+ 0 - 68
Assembly-CSharp/LimbIKData.cs

@@ -1,68 +0,0 @@
-using System;
-using System.Linq;
-using RootMotion.FinalIK;
-using UnityEngine;
-
-public abstract class LimbIKData : IKCtrlData
-{
-	public LimbIKData(FullBodyIKCtrl ik_ctrl, FBIKChain chain, IKMappingLimb ik_mapping, Transform tgt_bone, bool use_old = false) : base(ik_ctrl, tgt_bone, use_old, false)
-	{
-		this.Chain = chain;
-		this.IKMapping = ik_mapping;
-		this.m_ChainBones = (from node in this.Chain.nodes
-		select node.transform).ToArray<Transform>();
-	}
-
-	public override bool NeedFullbodySolverUpdate
-	{
-		get
-		{
-			return base.IsIKExec && !base.OldIkExec && this.m_IsPullBody;
-		}
-	}
-
-	public override void SetPullState(bool pull_on)
-	{
-		this.m_IsPullBody = pull_on;
-		if (this.m_OrijinPull < 0f)
-		{
-			this.m_OrijinPull = this.Chain.pull;
-		}
-		if (pull_on)
-		{
-			this.Chain.pull = this.m_OrijinPull;
-		}
-		else
-		{
-			this.Chain.pull = 0.1f;
-		}
-	}
-
-	public override void TagetTransCpy()
-	{
-		base.TagetTransCpy();
-		if (this.m_IsUpperBody)
-		{
-			this.IKMapping.weight = 0f;
-		}
-	}
-
-	public override void ApplyIKSetting()
-	{
-		base.ApplyIKSetting();
-		if (this.m_IsUpperBody)
-		{
-			this.IKMapping.weight = Mathf.Max(this.IKMapping.weight, Mathf.Max(base.PositionWeight, base.RotationWeight));
-		}
-	}
-
-	public readonly FBIKChain Chain;
-
-	public readonly IKMappingLimb IKMapping;
-
-	protected bool m_IsUpperBody;
-
-	protected float m_OrijinPull = -1f;
-
-	protected bool m_IsPullBody = true;
-}

+ 4 - 3
Assembly-CSharp/LoadReplaceMaid.cs

@@ -113,7 +113,7 @@ public class LoadReplaceMaid : MonoBehaviour
 				{
 					Localize.ArgsPair.Create(maid_name)
 				};
-				Utility.SetLocalizeTerm(component2, LoadReplaceMaid.kText, false);
+				Utility.SetLocalizeTerm(component2, LoadReplaceMaid.kText, true);
 			}
 			else
 			{
@@ -133,9 +133,10 @@ public class LoadReplaceMaid : MonoBehaviour
 		List<Maid> list = new List<Maid>();
 		for (int i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
 		{
-			if (!this.already_used_maid_list_.Contains(this.chara_mgr_.GetStockMaid(i)))
+			Maid stockMaid = this.chara_mgr_.GetStockMaid(i);
+			if (!this.already_used_maid_list_.Contains(stockMaid))
 			{
-				list.Add(this.chara_mgr_.GetStockMaid(i));
+				list.Add(stockMaid);
 			}
 		}
 		List<Maid> list2 = list;

+ 109 - 17
Assembly-CSharp/MPN.cs

@@ -3,15 +3,89 @@
 public enum MPN
 {
 	null_mpn,
-	MuneL,
-	MuneS,
-	MuneTare,
 	RegFat,
 	ArmL,
 	Hara,
 	RegMeet,
 	KubiScl,
 	UdeScl,
+	DouPer,
+	sintyou,
+	koshi,
+	kata,
+	west,
+	MuneL,
+	MuneS,
+	MuneTare,
+	MuneUpDown,
+	MuneYori,
+	MuneYawaraka,
+	MunePosX,
+	MunePosY,
+	MuneThick,
+	MuneLong,
+	MuneDir,
+	DouThick1X,
+	DouThick1Y,
+	DouThick2X,
+	DouThick2Y,
+	DouThick3X,
+	DouThick3Y,
+	ShoulderThick,
+	UpperArmThickX,
+	UpperArmThickY,
+	LowerArmThickX,
+	LowerArmThickY,
+	ElbowThickX,
+	ElbowThickY,
+	NeckThickX,
+	NeckThickY,
+	HandSize,
+	DouThick4X,
+	DouThick4Y,
+	DouThick5X,
+	DouThick5Y,
+	WaistPos,
+	HipSize,
+	HipRot,
+	ThighThickX,
+	ThighThickY,
+	KneeThickX,
+	KneeThickY,
+	CalfThickX,
+	CalfThickY,
+	AnkleThickX,
+	AnkleThickY,
+	FootSize,
+	UpperArmLowerThickX,
+	UpperArmLowerThickY,
+	WristThickX,
+	WristThickY,
+	ClavicleThick,
+	ShoulderTension,
+	ThighLowerThickX,
+	ThighLowerThickY,
+	ThighShin,
+	HaraN,
+	ChikubiH,
+	ChikubiK1,
+	ChikubiK2,
+	ChikubiK2_MuneS,
+	ChikubiR,
+	ChikubiW,
+	Nyurin1,
+	Nyurin2,
+	Nyurin3,
+	Nyurin4,
+	Nyurin5,
+	Nyurin6,
+	Nyurin7,
+	Nyurin8,
+	ChikubiWearTotsu,
+	HeadX,
+	HeadY,
+	FaceShape,
+	FaceShapeSlim,
 	EyeScl,
 	EyeSclX,
 	EyeSclY,
@@ -28,23 +102,11 @@ public enum MPN
 	EarScl,
 	NosePos,
 	NoseScl,
-	FaceShape,
-	FaceShapeSlim,
 	MayuShapeIn,
 	MayuShapeOut,
 	MayuX,
 	MayuY,
 	MayuRot,
-	HeadX,
-	HeadY,
-	DouPer,
-	sintyou,
-	koshi,
-	kata,
-	west,
-	MuneUpDown,
-	MuneYori,
-	MuneYawaraka,
 	MayuThick,
 	MayuLong,
 	Yorime,
@@ -56,6 +118,29 @@ public enum MPN
 	MabutaLowIn,
 	MabutaLowUpMiddle,
 	MabutaLowUpOut,
+	Ha1,
+	Ha2,
+	Ha3,
+	Ha4,
+	Ha5,
+	Ha6,
+	FutaePosX,
+	FutaePosY,
+	FutaeRot,
+	HitomiHiPosX,
+	HitomiHiPosY,
+	HitomiHiSclY,
+	HitomiShapeUp,
+	HitomiShapeLow,
+	HitomiShapeIn,
+	HitomiShapeOutUp,
+	HitomiShapeOutLow,
+	HitomiRot,
+	HohoShape,
+	LipThick,
+	WearSuso,
+	KuikomiPants,
+	KuikomiStkg,
 	body,
 	moza,
 	head,
@@ -69,14 +154,15 @@ public enum MPN
 	acctatoo,
 	accnail,
 	underhair,
+	asshair,
 	hokuro,
 	mayu,
 	lip,
+	chikubi,
+	chikubicolor,
 	eye,
 	eye_hi,
 	eye_hi_r,
-	chikubi,
-	chikubicolor,
 	eyewhite,
 	nose,
 	facegloss,
@@ -86,8 +172,11 @@ public enum MPN
 	wear,
 	skirt,
 	mizugi,
+	mizugi_top,
+	mizugi_buttom,
 	bra,
 	panz,
+	slip,
 	stkg,
 	shoes,
 	headset,
@@ -95,6 +184,7 @@ public enum MPN
 	acchead,
 	accha,
 	acchana,
+	accface,
 	acckamisub,
 	acckami,
 	accmimi,
@@ -106,6 +196,7 @@ public enum MPN
 	accashi,
 	accsenaka,
 	accshippo,
+	acckoshi,
 	accanl,
 	accvag,
 	megane,
@@ -117,6 +208,7 @@ public enum MPN
 	set_mywear,
 	set_underwear,
 	set_body,
+	set_face,
 	folder_eye,
 	folder_mayu,
 	folder_underhair,

+ 11 - 9
Assembly-CSharp/MPN_TYPE_RANGE.cs

@@ -3,14 +3,16 @@
 public enum MPN_TYPE_RANGE
 {
 	BODY_START = 1,
-	BODY_END = 80,
-	BODY_RELOAD_START = 55,
-	BODY_RELOAD_END = 114,
-	WEAR_START = 81,
-	WEAR_END = 110,
+	BODY_END = 166,
+	BODY_SLIDER_START = 1,
+	BODY_SLIDER_END = 78,
+	BODY_RELOAD_START = 140,
+	BODY_RELOAD_END = 201,
+	WEAR_START = 167,
+	WEAR_END = 201,
 	SET_START,
-	SET_END = 114,
-	FOLDER_BODY_START,
-	FOLDER_BODY_END = 122,
-	MAX = 131
+	SET_END = 205,
+	FOLDER_BODY_START = 207,
+	FOLDER_BODY_END = 214,
+	MAX = 223
 }

File diff suppressed because it is too large
+ 805 - 190
Assembly-CSharp/Maid.cs


+ 12 - 8
Assembly-CSharp/MaidColliderCollect.cs

@@ -59,7 +59,7 @@ public class MaidColliderCollect : MonoBehaviour
 		MaidColliderCollect component = maid.gameObject.GetComponent<MaidColliderCollect>();
 		if (component != null)
 		{
-			for (int i = 0; i < 2; i++)
+			for (int i = 0; i < 3; i++)
 			{
 				component.RemoveCollider((MaidColliderCollect.ColliderType)i);
 			}
@@ -75,7 +75,7 @@ public class MaidColliderCollect : MonoBehaviour
 		MaidColliderCollect component = maid.gameObject.GetComponent<MaidColliderCollect>();
 		if (component != null)
 		{
-			for (int i = 0; i < 2; i++)
+			for (int i = 0; i < 3; i++)
 			{
 				component.SuspendCollider((MaidColliderCollect.ColliderType)i, enable);
 			}
@@ -128,7 +128,7 @@ public class MaidColliderCollect : MonoBehaviour
 
 	public void SwitchCollider(MaidColliderCollect.ColliderType type)
 	{
-		for (int i = 0; i < 2; i++)
+		for (int i = 0; i < 3; i++)
 		{
 			this.ActiveCollider(type, false);
 			if (type != MaidColliderCollect.ColliderType.NON && i == (int)type)
@@ -192,7 +192,7 @@ public class MaidColliderCollect : MonoBehaviour
 		foreach (KeyValuePair<string, CapsuleCollider> keyValuePair in dictionary)
 		{
 			string key = keyValuePair.Key;
-			for (int i = 0; i < 2; i++)
+			for (int i = 0; i < 3; i++)
 			{
 				int num = keyValuePair.Key.IndexOf(this.add_obj_name_array_[i]);
 				if (0 < num)
@@ -275,28 +275,32 @@ public class MaidColliderCollect : MonoBehaviour
 	private string[] add_obj_name_array_ = new string[]
 	{
 		"OvrGrabHit_",
-		"OvrTouchHit_"
+		"OvrTouchHit_",
+		"OvrCrc_"
 	};
 
 	private string[] file_path_array_ = new string[]
 	{
 		"System/maid_collider.bytes",
-		"System/maid_collider_touch.bytes"
+		"System/maid_collider_touch.bytes",
+		"System/maid_collider_v2.bytes"
 	};
 
 	private int[] layer_array_ = new int[]
 	{
 		17,
-		19
+		19,
+		21
 	};
 
-	private List<CapsuleCollider>[] collider_array_ = new List<CapsuleCollider>[2];
+	private List<CapsuleCollider>[] collider_array_ = new List<CapsuleCollider>[3];
 
 	public enum ColliderType
 	{
 		NON = -1,
 		Grab,
 		Touch,
+		Crc,
 		MAX
 	}
 }

+ 415 - 0
Assembly-CSharp/MaidExtension/MaidCostumeChangeController.cs

@@ -0,0 +1,415 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace MaidExtension
+{
+	public class MaidCostumeChangeController
+	{
+		public MaidCostumeChangeController(Maid maid)
+		{
+			this.manager = new MaidCostumeChangeController.MaidCostumeChangeManager(maid);
+		}
+
+		public Maid maid
+		{
+			get
+			{
+				return this.manager.maid;
+			}
+			set
+			{
+				this.manager.maid = value;
+			}
+		}
+
+		public MaidCostumeChangeController.MaidCostumeChangeManager manager { get; private set; }
+
+		public bool IsSupportedCostumeType(MaidCostumeChangeController.CostumeType type)
+		{
+			switch (type)
+			{
+			case MaidCostumeChangeController.CostumeType.MekureFront:
+				return this.manager.IsSupportedCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureFront);
+			case MaidCostumeChangeController.CostumeType.MekureBack:
+				return this.manager.IsSupportedCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureBack);
+			case MaidCostumeChangeController.CostumeType.Zurasi:
+				return this.manager.IsSupportedCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Zurasi);
+			case MaidCostumeChangeController.CostumeType.Hadake:
+				return this.manager.IsSupportedCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Hadake);
+			default:
+				return false;
+			}
+		}
+
+		public void SetEnabledCostumeType(MaidCostumeChangeController.CostumeType type, bool enabled, string targetMpnName = null)
+		{
+			this.SetEnabledCostumeType(new MaidCostumeChangeController.CostumeType[]
+			{
+				type
+			}, enabled, targetMpnName);
+		}
+
+		public void SetEnabledCostumeType(MaidCostumeChangeController.CostumeType[] types, bool enabled, string targetMpnName = null)
+		{
+			if (this.maid == null)
+			{
+				Debug.LogWarning("MaidCostumeChangeController::SetEnabledCostumeType\n maid is null.");
+				return;
+			}
+			if (types == null || types.Length == 0)
+			{
+				return;
+			}
+			HashSet<MaidCostumeChangeController.CostumeType> hashSet = new HashSet<MaidCostumeChangeController.CostumeType>();
+			foreach (MaidCostumeChangeController.CostumeType item in types)
+			{
+				hashSet.Add(item);
+			}
+			if (enabled && hashSet.Contains(MaidCostumeChangeController.CostumeType.MekureFront) && hashSet.Contains(MaidCostumeChangeController.CostumeType.MekureBack))
+			{
+				hashSet.Remove(MaidCostumeChangeController.CostumeType.MekureBack);
+			}
+			bool flag = (!hashSet.Contains(MaidCostumeChangeController.CostumeType.Hadake)) ? this.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake) : enabled;
+			bool flag2 = (!hashSet.Contains(MaidCostumeChangeController.CostumeType.MekureFront)) ? this.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.MekureFront) : enabled;
+			bool flag3 = (!hashSet.Contains(MaidCostumeChangeController.CostumeType.MekureBack)) ? this.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.MekureBack) : enabled;
+			bool flag4 = (!hashSet.Contains(MaidCostumeChangeController.CostumeType.Zurasi)) ? this.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Zurasi) : enabled;
+			if (flag2 && flag3)
+			{
+				if (hashSet.Contains(MaidCostumeChangeController.CostumeType.MekureFront))
+				{
+					flag3 = !enabled;
+				}
+				else
+				{
+					flag2 = !enabled;
+				}
+			}
+			this.Reset(targetMpnName);
+			bool flag5 = false;
+			if (flag)
+			{
+				flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Hadake, true, false);
+			}
+			if (flag2)
+			{
+				flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureFront, true, false);
+				if (flag)
+				{
+					flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureFront, true, false);
+				}
+			}
+			if (flag3)
+			{
+				flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureBack, true, false);
+				if (flag)
+				{
+					flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureBack, true, false);
+				}
+			}
+			if (flag4)
+			{
+				flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Zurasi, true, false);
+				if (flag)
+				{
+					flag5 |= this.manager.SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndZurasi, true, false);
+				}
+			}
+			if (flag5)
+			{
+				this.maid.AllProcProp();
+			}
+		}
+
+		public bool IsEnabledCostumeType(MaidCostumeChangeController.CostumeType type)
+		{
+			switch (type)
+			{
+			case MaidCostumeChangeController.CostumeType.MekureFront:
+				return this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureFront) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureFront);
+			case MaidCostumeChangeController.CostumeType.MekureBack:
+				return this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureBack) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureBack);
+			case MaidCostumeChangeController.CostumeType.Zurasi:
+				return this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Zurasi) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndZurasi);
+			case MaidCostumeChangeController.CostumeType.Hadake:
+				return this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Hadake) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureFront) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureBack) || this.manager.IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndZurasi);
+			default:
+				return false;
+			}
+		}
+
+		public void Reset(string targetMpnName = null)
+		{
+			this.manager.Reset(targetMpnName);
+		}
+
+		public class MaidCostumeChangeManager
+		{
+			public MaidCostumeChangeManager(Maid maid)
+			{
+				this.maid = maid;
+			}
+
+			public static string[] GetTargetMpnNames(Maid maid, MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type)
+			{
+				if (maid == null)
+				{
+					Debug.LogWarning("MaidCostumeChangeManager::GetTargetMpnNames\n maid is null.");
+					return new string[0];
+				}
+				switch (type)
+				{
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureFront:
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureBack:
+					return new string[]
+					{
+						"skirt",
+						"onepiece"
+					};
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Zurasi:
+				{
+					string[] result;
+					if (maid.IsCrcBody)
+					{
+						string[] array = new string[4];
+						array[0] = "mizugi_buttom";
+						array[1] = "mizugi";
+						array[2] = "panz";
+						result = array;
+						array[3] = "slip";
+					}
+					else
+					{
+						string[] array2 = new string[2];
+						array2[0] = "panz";
+						result = array2;
+						array2[1] = "mizugi";
+					}
+					return result;
+				}
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Hadake:
+				{
+					string[] result2;
+					if (maid.IsCrcBody)
+					{
+						string[] array3 = new string[6];
+						array3[0] = "wear";
+						array3[1] = "onepiece";
+						array3[2] = "mizugi_top";
+						array3[3] = "mizugi";
+						array3[4] = "bra";
+						result2 = array3;
+						array3[5] = "slip";
+					}
+					else
+					{
+						result2 = new string[0];
+					}
+					return result2;
+				}
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureFront:
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureBack:
+				{
+					string[] result3;
+					if (maid.IsCrcBody)
+					{
+						(result3 = new string[1])[0] = "onepiece";
+					}
+					else
+					{
+						result3 = new string[0];
+					}
+					return result3;
+				}
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndZurasi:
+				{
+					string[] result4;
+					if (maid.IsCrcBody)
+					{
+						(result4 = new string[1])[0] = "mizugi";
+					}
+					else
+					{
+						result4 = new string[0];
+					}
+					return result4;
+				}
+				default:
+					return new string[0];
+				}
+			}
+
+			public static string GetItemChangeNames(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type)
+			{
+				switch (type)
+				{
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureFront:
+					return "めくれスカート";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.MekureBack:
+					return "めくれスカート後ろ";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Zurasi:
+					return "パンツずらし";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.Hadake:
+					return "はだけ";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureFront:
+					return "めくれスカートはだけ";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndMekureBack:
+					return "めくれスカート後ろはだけ";
+				case MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType.HadakeAndZurasi:
+					return "パンツずらしはだけ";
+				default:
+					return string.Empty;
+				}
+			}
+
+			public bool IsSupportedCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type)
+			{
+				if (this.maid == null)
+				{
+					Debug.LogWarning("MaidCostumeChangeManager::IsSupportedCostumeType\n maid is null.");
+					return false;
+				}
+				if (Product.isPublic)
+				{
+					return false;
+				}
+				string itemChangeNames = MaidCostumeChangeController.MaidCostumeChangeManager.GetItemChangeNames(type);
+				foreach (string mpn in MaidCostumeChangeController.MaidCostumeChangeManager.GetTargetMpnNames(this.maid, type))
+				{
+					if (this.maid.IsItemChangeEnabled(mpn, itemChangeNames))
+					{
+						return true;
+					}
+				}
+				return false;
+			}
+
+			public bool SetEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type, bool enabled, bool runAllProcProp = true)
+			{
+				if (this.maid == null)
+				{
+					Debug.LogWarning("MaidCostumeChangeManager::SetEnabledCostumeType\n maid is null.");
+					return false;
+				}
+				bool flag = false;
+				string[] targetMpnNames = MaidCostumeChangeController.MaidCostumeChangeManager.GetTargetMpnNames(this.maid, type);
+				if (enabled)
+				{
+					string itemChangeNames = MaidCostumeChangeController.MaidCostumeChangeManager.GetItemChangeNames(type);
+					foreach (string mpn in targetMpnNames)
+					{
+						if (this.maid.IsItemChangeEnabled(mpn, itemChangeNames) && !this.maid.IsItemChange(mpn, itemChangeNames))
+						{
+							this.maid.ItemChangeTemp(mpn, itemChangeNames);
+							flag = true;
+						}
+					}
+				}
+				else
+				{
+					flag = true;
+					foreach (string mpn2 in targetMpnNames)
+					{
+						this.maid.ResetProp(mpn2, true);
+					}
+				}
+				if (!flag)
+				{
+					return false;
+				}
+				if (!enabled || runAllProcProp)
+				{
+					this.maid.AllProcProp();
+				}
+				return true;
+			}
+
+			public bool IsEnabledCostumeType(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type)
+			{
+				if (this.maid == null)
+				{
+					Debug.LogWarning("MaidCostumeChangeManager::IsEnabledCostumeType\n maid is null.");
+					return false;
+				}
+				if (Product.isPublic)
+				{
+					return false;
+				}
+				string itemChangeNames = MaidCostumeChangeController.MaidCostumeChangeManager.GetItemChangeNames(type);
+				foreach (string mpn in MaidCostumeChangeController.MaidCostumeChangeManager.GetTargetMpnNames(this.maid, type))
+				{
+					if (this.maid.IsItemChange(mpn, itemChangeNames))
+					{
+						return true;
+					}
+				}
+				return false;
+			}
+
+			public void Reset(string targetMpnName = null)
+			{
+				if (this.maid == null)
+				{
+					Debug.LogWarning("MaidCostumeChangeManager::Reset\n maid is null.");
+					return;
+				}
+				if (targetMpnName == null)
+				{
+					HashSet<string> hashSet = new HashSet<string>();
+					IEnumerator enumerator = Enum.GetValues(typeof(MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType)).GetEnumerator();
+					try
+					{
+						while (enumerator.MoveNext())
+						{
+							object obj = enumerator.Current;
+							MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType type = (MaidCostumeChangeController.MaidCostumeChangeManager.CostumeType)obj;
+							foreach (string item in MaidCostumeChangeController.MaidCostumeChangeManager.GetTargetMpnNames(this.maid, type))
+							{
+								hashSet.Add(item);
+							}
+						}
+					}
+					finally
+					{
+						IDisposable disposable;
+						if ((disposable = (enumerator as IDisposable)) != null)
+						{
+							disposable.Dispose();
+						}
+					}
+					foreach (string mpn in hashSet)
+					{
+						this.maid.ResetProp(mpn, false);
+					}
+				}
+				else
+				{
+					this.maid.ResetProp(targetMpnName, false);
+				}
+				this.maid.AllProcProp();
+			}
+
+			public Maid maid;
+
+			public enum CostumeType
+			{
+				MekureFront,
+				MekureBack,
+				Zurasi,
+				Hadake,
+				HadakeAndMekureFront,
+				HadakeAndMekureBack,
+				HadakeAndZurasi
+			}
+		}
+
+		public enum CostumeType
+		{
+			MekureFront,
+			MekureBack,
+			Zurasi,
+			Hadake
+		}
+	}
+}

+ 0 - 147
Assembly-CSharp/MaidExtension/MaidMekureController.cs

@@ -1,147 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace MaidExtension
-{
-	public class MaidMekureController
-	{
-		public MaidMekureController(Maid maid)
-		{
-			this.maid = maid;
-		}
-
-		public MaidMekureController()
-		{
-		}
-
-		public static string[] GetTargetMpnNames(Maid maid, MaidMekureController.MekureType type)
-		{
-			if (maid == null)
-			{
-				Debug.LogWarning("MaidMekureController::GetTargetMpnNames\n maid is null.");
-				return new string[0];
-			}
-			if (type == MaidMekureController.MekureType.MekureSkirtFront || type == MaidMekureController.MekureType.MekureSkirtBack)
-			{
-				return new string[]
-				{
-					"skirt",
-					"onepiece"
-				};
-			}
-			if (type != MaidMekureController.MekureType.ZurasiPants)
-			{
-				return new string[0];
-			}
-			return new string[]
-			{
-				"panz",
-				"mizugi"
-			};
-		}
-
-		public static string GetItemChangeNames(MaidMekureController.MekureType type)
-		{
-			if (type == MaidMekureController.MekureType.MekureSkirtFront)
-			{
-				return "めくれスカート";
-			}
-			if (type == MaidMekureController.MekureType.MekureSkirtBack)
-			{
-				return "めくれスカート後ろ";
-			}
-			if (type != MaidMekureController.MekureType.ZurasiPants)
-			{
-				return string.Empty;
-			}
-			return "パンツずらし";
-		}
-
-		public bool IsSupportedMekure(MaidMekureController.MekureType type)
-		{
-			if (this.maid == null)
-			{
-				Debug.LogWarning("MaidMekureController::IsSupportedMekure\n maid is null.");
-				return false;
-			}
-			if (Product.isPublic)
-			{
-				return false;
-			}
-			string itemChangeNames = MaidMekureController.GetItemChangeNames(type);
-			foreach (string mpn in MaidMekureController.GetTargetMpnNames(this.maid, type))
-			{
-				if (this.maid.IsItemChangeEnabled(mpn, itemChangeNames))
-				{
-					return true;
-				}
-			}
-			return false;
-		}
-
-		public bool SetEnabledMekure(MaidMekureController.MekureType type, bool enabled, bool runAllProcProp = true)
-		{
-			if (this.maid == null)
-			{
-				Debug.LogWarning("MaidMekureController::SetEnabledMekure\n maid is null.");
-				return false;
-			}
-			if (!this.IsSupportedMekure(type) || enabled == this.IsEnabledMekure(type))
-			{
-				return false;
-			}
-			string[] targetMpnNames = MaidMekureController.GetTargetMpnNames(this.maid, type);
-			if (enabled)
-			{
-				string itemChangeNames = MaidMekureController.GetItemChangeNames(type);
-				foreach (string mpn in targetMpnNames)
-				{
-					this.maid.ItemChangeTemp(mpn, itemChangeNames);
-				}
-			}
-			else
-			{
-				foreach (string mpn2 in targetMpnNames)
-				{
-					this.maid.ResetProp(mpn2, false);
-				}
-			}
-			if (runAllProcProp)
-			{
-				this.maid.AllProcProp();
-			}
-			return true;
-		}
-
-		public bool IsEnabledMekure(MaidMekureController.MekureType type)
-		{
-			if (this.maid == null)
-			{
-				Debug.LogWarning("MaidMekureController::IsEnabledMekure\n maid is null.");
-				return false;
-			}
-			if (Product.isPublic)
-			{
-				return false;
-			}
-			string itemChangeNames = MaidMekureController.GetItemChangeNames(type);
-			foreach (string mpn in MaidMekureController.GetTargetMpnNames(this.maid, type))
-			{
-				if (this.maid.IsItemChange(mpn, itemChangeNames))
-				{
-					return true;
-				}
-			}
-			return false;
-		}
-
-		public Maid maid;
-
-		public enum MekureType
-		{
-			MekureSkirtFront,
-			MekureSkirtBack,
-			ZurasiPants
-		}
-	}
-}

+ 1 - 1
Assembly-CSharp/MaidParts.cs

@@ -37,7 +37,7 @@ public class MaidParts : MonoBehaviour
 	public unsafe bool Serialize(BinaryWriter f_bwWrite)
 	{
 		f_bwWrite.Write("CM3D2_MULTI_COL");
-		f_bwWrite.Write(1550);
+		f_bwWrite.Write(1570);
 		f_bwWrite.Write(this.m_aryPartsColor.Length);
 		for (int i = 0; i < this.m_aryPartsColor.Length; i++)
 		{

+ 56 - 11
Assembly-CSharp/MaidProp.cs

@@ -8,7 +8,7 @@ public class MaidProp
 	public bool Serialize(BinaryWriter f_bwWrite)
 	{
 		f_bwWrite.Write("CM3D2_MPROP");
-		f_bwWrite.Write(1550);
+		f_bwWrite.Write(MaidProp.MAID_PROP_VER);
 		f_bwWrite.Write(this.idx);
 		f_bwWrite.Write(this.name);
 		f_bwWrite.Write(this.type);
@@ -101,6 +101,7 @@ public class MaidProp
 				f_bwWrite.Write(keyValuePair6.Value);
 			}
 		}
+		f_bwWrite.Write(this.isCrcParts);
 		return true;
 	}
 
@@ -135,6 +136,10 @@ public class MaidProp
 		this.boDut = f_brRead.ReadBoolean();
 		this.max = f_brRead.ReadInt32();
 		this.min = f_brRead.ReadInt32();
+		if (!string.IsNullOrEmpty(this.strFileName))
+		{
+			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
+		}
 		if (this.listSubProp != null && this.listSubProp.Count != 0)
 		{
 			this.listSubProp = null;
@@ -179,17 +184,20 @@ public class MaidProp
 			this.strFileName = CM3.dicDelItem[(MPN)Enum.Parse(typeof(MPN), this.name, true)];
 			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
 		}
-		if (this.name == "eye_hi" && string.IsNullOrEmpty(this.strFileName))
-		{
-			this.strFileName = "_I_SkinHi.menu";
-			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
-		}
-		else if (this.name == "mayu" && string.IsNullOrEmpty(this.strFileName))
+		if (num < 2000)
 		{
-			this.strFileName = "_I_mayu_001_mugen.menu";
-			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
+			if (this.name == "eye_hi" && string.IsNullOrEmpty(this.strFileName))
+			{
+				this.strFileName = "_I_SkinHi.menu";
+				this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
+			}
+			else if (this.name == "mayu" && string.IsNullOrEmpty(this.strFileName))
+			{
+				this.strFileName = "_I_mayu_001_mugen.menu";
+				this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
+			}
 		}
-		if (num <= 208 && this.idx == 65 && this.strFileName.ToLower() == "_I_acctatoo_del.menu".ToLower())
+		if (num <= 208 && this.idx == 150 && this.strFileName.ToLower() == "_I_acctatoo_del.menu".ToLower())
 		{
 			this.strFileName = CM3.dicDelItem[MPN.accnail];
 			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
@@ -284,7 +292,26 @@ public class MaidProp
 				}
 			}
 		}
-		if (num < 200 && this.idx == 58 && Path.GetFileNameWithoutExtension(this.strFileName.ToLower()) == "hair_r095_i_")
+		if (2001 <= num)
+		{
+			this.isCrcParts = f_brRead.ReadBoolean();
+		}
+		if (num < 2002)
+		{
+			string text = this.strFileName.ToLower();
+			this.isCrcParts = (text.IndexOf("crc_") == 0 || text.IndexOf("crx_") == 0 || text.IndexOf("gp03_") == 0);
+			if (2000 <= num && string.IsNullOrEmpty(this.strFileName))
+			{
+				this.nFileNameRID = 0;
+				string text2;
+				if (CM3.dicDelItem.TryGetValue((MPN)this.idx, out text2))
+				{
+					this.strFileName = text2;
+					this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
+				}
+			}
+		}
+		if (num < 200 && this.idx == 143 && Path.GetFileNameWithoutExtension(this.strFileName.ToLower()) == "hair_r095_i_")
 		{
 			this.strFileName = "hair_r110_i_.menu";
 			this.nFileNameRID = this.strFileName.ToLower().GetHashCode();
@@ -320,6 +347,22 @@ public class MaidProp
 		return true;
 	}
 
+	public void CopyTo(MaidProp otherProp)
+	{
+		using (MemoryStream memoryStream = new MemoryStream())
+		{
+			BinaryWriter f_bwWrite = new BinaryWriter(memoryStream);
+			this.Serialize(f_bwWrite);
+			using (MemoryStream memoryStream2 = new MemoryStream(memoryStream.ToArray()))
+			{
+				BinaryReader f_brRead = new BinaryReader(memoryStream2);
+				otherProp.Deserialize(f_brRead);
+			}
+		}
+	}
+
+	private static int MAID_PROP_VER = 2002;
+
 	public int idx;
 
 	public string name;
@@ -365,4 +408,6 @@ public class MaidProp
 	public Dictionary<TBody.SlotID, KeyValuePair<int, MatPropSave>> m_dicMaterialProp = new Dictionary<TBody.SlotID, KeyValuePair<int, MatPropSave>>();
 
 	public Dictionary<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> m_dicBoneLength = new Dictionary<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>>();
+
+	public bool isCrcParts;
 }

+ 107 - 0
Assembly-CSharp/MaidStatus/GP003Status.cs

@@ -0,0 +1,107 @@
+using System;
+using UnityEngine;
+using wf.Serialization;
+
+namespace MaidStatus
+{
+	public class GP003Status : AJsonSerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public int inyoku
+		{
+			get
+			{
+				return this.inyoku_;
+			}
+			set
+			{
+				this.inyoku_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int mvalue
+		{
+			get
+			{
+				return this.mvalue_;
+			}
+			set
+			{
+				this.mvalue_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int hentai
+		{
+			get
+			{
+				return this.hentai_;
+			}
+			set
+			{
+				this.hentai_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int housi
+		{
+			get
+			{
+				return this.housi_;
+			}
+			set
+			{
+				this.housi_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int likability
+		{
+			get
+			{
+				return this.likability_;
+			}
+			set
+			{
+				this.likability_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int playCountYotogi
+		{
+			get
+			{
+				return this.playCountYotogi_;
+			}
+			set
+			{
+				this.playCountYotogi_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		[SerializeField]
+		private int inyoku_;
+
+		[SerializeField]
+		private int mvalue_;
+
+		[SerializeField]
+		private int hentai_;
+
+		[SerializeField]
+		private int housi_;
+
+		[SerializeField]
+		private int likability_;
+
+		[SerializeField]
+		private int playCountYotogi_;
+	}
+}

+ 42 - 2
Assembly-CSharp/MaidStatus/Status.cs

@@ -78,6 +78,10 @@ namespace MaidStatus
 
 		public string guid { get; private set; }
 
+		public string saveDataGuidGP03 { get; private set; }
+
+		public string saveDataGuidGP03Temp { get; private set; }
+
 		public string creationTime { get; private set; }
 
 		public ulong creationTimeNum { get; private set; }
@@ -92,6 +96,14 @@ namespace MaidStatus
 			}
 		}
 
+		public GP003Status gp003Status
+		{
+			get
+			{
+				return this.gp003Status_;
+			}
+		}
+
 		public int employmentDay
 		{
 			get
@@ -905,7 +917,7 @@ namespace MaidStatus
 		{
 			get
 			{
-				return this.heroineType == HeroineType.Transfer && this.personal.compatible;
+				return this.heroineType == HeroineType.Transfer && this.personal.compatible && !this.maid.IsCrcBody;
 			}
 		}
 
@@ -927,6 +939,7 @@ namespace MaidStatus
 		public void SetNewGuidAndCreationTime(string guidText = null, string creationTimeText = null)
 		{
 			this.guid = ((!string.IsNullOrEmpty(guidText)) ? guidText : Guid.NewGuid().ToString());
+			this.saveDataGuidGP03 = this.guid;
 			this.creationTime = ((!string.IsNullOrEmpty(creationTimeText)) ? creationTimeText : DateTime.Now.ToString("G", new CultureInfo("ja-JP")).Replace("/", string.Empty));
 			string text = this.creationTime.Replace(":", string.Empty);
 			text = text.Replace(" ", string.Empty);
@@ -1368,12 +1381,27 @@ namespace MaidStatus
 			}
 		}
 
+		public string RenewSaveDataGuidGP03ToTemp()
+		{
+			string text = Guid.NewGuid().ToString();
+			this.saveDataGuidGP03Temp = text;
+			return text;
+		}
+
+		public string RenewSaveDataGuidGP03FromTemp()
+		{
+			string saveDataGuidGP03Temp = this.saveDataGuidGP03Temp;
+			this.saveDataGuidGP03 = saveDataGuidGP03Temp;
+			return saveDataGuidGP03Temp;
+		}
+
 		public void Serialize(BinaryWriter binary)
 		{
 			this.SetFlag("__1330_specialrelation__", (int)this.specialRelation);
 			binary.Write("CM3D2_MAID_STATUS");
-			binary.Write(1550);
+			binary.Write(Status.MAID_STATUS_VER);
 			binary.Write(this.guid);
+			binary.Write(this.saveDataGuidGP03);
 			binary.Write(this.creationTime);
 			binary.Write((short)this.heroineType);
 			if (this.heroineType == HeroineType.Sub)
@@ -1496,6 +1524,14 @@ namespace MaidStatus
 			this.OldStatus = null;
 			int num = binary.ReadInt32();
 			this.guid = binary.ReadString();
+			if (2000 <= num)
+			{
+				this.saveDataGuidGP03 = binary.ReadString();
+			}
+			else
+			{
+				this.saveDataGuidGP03 = this.guid;
+			}
 			this.creationTime = binary.ReadString();
 			string text = this.creationTime.Replace(":", string.Empty);
 			text = text.Replace(" ", string.Empty);
@@ -2148,5 +2184,9 @@ namespace MaidStatus
 		private Dictionary<int, bool> eventEndFlags_;
 
 		private VoiceGroup voiceGroup_;
+
+		private GP003Status gp003Status_ = new GP003Status();
+
+		private static int MAID_STATUS_VER = 2000;
 	}
 }

+ 1 - 1
Assembly-CSharp/MaidStatus/SubMaid.cs

@@ -545,7 +545,7 @@ namespace MaidStatus
 					using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(this.presetBinary), Encoding.UTF8))
 					{
 						CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, string.Empty);
-						GameMain.Instance.CharacterMgr.PresetSet(status.maid, f_prest);
+						GameMain.Instance.CharacterMgr.PresetSet(status.maid, f_prest, false);
 					}
 				}
 			}

+ 306 - 0
Assembly-CSharp/MaterialMgr.cs

@@ -0,0 +1,306 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class MaterialMgr
+{
+	public MaterialMgr(TBodySkin tbskin)
+	{
+		this.m_tbSkin = tbskin;
+		this.m_SlotId = tbskin.SlotId;
+		this.m_tbody = tbskin.body;
+		this.m_bMan = tbskin.body.boMAN;
+	}
+
+	public void Init(GameObject obj, Material[] mats)
+	{
+		this.m_materials = mats;
+	}
+
+	public void Remove()
+	{
+		this.m_materials = null;
+		this.m_tbSkin.body.GetSlot(0).MaterialMgr.RemoveSkinMask(this.m_SlotId, this.m_tbSkin.m_subNo);
+		this.RemoveSkinMaskAll();
+	}
+
+	public Material GetMaterial(int f_nMatNo)
+	{
+		if (this.m_materials == null)
+		{
+			return null;
+		}
+		foreach (Transform transform in this.m_tbSkin.obj.transform.GetComponentsInChildren<Transform>(true))
+		{
+			Renderer component = transform.GetComponent<Renderer>();
+			if (component != null && component.material != null)
+			{
+				if (f_nMatNo < component.materials.Length)
+				{
+					return component.materials[f_nMatNo];
+				}
+				NDebug.Assert(string.Concat(new object[]
+				{
+					"マテリアル番号指定が ",
+					component.name,
+					" のマテリアル数を超えています。",
+					this.m_SlotId.ToString(),
+					" / ",
+					f_nMatNo
+				}), false);
+			}
+		}
+		return null;
+	}
+
+	public int materialCount
+	{
+		get
+		{
+			if (this.m_materials == null)
+			{
+				return -1;
+			}
+			return this.m_materials.Length;
+		}
+	}
+
+	public float MayuThick
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[3];
+				float num = 0.5f * (value - 0.5f) / -0.5f;
+				material.SetTextureScale("_MainTex", new Vector2(1f, 1f + num));
+				material.SetTextureOffset("_MainTex", new Vector2(0f, -(num / 2f)));
+			}
+		}
+	}
+
+	public float FutaePosX
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[9];
+				float x = 0.05f * (value - 0.5f) / 0.5f;
+				material.SetTextureOffset("_MainTex", new Vector2(x, material.GetTextureOffset("_MainTex").y));
+			}
+		}
+	}
+
+	public float FutaePosY
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[9];
+				float num = 0.1f * (value - 0.5f) / 0.5f;
+				material.SetTextureOffset("_MainTex", new Vector2(material.GetTextureOffset("_MainTex").x, -num));
+			}
+		}
+	}
+
+	public float FutaeRot
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[9];
+				float value2 = 0.4f * (value - 0.5f) / 0.5f;
+				material.EnableKeyword("USE_UV_ROT");
+				material.SetFloat("_UVRotAngle", value2);
+			}
+		}
+	}
+
+	public float HitomiHiPosX
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[2];
+				Material material2 = this.m_materials[7];
+				float num = 0.05f * (value - 0.5f) / 0.5f;
+				Vector2 textureOffset = material.GetTextureOffset("_MainTex");
+				material.SetTextureOffset("_MainTex", new Vector2(-num, textureOffset.y));
+				material2.SetTextureOffset("_MainTex", new Vector2(-num, textureOffset.y));
+			}
+		}
+	}
+
+	public float HitomiHiPosY
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[2];
+				Material material2 = this.m_materials[7];
+				float num = 0.1f * (value - 0.5f) / 0.5f;
+				Vector2 textureOffset = material.GetTextureOffset("_MainTex");
+				material.SetTextureOffset("_MainTex", new Vector2(textureOffset.x, -num + this.m_hitomiHiSclYOffsY));
+				material2.SetTextureOffset("_MainTex", new Vector2(textureOffset.x, -num + this.m_hitomiHiSclYOffsY));
+				this.m_hitomiHiPosYOffsY = -num;
+			}
+		}
+	}
+
+	public float HitomiHiSclY
+	{
+		set
+		{
+			if (this.m_tbSkin.m_bMan)
+			{
+				return;
+			}
+			if (this.m_SlotId == TBody.SlotID.head && 120 <= this.m_tbSkin.PartsVersion)
+			{
+				Material material = this.m_materials[2];
+				Material material2 = this.m_materials[7];
+				float num = -1f * (value - 0.5f) / 0.5f;
+				Vector2 textureOffset = material.GetTextureOffset("_MainTex");
+				material.SetTextureScale("_MainTex", new Vector2(1f, 1f + num));
+				material2.SetTextureScale("_MainTex", new Vector2(1f, 1f + num));
+				material.SetTextureOffset("_MainTex", new Vector2(textureOffset.x, -(num / 2f) + this.m_hitomiHiPosYOffsY));
+				material2.SetTextureOffset("_MainTex", new Vector2(textureOffset.x, -(num / 2f) + this.m_hitomiHiPosYOffsY));
+				this.m_hitomiHiSclYOffsY = -(num / 2f);
+			}
+		}
+	}
+
+	public void AddSkinMask(TBody.SlotID slot, int subNo, string texFileName)
+	{
+		NDebug.Assert(this.m_SlotId == TBody.SlotID.body, "skin mask destination is must be body.");
+		if (this.m_skinMaskTexs == null)
+		{
+			this.m_skinMaskTexs = new Dictionary<uint, Texture2D>();
+		}
+		if (this.m_skinMaskDestTex == null)
+		{
+			this.m_skinMaskDestTex = new Texture2D(512, 512, TextureFormat.ARGB32, false);
+		}
+		TextureResource textureResource = ImportCM.LoadTexture(null, texFileName, false);
+		NDebug.Assert(textureResource != null, "skin mask tex is not found. -> " + texFileName);
+		Texture2D value = textureResource.CreateTexture2D();
+		this.m_skinMaskTexs.Add((uint)(((uint)slot << 16) + subNo), value);
+		this.m_isSkinMaskBody = true;
+	}
+
+	public void RemoveSkinMask(TBody.SlotID slot, int subNo)
+	{
+		if (!this.m_isSkinMaskBody)
+		{
+			return;
+		}
+		uint key = (uint)(((uint)slot << 16) + subNo);
+		Texture2D obj;
+		if (this.m_skinMaskTexs.TryGetValue(key, out obj))
+		{
+			UnityEngine.Object.Destroy(obj);
+			this.m_skinMaskTexs.Remove(key);
+		}
+	}
+
+	public void RemoveSkinMaskAll()
+	{
+		if (!this.m_isSkinMaskBody)
+		{
+			return;
+		}
+		foreach (KeyValuePair<uint, Texture2D> keyValuePair in this.m_skinMaskTexs)
+		{
+			if (keyValuePair.Value != null)
+			{
+				UnityEngine.Object.Destroy(keyValuePair.Value);
+			}
+		}
+		this.m_skinMaskTexs = null;
+		if (this.m_skinMaskDestTex != null)
+		{
+			UnityEngine.Object.Destroy(this.m_skinMaskDestTex);
+		}
+		this.m_isSkinMaskBody = false;
+	}
+
+	public bool FixSkinMask()
+	{
+		if (!this.m_isSkinMaskBody)
+		{
+			return false;
+		}
+		RenderTexture active = RenderTexture.active;
+		RenderTexture temporary = RenderTexture.GetTemporary(this.m_skinMaskDestTex.width, this.m_skinMaskDestTex.height, 0, RenderTextureFormat.ARGB32);
+		RenderTexture.active = temporary;
+		GL.Clear(false, true, Color.white);
+		Material systemMaterial = GameUty.GetSystemMaterial(GameUty.SystemMaterial.Multiply);
+		foreach (KeyValuePair<uint, Texture2D> keyValuePair in this.m_skinMaskTexs)
+		{
+			TBodySkin slot = this.m_tbody.GetSlot((int)(keyValuePair.Key >> 16), (int)(keyValuePair.Key & 16U));
+			if (slot.boVisible)
+			{
+				Graphics.Blit(keyValuePair.Value, temporary, systemMaterial);
+			}
+		}
+		this.m_skinMaskDestTex.ReadPixels(new Rect(0f, 0f, (float)temporary.width, (float)temporary.height), 0, 0);
+		this.m_skinMaskDestTex.Apply();
+		RenderTexture.ReleaseTemporary(temporary);
+		RenderTexture.active = active;
+		return true;
+	}
+
+	public bool CheckSkinMaskUV(Vector2 uv)
+	{
+		return this.m_isSkinMaskBody && this.m_skinMaskDestTex.GetPixel((int)((float)this.m_skinMaskDestTex.width * uv.x + 0.5f), (int)((float)this.m_skinMaskDestTex.height * uv.y + 0.5f)).r < 0.5f;
+	}
+
+	private Material[] m_materials;
+
+	private TBody m_tbody;
+
+	private TBodySkin m_tbSkin;
+
+	private TBody.SlotID m_SlotId;
+
+	private bool m_bMan;
+
+	private float m_hitomiHiPosYOffsY;
+
+	private float m_hitomiHiSclYOffsY;
+
+	private Dictionary<uint, Texture2D> m_skinMaskTexs;
+
+	private Texture2D m_skinMaskDestTex;
+
+	private bool m_isSkinMaskBody;
+}

+ 28 - 0
Assembly-CSharp/MathCM.cs

@@ -322,6 +322,34 @@ public class MathCM
 		return false;
 	}
 
+	public static float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
+	{
+		float num = Vector3.Angle(from, to);
+		float num2 = from.y * to.z - from.z * to.y;
+		float num3 = from.z * to.x - from.x * to.z;
+		float num4 = from.x * to.y - from.y * to.x;
+		float num5 = Mathf.Sign(axis.x * num2 + axis.y * num3 + axis.z * num4);
+		return num * num5;
+	}
+
+	public static int SearchRayToNearVtxDistance(Vector3[] poss, MathCM.Segment seg)
+	{
+		float num = 1f;
+		int result = -1;
+		for (int i = 0; i < poss.Length; i++)
+		{
+			Vector3 vector;
+			float num3;
+			float num2 = MathCM.calcPointSegmentDist(ref poss[i], ref seg, out vector, out num3);
+			if (num2 < num)
+			{
+				num = num2;
+				result = i;
+			}
+		}
+		return result;
+	}
+
 	private static float _OX_EPSILON_ = 1E-06f;
 
 	public struct Line

+ 1 - 1
Assembly-CSharp/McSkip.cs

@@ -41,7 +41,7 @@ public class McSkip : MonoBehaviour
 		for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
 		{
 			Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
-			if (maid)
+			if (maid && maid.AudioMan)
 			{
 				maid.AudioMan.Stop();
 			}

File diff suppressed because it is too large
+ 709 - 280
Assembly-CSharp/Menu.cs


+ 5 - 1
Assembly-CSharp/Misc.cs

@@ -2,7 +2,7 @@
 
 public class Misc
 {
-	public const int GAME_VERSION = 1550;
+	public const int GAME_VERSION = 1570;
 
 	public const string GAME_DATA_PATH = "GameData";
 
@@ -38,6 +38,8 @@ public class Misc
 
 	public const string SHOP_URL_EN_PUBLIC = "https://com3d2-shop-en-inm.s-court.me";
 
+	public const string GP003OnlineManual = "http://cr-edit.jp/com3d2/manual";
+
 	public const string OFFICIAL_SITE = "http://com3d2.world/?shop";
 
 	public const string LAUNCHER_EXE = "COM3D2.exe";
@@ -46,6 +48,8 @@ public class Misc
 
 	public const string MOD_PATH = "Mod";
 
+	public const string CRC_IMPORT_PATH = "SaveData\\_gp03_import";
+
 	public const string MOD_EXPORT_PATH = "ModExport";
 
 	public const string MOD_EXPORT_MQO_PATH = "ModExportMqo";

+ 3 - 3
Assembly-CSharp/ModCompile.cs

@@ -20,7 +20,7 @@ public class ModCompile : MonoBehaviour
 			Directory.CreateDirectory(text);
 		}
 		string path = text + "\\" + Path.GetFileNameWithoutExtension(f_strInMenuTextPathFileName);
-		for (int i = 0; i < 131; i++)
+		for (int i = 0; i < 223; i++)
 		{
 			string[] aryDefCategoryName = ModCompile.m_aryDefCategoryName;
 			int num = i;
@@ -604,7 +604,7 @@ public class ModCompile : MonoBehaviour
 		MemoryStream memoryStream = new MemoryStream();
 		BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
 		binaryWriter.Write("CM3D2_MESH");
-		binaryWriter.Write(1550);
+		binaryWriter.Write(1570);
 		string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(f_strMqoFile);
 		binaryWriter.Write(fileNameWithoutExtension);
 		binaryWriter.Write(exObjIn2.strName);
@@ -948,7 +948,7 @@ public class ModCompile : MonoBehaviour
 		return true;
 	}
 
-	private static string[] m_aryDefCategoryName = new string[131];
+	private static string[] m_aryDefCategoryName = new string[223];
 
 	private static string[] m_aryDefSlotName;
 

File diff suppressed because it is too large
+ 1272 - 0
Assembly-CSharp/MotionKagManager.cs


+ 28 - 0
Assembly-CSharp/MouthIKCtrl.cs

@@ -0,0 +1,28 @@
+using System;
+using kt.ik;
+using UnityEngine;
+
+[Serializable]
+public class MouthIKCtrl : FABRIKCtrl
+{
+	public MouthIKCtrl(FullBodyIKMgr ik_mgr) : base(ik_mgr, FullBodyIKMgr.IKEffectorType.Mouth)
+	{
+		this.BlendCalc = AIKCtrl.BlendCalcType.Local;
+	}
+
+	public override void SetIKSetting(IKAttachParam param)
+	{
+		base.SetIKSetting(param);
+		base.isNeedAttachTargetUpdatePreExec = true;
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (base.pointIKData.isIKExec)
+		{
+			Vector3 localPosition = base.chainBones[0].localPosition;
+			base.OnPostFullBodySolverUpdate();
+			base.chainBones[0].localPosition = localPosition;
+		}
+	}
+}

+ 54 - 0
Assembly-CSharp/MuneIKCtrl.cs

@@ -0,0 +1,54 @@
+using System;
+using kt.ik;
+using UnityEngine;
+
+[Serializable]
+public class MuneIKCtrl : FreeFBIKCtrl
+{
+	public MuneIKCtrl(FullBodyIKMgr ik_mgr, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_mgr, effector_type, true, FullBodyIKMgr.IKBoneType.None)
+	{
+	}
+
+	private string AttachPointName
+	{
+		get
+		{
+			return (this.effectorType != FullBodyIKMgr.IKEffectorType.Bust_L) ? "乳首右" : "乳首左";
+		}
+	}
+
+	public override void SetIKSetting(IKAttachParam param)
+	{
+		base.SetIKSetting(param);
+		base.isNeedAttachTargetUpdatePreExec = true;
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		if (data.isPointAttach)
+		{
+			Vector3 b = base.bone.position - this.GetNipplePosRot().pos;
+			pos += b;
+		}
+		base.SetTargetTransform(data, pos, rot);
+	}
+
+	private AIKCtrl.PosRotPair GetNipplePosRot()
+	{
+		AIKCtrl.PosRotPair result = default(AIKCtrl.PosRotPair);
+		int slotNo = this.myIKMgr.body.GetSlotNo("body");
+		if (this.myIKMgr.body.goSlot[slotNo].morph == null)
+		{
+			return result;
+		}
+		Vector3 pos;
+		Quaternion rot;
+		Vector3 vector;
+		if (this.myIKMgr.body.goSlot[slotNo].morph.GetAttachPoint(this.AttachPointName, out pos, out rot, out vector, false))
+		{
+			result.pos = pos;
+			result.rot = rot;
+		}
+		return result;
+	}
+}

+ 10 - 10
Assembly-CSharp/OvrIK.cs

@@ -322,9 +322,9 @@ public class OvrIK : MonoBehaviour
 			GameMain.Instance.OvrMgr.OvrCamera.HandVRIKMode = false;
 			GameObject obj = this.m_maid.body0.GetSlot(1).obj;
 			this.LayerCheck(obj, LayerMask.NameToLayer("Charactor"));
-			GameObject obj2 = this.m_maid.body0.GetSlot(36).obj;
+			GameObject obj2 = this.m_maid.body0.GetSlot(45).obj;
 			this.LayerCheck(obj2, LayerMask.NameToLayer("Charactor"));
-			GameObject obj3 = this.m_maid.body0.GetSlot(17).obj;
+			GameObject obj3 = this.m_maid.body0.GetSlot(22).obj;
 			this.LayerCheck(obj3, LayerMask.NameToLayer("Charactor"));
 			Animation componentInChildren = this.m_maid.GetComponentInChildren<Animation>();
 			if (componentInChildren != null)
@@ -757,9 +757,9 @@ public class OvrIK : MonoBehaviour
 		this.m_maid.boOffsetY = false;
 		GameObject obj = this.m_maid.body0.GetSlot(1).obj;
 		this.LayerCheck(obj, LayerMask.NameToLayer("Face"));
-		GameObject obj2 = this.m_maid.body0.GetSlot(36).obj;
+		GameObject obj2 = this.m_maid.body0.GetSlot(45).obj;
 		this.LayerCheck(obj2, LayerMask.NameToLayer("Face"));
-		GameObject obj3 = this.m_maid.body0.GetSlot(17).obj;
+		GameObject obj3 = this.m_maid.body0.GetSlot(22).obj;
 		this.LayerCheck(obj3, LayerMask.NameToLayer("Face"));
 		GameMain.Instance.OvrMgr.OvrCamera.SetCameraMask((CameraMain.CameraMask)LayerMask.NameToLayer("Face"), false);
 		Transform transform7 = CMT.SearchObjName(this.m_maid.body0.m_Bones.transform, "Eyepos_L", false);
@@ -1043,18 +1043,18 @@ public class OvrIK : MonoBehaviour
 			{
 				GameObject obj = this.m_maid.body0.GetSlot(1).obj;
 				this.LayerCheck(obj, LayerMask.NameToLayer("Charactor"));
-				GameObject obj2 = this.m_maid.body0.GetSlot(36).obj;
+				GameObject obj2 = this.m_maid.body0.GetSlot(45).obj;
 				this.LayerCheck(obj2, LayerMask.NameToLayer("Charactor"));
-				GameObject obj3 = this.m_maid.body0.GetSlot(17).obj;
+				GameObject obj3 = this.m_maid.body0.GetSlot(22).obj;
 				this.LayerCheck(obj3, LayerMask.NameToLayer("Charactor"));
 			}
 			else
 			{
 				GameObject obj4 = this.m_maid.body0.GetSlot(1).obj;
 				this.LayerCheck(obj4, LayerMask.NameToLayer("Face"));
-				GameObject obj5 = this.m_maid.body0.GetSlot(36).obj;
+				GameObject obj5 = this.m_maid.body0.GetSlot(45).obj;
 				this.LayerCheck(obj5, LayerMask.NameToLayer("Face"));
-				GameObject obj6 = this.m_maid.body0.GetSlot(17).obj;
+				GameObject obj6 = this.m_maid.body0.GetSlot(22).obj;
 				this.LayerCheck(obj6, LayerMask.NameToLayer("Face"));
 			}
 			this.m_isHeadIsTracker = flag;
@@ -1568,7 +1568,7 @@ public class OvrIK : MonoBehaviour
 	{
 		public void OnBeforeSerialize()
 		{
-			this.m_nVersion = 1550;
+			this.m_nVersion = 1570;
 		}
 
 		public void OnAfterDeserialize()
@@ -1628,7 +1628,7 @@ public class OvrIK : MonoBehaviour
 		private const string CONF_NAME = "OvrIK.json";
 
 		[SerializeField]
-		private int m_nVersion = 1550;
+		private int m_nVersion = 1570;
 
 		[SerializeField]
 		private float solver_locomotion_weight = 1f;

+ 407 - 0
Assembly-CSharp/PenisIKCtrl.cs

@@ -0,0 +1,407 @@
+using System;
+using System.Collections.Generic;
+using kt.ik;
+using kt.Utility;
+using UnityEngine;
+
+[Serializable]
+public class PenisIKCtrl : AIKCtrl
+{
+	public PenisIKCtrl(FullBodyIKMgr ik_mgr) : base(ik_mgr, FullBodyIKMgr.IKEffectorType.Penis)
+	{
+		base.isUpperBody = false;
+		foreach (Transform transform in base.chainBones)
+		{
+			this.BoneDataDic[transform] = new PenisIKCtrl.BoneData(transform);
+		}
+	}
+
+	public AutoKupaCtrl kupaCtrl { get; private set; }
+
+	public override void Reset()
+	{
+		base.Reset();
+		this.LastIsInserted = this.IsInserted;
+		this.IsInserted = false;
+		this.IsNotEscape = false;
+		foreach (PenisIKCtrl.BoneData boneData in this.BoneDataDic.Values)
+		{
+			boneData.isInsertedOnce = false;
+			boneData.lastIsScaleVariable = boneData.isScaleVariable;
+			if (boneData.isScaleVariable)
+			{
+				boneData.isScaleVariable = false;
+				boneData.bone.localScale = Vector3.one;
+			}
+		}
+	}
+
+	public override void SetIKSetting(IKAttachParam param)
+	{
+		PenisIKParam penisIKParam = param as PenisIKParam;
+		this.insertBeforeAxis = penisIKParam.insertBefore;
+		this.insertAfterAxis = penisIKParam.insertAfter;
+		this.sensorLength = penisIKParam.sensorLength;
+		this.IsNotEscape = penisIKParam.isNotEscape;
+		this.IsForciblyBend = penisIKParam.isForciblyBend;
+		this.AlwaysLookTarget = penisIKParam.alwaysLookTarget;
+		if (this.LastIsInserted)
+		{
+			this.IsInserted |= (base.GetIKSettingData(param.attachType).curTargetData.target == param.attachTarget);
+		}
+		base.SetIKSetting(param);
+		this.kupaCtrl = penisIKParam.kupaCtrl;
+		if (this.kupaCtrl != null)
+		{
+			this.kupaCtrl.SetKupaInsert(base.chainBones, this.insertBeforeAxis);
+			this.kupaCtrl.isUpdateTBody = false;
+		}
+		foreach (KeyValuePair<string, float> keyValuePair in penisIKParam.boneNameScaleValPair)
+		{
+			Transform bone = this.myIKMgr.body.GetBone(keyValuePair.Key);
+			this.BoneDataDic[bone].isScaleVariable = true;
+			this.BoneDataDic[bone].scaleValue = keyValuePair.Value;
+		}
+		this.MotionCtrlBoneName = penisIKParam.motionCtrlBoneName;
+		this.MotionCtrlWeight = penisIKParam.motionCtrlWeight;
+	}
+
+	public override void Detach()
+	{
+		if (this.kupaCtrl != null && this.kupaCtrl.morphInsert.chainEndBone == base.bone)
+		{
+			this.kupaCtrl.SetKupaInsert(AutoKupaCtrl.KupaType.Close, base.chainBones, this.insertBeforeAxis);
+			this.kupaCtrl.isUpdateTBody = true;
+		}
+		this.kupaCtrl = null;
+		this.IsInserted = false;
+		this.IsNotEscape = false;
+		foreach (PenisIKCtrl.BoneData boneData in this.BoneDataDic.Values)
+		{
+			if (boneData.bone)
+			{
+				boneData.bone.localPosition = boneData.initLocalPos;
+			}
+			boneData.isScaleVariable = boneData.lastIsScaleVariable;
+		}
+		base.Detach();
+	}
+
+	protected override void SetTargetTransform(AIKCtrl.IKSettingData data, Vector3 pos, Quaternion rot)
+	{
+		if (data.blendType == AIKCtrl.IKBlendType.IK_To_Detach && data.curTargetData.lastTarget)
+		{
+			pos = data.curTargetData.lastTarget.position;
+			rot = data.curTargetData.lastTarget.rotation;
+		}
+		base.SetTargetTransform(data, pos, rot);
+		if (!data.isPointAttach)
+		{
+			return;
+		}
+		base.constraintTarget.rotation = rot;
+		Vector3 vector = rot * this.insertBeforeAxis;
+		Vector3 vector2 = rot * this.insertAfterAxis;
+		for (int i = 1; i < base.chainBones.Length; i++)
+		{
+			Transform transform = base.chainBones[i];
+			if (this.BoneDataDic[transform].isScaleVariable)
+			{
+				transform.localScale = Vector3.one;
+			}
+			transform.localPosition = this.BoneDataDic[transform].initLocalPos;
+			Transform transform2 = base.chainBones[i - 1];
+			Color magenta = Color.magenta;
+			magenta.a = base.positionWeight;
+			Debug.DrawLine(transform2.position, transform.position, magenta);
+		}
+		if ((this.IsNotEscape && this.IsForciblyBend) || this.AlwaysLookTarget)
+		{
+			Vector3 fromDirection = base.chainBones[1].position - base.chainBones[0].position;
+			Vector3 toDirection = base.constraintTarget.position - base.chainBones[0].position;
+			Quaternion quaternion = Quaternion.FromToRotation(fromDirection, toDirection) * base.chainBones[0].rotation;
+			if (this.AlwaysLookTarget)
+			{
+				quaternion = Quaternion.Lerp(base.chainBones[0].rotation, quaternion, base.positionWeight);
+			}
+			Debug.DrawLine(base.chainBones[0].position, base.bone.position, UnityUtility.SetAlpha(Color.cyan, base.positionWeight));
+			base.chainBones[0].rotation = quaternion;
+		}
+		float num = Vector3.Dot(base.bone.position - base.constraintTarget.position, vector);
+		if (!this.IsNotEscape || !this.IsInserted)
+		{
+			this.IsInserted = (num <= 0f);
+			if (this.IsInserted)
+			{
+				for (int j = 1; j < base.chainBones.Length; j++)
+				{
+					Transform transform3 = base.chainBones[j];
+					float num2 = Vector3.Dot(transform3.position - base.constraintTarget.position, vector);
+					if (num2 <= 0f)
+					{
+						this.IsInserted &= this.IsInsertRangeIn(transform3.position);
+						break;
+					}
+				}
+			}
+		}
+		Debug.DrawRay(pos, vector * 0.025f, UnityUtility.SetAlpha(Color.blue, base.positionWeight));
+		Debug.DrawRay(pos, vector2 * 0.025f, UnityUtility.SetAlpha(Color.red, base.positionWeight));
+		if (!this.IsInserted)
+		{
+			base.positionWeight = 0f;
+		}
+		else if (this.sensorLength > 0f && num > 0f)
+		{
+			base.positionWeight *= 1f - num / this.sensorLength;
+		}
+		if (!this.IsNotEscape && this.IsForciblyBend)
+		{
+			Vector3 fromDirection2 = base.chainBones[1].position - base.chainBones[0].position;
+			Vector3 toDirection2 = base.constraintTarget.position - base.chainBones[0].position;
+			Quaternion quaternion2 = Quaternion.FromToRotation(fromDirection2, toDirection2) * base.chainBones[0].rotation;
+			quaternion2 = Quaternion.Lerp(base.chainBones[0].rotation, quaternion2, base.positionWeight);
+			Debug.DrawLine(base.chainBones[0].position, base.bone.position, UnityUtility.SetAlpha(Color.cyan, base.positionWeight));
+			base.chainBones[0].rotation = quaternion2;
+		}
+		num -= this.sensorLength;
+		bool flag = true;
+		float num3 = -1f;
+		bool flag2 = false;
+		for (int k = 1; k < base.chainBones.Length; k++)
+		{
+			Transform transform4 = base.chainBones[k];
+			PenisIKCtrl.BoneData boneData = this.BoneDataDic[transform4];
+			Transform transform5 = base.chainBones[k - 1];
+			if (k == 1)
+			{
+				this.BoneDataDic[transform5].orijinPos = transform5.position;
+				this.BoneDataDic[transform5].solvePos = transform5.position;
+			}
+			Vector3 solvePos = this.BoneDataDic[transform5].solvePos;
+			Vector3 vector3;
+			if (this.MotionCtrlWeight < 1f)
+			{
+				Matrix4x4 localToWorldMatrix = transform5.localToWorldMatrix;
+				localToWorldMatrix.SetColumn(3, transform5.position);
+				vector3 = localToWorldMatrix.MultiplyPoint3x4(transform4.localPosition);
+			}
+			else
+			{
+				vector3 = transform4.position;
+			}
+			float num4 = Vector3.Dot(vector3 - base.constraintTarget.position, vector);
+			Vector3 vector4 = Vector3.zero;
+			boneData.insertValueSelf = 0f;
+			boneData.insertValueParent = 0f;
+			if (!flag2)
+			{
+				flag2 = (this.MotionCtrlBoneName == transform4.name);
+			}
+			if (num4 <= 0f)
+			{
+				float num5 = (!flag) ? (Mathf.Abs(num4) / (Mathf.Abs(num4) + num3)) : 1f;
+				Vector3 a = base.constraintTarget.position + vector * num4;
+				Vector3 b = base.constraintTarget.position + vector2 * Vector3.Dot(vector3 - base.constraintTarget.position, vector2);
+				vector4 = Vector3.Lerp(a, b, num5);
+				boneData.insertValueSelf = 1f;
+				boneData.insertValueParent = num5;
+				flag = true;
+			}
+			else
+			{
+				Vector3 vector5 = base.constraintTarget.position + vector * num4;
+				float num5 = Mathf.Abs(num) / (num4 + Mathf.Abs(num));
+				if (this.IsNotEscape && this.IsForciblyBend)
+				{
+					vector4 = vector5;
+				}
+				else
+				{
+					vector4 = Vector3.Lerp(vector3, vector5, num5);
+				}
+				boneData.insertValueSelf = num5;
+				flag = false;
+			}
+			if (!boneData.isInsertedOnce && !data.isBlendNow)
+			{
+				boneData.isInsertedOnce = (num4 <= 0f);
+			}
+			this.BoneDataDic[transform4].orijinPos = vector3;
+			float d = Vector3.Distance(transform5.position, transform4.position);
+			if (flag2)
+			{
+				vector4 = Vector3.Lerp(vector4, vector3, this.MotionCtrlWeight);
+			}
+			if (this.MotionCtrlWeight < 1f)
+			{
+				Vector3 a2 = vector4 - solvePos;
+				float magnitude = a2.magnitude;
+				if (magnitude > 0f)
+				{
+					vector4 = solvePos + a2 / magnitude * d;
+				}
+			}
+			this.BoneDataDic[transform4].solvePos = vector4;
+			num3 = num4;
+		}
+	}
+
+	private bool IsInsertRangeIn(Vector3 position)
+	{
+		Vector3 lhs = position - base.constraintTarget.position;
+		Quaternion rotation = Quaternion.FromToRotation(Vector3.forward, base.constraintTarget.rotation * this.insertBeforeAxis);
+		Vector3 rhs = rotation * Vector3.up;
+		Vector3 rhs2 = rotation * Vector3.right;
+		float num = Mathf.Abs(Vector3.Dot(lhs, rhs));
+		float num2 = Mathf.Abs(Vector3.Dot(lhs, rhs2));
+		return num <= 0.05f && num2 <= 0.05f;
+	}
+
+	public override void OnPostFullBodySolverUpdate()
+	{
+		if (!base.pointIKData.isIKExec)
+		{
+			return;
+		}
+		for (int i = 1; i < base.chainBones.Length; i++)
+		{
+			Transform transform = base.chainBones[i - 1];
+			Transform transform2 = base.chainBones[i];
+			PenisIKCtrl.BoneData boneData = this.BoneDataDic[transform2];
+			Vector3 orijinPos = boneData.orijinPos;
+			Vector3 solvePos = boneData.solvePos;
+			Vector3 a = Vector3.Lerp(orijinPos, solvePos, base.positionWeight);
+			Vector3 fromDirection = transform2.position - transform.position;
+			Vector3 toDirection = a - transform.position;
+			transform.rotation = Quaternion.FromToRotation(fromDirection, toDirection) * transform.rotation;
+			if (boneData.isScaleVariable)
+			{
+				Vector3 vector = new Vector3(1f, boneData.scaleValue, boneData.scaleValue);
+				if (base.pointIKData.blendType != AIKCtrl.IKBlendType.IK_To_Detach)
+				{
+					if (!boneData.isInsertedOnce)
+					{
+						transform2.localScale = Vector3.Lerp(Vector3.one, vector, boneData.insertValueSelf * base.positionWeight);
+					}
+					else
+					{
+						transform2.localScale = vector;
+					}
+				}
+				else
+				{
+					transform2.localScale = Vector3.Lerp(Vector3.one, vector, boneData.insertValueSelf * base.positionWeight);
+				}
+			}
+		}
+		if (this.kupaCtrl != null)
+		{
+			this.kupaCtrl.KupaUpdate();
+		}
+		if (this.IsInserted && this.IsNotEscape)
+		{
+			bool flag = false;
+			AIKCtrl.PosRotPair posRotPair = default(AIKCtrl.PosRotPair);
+			for (int j = 1; j < base.chainBones.Length; j++)
+			{
+				Transform transform3 = base.chainBones[j];
+				Vector3 rhs = base.constraintTarget.rotation * this.insertBeforeAxis;
+				float num = Vector3.Dot(transform3.position - base.constraintTarget.position, rhs);
+				if (!flag && num <= 0f)
+				{
+					flag = true;
+					posRotPair.Copy(transform3);
+				}
+				if (flag)
+				{
+					transform3.position = posRotPair.pos;
+					transform3.rotation = posRotPair.rot;
+				}
+				else if (j == base.chainBones.Length - 2)
+				{
+					transform3.position = base.constraintTarget.position;
+					break;
+				}
+			}
+		}
+	}
+
+	public void PenisRotateReset()
+	{
+		for (int i = 1; i < base.chainBones.Length; i++)
+		{
+			Transform transform = base.chainBones[i];
+			transform.localPosition = this.BoneDataDic[transform].initLocalPos;
+			transform.localRotation = this.BoneDataDic[transform].initLocalRot;
+		}
+	}
+
+	private const float INSERT_RANGE_MAX = 0.05f;
+
+	private Dictionary<Transform, PenisIKCtrl.BoneData> BoneDataDic = new Dictionary<Transform, PenisIKCtrl.BoneData>();
+
+	public Vector3 insertBeforeAxis = Vector3.back;
+
+	public Vector3 insertAfterAxis = Vector3.forward;
+
+	[Space]
+	public float sensorLength;
+
+	private bool IsInserted;
+
+	private bool LastIsInserted;
+
+	[SerializeField]
+	[Header("ちんこを抜けないようにする")]
+	private bool IsNotEscape;
+
+	[SerializeField]
+	[Header("ちんこを無理やり曲げる")]
+	private bool IsForciblyBend;
+
+	[SerializeField]
+	private bool AlwaysLookTarget;
+
+	[Space]
+	[SerializeField]
+	[Header("モーション側で制御するボーン名")]
+	private string MotionCtrlBoneName = string.Empty;
+
+	[SerializeField]
+	[Header("制御のウェイト")]
+	[Range(0f, 1f)]
+	private float MotionCtrlWeight;
+
+	private class BoneData
+	{
+		public BoneData(Transform bone)
+		{
+			this.bone = bone;
+			this.initLocalPos = bone.localPosition;
+			this.initLocalRot = bone.localRotation;
+		}
+
+		public readonly Transform bone;
+
+		public readonly Vector3 initLocalPos;
+
+		public readonly Quaternion initLocalRot;
+
+		public bool isInsertedOnce;
+
+		public float insertValueSelf;
+
+		public float insertValueParent;
+
+		public Vector3 orijinPos;
+
+		public Vector3 solvePos;
+
+		public bool isScaleVariable;
+
+		public bool lastIsScaleVariable;
+
+		public float scaleValue = 1f;
+	}
+}

+ 2 - 2
Assembly-CSharp/PhotoManEditManager.cs

@@ -221,8 +221,8 @@ public class PhotoManEditManager
 				{
 					return false;
 				}
-				List<TBodySkin> goSlot = this.man.body0.goSlot;
-				foreach (TBodySkin tbodySkin in goSlot)
+				TBody.Slot goSlot = this.man.body0.goSlot;
+				foreach (TBodySkin tbodySkin in goSlot.GetListParents())
 				{
 					if (!(tbodySkin.obj == null))
 					{

+ 1 - 1
Assembly-CSharp/PhotoModeSaveAndLoad.cs

@@ -450,7 +450,7 @@ public class PhotoModeSaveAndLoad : MonoBehaviour
 	private XElement CreateCommonData(string title, string comment)
 	{
 		string value = DateTime.ParseExact(DateTime.Now.ToString("yyyyMMddHHmmss"), "yyyyMMddHHmmss", null).ToString("yyyy.MM.dd HH:mm");
-		XElement xelement = new XElement("GameVersion", 1550);
+		XElement xelement = new XElement("GameVersion", 1570);
 		XElement xelement2 = new XElement("SaveTime", value);
 		XElement xelement3 = new XElement("Title", title);
 		XElement xelement4 = new XElement("Comment", comment);

+ 4 - 7
Assembly-CSharp/PhotoMotionData.cs

@@ -259,15 +259,12 @@ public class PhotoMotionData
 		}
 		if (!maid.boMAN)
 		{
-			maid.body0.MuneYureL((float)((!this.use_animekey_mune_l) ? 1 : 0));
-			maid.body0.MuneYureR((float)((!this.use_animekey_mune_r) ? 1 : 0));
-			maid.body0.jbMuneL.enabled = !this.use_animekey_mune_l;
-			maid.body0.jbMuneR.enabled = !this.use_animekey_mune_l;
+			maid.body0.SetMuneYureLWithEnable(!this.use_animekey_mune_l);
+			maid.body0.SetMuneYureRWithEnable(!this.use_animekey_mune_r);
 		}
 		if (!string.IsNullOrEmpty(this.direct_file))
 		{
-			maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-			maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+			maid.fullBodyIK.AllIKDetach(0f);
 			if (!this.is_mod && !this.is_mypose)
 			{
 				maid.CrossFade(this.direct_file, false, this.is_loop, false, 0f, 1f);
@@ -317,7 +314,7 @@ public class PhotoMotionData
 					break;
 				}
 			}
-			GameMain.Instance.ScriptMgr.LoadMotionScript(sloat, false, this.call_script_fil, this.call_script_label, maid.status.guid, string.Empty, true, true, false);
+			GameMain.Instance.ScriptMgr.LoadMotionScript(sloat, false, this.call_script_fil, this.call_script_label, maid.status.guid, string.Empty, true, true, false, false);
 		}
 	}
 

+ 9 - 1
Assembly-CSharp/PlacementWindow.cs

@@ -292,7 +292,15 @@ public class PlacementWindow : BaseMaidPhotoWindow
 			return;
 		}
 		MaidColliderCollect maidColliderCollect = MaidColliderCollect.AddColliderCollect(maid);
-		List<CapsuleCollider> list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+		List<CapsuleCollider> list = new List<CapsuleCollider>();
+		if (maid.body0.IsCrcBody)
+		{
+			list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Crc);
+		}
+		else
+		{
+			list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+		}
 		for (int j = 0; j < list.Count; j++)
 		{
 			ColliderEvent colliderEvent = list[j].gameObject.AddComponent<ColliderEvent>();

+ 77 - 0
Assembly-CSharp/PlayerStatus/GP003Status.cs

@@ -0,0 +1,77 @@
+using System;
+using UnityEngine;
+using wf.Serialization;
+
+namespace PlayerStatus
+{
+	public class GP003Status : AJsonSerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public int mind
+		{
+			get
+			{
+				return this.mind_;
+			}
+			set
+			{
+				this.mind_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int academic
+		{
+			get
+			{
+				return this.academic_;
+			}
+			set
+			{
+				this.academic_ = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int physical
+		{
+			get
+			{
+				return this.physical;
+			}
+			set
+			{
+				this.physical = Mathf.Clamp(value, 0, 9999);
+			}
+		}
+
+		public int libido
+		{
+			get
+			{
+				return this.libido;
+			}
+			set
+			{
+				this.libido = Mathf.Clamp(value, 0, 300);
+			}
+		}
+
+		[SerializeField]
+		private int mind_;
+
+		[SerializeField]
+		private int academic_;
+
+		[SerializeField]
+		private int physical_;
+
+		[SerializeField]
+		private int libido_;
+	}
+}

+ 11 - 1
Assembly-CSharp/PlayerStatus/Status.cs

@@ -301,6 +301,14 @@ namespace PlayerStatus
 
 		public ReadOnlyDictionary<int, NightWorkState> night_works_state_dic { get; private set; }
 
+		public GP003Status gp003Status
+		{
+			get
+			{
+				return this.gp003Status_;
+			}
+		}
+
 		public void SetFlag(string flagName, int value)
 		{
 			if (!this.flags_.ContainsKey(flagName))
@@ -831,7 +839,7 @@ namespace PlayerStatus
 		public void Serialize(BinaryWriter binary)
 		{
 			binary.Write("CM3D2_PLAYER_STATUS");
-			binary.Write(1550);
+			binary.Write(1570);
 			binary.Write(this.playerName_);
 			binary.Write(this.days_);
 			binary.Write(this.totalPurchasePrice_);
@@ -1151,6 +1159,8 @@ namespace PlayerStatus
 
 		private HashSet<int> yotogiClassOpenFlags;
 
+		private GP003Status gp003Status_ = new GP003Status();
+
 		private static Dictionary<string, int> jobClassTrophyCheckSet;
 
 		private static Dictionary<string, int> yotogiClassCheckSet;

+ 29 - 0
Assembly-CSharp/PosRotScale.cs

@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using UnityEngine;
 
 public class PosRotScale
@@ -14,6 +15,34 @@ public class PosRotScale
 		this.rotation = prs.rotation;
 	}
 
+	public void SetFromTransformLocal(Transform tr)
+	{
+		this.position = tr.localPosition;
+		this.rotation = tr.localRotation;
+		this.scale = tr.localScale;
+	}
+
+	public void SetToTransformLocal(Transform tr)
+	{
+		tr.localPosition = this.position;
+		tr.localRotation = this.rotation;
+		tr.localScale = this.scale;
+	}
+
+	public void Serialize(BinaryWriter bw)
+	{
+		bw.Write(this.position);
+		bw.Write(this.scale);
+		bw.Write(this.rotation);
+	}
+
+	public void Deserialize(BinaryReader br)
+	{
+		br.Read(out this.position);
+		br.Read(out this.scale);
+		br.Read(out this.rotation);
+	}
+
 	public Vector3 position;
 
 	public Vector3 scale;

+ 36 - 18
Assembly-CSharp/PoseEditWindow.cs

@@ -272,10 +272,8 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 			KeyValuePair<bool, bool> keyValuePair2 = maidIKManager.cache_bone_data.SetFrameBinary(Convert.FromBase64String(maidStoreData["pose_binary"]));
 			bool key2 = keyValuePair2.Key;
 			bool value2 = keyValuePair2.Value;
-			maid.body0.MuneYureL((float)((!key2) ? 1 : 0));
-			maid.body0.MuneYureR((float)((!value2) ? 1 : 0));
-			maid.body0.jbMuneL.enabled = !key2;
-			maid.body0.jbMuneR.enabled = !value2;
+			maid.body0.SetMuneYureLWithEnable(!key2);
+			maid.body0.SetMuneYureRWithEnable(!value2);
 		}
 	}
 
@@ -294,8 +292,16 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 		bool flag2 = maid.body0.GetMuneYureR() == 0f;
 		maidStoreData["use_mune_key_l"] = flag.ToString();
 		maidStoreData["use_mune_key_r"] = flag2.ToString();
-		maid.body0.jbMuneL.enabled = !flag;
-		maid.body0.jbMuneR.enabled = !flag2;
+		if (maid.body0.IsCrcBody)
+		{
+			maid.body0.dbMuneL.isDynamicOn = !bool.Parse(maidStoreData["use_mune_key_l"]);
+			maid.body0.dbMuneR.isDynamicOn = !bool.Parse(maidStoreData["use_mune_key_r"]);
+		}
+		else
+		{
+			maid.body0.jbMuneL.enabled = !bool.Parse(maidStoreData["use_mune_key_l"]);
+			maid.body0.jbMuneR.enabled = !bool.Parse(maidStoreData["use_mune_key_r"]);
+		}
 		for (int i = 0; i < this.RotateCheckBoxArray.Length; i++)
 		{
 			this.RotateCheckBoxArray[i].OnMotionUpdate();
@@ -461,8 +467,16 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 		this.ik_mgr.HistoryClear();
 		this.ik_mgr.HistoryNew();
 		MaidColliderCollect component = base.mgr.select_maid.GetComponent<MaidColliderCollect>();
-		List<CapsuleCollider> collider = component.GetCollider(MaidColliderCollect.ColliderType.Grab);
-		foreach (CapsuleCollider capsuleCollider in collider)
+		List<CapsuleCollider> list = new List<CapsuleCollider>();
+		if (base.mgr.select_maid.body0.IsCrcBody)
+		{
+			list = component.GetCollider(MaidColliderCollect.ColliderType.Crc);
+		}
+		else
+		{
+			list = component.GetCollider(MaidColliderCollect.ColliderType.Grab);
+		}
+		foreach (CapsuleCollider capsuleCollider in list)
 		{
 			capsuleCollider.gameObject.SetActive(!check);
 		}
@@ -512,8 +526,7 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 				motionWindow.CheckbtnStop.check = true;
 				motionWindow.OnClickStopCheck(motionWindow.CheckbtnStop);
 			}
-			base.mgr.select_maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-			base.mgr.select_maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+			base.mgr.select_maid.fullBodyIK.AllIKDetach(0f);
 			this.ControlSelectBtnTab.ResetSelect();
 			Dictionary<PoseEditWindow.ControlType, UIWFTabButton> dictionary = new Dictionary<PoseEditWindow.ControlType, UIWFTabButton>();
 			foreach (UIWFTabButton uiwftabButton in this.ControlSelectBtnTab.button_list)
@@ -569,10 +582,8 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 			}
 			if (base.mgr.select_maid != null && base.mgr.select_maid.body0 != null && !base.mgr.select_maid.boMAN)
 			{
-				base.mgr.select_maid.body0.MuneYureL(1f);
-				base.mgr.select_maid.body0.MuneYureR(1f);
-				base.mgr.select_maid.body0.jbMuneL.enabled = true;
-				base.mgr.select_maid.body0.jbMuneR.enabled = true;
+				base.mgr.select_maid.body0.SetMuneYureLWithEnable(true);
+				base.mgr.select_maid.body0.SetMuneYureRWithEnable(true);
 			}
 			if (this.ik_mgr != null)
 			{
@@ -692,10 +703,17 @@ public class PoseEditWindow : BaseMaidPhotoWindow
 			KeyValuePair<bool, bool> keyValuePair = this.ik_mgr_.cache_bone_data.SetFrameBinary(Convert.FromBase64String(dictionary["pose_binary"]));
 			bool key = keyValuePair.Key;
 			bool value = keyValuePair.Value;
-			maid.body0.MuneYureL((float)((!key) ? 1 : 0));
-			maid.body0.MuneYureR((float)((!value) ? 1 : 0));
-			maid.body0.jbMuneL.enabled = !key;
-			maid.body0.jbMuneR.enabled = !value;
+			if (!maid.IsCrcBody)
+			{
+				if (maid.body0.jbMuneL)
+				{
+					maid.body0.jbMuneL.enabled = key;
+				}
+				if (maid.body0.jbMuneR)
+				{
+					maid.body0.jbMuneR.enabled = value;
+				}
+			}
 		}
 		this.ChangeEnabeled(this.CheckbtnUse.check);
 		if (this.ik_mgr_ != null && this.CheckbtnUse.check)

+ 1 - 1
Assembly-CSharp/PresetCtrl.cs

@@ -219,7 +219,7 @@ public class PresetCtrl : MonoBehaviour
 		if (this.m_dicPresetButton.TryGetValue(name, out presetButton))
 		{
 			CharacterMgr.Preset preset = presetButton.preset;
-			GameMain.Instance.CharacterMgr.PresetSet(this.m_maid, preset);
+			GameMain.Instance.CharacterMgr.PresetSet(this.m_maid, preset, false);
 			if (Product.isPublic)
 			{
 				SceneEdit.AllProcPropSeqStart(this.m_maid);

+ 1 - 1
Assembly-CSharp/PresetServer.cs

@@ -143,7 +143,7 @@ public class PresetServer : MonoBehaviour
 					CharacterMgr.Preset preset = CharacterMgr.LoadePresetLowCapacityData(text);
 					if (preset != null)
 					{
-						characterMgr.PresetSet(characterMgr.GetMaid(0), preset);
+						characterMgr.PresetSet(characterMgr.GetMaid(0), preset, false);
 						string s = "HTTP/1.0 204 OK\r\nConnection: close\r\n\r\n";
 						byte[] bytes = this.enc.GetBytes(s);
 						this.nsWEB.Write(bytes, 0, bytes.Length);

+ 52 - 0
Assembly-CSharp/PrivateMaidMode/GP003MainMenuManager.cs

@@ -0,0 +1,52 @@
+using System;
+
+namespace PrivateMaidMode
+{
+	public class GP003MainMenuManager : WfScreenChildren
+	{
+		private CharacterMgr charaMgr
+		{
+			get
+			{
+				return GameMain.Instance.CharacterMgr;
+			}
+		}
+
+		public override void Awake()
+		{
+			base.Awake();
+		}
+
+		protected override void OnCall()
+		{
+			GameMain.Instance.MainLight.Reset();
+			GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
+			GameMain.Instance.SoundMgr.VoiceStopAll();
+			for (int i = 0; i < this.charaMgr.GetMaidCount(); i++)
+			{
+				Maid maid = this.charaMgr.GetMaid(i);
+				if (!(maid == null))
+				{
+					maid.Visible = true;
+					maid.AllProcPropSeqStart();
+				}
+			}
+		}
+
+		protected override bool IsCallFadeIn()
+		{
+			return !this.charaMgr.IsBusy();
+		}
+
+		protected override void OnFinish()
+		{
+			if (this.screenManager.MoveScreen.IsExistNextFile())
+			{
+				this.screenManager.CallScreen("Move");
+			}
+		}
+
+		[NonSerialized]
+		public SceneGP003MainMenuScreenManager screenManager;
+	}
+}

+ 1 - 1
Assembly-CSharp/PrivateMaidMode/PrivateModeMgr.cs

@@ -75,7 +75,7 @@ namespace PrivateMaidMode
 			{
 				this.ChangeRandom();
 			}
-			if (!this.maidList.Contains(this.PrivateMaid))
+			if (!this.maidList.Contains(this.PrivateMaid) || (this.PrivateMaid != null && this.PrivateMaid.IsCrcBody))
 			{
 				this.SetPrivateMaid(null);
 			}

+ 55 - 0
Assembly-CSharp/PrivateMaidMode/SceneGP003MainMenuScreenManager.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+
+namespace PrivateMaidMode
+{
+	public class SceneGP003MainMenuScreenManager : WfScreenManager
+	{
+		public void Awake()
+		{
+			this.m_advKag = GameMain.Instance.ScriptMgr.adv_kag;
+		}
+
+		public override void Start()
+		{
+			base.Start();
+			this.m_moveScreen = base.children_dic["Move"].GetComponent<PrivateCharaSelectMove>();
+			if (this.m_advKag.tag_backup != null && this.m_advKag.tag_backup.Count > 0 && this.m_advKag.tag_backup["name"] == "SceneGP003MainMenu")
+			{
+				NDebug.Assert(this.m_advKag.tag_backup.ContainsKey("label"), "SceneCallにlabelの設定がされていませんでした");
+				this.m_moveScreen.SetNextLabel(this.m_advKag.tag_backup["label"]);
+				this.m_moveScreen.SetBackupFile(this.m_advKag.kag.GetCurrentFileName());
+			}
+			GP003MainMenuManager component = base.children_dic["Main"].GetComponent<GP003MainMenuManager>();
+			component.screenManager = this;
+			this.CallScreen("Main");
+		}
+
+		protected override void SettingChildrenList(Dictionary<string, WfScreenChildren> children_dic)
+		{
+			string[] array = new string[]
+			{
+				"Main",
+				"Move"
+			};
+			for (int i = 0; i < array.Length; i++)
+			{
+				WfScreenChildren component = UTY.GetChildObject(base.gameObject, array[i], false).GetComponent<WfScreenChildren>();
+				component.parent_mgr = this;
+				children_dic.Add(array[i], component);
+			}
+		}
+
+		public PrivateCharaSelectMove MoveScreen
+		{
+			get
+			{
+				return this.m_moveScreen;
+			}
+		}
+
+		private PrivateCharaSelectMove m_moveScreen;
+
+		private ADVKagManager m_advKag;
+	}
+}

+ 22 - 0
Assembly-CSharp/ProfileMgr.cs

@@ -32,13 +32,35 @@ public class ProfileMgr : BaseMgr<ProfileMgr>
 		this.m_maidStatus = maid.status;
 		this.m_enabledInput = (this.sceneEdit.modeType == SceneEdit.ModeType.OriginalChara || this.sceneEdit.modeType == SceneEdit.ModeType.MainChara || this.sceneEdit.modeType == SceneEdit.ModeType.ScoutChara);
 		this.m_enabledPersonalityInput = (this.sceneEdit.modeType == SceneEdit.ModeType.OriginalChara || this.sceneEdit.modeType == SceneEdit.ModeType.ScoutChara);
+		if (SceneEdit.storageModeType == SceneEdit.ModeType.OriginalChara || SceneEdit.storageModeType == SceneEdit.ModeType.MainChara || SceneEdit.storageModeType == SceneEdit.ModeType.ScoutChara)
+		{
+			this.m_enabledInput = true;
+		}
+		if (SceneEdit.storageModeType == SceneEdit.ModeType.OriginalChara || SceneEdit.storageModeType == SceneEdit.ModeType.ScoutChara)
+		{
+			this.m_enabledPersonalityInput = true;
+		}
 		this.m_profileCtrl.Init(this.m_goProfilePanel, this.m_maidStatus);
 		this.m_profileCtrl.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.None);
 		this.m_dicDividedPoint = this.InitDicDividedPoint();
+		if (SceneEdit.storageFlg)
+		{
+			this.m_dicDividedPoint = this.CRCUpdataDicDividedPoint(SceneEdit.StorageDicDividedPoint);
+		}
 		this.m_goProfilePanel.SetActive(false);
 		this.m_bInited = true;
 	}
 
+	private Dictionary<string, int> CRCUpdataDicDividedPoint(Dictionary<string, int> storageDicDividedPoint)
+	{
+		this.m_dicDividedPoint = new Dictionary<string, int>();
+		foreach (KeyValuePair<string, int> keyValuePair in storageDicDividedPoint)
+		{
+			this.m_dicDividedPoint.Add(keyValuePair.Key, keyValuePair.Value);
+		}
+		return this.m_dicDividedPoint;
+	}
+
 	private Dictionary<string, int> InitDicDividedPoint()
 	{
 		this.m_dicDividedPoint = new Dictionary<string, int>();

+ 106 - 0
Assembly-CSharp/SavedAttachData.cs

@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+public class SavedAttachData
+{
+	public void Reset()
+	{
+		this.bEnable = false;
+		this.nMyRID = 0UL;
+		this.eMySlotID = TBody.SlotID.body;
+		this.nTargetRID = 0UL;
+		this.eTargetSlotID = TBody.SlotID.body;
+		this.nTargetSlotNo = 0;
+		this.strTargetAttachPointName = null;
+		this.nTargetVtxCount = 0;
+		this.nTargetVidx = 0;
+		this.newAttachVidx = null;
+		this.prs2 = new PosRotScale();
+		this.prs3 = new PosRotScale();
+		if (this.boneAttachedHie != null)
+		{
+			this.boneAttachedHie.Clear();
+		}
+		this.boneAttachEdited = false;
+	}
+
+	public void Deserialize(BinaryReader br)
+	{
+		this.nTargetSlotNo = 0;
+		int num = 2000;
+		br.ReadNaS(out this.partName);
+		if (string.IsNullOrEmpty(this.partName))
+		{
+			num = br.ReadInt32();
+			br.ReadNaS(out this.partName);
+		}
+		br.Read(out this.bEnable);
+		br.Read(out this.nMyRID);
+		br.ReadParse(out this.eMySlotID);
+		br.Read(out this.nTargetRID);
+		br.ReadParse(out this.eTargetSlotID);
+		if (2001 <= num)
+		{
+			this.nTargetSlotNo = br.ReadInt32();
+		}
+		br.ReadNaS(out this.strTargetAttachPointName);
+		br.Read(out this.nTargetVtxCount);
+		br.Read(out this.nTargetVidx);
+		br.Read(out this.newAttachVidx);
+		this.prs2 = new PosRotScale();
+		if (br.ReadBoolean())
+		{
+			this.prs2.Deserialize(br);
+		}
+		this.prs3 = new PosRotScale();
+		if (br.ReadBoolean())
+		{
+			this.prs3.Deserialize(br);
+		}
+		this.boneAttachedHie = null;
+		if (br.ReadBoolean())
+		{
+			this.boneAttachedHie = new Dictionary<string, PosRotScale>();
+			int num2 = br.ReadInt32();
+			for (int i = 0; i < num2; i++)
+			{
+				PosRotScale posRotScale = new PosRotScale();
+				string key = br.ReadString();
+				posRotScale.Deserialize(br);
+				this.boneAttachedHie.Add(key, posRotScale);
+			}
+		}
+		br.Read(out this.boneAttachEdited);
+	}
+
+	public string partName;
+
+	public bool bEnable;
+
+	public ulong nMyRID;
+
+	public TBody.SlotID eMySlotID;
+
+	public ulong nTargetRID;
+
+	public TBody.SlotID eTargetSlotID;
+
+	public int nTargetSlotNo;
+
+	public string strTargetAttachPointName;
+
+	public int nTargetVtxCount;
+
+	public int nTargetVidx;
+
+	public int[] newAttachVidx;
+
+	public PosRotScale prs2 = new PosRotScale();
+
+	public PosRotScale prs3 = new PosRotScale();
+
+	public Dictionary<string, PosRotScale> boneAttachedHie;
+
+	public bool boneAttachEdited;
+}

+ 74 - 7
Assembly-CSharp/ScenarioData.cs

@@ -154,6 +154,12 @@ public class ScenarioData
 			case 24:
 				action(ScenarioData.PlayableCondition.契約, i);
 				break;
+			case 25:
+				action(ScenarioData.PlayableCondition.新ボディブロック, i);
+				break;
+			case 26:
+				action(ScenarioData.PlayableCondition.メインキャラとのボディ一致チェック, i);
+				break;
 			}
 		}
 		this.CheckPlayableCondition(false);
@@ -458,12 +464,12 @@ public class ScenarioData
 								if (text == "移籍メイド")
 								{
 									add_maid(stockMaid2);
-									goto IL_45B;
+									goto IL_463;
 								}
 								if (text == "雇用移籍メイド")
 								{
 									action(stockMaid2, !stockMaid2.status.mainChara);
-									goto IL_45B;
+									goto IL_463;
 								}
 							}
 							string convertPersonal = GameMain.Instance.ScenarioSelectMgr.GetConvertPersonal(stockMaid2);
@@ -484,7 +490,7 @@ public class ScenarioData
 								action(stockMaid2, "移籍" + convertPersonal == text);
 							}
 						}
-						IL_45B:;
+						IL_463:;
 					}
 					else if (stockMaid2.status.heroineType == HeroineType.Original)
 					{
@@ -493,12 +499,12 @@ public class ScenarioData
 							if (text == "オリジナルメイド")
 							{
 								add_maid(stockMaid2);
-								goto IL_59B;
+								goto IL_5A3;
 							}
 							if (text == "雇用メイド")
 							{
 								action(stockMaid2, !stockMaid2.status.mainChara);
-								goto IL_59B;
+								goto IL_5A3;
 							}
 						}
 						string convertPersonal2 = GameMain.Instance.ScenarioSelectMgr.GetConvertPersonal(stockMaid2);
@@ -519,7 +525,7 @@ public class ScenarioData
 							action(stockMaid2, convertPersonal2 == text);
 						}
 					}
-					IL_59B:;
+					IL_5A3:;
 				}
 				break;
 			}
@@ -721,6 +727,65 @@ public class ScenarioData
 					action(stockMaid13, EnumConvert.GetString(stockMaid13.status.contract) == text);
 				}
 				break;
+			case ScenarioData.PlayableCondition.新ボディブロック:
+			{
+				action2();
+				bool flag4 = text == "○" || text == "◯";
+				for (int num13 = 0; num13 < characterMgr.GetStockMaidCount(); num13++)
+				{
+					Maid stockMaid14 = characterMgr.GetStockMaid(num13);
+					action(stockMaid14, !flag4 || (flag4 && !stockMaid14.IsCrcBody));
+				}
+				break;
+			}
+			case ScenarioData.PlayableCondition.メインキャラとのボディ一致チェック:
+			{
+				action2();
+				CharacterMgr characterMgr2 = GameMain.Instance.CharacterMgr;
+				Maid maid3 = null;
+				for (int num14 = 0; num14 < characterMgr2.GetStockMaidCount(); num14++)
+				{
+					Maid stockMaid15 = characterMgr2.GetStockMaid(num14);
+					if (stockMaid15 != null && stockMaid15.status.mainChara)
+					{
+						string convertPersonal3 = GameMain.Instance.ScenarioSelectMgr.GetConvertPersonal(stockMaid15);
+						if (convertPersonal3 == text)
+						{
+							maid3 = stockMaid15;
+							break;
+						}
+					}
+				}
+				if (!maid3)
+				{
+					set_ok(false);
+				}
+				else if (this.m_EventMaid.Count > 0)
+				{
+					List<Maid> list = new List<Maid>(this.m_EventMaid);
+					for (int num15 = 0; num15 < list.Count; num15++)
+					{
+						Maid maid2 = list[num15];
+						if (maid2 == maid3)
+						{
+							this.m_EventMaid.Remove(maid2);
+						}
+						else
+						{
+							action(maid2, maid3.IsCrcBody == maid2.IsCrcBody);
+						}
+					}
+				}
+				else
+				{
+					for (int num16 = 0; num16 < characterMgr.GetStockMaidCount(); num16++)
+					{
+						Maid stockMaid16 = characterMgr.GetStockMaid(num16);
+						action(stockMaid16, maid3 != stockMaid16 && maid3.IsCrcBody == stockMaid16.IsCrcBody);
+					}
+				}
+				break;
+			}
 			}
 			if (maid_check && maid_update)
 			{
@@ -739,7 +804,7 @@ public class ScenarioData
 
 	public bool IsEnoughEventMaid()
 	{
-		if (!this.IsFixedMaid)
+		if (!this.IsFixedMaid || this.EventMaidNum > 0)
 		{
 			return this.EventMaidNum <= this.m_EventMaid.Count;
 		}
@@ -921,6 +986,8 @@ public class ScenarioData
 		NTRブロック,
 		性経験,
 		契約,
+		新ボディブロック,
+		メインキャラとのボディ一致チェック,
 		MAX
 	}
 

+ 42 - 4
Assembly-CSharp/SceneCasino.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using MaidStatus;
 using UnityEngine;
 using UnityEngine.UI;
@@ -60,7 +61,12 @@ public class SceneCasino : KasaSceneMgr<SceneCasino>
 		if (CasinoDataMgr.Instance.IsChangeCostume)
 		{
 			CasinoDataMgr.Instance.IsChangeCostume = false;
-			CasinoDataMgr.Instance.CurrentCasino.UpdateEditCostumeToMaidCostume(CasinoDataMgr.Instance.DealerMaid);
+			Maid maid = CasinoDataMgr.Instance.DealerMaid;
+			if (PluginData.IsEnabled("GP003"))
+			{
+				maid = GameMain.Instance.CharacterMgr.GetStockNpcMaid(0);
+			}
+			CasinoDataMgr.Instance.CurrentCasino.UpdateEditCostumeToMaidCostume(maid);
 		}
 		CasinoDataMgr.Instance.DealerMaid.Visible = true;
 		CasinoDataMgr.Instance.DealerMaid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
@@ -162,7 +168,7 @@ public class SceneCasino : KasaSceneMgr<SceneCasino>
 		CasinoDataMgr.Instance.DealerMaid.FaceAnime("通常", 1f, 0);
 		CasinoDataMgr.Instance.DealerMaid.AudioMan.Stop();
 		GameMain.Instance.ScriptMgr.is_motion_blend = false;
-		GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false);
+		GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false, false);
 		GameMain.Instance.CharacterMgr.CharaAllOfsetPos(this.m_MaidPos);
 		GameMain.Instance.CharacterMgr.CharaAllOfsetRot(this.m_MaidAngle);
 		base.LoadEnd();
@@ -228,8 +234,35 @@ public class SceneCasino : KasaSceneMgr<SceneCasino>
 	{
 		GameMain.Instance.FacilityMgr.tempSelectFacility = CasinoDataMgr.Instance.CurrentCasino;
 		CasinoDataMgr.Instance.CurrentCasino.typeCostume = Facility.CostumeType.Edit;
-		CasinoDataMgr.Instance.CurrentCasino.UpdateMaidCostumeToEditCostume(CasinoDataMgr.Instance.DealerMaid, true);
-		CasinoDataMgr.Instance.DealerMaid.AllProcPropSeqStart();
+		if (!PluginData.IsEnabled("GP003"))
+		{
+			CasinoDataMgr.Instance.CurrentCasino.UpdateMaidCostumeToEditCostume(CasinoDataMgr.Instance.DealerMaid, true);
+			CasinoDataMgr.Instance.DealerMaid.AllProcPropSeqStart();
+		}
+		else
+		{
+			GameMain.Instance.CharacterMgr.DeactivateMaid(CasinoDataMgr.Instance.DealerMaid);
+			Maid tmpMaid = GameMain.Instance.CharacterMgr.ActivateNpc(0);
+			string preset_name = "pre_facility";
+			TextAsset txt = Resources.Load("Preset/" + preset_name) as TextAsset;
+			using (MemoryStream memoryStream = new MemoryStream(txt.bytes))
+			{
+				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
+				{
+					CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, preset_name);
+					GameMain.Instance.CharacterMgr.PresetSet(tmpMaid, f_prest, false);
+					tmpMaid.Visible = true;
+				}
+			}
+			Resources.UnloadAsset(txt);
+			tmpMaid.AllProcPropSeqStart();
+			while (GameMain.Instance.CharacterMgr.IsBusy())
+			{
+				yield return null;
+			}
+			CasinoDataMgr.Instance.CurrentCasino.UpdateMaidCostumeToEditCostume(tmpMaid, true);
+			tmpMaid.AllProcPropSeqStart();
+		}
 		while (GameMain.Instance.CharacterMgr.IsBusy())
 		{
 			yield return null;
@@ -277,6 +310,11 @@ public class SceneCasino : KasaSceneMgr<SceneCasino>
 			base.StartCoroutine(KasaiUtility.FadeCoroutine(this.m_SelectPanel, false, 0.5f, null, true, true));
 			break;
 		case SceneCasino.CasinoMenu.SetCostume:
+			if (CasinoDataMgr.Instance.DealerMaid.IsCrcBody)
+			{
+				GameMain.Instance.SysDlg.Show("ディラーが旧ボディの場合のみ設定する事ができます", SystemDialog.TYPE.OK, null, null);
+				return;
+			}
 			CasinoDataMgr.Instance.IsChangeCostume = true;
 			GameMain.Instance.ScriptMgr.EvalScript("tf['menu_label_name'] = '" + this.m_MenuLabelPair[menu] + "';");
 			this.m_GraphicRaycaster.enabled = false;

+ 1 - 1
Assembly-CSharp/SceneCasinoShop.cs

@@ -103,7 +103,7 @@ public class SceneCasinoShop : KasaSceneMgr<SceneCasinoShop>
 
 	protected override void LoadEnd()
 	{
-		GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false);
+		GameMain.Instance.ScriptMgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false, false);
 		base.StartCoroutine(this.AnimateWait());
 	}
 

+ 494 - 131
Assembly-CSharp/SceneEdit.cs

@@ -5,6 +5,7 @@ using System.IO;
 using System.Text;
 using System.Text.RegularExpressions;
 using CharacterEdit;
+using CRCEdit;
 using I2.Loc;
 using Kasizuki;
 using MaidStatus;
@@ -182,53 +183,73 @@ public class SceneEdit : MonoBehaviour
 		SceneEdit.Instance = this;
 		this.modeType = SceneEdit.ModeType.OriginalChara;
 		this.enabledMpns = new HashSet<MPN>();
+		this.isNewEditEnabled = true;
+		bool flag = false;
 		Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
-		string a;
-		if (tag_backup != null && tag_backup.TryGetValue("name", out a) && a == "SceneEdit")
+		if (tag_backup != null)
 		{
-			string strScriptArg;
-			if (tag_backup.TryGetValue("label", out strScriptArg))
-			{
-				this.m_strScriptArg = strScriptArg;
-			}
-			bool flag = false;
-			if (tag_backup.TryGetValue("original", out strScriptArg))
-			{
-				this.modeType = SceneEdit.ModeType.OriginalChara;
-				flag = true;
-			}
-			else if (tag_backup.TryGetValue("main", out strScriptArg))
+			string a;
+			if (tag_backup.TryGetValue("name", out a) && a == "SceneEdit")
 			{
-				this.modeType = SceneEdit.ModeType.MainChara;
-				flag = true;
-			}
-			else if (tag_backup.TryGetValue("after", out strScriptArg))
-			{
-				this.modeType = SceneEdit.ModeType.AfterEdit;
-				flag = true;
-			}
-			else if (tag_backup.TryGetValue("facility_costume", out strScriptArg))
-			{
-				this.modeType = SceneEdit.ModeType.CostumeEdit;
-				flag = true;
-			}
-			else if (tag_backup.TryGetValue("npcedit", out strScriptArg))
-			{
-				this.modeType = SceneEdit.ModeType.NpcEdit;
-				flag = true;
-			}
-			else if (tag_backup.TryGetValue("scout", out strScriptArg))
-			{
-				this.modeType = SceneEdit.ModeType.ScoutChara;
-				flag = true;
+				string strScriptArg;
+				if (tag_backup.TryGetValue("label", out strScriptArg))
+				{
+					this.m_strScriptArg = strScriptArg;
+				}
+				if (tag_backup.TryGetValue("edit_back", out strScriptArg))
+				{
+					flag = true;
+				}
+				bool flag2 = false;
+				if (tag_backup.TryGetValue("original", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.OriginalChara;
+					flag2 = true;
+				}
+				else if (tag_backup.TryGetValue("main", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.MainChara;
+					flag2 = true;
+				}
+				else if (tag_backup.TryGetValue("after", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.AfterEdit;
+					flag2 = true;
+				}
+				else if (tag_backup.TryGetValue("facility_costume", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.CostumeEdit;
+					flag2 = true;
+					this.isNewEditEnabled = false;
+				}
+				else if (tag_backup.TryGetValue("npcedit", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.NpcEdit;
+					flag2 = true;
+					this.isNewEditEnabled = false;
+				}
+				else if (tag_backup.TryGetValue("scout", out strScriptArg))
+				{
+					this.modeType = SceneEdit.ModeType.ScoutChara;
+					flag2 = true;
+					this.isNewEditEnabled = false;
+				}
+				if (!flag2)
+				{
+					NDebug.Assert("エディットシーンのモード指定がありませんでした。次のうち必ず一つは指定してください[original|main|after|costume]", false);
+				}
+				if (tag_backup.TryGetValue("new_edit_off", out strScriptArg))
+				{
+					this.isNewEditEnabled = false;
+				}
+				if (tag_backup.ContainsKey("vr_mode"))
+				{
+					this.m_bVRComMode = true;
+				}
 			}
 			if (!flag)
 			{
-				NDebug.Assert("エディットシーンのモード指定がありませんでした。次のうち必ず一つは指定してください[original|main|after|costume]", false);
-			}
-			if (tag_backup.ContainsKey("vr_mode"))
-			{
-				this.m_bVRComMode = true;
+				SceneEdit.backupEditStartOption = null;
 			}
 		}
 		this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
@@ -322,6 +343,14 @@ public class SceneEdit : MonoBehaviour
 		GameMain.Instance.CharacterMgr.DeactivateCharaAll();
 		this.m_maid = GameMain.Instance.CharacterMgr.GetMaid(0);
 		this.maidPoint = GameMain.Instance.CharacterMgr.status.maidPoint;
+		if (this.m_maid.IsCrcBody && this.maidPoint != SceneEdit.storageMaidPoint)
+		{
+			this.maidPoint = SceneEdit.storageMaidPoint;
+		}
+		if (this.m_maid.status.subCharaData != null || DailyMgr.IsLegacy || !PluginData.IsEnabled("GP003"))
+		{
+			this.isNewEditEnabled = false;
+		}
 		this.m_maid.Visible = true;
 		if (this.m_bVRComMode)
 		{
@@ -471,6 +500,26 @@ public class SceneEdit : MonoBehaviour
 		{
 			GameMain.Instance.SysShortcut.strSceneHelpName = string.Empty;
 		}
+		this.windowCustomView = GameObject.Find("WindowCustomView");
+		this.windowPresetSave = GameObject.Find("WindowPresetSave");
+		if (maid.IsCrcBody)
+		{
+			this.EditItemGroupSwitch.gameObject.SetActive(false);
+			this.EditTouchJumpSwitch.gameObject.SetActive(false);
+			if (this.windowCustomView != null)
+			{
+				this.windowCustomView.SetActive(false);
+			}
+			if (this.windowPresetSave != null)
+			{
+				this.windowPresetSave.SetActive(false);
+			}
+			this.m_bUseTouchJump = false;
+		}
+		if ((!this.isNewEditEnabled || string.IsNullOrEmpty(EditBridge.CREditSystemLauncherExePath)) && this.BodySelectButton != null)
+		{
+			this.BodySelectButton.gameObject.SetActive(false);
+		}
 	}
 
 	private IEnumerator CoLoadWait()
@@ -520,7 +569,14 @@ public class SceneEdit : MonoBehaviour
 		}
 		this.m_maid.boMabataki = true;
 		MaidColliderCollect collect = MaidColliderCollect.AddColliderCollect(this.m_maid);
-		this.touchJumpColliderList = collect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+		if (this.m_maid.body0.IsCrcBody)
+		{
+			this.touchJumpColliderList = collect.AddCollider(MaidColliderCollect.ColliderType.Crc);
+		}
+		else
+		{
+			this.touchJumpColliderList = collect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+		}
 		if (!GameMain.Instance.VRMode)
 		{
 			Dictionary<IKManager.BoneType, KeyValuePair<IKManager.BoneSetType, GameObject>> dictionary = IKManager.CreateBoneDic(this.m_maid);
@@ -616,6 +672,23 @@ public class SceneEdit : MonoBehaviour
 		this.customViewWindow.Create();
 		GameMain.Instance.LoadIcon.force_draw_new = false;
 		GameMain.Instance.MainCamera.FadeIn(0.5f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
+		if (this.maid.IsCrcBody)
+		{
+			WindowPartsWindowVisible component = this.windowCustomView.GetComponent<WindowPartsWindowVisible>();
+			if (!component.visible)
+			{
+				component.TargetWindow.visible = false;
+			}
+			WindowPartsWindowVisible component2 = this.windowPresetSave.GetComponent<WindowPartsWindowVisible>();
+			if (!component2.visible)
+			{
+				component2.TargetWindow.visible = false;
+			}
+			if (SceneEdit.storageModeType == SceneEdit.ModeType.OriginalChara || SceneEdit.storageModeType == SceneEdit.ModeType.MainChara || SceneEdit.storageModeType == SceneEdit.ModeType.ScoutChara)
+			{
+				this.modeType = SceneEdit.storageModeType;
+			}
+		}
 		yield break;
 	}
 
@@ -668,32 +741,35 @@ public class SceneEdit : MonoBehaviour
 				}
 				if (!mi.m_bMan && this.editItemTextureCache.IsRegister(mi.m_nMenuFileRID))
 				{
-					this.AddMenuItemToList(mi);
-					menuList.Add(mi);
-					if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
+					if (!mi.m_strMenuFileName.Contains("_crc") && !mi.m_strMenuFileName.Contains("crc_"))
 					{
-						this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
-					}
-					string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
-					if (!string.IsNullOrEmpty(parentMenuName))
-					{
-						int hashCode = parentMenuName.GetHashCode();
-						if (!menuGroupMemberDic.ContainsKey(hashCode))
+						this.AddMenuItemToList(mi);
+						menuList.Add(mi);
+						if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
 						{
-							menuGroupMemberDic.Add(hashCode, new List<int>());
+							this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
+						}
+						string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
+						if (!string.IsNullOrEmpty(parentMenuName))
+						{
+							int hashCode = parentMenuName.GetHashCode();
+							if (!menuGroupMemberDic.ContainsKey(hashCode))
+							{
+								menuGroupMemberDic.Add(hashCode, new List<int>());
+							}
+							menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
+						}
+						else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
+						{
+							mi.m_bGroupLeader = true;
+							mi.m_listMember = new List<SceneEdit.SMenuItem>();
+							mi.m_listMember.Add(mi);
+						}
+						if (0.5f < Time.realtimeSinceStartup - time)
+						{
+							yield return null;
+							time = Time.realtimeSinceStartup;
 						}
-						menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
-					}
-					else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
-					{
-						mi.m_bGroupLeader = true;
-						mi.m_listMember = new List<SceneEdit.SMenuItem>();
-						mi.m_listMember.Add(mi);
-					}
-					if (0.5f < Time.realtimeSinceStartup - time)
-					{
-						yield return null;
-						time = Time.realtimeSinceStartup;
 					}
 				}
 			}
@@ -923,7 +999,7 @@ public class SceneEdit : MonoBehaviour
 		}
 		foreach (SceneEdit.SCategory scategory in this.m_listCategory)
 		{
-			if (scategory.m_eCategory == SceneEditInfo.EMenuCategory.プリセット || scategory.m_eCategory == SceneEditInfo.EMenuCategory.ランダム || scategory.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル || scategory.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
+			if (scategory.m_eCategory == SceneEditInfo.EMenuCategory.プリセット || scategory.m_eCategory == SceneEditInfo.EMenuCategory.ランダム || scategory.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル || scategory.m_eCategory == SceneEditInfo.EMenuCategory.ボディ選択 || scategory.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
 			{
 				scategory.m_isEnabled = true;
 			}
@@ -947,7 +1023,8 @@ public class SceneEdit : MonoBehaviour
 				SceneEditInfo.EMenuCategory.セット,
 				SceneEditInfo.EMenuCategory.プリセット,
 				SceneEditInfo.EMenuCategory.ランダム,
-				SceneEditInfo.EMenuCategory.プロフィ\u30FCル
+				SceneEditInfo.EMenuCategory.プロフィ\u30FCル,
+				SceneEditInfo.EMenuCategory.ボディ選択
 			};
 			SceneEditInfo.EMenuCategory[] array2 = array;
 			for (int l = 0; l < array2.Length; l++)
@@ -960,7 +1037,8 @@ public class SceneEdit : MonoBehaviour
 		{
 			SceneEditInfo.EMenuCategory[] array3 = new SceneEditInfo.EMenuCategory[]
 			{
-				SceneEditInfo.EMenuCategory.プロフィ\u30FCル
+				SceneEditInfo.EMenuCategory.プロフィ\u30FCル,
+				SceneEditInfo.EMenuCategory.ボディ選択
 			};
 			SceneEditInfo.EMenuCategory[] array4 = array3;
 			for (int m = 0; m < array4.Length; m++)
@@ -993,6 +1071,7 @@ public class SceneEdit : MonoBehaviour
 		this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プリセット.ToString(), SceneEditInfo.EMenuCategory.プリセット));
 		this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.ランダム.ToString(), SceneEditInfo.EMenuCategory.ランダム));
 		this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プロフィ\u30FCル.ToString(), SceneEditInfo.EMenuCategory.プロフィ\u30FCル));
+		this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.ボディ選択.ToString(), SceneEditInfo.EMenuCategory.ボディ選択));
 	}
 
 	public static void ReadMenuItemDataFromNative(SceneEdit.SMenuItem mi, int menuDataBaseIndex)
@@ -1514,27 +1593,41 @@ public class SceneEdit : MonoBehaviour
 		for (int i = 0; i < this.m_listCategory.Count; i++)
 		{
 			SceneEdit.SCategory scategory = this.m_listCategory[i];
-			UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
-			GameObject gameObject = NGUITools.AddChild(this.m_Panel_Category.goGrid, @object as GameObject);
-			UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
-			Localize component = uilabel.gameObject.GetComponent<Localize>();
-			if (component != null)
+			if (this.isNewEditEnabled || scategory.m_eCategory != SceneEditInfo.EMenuCategory.ボディ選択)
 			{
-				component.SetTerm("SceneEdit/カテゴリー/" + scategory.m_strCateName);
-			}
-			ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
-			buttonEdit.m_Category = scategory;
-			UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
-			uibutton.isEnabled = scategory.m_isEnabled;
-			if (uibutton.isEnabled)
-			{
-				EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
+				if (this.maid.IsCrcBody)
+				{
+					if (scategory.m_eCategory != SceneEditInfo.EMenuCategory.プロフィ\u30FCル && scategory.m_eCategory != SceneEditInfo.EMenuCategory.ボディ選択)
+					{
+						scategory.m_isEnabled = false;
+					}
+				}
+				else
+				{
+					scategory.m_isEnabled = true;
+				}
+				UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
+				GameObject gameObject = NGUITools.AddChild(this.m_Panel_Category.goGrid, @object as GameObject);
+				UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
+				Localize component = uilabel.gameObject.GetComponent<Localize>();
+				if (component != null)
+				{
+					component.SetTerm("SceneEdit/カテゴリー/" + scategory.m_strCateName);
+				}
+				ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
+				buttonEdit.m_Category = scategory;
+				UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
+				uibutton.isEnabled = scategory.m_isEnabled;
+				if (uibutton.isEnabled)
+				{
+					EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
+				}
+				buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
+				buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
+				UIButton component2 = buttonEdit.GetComponent<UIButton>();
+				buttonEdit.m_colBtnDefault = component2.defaultColor;
+				this.m_listBtnCate.Add(gameObject);
 			}
-			buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
-			buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
-			UIButton component2 = buttonEdit.GetComponent<UIButton>();
-			buttonEdit.m_colBtnDefault = component2.defaultColor;
-			this.m_listBtnCate.Add(gameObject);
 		}
 		this.m_Panel_Category.gcScrollView.ResetPosition();
 		this.m_Panel_Category.gcUIGrid.Reposition();
@@ -2324,6 +2417,7 @@ public class SceneEdit : MonoBehaviour
 			BaseMgr<PresetMgr>.Instance.ClosePresetPanel();
 			BaseMgr<ProfileMgr>.Instance.CloseProfilePanel();
 			BaseMgr<CostumePartsEnabledMgr>.Instance.CloseRandomPresetPanel();
+			BaseMgr<BodySelectMgr>.Instance.CloseBodySelectPanel();
 			if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.ランダム)
 			{
 				if (this.m_viewreset.GetVisibleAutoCam())
@@ -2356,6 +2450,16 @@ public class SceneEdit : MonoBehaviour
 				this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
 				BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
 			}
+			else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.ボディ選択)
+			{
+				if (this.m_viewreset.GetVisibleAutoCam())
+				{
+					this.CameraReset(0.5f);
+				}
+				BaseMgr<BodySelectMgr>.Instance.OpenBodySelectPanel();
+				this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
+				BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
+			}
 			else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
 			{
 				if (this.m_viewreset.GetVisibleAutoCam())
@@ -2944,6 +3048,7 @@ public class SceneEdit : MonoBehaviour
 				this.OnEndDlgOk();
 			}
 		}
+		SceneEdit.storageModeType = SceneEdit.ModeType.AfterEdit;
 	}
 
 	private void OnFFNameFirst()
@@ -2976,7 +3081,7 @@ public class SceneEdit : MonoBehaviour
 		this.m_maid.boMabataki = false;
 		if (this.modeType == SceneEdit.ModeType.CostumeEdit)
 		{
-			for (int i = 81; i <= 80; i++)
+			for (int i = 167; i <= 166; i++)
 			{
 				this.maid.ResetProp((MPN)i, true);
 			}
@@ -3017,6 +3122,12 @@ public class SceneEdit : MonoBehaviour
 		this.m_maid.boMabataki = true;
 		this.m_maid.body0.trsLookTarget = null;
 		this.m_currentScriptFile = GameMain.Instance.ScriptMgr.adv_kag.kag.GetCurrentFileName();
+		if (SceneEdit.backupEditStartOption != null)
+		{
+			this.m_currentScriptFile = SceneEdit.backupEditStartOption.currentScriptFile;
+			this.m_strScriptArg = SceneEdit.backupEditStartOption.nextLabel;
+			SceneEdit.backupEditStartOption = null;
+		}
 		GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.CreateKasizukiThumShot), true, default(Color));
 		yield break;
 	}
@@ -3116,35 +3227,43 @@ public class SceneEdit : MonoBehaviour
 	{
 		switch (mpn)
 		{
-		case MPN.skin:
-			mpn = MPN.folder_skin;
+		case MPN.matsuge_up:
+			mpn = MPN.folder_matsuge_up;
+			break;
+		case MPN.matsuge_low:
+			mpn = MPN.folder_matsuge_low;
+			break;
+		case MPN.futae:
+			mpn = MPN.folder_futae;
 			break;
 		default:
 			switch (mpn)
 			{
-			case MPN.eyewhite:
-				mpn = MPN.folder_eyewhite;
+			case MPN.skin:
+				mpn = MPN.folder_skin;
 				break;
-			case MPN.matsuge_up:
-				mpn = MPN.folder_matsuge_up;
-				break;
-			case MPN.matsuge_low:
-				mpn = MPN.folder_matsuge_low;
+			default:
+				switch (mpn)
+				{
+				case MPN.eye:
+					mpn = MPN.folder_eye;
+					break;
+				default:
+					if (mpn == MPN.mayu)
+					{
+						mpn = MPN.folder_mayu;
+					}
+					break;
+				case MPN.eyewhite:
+					mpn = MPN.folder_eyewhite;
+					break;
+				}
 				break;
-			case MPN.futae:
-				mpn = MPN.folder_futae;
+			case MPN.underhair:
+				mpn = MPN.folder_underhair;
 				break;
 			}
 			break;
-		case MPN.underhair:
-			mpn = MPN.folder_underhair;
-			break;
-		case MPN.mayu:
-			mpn = MPN.folder_mayu;
-			break;
-		case MPN.eye:
-			mpn = MPN.folder_eye;
-			break;
 		}
 		if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
 		{
@@ -3177,35 +3296,43 @@ public class SceneEdit : MonoBehaviour
 	{
 		switch (mpn)
 		{
-		case MPN.skin:
-			mpn = MPN.folder_skin;
+		case MPN.matsuge_up:
+			mpn = MPN.folder_matsuge_up;
+			break;
+		case MPN.matsuge_low:
+			mpn = MPN.folder_matsuge_low;
+			break;
+		case MPN.futae:
+			mpn = MPN.folder_futae;
 			break;
 		default:
 			switch (mpn)
 			{
-			case MPN.eyewhite:
-				mpn = MPN.folder_eyewhite;
-				break;
-			case MPN.matsuge_up:
-				mpn = MPN.folder_matsuge_up;
+			case MPN.skin:
+				mpn = MPN.folder_skin;
 				break;
-			case MPN.matsuge_low:
-				mpn = MPN.folder_matsuge_low;
+			default:
+				switch (mpn)
+				{
+				case MPN.eye:
+					mpn = MPN.folder_eye;
+					break;
+				default:
+					if (mpn == MPN.mayu)
+					{
+						mpn = MPN.folder_mayu;
+					}
+					break;
+				case MPN.eyewhite:
+					mpn = MPN.folder_eyewhite;
+					break;
+				}
 				break;
-			case MPN.futae:
-				mpn = MPN.folder_futae;
+			case MPN.underhair:
+				mpn = MPN.folder_underhair;
 				break;
 			}
 			break;
-		case MPN.underhair:
-			mpn = MPN.folder_underhair;
-			break;
-		case MPN.mayu:
-			mpn = MPN.folder_mayu;
-			break;
-		case MPN.eye:
-			mpn = MPN.folder_eye;
-			break;
 		}
 		if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
 		{
@@ -3217,7 +3344,7 @@ public class SceneEdit : MonoBehaviour
 
 	public bool ClickEmulate(SceneEditInfo.EMenuCategory category, string partsType, bool forceViewOff = false)
 	{
-		if (!this.ClickEmulate(category, false) || category == SceneEditInfo.EMenuCategory.プリセット || category == SceneEditInfo.EMenuCategory.ランダム || category == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
+		if (!this.ClickEmulate(category, false) || category == SceneEditInfo.EMenuCategory.プリセット || category == SceneEditInfo.EMenuCategory.ランダム || category == SceneEditInfo.EMenuCategory.プロフィ\u30FCル || category == SceneEditInfo.EMenuCategory.ボディ選択)
 		{
 			return false;
 		}
@@ -3356,8 +3483,10 @@ public class SceneEdit : MonoBehaviour
 			MaidColliderCollect.RemoveColliderAll(maid);
 			maid.body0.SetMaskMode(TBody.MaskMode.None);
 			maid.OpenMouthLookTooth(false);
-			maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-			maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+			if (maid.fullBodyIK != null)
+			{
+				maid.fullBodyIK.AllIKDetach(0f);
+			}
 			maid.Visible = false;
 		}
 		this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
@@ -3402,6 +3531,215 @@ public class SceneEdit : MonoBehaviour
 		}
 	}
 
+	public void StartNewEdit()
+	{
+		if (this.modeType == SceneEdit.ModeType.OriginalChara || this.modeType == SceneEdit.ModeType.MainChara || this.modeType == SceneEdit.ModeType.CostumeEdit)
+		{
+			SceneEdit.storageMaidPoint = this.maidPoint;
+			SceneEdit.storageModeType = this.modeType;
+			SceneEdit.storageFlg = true;
+			SceneEdit.StorageDicDividedPoint = new Dictionary<string, int>();
+			SceneEdit.StorageDicDividedPoint.Add("Lovely", this.m_maid.status.lovely);
+			SceneEdit.StorageDicDividedPoint.Add("Elegance", this.m_maid.status.elegance);
+			SceneEdit.StorageDicDividedPoint.Add("Charm", this.m_maid.status.charm);
+			SceneEdit.StorageDicDividedPoint.Add("Hentai", this.m_maid.status.hentai);
+			SceneEdit.StorageDicDividedPoint.Add("MValue", this.m_maid.status.mvalue);
+			SceneEdit.StorageDicDividedPoint.Add("Inran", this.m_maid.status.inyoku);
+			SceneEdit.StorageDicDividedPoint.Add("Housi", this.m_maid.status.housi);
+			SceneEdit.StorageDicDividedPoint.Add("Cooking", this.m_maid.status.cooking);
+			SceneEdit.StorageDicDividedPoint.Add("Dance", this.m_maid.status.dance);
+			SceneEdit.StorageDicDividedPoint.Add("Vocal", this.m_maid.status.vocal);
+		}
+		if (SceneEdit.backupEditStartOption == null)
+		{
+			SceneEdit.backupEditStartOption = new SceneEdit.BackupEditStartOption();
+			SceneEdit.backupEditStartOption.currentScriptFile = GameMain.Instance.ScriptMgr.adv_kag.kag.GetCurrentFileName();
+			SceneEdit.backupEditStartOption.nextLabel = this.m_strScriptArg;
+		}
+		this.m_currentScriptFile = "new_edit_call.ks";
+		this.m_strScriptArg = "*エディット";
+		UICamera.InputEnable = false;
+		GameMain.Instance.SoundMgr.StopBGM(1f);
+		GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnEndSceneNextNewEdit), true, default(Color));
+	}
+
+	public void OnEndSceneNextNewEdit()
+	{
+		if (GameMain.Instance.VRMode)
+		{
+			GameMain.Instance.CharacterMgr.ResetCharaPosAll();
+		}
+		UICamera.InputEnable = true;
+		if (!string.IsNullOrEmpty(this.m_strScriptArg))
+		{
+			GameMain.Instance.SoundMgr.StopAll();
+			GameMain.Instance.CharacterMgr.DeactivateMaid(this.maid);
+			Debug.Log("OnEndSceneNextNewEdit JumpTo " + this.m_strScriptArg);
+			GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_currentScriptFile, this.m_strScriptArg);
+			GameMain.Instance.ScriptMgr.adv_kag.kag.Exec();
+			if (!EditBridge.StartEdit(this.maid, delegate
+			{
+				EditBridge.Import(this.maid);
+				GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile("new_edit_call.ks", "*エディット_Back");
+				GameMain.Instance.ScriptMgr.adv_kag.kag.Exec();
+			}))
+			{
+				NDebug.Assert("CR EditSystemの起動に失敗しました", false);
+			}
+		}
+	}
+
+	public void UpdateCategoryButton()
+	{
+		this.m_listNg2Cate.Clear();
+		foreach (GameObject obj in this.m_listBtnCate)
+		{
+			UnityEngine.Object.DestroyImmediate(obj);
+		}
+		this.m_listBtnCate.Clear();
+		for (int i = 0; i < this.m_listCategory.Count; i++)
+		{
+			SceneEdit.SCategory scategory = this.m_listCategory[i];
+			if (this.maid.IsCrcBody)
+			{
+				if (scategory.m_eCategory != SceneEditInfo.EMenuCategory.プロフィ\u30FCル && scategory.m_eCategory != SceneEditInfo.EMenuCategory.ボディ選択)
+				{
+					scategory.m_isEnabled = false;
+				}
+			}
+			else
+			{
+				scategory.m_isEnabled = true;
+			}
+			UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
+			GameObject gameObject = NGUITools.AddChild(this.m_Panel_Category.goGrid, @object as GameObject);
+			UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
+			Localize component = uilabel.gameObject.GetComponent<Localize>();
+			if (component != null)
+			{
+				component.SetTerm("SceneEdit/カテゴリー/" + scategory.m_strCateName);
+			}
+			ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
+			buttonEdit.m_Category = scategory;
+			UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
+			uibutton.isEnabled = scategory.m_isEnabled;
+			if (uibutton.isEnabled)
+			{
+				EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
+			}
+			buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
+			buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
+			UIButton component2 = buttonEdit.GetComponent<UIButton>();
+			buttonEdit.m_colBtnDefault = component2.defaultColor;
+			if (scategory.m_eCategory == SceneEditInfo.EMenuCategory.ボディ選択)
+			{
+				buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = true;
+				component2.defaultColor = new Color(component2.defaultColor.r, component2.defaultColor.g, component2.defaultColor.b, 1f);
+			}
+			this.m_listBtnCate.Add(gameObject);
+		}
+		this.m_Panel_Category.gcScrollView.ResetPosition();
+		this.m_Panel_Category.gcUIGrid.Reposition();
+	}
+
+	public void PanelOpenClose()
+	{
+		if (this.maid.IsCrcBody)
+		{
+			this.EditItemGroupSwitch.gameObject.SetActive(false);
+			this.EditTouchJumpSwitch.gameObject.SetActive(false);
+			if (this.windowCustomView != null)
+			{
+				this.windowCustomView.SetActive(false);
+			}
+			if (this.windowPresetSave != null)
+			{
+				this.windowPresetSave.SetActive(false);
+			}
+			WindowPartsWindowVisible component = this.windowCustomView.GetComponent<WindowPartsWindowVisible>();
+			if (!this.customPartsWindowVisibleButton.visible)
+			{
+				component.TargetWindow.visible = false;
+			}
+			WindowPartsWindowVisible component2 = this.windowPresetSave.GetComponent<WindowPartsWindowVisible>();
+			if (!component2.visible)
+			{
+				component2.TargetWindow.visible = false;
+			}
+		}
+		else
+		{
+			this.EditItemGroupSwitch.gameObject.SetActive(true);
+			this.EditTouchJumpSwitch.gameObject.SetActive(true);
+			if (this.windowCustomView != null)
+			{
+				this.windowCustomView.SetActive(true);
+			}
+			if (this.windowPresetSave != null)
+			{
+				this.windowPresetSave.SetActive(true);
+			}
+		}
+	}
+
+	public void UpdataCollidert()
+	{
+		this.touchJumpColliderList.Clear();
+		MaidColliderCollect maidColliderCollect = MaidColliderCollect.AddColliderCollect(this.m_maid);
+		this.touchJumpColliderList = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+		if (!GameMain.Instance.VRMode)
+		{
+			Dictionary<IKManager.BoneType, KeyValuePair<IKManager.BoneSetType, GameObject>> dictionary = IKManager.CreateBoneDic(this.m_maid);
+			Dictionary<Transform, SceneEdit.TouchType> dictionary2 = new Dictionary<Transform, SceneEdit.TouchType>();
+			dictionary2.Add(dictionary[IKManager.BoneType.Head].Value.transform, SceneEdit.TouchType.Head);
+			dictionary2.Add(dictionary[IKManager.BoneType.Spine1].Value.transform, SceneEdit.TouchType.UpperBody);
+			dictionary2.Add(dictionary[IKManager.BoneType.Bust_R].Value.transform, SceneEdit.TouchType.Bust);
+			dictionary2.Add(dictionary[IKManager.BoneType.Bust_L].Value.transform, SceneEdit.TouchType.Bust);
+			dictionary2.Add(dictionary[IKManager.BoneType.Pelvis].Value.transform, SceneEdit.TouchType.LowerBody);
+			dictionary2.Add(dictionary[IKManager.BoneType.Thigh_L].Value.transform, SceneEdit.TouchType.Leg);
+			dictionary2.Add(dictionary[IKManager.BoneType.Thigh_R].Value.transform, SceneEdit.TouchType.Leg);
+			Dictionary<SceneEdit.TouchType, Action> dictionary3 = new Dictionary<SceneEdit.TouchType, Action>();
+			dictionary3.Add(SceneEdit.TouchType.Head, delegate
+			{
+				this.OnTouchJump(SceneEdit.TouchType.Head);
+			});
+			dictionary3.Add(SceneEdit.TouchType.Bust, delegate
+			{
+				this.OnTouchJump(SceneEdit.TouchType.Bust);
+			});
+			dictionary3.Add(SceneEdit.TouchType.UpperBody, delegate
+			{
+				this.OnTouchJump(SceneEdit.TouchType.UpperBody);
+			});
+			dictionary3.Add(SceneEdit.TouchType.LowerBody, delegate
+			{
+				this.OnTouchJump(SceneEdit.TouchType.LowerBody);
+			});
+			dictionary3.Add(SceneEdit.TouchType.Leg, delegate
+			{
+				this.OnTouchJump(SceneEdit.TouchType.Leg);
+			});
+			for (int i = 0; i < this.touchJumpColliderList.Count; i++)
+			{
+				ColliderEvent colliderEvent = this.touchJumpColliderList[i].gameObject.AddComponent<ColliderEvent>();
+				Transform transform = colliderEvent.transform;
+				while (transform != null && !dictionary2.ContainsKey(transform))
+				{
+					transform = transform.parent;
+				}
+				if (!(transform == null))
+				{
+					SceneEdit.TouchType key = dictionary2[transform];
+					colliderEvent.onMouseDown = dictionary3[key];
+				}
+			}
+		}
+		else
+		{
+			this.touchJumpColliderList.Clear();
+		}
+	}
+
 	public void Update()
 	{
 		if (GameMain.Instance.VRMode)
@@ -3450,6 +3788,14 @@ public class SceneEdit : MonoBehaviour
 		}
 	}
 
+	public static SceneEdit.ModeType storageModeType = SceneEdit.ModeType.AfterEdit;
+
+	public static int storageMaidPoint;
+
+	public static bool storageFlg;
+
+	public static Dictionary<string, int> StorageDicDividedPoint;
+
 	private bool updateCustomViewFlag;
 
 	private List<CapsuleCollider> touchJumpColliderList = new List<CapsuleCollider>();
@@ -3474,6 +3820,8 @@ public class SceneEdit : MonoBehaviour
 
 	public UIButton EditTouchJumpSwitch;
 
+	public UIButton BodySelectButton;
+
 	[SerializeField]
 	public ColorPaletteManager colorPaletteMgr;
 
@@ -3517,6 +3865,8 @@ public class SceneEdit : MonoBehaviour
 
 	public Dictionary<int, SceneEdit.SMenuItem> m_menuRidDic;
 
+	private static SceneEdit.BackupEditStartOption backupEditStartOption;
+
 	public Dictionary<Personal.Data, List<SceneEdit.PVBInfo>> m_dicVoice = new Dictionary<Personal.Data, List<SceneEdit.PVBInfo>>();
 
 	public GameObject m_goUIRoot;
@@ -3547,8 +3897,14 @@ public class SceneEdit : MonoBehaviour
 
 	private string last_select_category_name_ = string.Empty;
 
+	private bool isNewEditEnabled;
+
 	private Dictionary<string, float> backup_category_scroll_pos_ = new Dictionary<string, float>();
 
+	private GameObject windowCustomView;
+
+	private GameObject windowPresetSave;
+
 	private int m_nDemoBgNo;
 
 	private MPN m_nNowMPN;
@@ -4228,6 +4584,13 @@ public class SceneEdit : MonoBehaviour
 		public string strFace2;
 	}
 
+	public class BackupEditStartOption
+	{
+		public string currentScriptFile;
+
+		public string nextLabel;
+	}
+
 	public enum CAM_OFFS
 	{
 		CENTER,

+ 1 - 0
Assembly-CSharp/SceneEditInfo.cs

@@ -250,6 +250,7 @@ public static class SceneEditInfo
 		プリセット,
 		ランダム,
 		プロフィ\u30FCル,
+		ボディ選択,
 		着衣設定
 	}
 

+ 11 - 3
Assembly-CSharp/SceneEditWindow/CustomPartsWindow.cs

@@ -277,7 +277,7 @@ namespace SceneEditWindow
 			{
 				if (Product.isPublic)
 				{
-					foreach (TBodySkin tbodySkin in this.maid.body0.goSlot)
+					foreach (TBodySkin tbodySkin in this.maid.body0.goSlot.GetListParents())
 					{
 						if (tbodySkin.m_ParentMPN == menu.m_mpn)
 						{
@@ -417,8 +417,16 @@ namespace SceneEditWindow
 					MaidColliderCollect component = this.maid.GetComponent<MaidColliderCollect>();
 					if (component != null)
 					{
-						List<CapsuleCollider> collider = component.GetCollider(MaidColliderCollect.ColliderType.Grab);
-						foreach (CapsuleCollider capsuleCollider in collider)
+						List<CapsuleCollider> list = new List<CapsuleCollider>();
+						if (this.maid.body0.IsCrcBody)
+						{
+							list = component.GetCollider(MaidColliderCollect.ColliderType.Crc);
+						}
+						else
+						{
+							list = component.GetCollider(MaidColliderCollect.ColliderType.Grab);
+						}
+						foreach (CapsuleCollider capsuleCollider in list)
 						{
 							capsuleCollider.gameObject.SetActive(value);
 						}

+ 26 - 21
Assembly-CSharp/SceneEditWindow/CustomViewItem.cs

@@ -135,45 +135,50 @@ namespace SceneEditWindow
 			bool flag = false;
 			switch (mpn)
 			{
-			case MPN.chikubicolor:
-				mpn = MPN.chikubi;
-				flag = true;
-				break;
-			case MPN.eyewhite:
-				mpn = MPN.folder_eyewhite;
+			case MPN.mayu:
+				mpn = MPN.folder_mayu;
 				flag = true;
 				break;
 			default:
 				switch (mpn)
 				{
-				case MPN.skin:
-					mpn = MPN.folder_skin;
+				case MPN.matsuge_up:
+					mpn = MPN.folder_matsuge_up;
 					flag = true;
 					break;
-				case MPN.underhair:
-					mpn = MPN.folder_underhair;
+				case MPN.matsuge_low:
+					mpn = MPN.folder_matsuge_low;
 					flag = true;
 					break;
-				case MPN.mayu:
-					mpn = MPN.folder_mayu;
+				case MPN.futae:
+					mpn = MPN.folder_futae;
 					flag = true;
 					break;
-				case MPN.eye:
-					mpn = MPN.folder_eye;
-					flag = true;
+				default:
+					switch (mpn)
+					{
+					case MPN.skin:
+						mpn = MPN.folder_skin;
+						flag = true;
+						break;
+					case MPN.underhair:
+						mpn = MPN.folder_underhair;
+						flag = true;
+						break;
+					}
 					break;
 				}
 				break;
-			case MPN.matsuge_up:
-				mpn = MPN.folder_matsuge_up;
+			case MPN.chikubicolor:
+				mpn = MPN.chikubi;
 				flag = true;
 				break;
-			case MPN.matsuge_low:
-				mpn = MPN.folder_matsuge_low;
+			case MPN.eye:
+				mpn = MPN.folder_eye;
 				flag = true;
 				break;
-			case MPN.futae:
-				mpn = MPN.folder_futae;
+			case MPN.eyewhite:
+				mpn = MPN.folder_eyewhite;
 				flag = true;
 				break;
 			}

+ 1 - 1
Assembly-CSharp/SceneEditWindow/PoseIconData.cs

@@ -147,7 +147,7 @@ namespace SceneEditWindow
 					scriptMgr.compatibilityMode = true;
 				}
 				scriptMgr.is_motion_blend = false;
-				scriptMgr.LoadMotionScript(0, false, this.callScriptFileName, this.callLabelName, string.Empty, string.Empty, false, true, false);
+				scriptMgr.LoadMotionScript(0, false, this.callScriptFileName, this.callLabelName, string.Empty, string.Empty, false, true, false, false);
 				scriptMgr.is_motion_blend = true;
 				if (scriptMgr.compatibilityMode)
 				{

+ 39 - 7
Assembly-CSharp/SceneFacilityManagement.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using I2.Loc;
 using PlayerStatus;
 using UnityEngine;
@@ -1228,20 +1229,32 @@ public class SceneFacilityManagement : MonoBehaviour
 				return;
 			}
 		}
-		Maid maidLeader = this.GetMaidLeader();
-		if (maidLeader == null)
+		Maid maid;
+		if (!PluginData.IsEnabled("GP003"))
+		{
+			maid = this.GetMaidLeader();
+		}
+		else
+		{
+			maid = GameMain.Instance.CharacterMgr.GetStockNpcMaid(0);
+		}
+		if (maid == null)
 		{
 			NDebug.Warning("メイド長が見つかりません");
 			return;
 		}
-		facility.UpdateEditCostumeToMaidCostume(maidLeader);
+		facility.UpdateEditCostumeToMaidCostume(maid);
 		MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
 		for (int i = 0; i < facilityCostumeEnableMPN.Length; i++)
 		{
-			maidLeader.ResetProp(facilityCostumeEnableMPN[i], true);
+			maid.ResetProp(facilityCostumeEnableMPN[i], true);
+		}
+		maid.AllProcPropSeqStart();
+		maid.Visible = false;
+		if (maid.boNPC)
+		{
+			GameMain.Instance.CharacterMgr.DeactivateMaid(maid);
 		}
-		maidLeader.AllProcPropSeqStart();
-		maidLeader.Visible = false;
 		Debug.Log(string.Format("[SceneFacilityManagement]施設「{0}」の指定コスチュームの更新終了", facility.facilityName));
 	}
 
@@ -1262,7 +1275,26 @@ public class SceneFacilityManagement : MonoBehaviour
 				return;
 			}
 		}
-		Maid maid = this.GetMaidLeader();
+		Maid maid = null;
+		if (!PluginData.IsEnabled("GP003"))
+		{
+			maid = this.GetMaidLeader();
+		}
+		else
+		{
+			maid = GameMain.Instance.CharacterMgr.ActivateNpc(0);
+			string text = "pre_facility";
+			TextAsset textAsset = Resources.Load("Preset/" + text) as TextAsset;
+			using (MemoryStream memoryStream = new MemoryStream(textAsset.bytes))
+			{
+				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
+				{
+					CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, text);
+					GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest, false);
+				}
+			}
+			Resources.UnloadAsset(textAsset);
+		}
 		if (maid == null)
 		{
 			NDebug.Warning("メイド長が見つかりません");

+ 1 - 0
Assembly-CSharp/SceneKasizukiMainMenu.cs

@@ -112,6 +112,7 @@ public class SceneKasizukiMainMenu : WfScreenManager
 
 	public void UpdateMan(Action callback)
 	{
+		GameMain.Instance.CharacterMgr.SwapNewManBody(0, false);
 		int nowManType = GameMain.Instance.KasizukiMgr.GetNowManType();
 		ManData.Data data = ManData.GetData(nowManType);
 		Maid man = GameMain.Instance.KasizukiMgr.GetMan();

+ 1 - 1
Assembly-CSharp/SceneNPCEdit/NPCEditMain.cs

@@ -95,7 +95,7 @@ namespace SceneNPCEdit
 					return;
 				}
 				Maid maid = this.charaMgr.ActivateNpc(0);
-				this.npcEditCharaSelect.selectNPC.npcData.Apply(maid, true);
+				this.npcEditCharaSelect.selectNPC.npcData.Apply(maid, false);
 				NPCCharaSelect.editTargetNPCData = this.npcEditCharaSelect.selectNPC;
 				this.screenManager.move_screen.SetNextLabel(this.edit_label_);
 				this.Finish();

+ 1 - 1
Assembly-CSharp/SceneNPCEdit/SaveData.cs

@@ -10,7 +10,7 @@ namespace SceneNPCEdit
 		public static void Serialize(BinaryWriter binary)
 		{
 			binary.Write("CM3D2_NPCEDIT");
-			binary.Write(1550);
+			binary.Write(1570);
 			binary.Write(SaveData.presetData.Count);
 			foreach (KeyValuePair<int, byte[]> keyValuePair in SaveData.presetData)
 			{

+ 1 - 0
Assembly-CSharp/SceneUserEditMain.cs

@@ -138,6 +138,7 @@ public class SceneUserEditMain : WfScreenChildren
 		mainCamera.SetDistance(2.2f, true);
 		mainCamera.SetAroundAngle(new Vector2(177.9044f, 2.546583f), true);
 		mainCamera.SetTargetOffset(new Vector3((float)Screen.width / 3f * 2f - (float)Screen.width / 2f, 0f, 0f), false);
+		GameMain.Instance.CharacterMgr.SwapNewManBody(0, false);
 		Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
 		this.manController = new PhotoManEditManager.Controller(man);
 		man.Visible = true;

+ 2 - 4
Assembly-CSharp/SceneVRCommunication.cs

@@ -256,8 +256,7 @@ public class SceneVRCommunication : MonoBehaviour
 						{
 							stockMaid.body0.MuneYureL(1f);
 							stockMaid.body0.MuneYureR(1f);
-							stockMaid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-							stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+							stockMaid.fullBodyIK.AllIKDetach(0f);
 							stockMaid.transform.localScale = Vector3.one;
 							stockMaid.StopKuchipakuPattern();
 							stockMaid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
@@ -269,8 +268,7 @@ public class SceneVRCommunication : MonoBehaviour
 						Maid stockMan = characterMgr.GetStockMan(j);
 						if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
 						{
-							stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-							stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+							stockMan.fullBodyIK.AllIKDetach(0f);
 							stockMan.DelPrefabAll();
 						}
 					}

+ 8 - 1
Assembly-CSharp/SceneVRTouch.cs

@@ -73,7 +73,14 @@ public class SceneVRTouch : MonoBehaviour
 		}
 		GameMain.Instance.CharacterMgr.ResetCharaPosAll();
 		this.m_maid.boMabataki = true;
-		MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Grab);
+		if (this.m_maid.body0.IsCrcBody)
+		{
+			MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Crc);
+		}
+		else
+		{
+			MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Grab);
+		}
 		MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Touch);
 		foreach (SceneVRTouch.TouchMotionScript touchMotionScript in this.m_listTouchMotionScript)
 		{

+ 120 - 87
Assembly-CSharp/Schedule/ScheduleAPI.cs

@@ -601,25 +601,29 @@ namespace Schedule
 					{
 						if (PersonalEventBlocker.IsEnabledScheduleTask(stockMaid.status.personal, workData.id))
 						{
-							if (workData.id == 10072 && workData.isCheckGP002Personal)
+							if (excludeMaid.IsCrcBody == stockMaid.IsCrcBody)
 							{
-								if ((stockMaid.status.seikeiken == Seikeiken.Yes_No || stockMaid.status.seikeiken == Seikeiken.Yes_Yes) && condPersonalIds.Contains(stockMaid.status.personal.id) && PluginData.IsEnabledForGP002Personal(stockMaid.status.personal.uniqueName))
+								int count = list.Count;
+								if (workData.id == 10072 && workData.isCheckGP002Personal)
 								{
-									list.Add(stockMaid);
-								}
-							}
-							else if (stockMaid.status.seikeiken == Seikeiken.Yes_Yes && stockMaid.status.relation >= Relation.Lover && condPersonalIds.Contains(stockMaid.status.personal.id))
-							{
-								if (workData.isCheckGP002Personal)
-								{
-									if (PluginData.IsEnabledForGP002Personal(stockMaid.status.personal.uniqueName))
+									if ((stockMaid.status.seikeiken == Seikeiken.Yes_No || stockMaid.status.seikeiken == Seikeiken.Yes_Yes) && condPersonalIds.Contains(stockMaid.status.personal.id) && PluginData.IsEnabledForGP002Personal(stockMaid.status.personal.uniqueName))
 									{
 										list.Add(stockMaid);
 									}
 								}
-								else
+								else if (stockMaid.status.seikeiken == Seikeiken.Yes_Yes && stockMaid.status.relation >= Relation.Lover && condPersonalIds.Contains(stockMaid.status.personal.id))
 								{
-									list.Add(stockMaid);
+									if (workData.isCheckGP002Personal)
+									{
+										if (PluginData.IsEnabledForGP002Personal(stockMaid.status.personal.uniqueName))
+										{
+											list.Add(stockMaid);
+										}
+									}
+									else
+									{
+										list.Add(stockMaid);
+									}
 								}
 							}
 						}
@@ -1109,6 +1113,10 @@ namespace Schedule
 						}
 					}
 				}
+				if ((training.isNewBodyBlock && maid.IsCrcBody) || !training.CheckMainHeroineBodyTypeMatch(maid))
+				{
+					return false;
+				}
 			}
 			return true;
 		}
@@ -1216,6 +1224,10 @@ namespace Schedule
 				{
 					return false;
 				}
+				if ((yotogi.isNewBodyBlock && maid.IsCrcBody) || !yotogi.CheckMainHeroineBodyTypeMatch(maid))
+				{
+					return false;
+				}
 			}
 			return true;
 		}
@@ -1531,7 +1543,18 @@ namespace Schedule
 						return false;
 					}
 				}
-				if (yotogi.pairCondPersonal.Count > 0 && ScheduleAPI.GetNewYotogiHaremPairCandidateList(yotogi, yotogi.pairCondPersonal, maid).Count <= 0)
+				if (yotogi.pairCondPersonal.Count > 0)
+				{
+					if (ScheduleAPI.GetNewYotogiHaremPairCandidateList(yotogi, yotogi.pairCondPersonal, maid).Count <= 0)
+					{
+						return false;
+					}
+				}
+				else if (yotogi.isCheckBodyType && maid.IsCrcBody)
+				{
+					return false;
+				}
+				if ((yotogi.isNewBodyBlock && maid.IsCrcBody) || !yotogi.CheckMainHeroineBodyTypeMatch(maid))
 				{
 					return false;
 				}
@@ -1822,6 +1845,11 @@ namespace Schedule
 						ScheduleAPI.WorkIdReset(maid.status, time);
 					}
 				}
+				if (maid != null && ((work.isNewBodyBlock && maid.IsCrcBody) || !work.CheckMainHeroineBodyTypeMatch(maid)))
+				{
+					ScheduleAPI.WorkIdReset(maid.status, time);
+					GameMain.Instance.FacilityMgr.UpdateFacilityAssignedMaidData();
+				}
 			}
 		}
 
@@ -1831,75 +1859,19 @@ namespace Schedule
 			{
 				bool flag = false;
 				ScheduleCSVData.Training training = ScheduleCSVData.TrainingData[taskId];
-				ScheduleCSVData.TrainingType trainingType = training.trainingType;
-				if (trainingType != ScheduleCSVData.TrainingType.Trainer)
+				switch (training.trainingType)
 				{
-					if (trainingType != ScheduleCSVData.TrainingType.Trainee)
+				case ScheduleCSVData.TrainingType.Basic:
+					if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
 					{
-						if (trainingType == ScheduleCSVData.TrainingType.Travel)
-						{
-							if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
-							{
-								flag = true;
-							}
-							if (!flag && ScheduleCSVData.YotogiData[maid.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Travel)
-							{
-								flag = true;
-							}
-							if (!flag)
-							{
-								int num = 0;
-								while (num < 40 && !flag)
-								{
-									Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(num);
-									if (!(scheduleSlot == maid))
-									{
-										if (scheduleSlot != null && ScheduleCSVData.YotogiData.ContainsKey(scheduleSlot.status.nightWorkId) && ScheduleCSVData.YotogiData[scheduleSlot.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Entertain && ScheduleCSVData.YotogiData[scheduleSlot.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Rest)
-										{
-											flag = true;
-										}
-									}
-									num++;
-								}
-							}
-							if (flag)
-							{
-								ScheduleAPI.EmptyToRandomWork(maid);
-							}
-						}
+						flag = true;
 					}
-					else
+					if (flag)
 					{
-						if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
-						{
-							flag = true;
-						}
-						if (!flag && maid.status.noonWorkId != maid.status.nightWorkId)
-						{
-							flag = true;
-						}
-						if (flag)
-						{
-							ScheduleAPI.WorkIdReset(maid.status, ScheduleMgr.ScheduleTime.DayTime);
-							ScheduleAPI.WorkIdReset(maid.status, ScheduleMgr.ScheduleTime.Night);
-							for (int i = 0; i < 40; i++)
-							{
-								Maid scheduleSlot2 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(i);
-								if (scheduleSlot2 != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot2.status.noonWorkId) && ScheduleCSVData.TrainingData[scheduleSlot2.status.noonWorkId].trainingType == ScheduleCSVData.TrainingType.Trainer)
-								{
-									ScheduleAPI.WorkIdReset(scheduleSlot2.status, ScheduleMgr.ScheduleTime.DayTime);
-									ScheduleAPI.WorkIdReset(scheduleSlot2.status, ScheduleMgr.ScheduleTime.Night);
-									if (care)
-									{
-										ScheduleAPI.EmptyToRandomWork(scheduleSlot2);
-									}
-									break;
-								}
-							}
-						}
+						ScheduleAPI.EmptyToRandomWork(maid);
 					}
-				}
-				else
+					break;
+				case ScheduleCSVData.TrainingType.Trainer:
 				{
 					if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
 					{
@@ -1910,13 +1882,13 @@ namespace Schedule
 						flag = true;
 					}
 					bool flag2 = false;
-					for (int j = 0; j < 40; j++)
+					for (int i = 0; i < 40; i++)
 					{
-						Maid scheduleSlot3 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(j);
-						if (scheduleSlot3 != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot3.status.noonWorkId))
+						Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(i);
+						if (scheduleSlot != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot.status.noonWorkId))
 						{
-							ScheduleCSVData.Training training2 = ScheduleCSVData.TrainingData[scheduleSlot3.status.noonWorkId];
-							if (training2.trainingType == ScheduleCSVData.TrainingType.Trainee && scheduleSlot3.status.noonWorkId == scheduleSlot3.status.nightWorkId)
+							ScheduleCSVData.Training training2 = ScheduleCSVData.TrainingData[scheduleSlot.status.noonWorkId];
+							if (training2.trainingType == ScheduleCSVData.TrainingType.Trainee && scheduleSlot.status.noonWorkId == scheduleSlot.status.nightWorkId)
 							{
 								flag2 = true;
 								break;
@@ -1935,21 +1907,82 @@ namespace Schedule
 						{
 							ScheduleAPI.EmptyToRandomWork(maid);
 						}
+						for (int j = 0; j < 40; j++)
+						{
+							Maid scheduleSlot2 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(j);
+							if (scheduleSlot2 != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot2.status.noonWorkId) && ScheduleCSVData.TrainingData[scheduleSlot2.status.noonWorkId].trainingType == ScheduleCSVData.TrainingType.Trainee)
+							{
+								ScheduleAPI.WorkIdReset(scheduleSlot2.status, ScheduleMgr.ScheduleTime.DayTime);
+								ScheduleAPI.WorkIdReset(scheduleSlot2.status, ScheduleMgr.ScheduleTime.Night);
+								if (care)
+								{
+									ScheduleAPI.EmptyToRandomWork(scheduleSlot2);
+								}
+								break;
+							}
+						}
+					}
+					break;
+				}
+				case ScheduleCSVData.TrainingType.Trainee:
+					if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
+					{
+						flag = true;
+					}
+					if (!flag && maid.status.noonWorkId != maid.status.nightWorkId)
+					{
+						flag = true;
+					}
+					if (flag)
+					{
+						ScheduleAPI.WorkIdReset(maid.status, ScheduleMgr.ScheduleTime.DayTime);
+						ScheduleAPI.WorkIdReset(maid.status, ScheduleMgr.ScheduleTime.Night);
 						for (int k = 0; k < 40; k++)
 						{
-							Maid scheduleSlot4 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(k);
-							if (scheduleSlot4 != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot4.status.noonWorkId) && ScheduleCSVData.TrainingData[scheduleSlot4.status.noonWorkId].trainingType == ScheduleCSVData.TrainingType.Trainee)
+							Maid scheduleSlot3 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(k);
+							if (scheduleSlot3 != null && ScheduleCSVData.TrainingData.ContainsKey(scheduleSlot3.status.noonWorkId) && ScheduleCSVData.TrainingData[scheduleSlot3.status.noonWorkId].trainingType == ScheduleCSVData.TrainingType.Trainer)
 							{
-								ScheduleAPI.WorkIdReset(scheduleSlot4.status, ScheduleMgr.ScheduleTime.DayTime);
-								ScheduleAPI.WorkIdReset(scheduleSlot4.status, ScheduleMgr.ScheduleTime.Night);
+								ScheduleAPI.WorkIdReset(scheduleSlot3.status, ScheduleMgr.ScheduleTime.DayTime);
+								ScheduleAPI.WorkIdReset(scheduleSlot3.status, ScheduleMgr.ScheduleTime.Night);
 								if (care)
 								{
-									ScheduleAPI.EmptyToRandomWork(scheduleSlot4);
+									ScheduleAPI.EmptyToRandomWork(scheduleSlot3);
 								}
 								break;
 							}
 						}
 					}
+					break;
+				case ScheduleCSVData.TrainingType.Travel:
+					if (!flag && !ScheduleAPI.EnableNoonWork(taskId, maid))
+					{
+						flag = true;
+					}
+					if (!flag && ScheduleCSVData.YotogiData[maid.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Travel)
+					{
+						flag = true;
+					}
+					if (!flag)
+					{
+						int num = 0;
+						while (num < 40 && !flag)
+						{
+							Maid scheduleSlot4 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(num);
+							if (!(scheduleSlot4 == maid))
+							{
+								if (scheduleSlot4 != null && ScheduleCSVData.YotogiData.ContainsKey(scheduleSlot4.status.nightWorkId) && ScheduleCSVData.YotogiData[scheduleSlot4.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Entertain && ScheduleCSVData.YotogiData[scheduleSlot4.status.nightWorkId].yotogiType != ScheduleCSVData.YotogiType.Rest)
+								{
+									flag = true;
+								}
+							}
+							num++;
+						}
+					}
+					if (flag)
+					{
+						ScheduleAPI.EmptyToRandomWork(maid);
+					}
+					break;
 				}
 			}
 			else

+ 111 - 2
Assembly-CSharp/Schedule/ScheduleCSVData.cs

@@ -919,6 +919,54 @@ namespace Schedule
 							yotogi.isCheckGP002Personal = (cellAsString19 == "〇" || cellAsString19 == "○");
 						}
 						num++;
+						yotogi.isCheckBodyType = false;
+						if (csv.IsCellToExistData(num, 0) && csv.IsCellToExistData(num, i))
+						{
+							string cellAsString20 = csv.GetCellAsString(num, i);
+							yotogi.isCheckBodyType = (cellAsString20 == "〇" || cellAsString20 == "○");
+						}
+						num++;
+						yotogi.isNewBodyBlock = false;
+						if (csv.IsCellToExistData(num, 0) && csv.IsCellToExistData(num, i))
+						{
+							string cellAsString21 = csv.GetCellAsString(num, i);
+							yotogi.isNewBodyBlock = (cellAsString21 == "〇" || cellAsString21 == "○");
+						}
+						num++;
+						if (csv.IsCellToExistData(num, 0) && csv.IsCellToExistData(num, i))
+						{
+							yotogi.mainHeroineBodyTypeMatchCheckList = new HashSet<string>();
+							string cellAsString22 = csv.GetCellAsString(num, i);
+							foreach (string text in cellAsString22.Split(new char[]
+							{
+								','
+							}))
+							{
+								if (!string.IsNullOrEmpty(text))
+								{
+									string text2 = text.Trim();
+									if (text2 != null)
+									{
+										if (text2 == "無垢" || text2 == "真面目" || text2 == "凜デレ")
+										{
+											yotogi.mainHeroineBodyTypeMatchCheckList.Add(text.Trim());
+											goto IL_C91;
+										}
+									}
+									Debug.LogError(string.Concat(new object[]
+									{
+										"ID[",
+										yotogi.id,
+										"]",
+										yotogi.name,
+										"のメインキャラとのボディ一致チェック項目で不正な文字列が指定されています=>",
+										text.Trim()
+									}));
+								}
+								IL_C91:;
+							}
+						}
+						num++;
 						if (mode == ScheduleCSVData.ScheduleBase.Mode.COM3D)
 						{
 							if (yotogi.yotogiType == ScheduleCSVData.YotogiType.HaveSex)
@@ -932,7 +980,7 @@ namespace Schedule
 						}
 						else if (mode == ScheduleCSVData.ScheduleBase.Mode.CM3D2 && yotogi.yotogiType != ScheduleCSVData.YotogiType.Vip && yotogi.yotogiType != ScheduleCSVData.YotogiType.VipCall)
 						{
-							goto IL_B54;
+							goto IL_D24;
 						}
 						if (yotogi.id > 0)
 						{
@@ -940,7 +988,7 @@ namespace Schedule
 						}
 					}
 				}
-				IL_B54:;
+				IL_D24:;
 			}
 		}
 
@@ -1333,6 +1381,61 @@ namespace Schedule
 				}
 			}
 
+			public bool CheckMainHeroineBodyTypeMatch(Maid maid)
+			{
+				return ScheduleCSVData.ScheduleBase.CheckMainHeroineBodyTypeMatch(this.mainHeroineBodyTypeMatchCheckList, maid);
+			}
+
+			public static bool CheckMainHeroineBodyTypeMatch(HashSet<string> mainHeroineBodyTypeMatchCheckList, Maid maid)
+			{
+				if (maid == null || mainHeroineBodyTypeMatchCheckList == null || mainHeroineBodyTypeMatchCheckList.Count <= 0)
+				{
+					return true;
+				}
+				CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
+				Dictionary<string, Maid> dictionary = new Dictionary<string, Maid>();
+				for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
+				{
+					Maid stockMaid = characterMgr.GetStockMaid(i);
+					if (stockMaid != null && stockMaid.status.mainChara)
+					{
+						string text = string.Empty;
+						int num = stockMaid.status.personal.id;
+						if (num != 80)
+						{
+							if (num != 90)
+							{
+								if (num == 100)
+								{
+									text = "凜デレ";
+								}
+							}
+							else
+							{
+								text = "真面目";
+							}
+						}
+						else
+						{
+							text = "無垢";
+						}
+						if (!string.IsNullOrEmpty(text) && !dictionary.ContainsKey(text))
+						{
+							dictionary.Add(text, stockMaid);
+						}
+					}
+				}
+				foreach (string key in mainHeroineBodyTypeMatchCheckList)
+				{
+					Maid maid2;
+					if (!dictionary.TryGetValue(key, out maid2) || maid2.IsCrcBody != maid.IsCrcBody)
+					{
+						return false;
+					}
+				}
+				return true;
+			}
+
 			public ScheduleCSVData.ScheduleBase.Mode mode = ScheduleCSVData.ScheduleBase.Mode.COM3D;
 
 			public ScheduleTaskCtrl.TaskType type;
@@ -1355,6 +1458,10 @@ namespace Schedule
 
 			public bool disableIfRentalMaid;
 
+			public bool isNewBodyBlock;
+
+			public HashSet<string> mainHeroineBodyTypeMatchCheckList;
+
 			public enum Mode
 			{
 				CM3D2,
@@ -1487,6 +1594,8 @@ namespace Schedule
 
 			public bool isCheckGP002Personal;
 
+			public bool isCheckBodyType;
+
 			public bool netorareFlag;
 
 			public ScheduleCSVData.Yotogi.EasyYotogi easyYotogi;

+ 8 - 0
Assembly-CSharp/Schedule/ScheduleWork.cs

@@ -26,6 +26,14 @@ namespace Schedule
 				{
 					this.visible = false;
 				}
+				if (this.visible && base.maid != null && ScheduleCSVData.WorkData.ContainsKey(base.id))
+				{
+					ScheduleCSVData.Work work2 = ScheduleCSVData.WorkData[base.id];
+					if ((work2.isNewBodyBlock && base.maid.IsCrcBody) || !work2.CheckMainHeroineBodyTypeMatch(base.maid))
+					{
+						this.enabled = false;
+					}
+				}
 			}
 		}
 	}

+ 277 - 0
Assembly-CSharp/Scourt/Utility/Parse.cs

@@ -0,0 +1,277 @@
+using System;
+using UnityEngine;
+
+namespace Scourt.Utility
+{
+	public static class Parse
+	{
+		public static bool TryParse(string text, out Vector2 result, Action<string> errorCallBack = null)
+		{
+			result = Vector2.zero;
+			if (string.IsNullOrEmpty(text))
+			{
+				return false;
+			}
+			text = text.Trim();
+			string[] array = text.Substring(1, text.Length - 2).Split(new char[]
+			{
+				','
+			});
+			bool flag = array.Length != 2;
+			if (!flag)
+			{
+				flag |= !Parse.TryParse(array[0], out result.x, null);
+				flag |= !Parse.TryParse(array[1], out result.y, null);
+			}
+			if (flag)
+			{
+				if (errorCallBack != null)
+				{
+					errorCallBack("Vector2のParseに失敗しました");
+				}
+				return false;
+			}
+			return true;
+		}
+
+		public static bool TryParse(string text, out Vector3 result, Action<string> errorCallBack = null)
+		{
+			result = Vector3.zero;
+			if (string.IsNullOrEmpty(text))
+			{
+				return false;
+			}
+			text = text.Trim();
+			string[] array;
+			if ('0' <= text[0] && text[0] <= '9')
+			{
+				array = text.Split(new char[]
+				{
+					','
+				});
+			}
+			else
+			{
+				array = text.Substring(1, text.Length - 2).Split(new char[]
+				{
+					','
+				});
+			}
+			bool flag = array.Length != 3;
+			if (!flag)
+			{
+				flag |= !Parse.TryParse(array[0], out result.x, null);
+				flag |= !Parse.TryParse(array[1], out result.y, null);
+				flag |= !Parse.TryParse(array[2], out result.z, null);
+			}
+			if (flag)
+			{
+				if (errorCallBack != null)
+				{
+					errorCallBack("Vector3のParseに失敗しました");
+				}
+				return false;
+			}
+			return true;
+		}
+
+		public static bool TryParse(string text, out Vector4 result, Action<string> errorCallBack = null)
+		{
+			result = Vector4.zero;
+			if (string.IsNullOrEmpty(text))
+			{
+				return false;
+			}
+			text = text.Trim();
+			string[] array = text.Substring(1, text.Length - 2).Split(new char[]
+			{
+				','
+			});
+			bool flag = array.Length != 4;
+			if (!flag)
+			{
+				flag |= !Parse.TryParse(array[0], out result.x, null);
+				flag |= !Parse.TryParse(array[1], out result.y, null);
+				flag |= !Parse.TryParse(array[2], out result.z, null);
+				flag |= !Parse.TryParse(array[3], out result.w, null);
+			}
+			if (flag)
+			{
+				if (errorCallBack != null)
+				{
+					errorCallBack("Vector4のParseに失敗しました");
+				}
+				return false;
+			}
+			return true;
+		}
+
+		public static bool TryParse(string text, out Quaternion result, Action<string> errorCallBack = null)
+		{
+			result = Quaternion.identity;
+			if (string.IsNullOrEmpty(text))
+			{
+				return false;
+			}
+			text = text.Trim();
+			string[] array = text.Substring(1, text.Length - 2).Split(new char[]
+			{
+				','
+			});
+			bool flag = array.Length != 4;
+			if (!flag)
+			{
+				float x;
+				flag |= !Parse.TryParse(array[0], out x, null);
+				float y;
+				flag |= !Parse.TryParse(array[1], out y, null);
+				float z;
+				flag |= !Parse.TryParse(array[2], out z, null);
+				float w;
+				flag |= !Parse.TryParse(array[3], out w, null);
+				result = new Quaternion(x, y, z, w);
+			}
+			if (flag)
+			{
+				if (errorCallBack != null)
+				{
+					errorCallBack("QuaternionのParseに失敗しました");
+				}
+				return false;
+			}
+			return true;
+		}
+
+		public static bool TryParse(string text, out Color result, Action<string> errorCallBack = null)
+		{
+			result = Color.black;
+			if (string.IsNullOrEmpty(text))
+			{
+				return false;
+			}
+			text = text.Trim().Replace("RGBA", string.Empty);
+			string[] array = text.Substring(1, text.Length - 2).Split(new char[]
+			{
+				','
+			});
+			bool flag = array.Length != 4;
+			if (!flag)
+			{
+				float r;
+				flag |= !Parse.TryParse(array[0], out r, null);
+				float g;
+				flag |= !Parse.TryParse(array[1], out g, null);
+				float b;
+				flag |= !Parse.TryParse(array[2], out b, null);
+				float a;
+				flag |= !Parse.TryParse(array[3], out a, null);
+				result = new Color(r, g, b, a);
+			}
+			if (flag)
+			{
+				if (errorCallBack != null)
+				{
+					errorCallBack("ColorのParseに失敗しました");
+				}
+				return false;
+			}
+			return true;
+		}
+
+		public static bool TryParse(string text, out byte result, Action<string> errorCallBack = null)
+		{
+			bool flag = byte.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("byteのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse(string text, out int result, Action<string> errorCallBack = null)
+		{
+			bool flag = int.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("intのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse(string text, out uint result, Action<string> errorCallBack = null)
+		{
+			bool flag = uint.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("uintのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse(string text, out float result, Action<string> errorCallBack = null)
+		{
+			bool flag = float.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("floatのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse(string text, out double result, Action<string> errorCallBack = null)
+		{
+			bool flag = double.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("doubleのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse(string text, out long result, Action<string> errorCallBack = null)
+		{
+			bool flag = long.TryParse(text, out result);
+			if (!flag && errorCallBack != null)
+			{
+				errorCallBack("longのParseに失敗しました");
+			}
+			return flag;
+		}
+
+		public static bool TryParse<T>(string text, out T result, Action<string> errorCallBack = null) where T : struct
+		{
+			try
+			{
+				result = (T)((object)Enum.Parse(typeof(T), text));
+				return true;
+			}
+			catch (Exception ex)
+			{
+				if (!string.IsNullOrEmpty(text))
+				{
+					text = text.ToLower();
+					foreach (string text2 in Enum.GetNames(typeof(T)))
+					{
+						if (text == text2.ToLower())
+						{
+							try
+							{
+								result = (T)((object)Enum.Parse(typeof(T), text2));
+								return true;
+							}
+							catch (Exception ex2)
+							{
+							}
+						}
+					}
+				}
+			}
+			result = default(T);
+			if (errorCallBack != null)
+			{
+				errorCallBack(typeof(T).ToString() + "のParseに失敗しました");
+			}
+			return false;
+		}
+	}
+}

+ 225 - 10
Assembly-CSharp/ScriptManager.cs

@@ -220,6 +220,8 @@ public class ScriptManager : IDisposable
 		this.tjs_ = TJSScript.Create(this.file_system);
 		this.tjs_.AddFunction("GetMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncGetMaidMPN));
 		this.tjs_.AddFunction("GetMenuFileNameFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncGetMenuFileNameFromMaidMPN));
+		this.tjs_.AddFunction("IsMenuFileDelFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncIsMenuFileDelFromMaidMPN));
+		this.tjs_.AddFunction("HasItemNameFromMaidMPN", new TJSScript.FunctionCallBack(this.TJSFuncHasItemNameFromMaidMPN));
 		this.tjs_.AddFunction("IsEquipTatoo", new TJSScript.FunctionCallBack(this.TJSFuncIsEquipTatoo));
 		this.tjs_.AddFunction("SetMaidFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetMaidFlag));
 		this.tjs_.AddFunction("SetManFlag", new TJSScript.FunctionCallBack(this.TJSFuncSetManFlag));
@@ -485,9 +487,29 @@ public class ScriptManager : IDisposable
 
 	public void LoadYotogiScript(string file_name, string label_name = "")
 	{
+		if (Time.frameCount == this.asyncCheckPrevFrame)
+		{
+			Debug.LogError(string.Concat(new object[]
+			{
+				"LoadYotogiScript でスクリプトが中断された可能性があります。-> ",
+				this.asyncCheckPrevFileName,
+				" : ",
+				this.asyncCheckPrevFileLine
+			}));
+		}
 		this.yotogi_kag_.enabled = true;
 		this.yotogi_kag_.LoadScriptFile(file_name, string.Empty);
-		this.yotogi_kag_.Exec();
+		bool flag = this.yotogi_kag_.Exec();
+		if (flag)
+		{
+			this.asyncCheckPrevFrame = Time.frameCount;
+			this.asyncCheckPrevFileName = this.yotogi_kag_.kag.GetCurrentFileName();
+			this.asyncCheckPrevFileLine = this.yotogi_kag_.kag.GetCurrentLine();
+		}
+		else
+		{
+			this.asyncCheckPrevFrame = -1;
+		}
 	}
 
 	public void LoadTempScript(string file_name, string label_name = "")
@@ -496,7 +518,7 @@ public class ScriptManager : IDisposable
 		this.tmp_kag_.LoadScriptFile(file_name, label_name);
 	}
 
-	public void LoadMotionScript(int sloat, bool is_next, string file_name, string label_name = "", string maid_guid = "", string man_guid = "", bool face_fix = false, bool valid_pos = true, bool disable_diff_pos = false)
+	public void LoadMotionScript(int sloat, bool is_next, string file_name, string label_name = "", string maid_guid = "", string man_guid = "", bool face_fix = false, bool valid_pos = true, bool disable_diff_pos = false, bool body_mix_ok = false)
 	{
 		if (!string.IsNullOrEmpty(maid_guid))
 		{
@@ -555,6 +577,7 @@ public class ScriptManager : IDisposable
 			mainMaid = maid2;
 		}
 		motionKagManager2.valid_pos = valid_pos;
+		motionKagManager2.isBodyMixOK = body_mix_ok;
 		motionKagManager2.enabled = true;
 		motionKagManager2.ExecForcWaitEvent();
 		motionKagManager2.LoadScriptFile(file_name, label_name);
@@ -660,6 +683,168 @@ public class ScriptManager : IDisposable
 		}
 	}
 
+	private void TJSFuncIsMenuFileDelFromMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
+	{
+		NDebug.Assert(2 == param.Length, "IsMenuFileDelFromMaidMPN args count error.");
+		if (result == null)
+		{
+			return;
+		}
+		TJSVariantRef.Type[] array = new TJSVariantRef.Type[]
+		{
+			TJSVariantRef.Type.tvtInteger,
+			TJSVariantRef.Type.tvtString
+		};
+		for (int i = 0; i < param.Length; i++)
+		{
+			NDebug.Assert(param[i].type == array[i], "TJSFuncIsMenuFileDelFromMaidMPN args[" + i + "] type error.");
+		}
+		int nMaidNo = param[0].AsInteger();
+		string text = param[1].AsString();
+		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
+		MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
+		MaidProp prop = maid.GetProp(mpn);
+		NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
+		if (prop.type == 3)
+		{
+			bool flag;
+			if (!maid.IsCrcBody)
+			{
+				flag = prop.strFileName.ToLower().Contains("_del");
+			}
+			else
+			{
+				flag = prop.strFileName.ToLower().Contains("_del");
+				if (!flag)
+				{
+					Menu.MenuHeader menuHeader = Menu.ReadMenuHeader(prop.strFileName);
+					if (menuHeader != null)
+					{
+						string[] array2 = menuHeader.srcFileName.Split(new char[]
+						{
+							'|'
+						});
+						flag = (array2.Length == 0);
+						if (!flag)
+						{
+							int num = array2.Length;
+							foreach (string text2 in array2)
+							{
+								string text3 = null;
+								string[] array4 = text2.Split(new char[]
+								{
+									':'
+								});
+								if (array4.Length == 1)
+								{
+									text3 = array4[0];
+								}
+								else if (array4.Length == 2)
+								{
+									text3 = array4[1];
+								}
+								if (string.IsNullOrEmpty(text3) || text3.Contains("_del"))
+								{
+									num--;
+								}
+							}
+							if (num == 0)
+							{
+								flag = true;
+							}
+						}
+					}
+				}
+			}
+			result.SetBool(flag);
+		}
+		else
+		{
+			string str = "パーツ系MPNにしか使えません。IsMenuFileDelFromMaidMPN -> ";
+			MPN idx = (MPN)prop.idx;
+			Debug.LogError(str + idx.ToString());
+			result.SetBool(false);
+		}
+	}
+
+	private void TJSFuncHasItemNameFromMaidMPN(TJSVariantRef[] param, TJSVariantRef result)
+	{
+		NDebug.Assert(3 == param.Length, "HasItemNameFromMaidMPN args count error.");
+		if (result == null)
+		{
+			return;
+		}
+		TJSVariantRef.Type[] array = new TJSVariantRef.Type[3];
+		RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.$field-AD6FA4B5EC3AD70674F3E959B5FDF69348B2242D).FieldHandle);
+		TJSVariantRef.Type[] array2 = array;
+		for (int i = 0; i < param.Length; i++)
+		{
+			NDebug.Assert(param[i].type == array2[i], "TJSFuncHasItemNameFromMaidMPN args[" + i + "] type error.");
+		}
+		int nMaidNo = param[0].AsInteger();
+		string text = param[1].AsString();
+		string value = param[2].AsString();
+		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
+		MPN mpn = (MPN)Enum.Parse(typeof(MPN), text);
+		if (maid.IsCrcBody)
+		{
+			if (mpn == MPN.acchat || mpn == MPN.headset)
+			{
+				mpn = MPN.acchead;
+			}
+			else if (mpn == MPN.acckubiwa)
+			{
+				mpn = MPN.acckubi;
+			}
+		}
+		MaidProp prop = maid.GetProp(mpn);
+		NDebug.Assert(prop != null, "[" + text + "] 指定MPNが不正です。");
+		if (prop.type == 3)
+		{
+			if (string.IsNullOrEmpty(prop.strFileName))
+			{
+				result.SetBool(false);
+				return;
+			}
+			Menu.MenuHeader menuHeader = Menu.ReadMenuHeader(prop.strFileName);
+			if (menuHeader != null)
+			{
+				string[] array3 = menuHeader.itemName.Split(new char[]
+				{
+					'|'
+				});
+				foreach (string text2 in array3)
+				{
+					string text3 = null;
+					string[] array5 = text2.Split(new char[]
+					{
+						':'
+					});
+					if (array5.Length == 1)
+					{
+						text3 = array5[0];
+					}
+					else if (array5.Length == 2)
+					{
+						text3 = array5[1];
+					}
+					if (!string.IsNullOrEmpty(text3) && text3.Contains(value))
+					{
+						result.SetBool(true);
+						return;
+					}
+				}
+			}
+		}
+		else
+		{
+			string str = "パーツ系MPNにしか使えません。HasItemNameFromMaidMPN -> ";
+			MPN idx = (MPN)prop.idx;
+			Debug.LogError(str + idx.ToString());
+		}
+		result.SetBool(false);
+	}
+
 	private void TJSFuncIsEquipTatoo(TJSVariantRef[] param, TJSVariantRef result)
 	{
 		NDebug.Assert(1 == param.Length, "IsEquipTatoo args count error.");
@@ -678,6 +863,11 @@ public class ScriptManager : IDisposable
 		int nMaidNo = param[0].AsInteger();
 		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(nMaidNo);
 		MaidProp prop = maid.GetProp(MPN.acctatoo);
+		if (maid.IsCrcBody && !string.IsNullOrEmpty(prop.strFileName) && prop.strFileName.Contains("crc_acctatoo_use_dummy"))
+		{
+			result.SetBool(true);
+			return;
+		}
 		result.SetBool(false);
 		if (prop != null && prop.listSubProp != null)
 		{
@@ -1271,7 +1461,7 @@ public class ScriptManager : IDisposable
 		if (text == "pre_maid_secretary")
 		{
 			CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoadFromResources(text);
-			GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest);
+			GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest, false);
 		}
 		else
 		{
@@ -1293,7 +1483,7 @@ public class ScriptManager : IDisposable
 			using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(array), Encoding.UTF8))
 			{
 				CharacterMgr.Preset f_prest2 = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, text);
-				GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest2);
+				GameMain.Instance.CharacterMgr.PresetSet(maid, f_prest2, false);
 			}
 			array = null;
 		}
@@ -3291,11 +3481,6 @@ public class ScriptManager : IDisposable
 		ScoutManager.Instance.CancelScout(maid);
 	}
 
-	public void TJSFuncIsCRCBody(TJSVariantRef[] tjs_param, TJSVariantRef result)
-	{
-		result.SetBool(false);
-	}
-
 	public void TJSFuncGetRemainingDanceTime(TJSVariantRef[] tjs_param, TJSVariantRef result)
 	{
 		if (result == null)
@@ -3348,6 +3533,30 @@ public class ScriptManager : IDisposable
 		YotogiStageSelectManager.SelectStage(data, isDayTime);
 	}
 
+	public void TJSFuncIsCRCBody(TJSVariantRef[] tjs_param, TJSVariantRef result)
+	{
+		NDebug.Assert(tjs_param.Length == 2, "IsCRCBody:引数が2つである必要があります");
+		string text = tjs_param[0].AsString();
+		int num = tjs_param[1].AsInteger();
+		if (text != null)
+		{
+			if (text == "man")
+			{
+				Maid man = GameMain.Instance.CharacterMgr.GetMan(num);
+				result.SetBool(man != null && man.body0.IsCrcBody);
+				return;
+			}
+			if (text == "maid")
+			{
+				Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
+				result.SetBool(maid != null && maid.body0.IsCrcBody);
+				return;
+			}
+		}
+		NDebug.Assert("IsCRCBody:キャラの指定が不正です:" + text, false);
+		result.SetBool(false);
+	}
+
 	public void OnReturnEvent(string fileName, int line)
 	{
 		if (this.compatibilityMode)
@@ -3419,7 +3628,7 @@ public class ScriptManager : IDisposable
 	public void Serialize(BinaryWriter binary)
 	{
 		binary.Write("CM3D2_SCRIPT");
-		binary.Write(1550);
+		binary.Write(1570);
 		this.adv_kag_.Serialize(binary);
 	}
 
@@ -3542,6 +3751,12 @@ public class ScriptManager : IDisposable
 		}
 	}
 
+	private int asyncCheckPrevFrame = -1;
+
+	private string asyncCheckPrevFileName;
+
+	private int asyncCheckPrevFileLine;
+
 	private TJSScript tjs_;
 
 	private Dictionary<int, MotionKagManager> kag_mot_dic_ = new Dictionary<int, MotionKagManager>();

+ 82 - 0
Assembly-CSharp/ShoulderThighIKCtrl.cs

@@ -0,0 +1,82 @@
+using System;
+using RootMotion.FinalIK;
+using UnityEngine;
+
+[Serializable]
+public class ShoulderThighIKCtrl : ALimbIKCtrl
+{
+	public ShoulderThighIKCtrl(IKEffector root_effector, FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKMgr ik_ctrl, FullBodyIKMgr.IKEffectorType effector_type) : base(ik_ctrl, chain, ik_mapping, effector_type)
+	{
+		this.effector = root_effector;
+		this.effector.target = base.constraintTarget;
+		base.isUpperBody = (effector_type == FullBodyIKMgr.IKEffectorType.UpperArm_L || effector_type == FullBodyIKMgr.IKEffectorType.UpperArm_R);
+	}
+
+	public override bool isLeft
+	{
+		get
+		{
+			return this.effectorType == FullBodyIKMgr.IKEffectorType.UpperArm_L || this.effectorType == FullBodyIKMgr.IKEffectorType.Thigh_L;
+		}
+	}
+
+	public override ALimbIKCtrl pairIK
+	{
+		get
+		{
+			FullBodyIKMgr.IKEffectorType effector_type;
+			if (base.isUpperBody)
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.UpperArm_L : FullBodyIKMgr.IKEffectorType.UpperArm_R);
+			}
+			else
+			{
+				effector_type = ((!this.isLeft) ? FullBodyIKMgr.IKEffectorType.Thigh_L : FullBodyIKMgr.IKEffectorType.Thigh_R);
+			}
+			return this.myIKMgr.GetIKCtrl<ALimbIKCtrl>(effector_type);
+		}
+	}
+
+	public ElbowKneeIKCtrl elbowKneeCtrl { get; private set; }
+
+	public HandFootIKCtrl handFootCtrl { get; private set; }
+
+	public void SetChain(HandFootIKCtrl handfoot_data, ElbowKneeIKCtrl elbowknee_data)
+	{
+		this.handFootCtrl = handfoot_data;
+		this.elbowKneeCtrl = elbowknee_data;
+		this.ChainChildCtrl = elbowknee_data;
+	}
+
+	public override void ApplyIKSetting()
+	{
+		this.BackLocalPos = base.bone.localPosition;
+		base.ApplyIKSetting();
+	}
+
+	public override void OnPostIKUpdate()
+	{
+		base.OnPostIKUpdate();
+		base.bone.localPosition = this.BackLocalPos;
+	}
+
+	protected override void OnPostSetPositionWeight(float val)
+	{
+		if (this.IsPullBody)
+		{
+			this.effector.positionWeight = val;
+		}
+	}
+
+	protected override void OnPostSetRotationWeight(float val)
+	{
+		if (this.IsPullBody)
+		{
+			this.effector.rotationWeight = val;
+		}
+	}
+
+	public readonly IKEffector effector;
+
+	private Vector3 BackLocalPos = Vector3.zero;
+}

+ 0 - 95
Assembly-CSharp/ShoulderThighIKData.cs

@@ -1,95 +0,0 @@
-using System;
-using RootMotion.FinalIK;
-using UnityEngine;
-
-[Serializable]
-public class ShoulderThighIKData : LimbIKData
-{
-	public ShoulderThighIKData(IKEffector root_effector, FBIKChain chain, IKMappingLimb ik_mapping, FullBodyIKCtrl ik_ctrl, Transform tgt_bone) : base(ik_ctrl, chain, ik_mapping, tgt_bone, false)
-	{
-		this.Effector = root_effector;
-		this.Effector.target = base.IKTarget;
-		this.m_IsUpperBody = (this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_L) || this.TargetBone == this.MyIKCtrl.GetIKBone(FullBodyIKCtrl.IKBoneType.UpperArm_R));
-		this.m_ForceIKEnable = true;
-	}
-
-	public ElbowKneeIKData ElbowKneeData
-	{
-		get
-		{
-			return this.m_ElbowKneeData;
-		}
-	}
-
-	public HandFootIKData HandFootData
-	{
-		get
-		{
-			return this.m_HandFootData;
-		}
-	}
-
-	protected override void SetTargetTransform(IKCtrlData.IKSettingData data, Vector3 pos, Quaternion rot)
-	{
-		base.SetTargetTransform(data, pos, rot);
-		Transform iktarget = this.m_HandFootData.IKTarget;
-		Transform iktarget2 = this.m_ElbowKneeData.IKTarget;
-		Vector3 position = this.TargetBone.InverseTransformPoint(this.m_ElbowKneeData.TargetBone.position);
-		Vector3 position2 = this.m_ElbowKneeData.TargetBone.InverseTransformPoint(this.m_HandFootData.TargetBone.position);
-		if (!data.IsPointAttach)
-		{
-			if (!this.m_ElbowKneeData.GetIKSettingData(IKCtrlData.IKAttachType.Rotate).IsIKExec)
-			{
-				iktarget2.rotation = base.IKTarget.rotation * this.m_ElbowKneeData.TargetBone.localRotation;
-			}
-			if (!this.m_HandFootData.GetIKSettingData(IKCtrlData.IKAttachType.Rotate).IsIKExec)
-			{
-				iktarget.rotation = iktarget2.rotation * this.m_HandFootData.TargetBone.localRotation;
-			}
-		}
-		if (!this.m_ElbowKneeData.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).IsIKExec)
-		{
-			iktarget2.position = base.IKTarget.TransformPoint(position);
-		}
-		if (!this.m_HandFootData.GetIKSettingData(IKCtrlData.IKAttachType.NewPoint).IsIKExec)
-		{
-			iktarget.position = iktarget2.TransformPoint(position2);
-		}
-	}
-
-	public void SetChainData(HandFootIKData handfoot_data, ElbowKneeIKData elbowknee_data)
-	{
-		this.m_HandFootData = handfoot_data;
-		this.m_ElbowKneeData = elbowknee_data;
-	}
-
-	protected override void OnPostSetPositionWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.Effector.positionWeight = val;
-		}
-	}
-
-	protected override void OnPostSetRotationWeight(float val)
-	{
-		if (this.m_IsPullBody)
-		{
-			this.Effector.rotationWeight = val;
-		}
-	}
-
-	public override void Update()
-	{
-		if (!this.m_IsPullBody && base.RotateIK.IsIKExec)
-		{
-			this.TargetBone.rotation = Quaternion.Lerp(this.TargetBone.rotation, base.IKTarget.rotation, base.RotationWeight);
-		}
-	}
-
-	public readonly IKEffector Effector;
-
-	private ElbowKneeIKData m_ElbowKneeData;
-
-	private HandFootIKData m_HandFootData;
-}

+ 86 - 0
Assembly-CSharp/ShoulderTwist.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ShoulderTwist : ATwistCtrl
+{
+	public ShoulderTwist(bool is_left, TBody body) : base((!is_left) ? Maid.AutoTwist.ShoulderR : Maid.AutoTwist.ShoulderL, body)
+	{
+		string str;
+		if (body.IsCrcBody)
+		{
+			str = "Bip01";
+		}
+		else
+		{
+			str = (body.boMAN ? "ManBip" : "Bip01");
+		}
+		string str2 = (!is_left) ? " R UpperArm" : " L UpperArm";
+		base.bone = body.GetBone(str + str2);
+		base.mrBone = base.GetMRBone(str + str2);
+		if (body.IsCrcBody)
+		{
+			for (int i = 0; i < 5; i++)
+			{
+				string name = (!is_left) ? string.Format("UpperTwist{0}_R", i + 1) : string.Format("UpperTwist{0}_L", i + 1);
+				Transform transform = base.bone.Find(name);
+				if (transform)
+				{
+					Transform transform2 = base.mrBone.Find(name);
+					if (transform2)
+					{
+						base.twistBones.Add(new KeyValuePair<Transform, Transform>(transform2, transform));
+					}
+				}
+			}
+			string text = (!is_left) ? "Kata_R" : "Kata_L";
+			Transform bone = body.GetBone(text);
+			Transform mrbone = base.GetMRBone(text);
+			if (bone && mrbone)
+			{
+				this.KataPair = new KeyValuePair<Transform, Transform>(mrbone, bone);
+			}
+		}
+	}
+
+	public void SetCalcMode(ShoulderTwist.CalcType calc_mode)
+	{
+		this.TwistCalcType = calc_mode;
+	}
+
+	public override void ApplyTwist()
+	{
+		Quaternion quaternion = base.bone.parent.rotation;
+		quaternion = Quaternion.FromToRotation(quaternion * Vector3.right, base.bone.rotation * Vector3.right) * quaternion;
+		for (int i = 0; i < base.twistBones.Count; i++)
+		{
+			KeyValuePair<Transform, Transform> keyValuePair = base.twistBones[i];
+			float t = (float)(i + 1) / (float)base.twistBones.Count;
+			keyValuePair.Value.rotation = Quaternion.Lerp(quaternion, base.bone.rotation, t);
+		}
+		if (base.twistBones.Count > 0 && this.KataPair.Key && this.KataPair.Value)
+		{
+			if (this.TwistCalcType == ShoulderTwist.CalcType.Normal)
+			{
+				this.KataPair.Value.localRotation = this.KataPair.Key.localRotation;
+				this.KataPair.Value.rotation = Quaternion.Lerp(this.KataPair.Value.rotation, base.twistBones[0].Value.rotation, 0.5f);
+			}
+			else
+			{
+				this.KataPair.Value.rotation = Quaternion.Lerp(quaternion, base.twistBones[0].Value.rotation, 0.5f);
+			}
+		}
+	}
+
+	private KeyValuePair<Transform, Transform> KataPair;
+
+	private const float KATA_BLEND_VAL = 0.5f;
+
+	private ShoulderTwist.CalcType TwistCalcType;
+
+	public enum CalcType
+	{
+		Normal,
+		Behind
+	}
+}

+ 141 - 0
Assembly-CSharp/SkinThickness.cs

@@ -0,0 +1,141 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+public class SkinThickness
+{
+	public void Serialize(BinaryWriter bw)
+	{
+		bw.Write("SkinThickness");
+		bw.Write(SkinThickness.VER);
+		bw.Write(this.use);
+		bw.Write(this.groups.Count);
+		foreach (KeyValuePair<string, SkinThickness.Group> keyValuePair in this.groups)
+		{
+			bw.Write(keyValuePair.Key);
+			keyValuePair.Value.Serialize(bw);
+		}
+	}
+
+	public void Deserialize(BinaryReader br)
+	{
+		this.groups = new Dictionary<string, SkinThickness.Group>();
+		string a = br.ReadString();
+		NDebug.Assert(a == "SkinThickness", "表皮までの距離ファイル破損。");
+		int num = br.ReadInt32();
+		this.use = br.ReadBoolean();
+		int num2 = br.ReadInt32();
+		for (int i = 0; i < num2; i++)
+		{
+			string key = br.ReadString();
+			SkinThickness.Group group = new SkinThickness.Group();
+			group.Deserialize(br);
+			this.groups.Add(key, group);
+		}
+	}
+
+	public bool use;
+
+	public Dictionary<string, SkinThickness.Group> groups;
+
+	private static readonly int VER = 100;
+
+	public class Group
+	{
+		public void Serialize(BinaryWriter bw)
+		{
+			bw.Write(this.groupName);
+			bw.Write(this.startBoneName);
+			bw.Write(this.endBoneName);
+			bw.Write(this.stepAngleDgree);
+			bw.Write(this.points.Count);
+			for (int i = 0; i < this.points.Count; i++)
+			{
+				this.points[i].Serialize(bw);
+			}
+		}
+
+		public void Deserialize(BinaryReader br)
+		{
+			this.points = new List<SkinThickness.Group.Point>();
+			this.groupName = br.ReadString();
+			this.startBoneName = br.ReadString();
+			this.endBoneName = br.ReadString();
+			this.stepAngleDgree = br.ReadInt32();
+			int num = br.ReadInt32();
+			for (int i = 0; i < num; i++)
+			{
+				SkinThickness.Group.Point point = new SkinThickness.Group.Point();
+				point.Deserialize(br);
+				this.points.Add(point);
+			}
+		}
+
+		public string groupName;
+
+		public string startBoneName;
+
+		public string endBoneName;
+
+		public int stepAngleDgree;
+
+		public List<SkinThickness.Group.Point> points;
+
+		public class Point
+		{
+			public void Serialize(BinaryWriter bw)
+			{
+				bw.Write(this.targetBoneName);
+				bw.Write(this.ratioSegmentStartToEnd);
+				bw.Write(this.distanceParAngle.Count);
+				for (int i = 0; i < this.distanceParAngle.Count; i++)
+				{
+					this.distanceParAngle[i].Serialize(bw);
+				}
+			}
+
+			public void Deserialize(BinaryReader br)
+			{
+				this.distanceParAngle = new List<SkinThickness.Group.Point.DefPerAngle>();
+				this.targetBoneName = br.ReadString();
+				this.ratioSegmentStartToEnd = br.ReadSingle();
+				int num = br.ReadInt32();
+				for (int i = 0; i < num; i++)
+				{
+					SkinThickness.Group.Point.DefPerAngle defPerAngle = new SkinThickness.Group.Point.DefPerAngle();
+					defPerAngle.Deserialize(br);
+					this.distanceParAngle.Add(defPerAngle);
+				}
+			}
+
+			public string targetBoneName;
+
+			public float ratioSegmentStartToEnd;
+
+			public List<SkinThickness.Group.Point.DefPerAngle> distanceParAngle;
+
+			public class DefPerAngle
+			{
+				public void Serialize(BinaryWriter bw)
+				{
+					bw.Write(this.angleDgree);
+					bw.Write(this.vidx);
+					bw.Write(this.defaultDistance);
+				}
+
+				public void Deserialize(BinaryReader br)
+				{
+					this.angleDgree = br.ReadInt32();
+					this.vidx = br.ReadInt32();
+					this.defaultDistance = br.ReadSingle();
+				}
+
+				public int angleDgree;
+
+				public int vidx;
+
+				public float defaultDistance;
+			}
+		}
+	}
+}

+ 4 - 0
Assembly-CSharp/SpinBoxButton.cs

@@ -15,6 +15,10 @@ public class SpinBoxButton : MonoBehaviour
 		{
 			this.maxMaidPoint = SceneEdit.Instance.maidPoint;
 		}
+		if (BaseMgr<ProfileMgr>.Instance.m_maidStatus != null && SceneEdit.storageFlg && this.maxMaidPoint != GameMain.Instance.CharacterMgr.status.maidPoint)
+		{
+			this.maxMaidPoint = GameMain.Instance.CharacterMgr.status.maidPoint;
+		}
 		this.m_myUiButton = base.gameObject.GetComponent<UIButton>();
 		this.activeColor = new Color(this.m_myUiButton.defaultColor.r, this.m_myUiButton.defaultColor.g, this.m_myUiButton.defaultColor.b, 1f);
 		this.inActiveColor = this.m_myUiButton.defaultColor;

+ 28 - 14
Assembly-CSharp/SystemShortcut.cs

@@ -29,8 +29,9 @@ public class SystemShortcut : MonoBehaviour
 		this.m_aryDgOnClick[7] = new EventDelegate(new EventDelegate.Callback(this.OnClick_VRCommHome));
 		this.m_aryDgOnClick[8] = new EventDelegate(new EventDelegate.Callback(this.OnClick_VRHelp));
 		this.m_aryDgOnClick[9] = new EventDelegate(new EventDelegate.Callback(this.OnClick_Help));
-		this.m_aryDgOnClick[10] = new EventDelegate(new EventDelegate.Callback(this.OnClick_VRAvatar));
-		this.m_aryDgOnClick[11] = new EventDelegate(new EventDelegate.Callback(this.OnClickDictionary));
+		this.m_aryDgOnClick[10] = new EventDelegate(new EventDelegate.Callback(this.OnClick_Gp003Help));
+		this.m_aryDgOnClick[11] = new EventDelegate(new EventDelegate.Callback(this.OnClick_VRAvatar));
+		this.m_aryDgOnClick[12] = new EventDelegate(new EventDelegate.Callback(this.OnClickDictionary));
 		Dictionary<int, string> dictionary = new Dictionary<int, string>();
 		dictionary.Add(0, "System/ショートカット/コンフィグ");
 		dictionary.Add(3, "System/ショートカット/UI無し スクリーンショット");
@@ -49,8 +50,9 @@ public class SystemShortcut : MonoBehaviour
 		dictionary.Add(7, "System/ショートカット/エンパイアクラブに帰る");
 		dictionary.Add(8, "System/ショートカット/VRヘルプ");
 		dictionary.Add(9, "System/ショートカット/シーンのヘルプ");
-		dictionary.Add(10, "System/ショートカット/バーチャル アバター スタジオ");
-		dictionary.Add(11, "System/ショートカット/辞書");
+		dictionary.Add(10, "System/ショートカット/GP003ヘルプ");
+		dictionary.Add(11, "System/ショートカット/バーチャル アバター スタジオ");
+		dictionary.Add(12, "System/ショートカット/辞書");
 		for (int i = 0; i < this.m_aryObjPath.Length; i++)
 		{
 			this.m_goBtn[i] = UTY.GetChildObject(base.gameObject, this.m_aryObjPath[i], false);
@@ -87,7 +89,7 @@ public class SystemShortcut : MonoBehaviour
 		int num = 0;
 		if (Product.isJapan)
 		{
-			GameObject childObject = UTY.GetChildObject(base.gameObject, this.m_aryObjPath[11], false);
+			GameObject childObject = UTY.GetChildObject(base.gameObject, this.m_aryObjPath[12], false);
 			if (childObject != null)
 			{
 				childObject.SetActive(false);
@@ -105,7 +107,12 @@ public class SystemShortcut : MonoBehaviour
 			childObject2.SetActive(false);
 			num++;
 		}
-		this.m_uiBase.width = 420 - num * 40;
+		if (!PluginData.IsEnabled("GP003"))
+		{
+			UTY.GetChildObject(base.gameObject, this.m_aryObjPath[10], false).SetActive(false);
+			num++;
+		}
+		this.m_uiBase.width = 460 - num * 40;
 		UTY.GetChildObject(this.m_goBase, "Grid", false).GetComponent<UIGrid>().repositionNow = true;
 		SceneManager.activeSceneChanged += this.OnActiveSceneChanged;
 		SceneManager.sceneUnloaded += this.OnSceneUnloaded;
@@ -363,6 +370,11 @@ public class SystemShortcut : MonoBehaviour
 		this.BaseClose();
 	}
 
+	private void OnClick_Gp003Help()
+	{
+		Application.OpenURL("http://cr-edit.jp/com3d2/manual");
+	}
+
 	private void OnClick_VRAvatar()
 	{
 		ControllerShortcutWindow controllerShortcutWindow = OvrIK.CreateUI();
@@ -426,11 +438,11 @@ public class SystemShortcut : MonoBehaviour
 			this.m_uiPanel.alpha = 0f;
 		}
 		this.SetVRAvatarButtonInteractable();
-		Vector2 vector = new Vector2(700f, (float)((!this.m_goBtn[10].activeSelf) ? 20 : 110));
+		Vector2 vector = new Vector2(700f, (float)((!this.m_goBtn[11].activeSelf) ? 20 : 110));
 		this.m_hitArea.size = new Vector3((float)this.m_uiBase.width + vector.x, (float)this.m_uiBase.height + vector.y, 0f);
 		Vector3 center = this.m_uiBase.GetComponent<BoxCollider>().center;
 		center.x = -190f + vector.x / 2f;
-		center.y = (float)((!this.m_goBtn[10].activeSelf) ? -5 : -50);
+		center.y = (float)((!this.m_goBtn[11].activeSelf) ? -5 : -50);
 		this.m_hitArea.center = center;
 	}
 
@@ -507,11 +519,11 @@ public class SystemShortcut : MonoBehaviour
 		this.SetHelpButtonInteractable();
 		uGUITutorialPanel.CloseTutorial(true, false);
 		this.SetVRAvatarButtonInteractable();
-		Vector2 vector = new Vector2(700f, (float)((!this.m_goBtn[10].activeSelf) ? 20 : 110));
+		Vector2 vector = new Vector2(700f, (float)((!this.m_goBtn[11].activeSelf) ? 20 : 110));
 		this.m_hitArea.size = new Vector3((float)this.m_uiBase.width + vector.x, (float)this.m_uiBase.height + vector.y, 0f);
 		Vector3 center = this.m_uiBase.GetComponent<BoxCollider>().center;
 		center.x = -190f + vector.x / 2f;
-		center.y = (float)((!this.m_goBtn[10].activeSelf) ? -5 : -50);
+		center.y = (float)((!this.m_goBtn[11].activeSelf) ? -5 : -50);
 		this.m_hitArea.center = center;
 	}
 
@@ -590,7 +602,7 @@ public class SystemShortcut : MonoBehaviour
 
 	private void SetVRAvatarButtonInteractable()
 	{
-		GameObject childObject = UTY.GetChildObject(base.gameObject, this.m_aryObjPath[10], false);
+		GameObject childObject = UTY.GetChildObject(base.gameObject, this.m_aryObjPath[11], false);
 		NDebug.Assert(childObject != null, "VRアバターボタンの取得に失敗しました。");
 		if (GameMain.Instance == null)
 		{
@@ -625,6 +637,7 @@ public class SystemShortcut : MonoBehaviour
 		"BaseVR/Grid/VRCommHome",
 		"BaseVR/Grid/VRHelp",
 		"Base/Grid/Help",
+		"Base/Grid/GP003Help",
 		"Base/VR Avatar",
 		"Base/Grid/Dic"
 	};
@@ -645,9 +658,9 @@ public class SystemShortcut : MonoBehaviour
 
 	private UIButton m_uiGear;
 
-	private GameObject[] m_goBtn = new GameObject[12];
+	private GameObject[] m_goBtn = new GameObject[13];
 
-	private UIButton[] m_uiBtn = new UIButton[12];
+	private UIButton[] m_uiBtn = new UIButton[13];
 
 	private Camera m_uiCam;
 
@@ -661,7 +674,7 @@ public class SystemShortcut : MonoBehaviour
 
 	private Dictionary<SystemShortcut.BGSizeType, int> dicBGSizeType = new Dictionary<SystemShortcut.BGSizeType, int>();
 
-	private EventDelegate[] m_aryDgOnClick = new EventDelegate[12];
+	private EventDelegate[] m_aryDgOnClick = new EventDelegate[13];
 
 	private bool m_bAlways = true;
 
@@ -681,6 +694,7 @@ public class SystemShortcut : MonoBehaviour
 		VRCommHome,
 		VRHelp,
 		Help,
+		GP003Help,
 		VRAvatar,
 		Dic,
 		Max

+ 6 - 0
Assembly-CSharp/TAttachPoint.cs

@@ -18,4 +18,10 @@ public class TAttachPoint
 	public bool bEditable;
 
 	public BoneWeight bw;
+
+	public bool newAttachPoint;
+
+	public TBodySkin newAttachChild;
+
+	public int[] newAttachVidx = new int[3];
 }

File diff suppressed because it is too large
+ 2498 - 512
Assembly-CSharp/TBody.cs


+ 4 - 0
Assembly-CSharp/TBodyHit.cs

@@ -80,6 +80,10 @@ public class TBodyHit
 		MemoryStream input = null;
 		using (AFileBase afileBase = GameUty.FileOpen(FileName, null))
 		{
+			if (afileBase == null || !afileBase.IsValid())
+			{
+				return;
+			}
 			input = new MemoryStream(afileBase.ReadAll());
 		}
 		BinaryReader binaryReader = new BinaryReader(input);

File diff suppressed because it is too large
+ 802 - 59
Assembly-CSharp/TBodySkin.cs


+ 64 - 30
Assembly-CSharp/TMorph.cs

@@ -6,6 +6,10 @@ using UnityEngine;
 
 public class TMorph
 {
+	public TMorph()
+	{
+	}
+
 	public TMorph(TBodySkin bs)
 	{
 		this.bodyskin = bs;
@@ -59,7 +63,7 @@ public class TMorph
 		this.DeleteObj();
 	}
 
-	public BlendData this[string tag]
+	public virtual BlendData this[string tag]
 	{
 		get
 		{
@@ -68,24 +72,24 @@ public class TMorph
 		}
 	}
 
-	public bool Contains(string name)
+	public virtual bool Contains(string name)
 	{
 		return this.hash.ContainsKey(name);
 	}
 
-	public float GetBlendValues(int f_nIdx)
+	public virtual float GetBlendValues(int f_nIdx)
 	{
 		return this.BlendValues[f_nIdx];
 	}
 
-	public void SetBlendValues(int f_nIdx, float f_fValue)
+	public virtual void SetBlendValues(int f_nIdx, float f_fValue)
 	{
 		float[] blendValuesBackup = this.BlendValuesBackup;
 		this.BlendValues[f_nIdx] = f_fValue;
 		blendValuesBackup[f_nIdx] = f_fValue;
 	}
 
-	public void DeleteObj()
+	public virtual void DeleteObj()
 	{
 		this.bodyskin = null;
 		this.m_mesh = null;
@@ -97,7 +101,7 @@ public class TMorph
 		this.m_bws = null;
 	}
 
-	public unsafe void InitGameObject(GameObject o)
+	public unsafe virtual void InitGameObject(GameObject o)
 	{
 		SkinnedMeshRenderer skinnedMeshRenderer = null;
 		List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>(3);
@@ -158,7 +162,6 @@ public class TMorph
 				flag |= ((idx.idxUpR = ((!this.hash.ContainsKey("eyeeditr" + no + "_up")) ? -1 : ((int)this.hash["eyeeditr" + no + "_up"]))) == -1);
 				if (flag)
 				{
-					Debug.LogError("not fund shape key name");
 					return;
 				}
 				idx.exec = delegate(float rateL, float rateR)
@@ -354,7 +357,7 @@ public class TMorph
 		this.m_bDut = false;
 	}
 
-	public void ClearAllVisibleFlag(bool boSetFlag)
+	public virtual void ClearAllVisibleFlag(bool boSetFlag)
 	{
 		for (int i = 0; i < this.BoneCount; i++)
 		{
@@ -366,7 +369,7 @@ public class TMorph
 		}
 	}
 
-	public void SetVisibleFlag1(int idx, bool flag)
+	public virtual void SetVisibleFlag1(int idx, bool flag)
 	{
 		if (this.BoneVisible[idx] != flag)
 		{
@@ -407,7 +410,7 @@ public class TMorph
 		}
 	}
 
-	public void FixVisibleFlag()
+	public virtual void FixVisibleFlag()
 	{
 		if (this.smr_src == null)
 		{
@@ -466,7 +469,7 @@ public class TMorph
 		this.m_bDut = false;
 	}
 
-	public void LoadMoprhData2(BinaryReader r)
+	public virtual void LoadMoprhData2(BinaryReader r, int ver)
 	{
 		string text = r.ReadString();
 		int count = this.BlendDatas.Count;
@@ -477,6 +480,15 @@ public class TMorph
 		blendData.vert = new Vector3[num];
 		blendData.norm = new Vector3[num];
 		blendData.v_index = new int[num];
+		bool flag = false;
+		if (2102 <= ver)
+		{
+			flag = r.ReadBoolean();
+		}
+		if (flag)
+		{
+			blendData.tans = new Vector4[num];
+		}
 		for (int i = 0; i < num; i++)
 		{
 			blendData.v_index[i] = (int)r.ReadUInt16();
@@ -486,6 +498,13 @@ public class TMorph
 			blendData.norm[i].x = r.ReadSingle();
 			blendData.norm[i].y = r.ReadSingle();
 			blendData.norm[i].z = r.ReadSingle();
+			if (flag)
+			{
+				blendData.tans[i].x = r.ReadSingle();
+				blendData.tans[i].y = r.ReadSingle();
+				blendData.tans[i].z = r.ReadSingle();
+				blendData.tans[i].w = r.ReadSingle();
+			}
 		}
 		this.MorphCount++;
 		this.BlendDatas.Add(blendData);
@@ -495,7 +514,7 @@ public class TMorph
 		this.BlendValuesCHK = new float[this.MorphCount + 1];
 	}
 
-	public void NewBlendSet(string BlendSetName)
+	public virtual void NewBlendSet(string BlendSetName)
 	{
 		float[] array = new float[this.hash.Count];
 		for (int i = 0; i < array.Length; i++)
@@ -521,6 +540,11 @@ public class TMorph
 
 	public void SetValueOriginalBlendSet(TMorph.AddBlendType add_blend_type_flag)
 	{
+		this.SetBlendSetValueOriginal(add_blend_type_flag);
+	}
+
+	public virtual void SetBlendSetValueOriginal(TMorph.AddBlendType add_blend_type_flag)
+	{
 		float[] array = this.dicBlendSet["オリジナル"];
 		array[(int)this.hash["hohol"]] = (array[(int)this.hash["hoho"]] = (array[(int)this.hash["hohos"]] = 0f));
 		if ((add_blend_type_flag & TMorph.AddBlendType.Cheek3) == TMorph.AddBlendType.Cheek3)
@@ -554,7 +578,7 @@ public class TMorph
 		array[(int)this.hash["shock"]] = (float)(((add_blend_type_flag & TMorph.AddBlendType.Shock) != TMorph.AddBlendType.Shock) ? 0 : 1);
 	}
 
-	public void SetValueBlendSet(string BlendSetName, string tag, float val)
+	public virtual void SetValueBlendSet(string BlendSetName, string tag, float val)
 	{
 		if (tag == "hoho2")
 		{
@@ -616,7 +640,7 @@ public class TMorph
 		}
 	}
 
-	public void ClearBlendValues()
+	public virtual void ClearBlendValues()
 	{
 		for (int i = 0; i < this.MorphCount; i++)
 		{
@@ -626,6 +650,11 @@ public class TMorph
 
 	public void MulBlendValues(string BlendSetName, float mul = 1f)
 	{
+		this.MulBlendSetValues(BlendSetName, mul);
+	}
+
+	public virtual void MulBlendSetValues(string BlendSetName, float mul = 1f)
+	{
 		if (this.dicBlendSet.ContainsKey(BlendSetName))
 		{
 			float[] array = this.dicBlendSet[BlendSetName];
@@ -644,6 +673,11 @@ public class TMorph
 
 	public void AddBlendValues(string BlendSetName, float add = 1f)
 	{
+		this.AddBlendSetValues(BlendSetName, add);
+	}
+
+	public virtual void AddBlendSetValues(string BlendSetName, float add = 1f)
+	{
 		if (this.dicBlendSet.ContainsKey(BlendSetName))
 		{
 			float[] array = this.dicBlendSet[BlendSetName];
@@ -685,7 +719,7 @@ public class TMorph
 		return TMorph.GP01FB_FACE_TYPE.MAX;
 	}
 
-	public void FixBlendValues_Face()
+	public virtual void FixBlendValues_Face()
 	{
 		if (120 <= this.bodyskin.PartsVersion)
 		{
@@ -833,8 +867,6 @@ public class TMorph
 		{
 			return;
 		}
-		this.m_vOriVert.CopyTo(this.m_vTmpVert, 0);
-		this.m_bMorph = true;
 		if (this.BlendValues[this.IdxHOHO] < 0.5f)
 		{
 			this.BlendValues[this.IdxHOHO] = 0f;
@@ -851,6 +883,8 @@ public class TMorph
 		{
 			this.BlendValues[this.IdxHOHO2] = 1f;
 		}
+		this.m_vOriVert.CopyTo(this.m_vTmpVert, 0);
+		this.m_bMorph = true;
 		for (int num6 = 0; num6 < this.MorphCount; num6++)
 		{
 			if (this.BlendDatas[num6] == null)
@@ -912,7 +946,7 @@ public class TMorph
 		}
 	}
 
-	public void FixBlendValues()
+	public virtual void FixBlendValues()
 	{
 		int num = 0;
 		for (int i = 0; i < this.MorphCount; i++)
@@ -960,7 +994,7 @@ public class TMorph
 		}
 	}
 
-	public void ResetBlendValues()
+	public virtual void ResetBlendValues()
 	{
 		if (this.m_bMorph)
 		{
@@ -969,7 +1003,7 @@ public class TMorph
 		}
 	}
 
-	public void SetEnableAttachPointEdit(bool f_bEnable, string f_strApName)
+	public virtual void SetEnableAttachPointEdit(bool f_bEnable, string f_strApName)
 	{
 		TAttachPoint tattachPoint = this.dicAttachPoint[f_strApName];
 		if (tattachPoint.bEditable == f_bEnable)
@@ -1008,12 +1042,12 @@ public class TMorph
 		this.bodyskin.body.maid.SetAttachPointPos(this.bodyskin.m_ParentMPN, this.bodyskin.SlotId, this.m_vOriVert.Length, f_strApName, num, vector, quaternion, vector2, tattachPoint.bEditable);
 	}
 
-	public bool GetEnableAttachPointEdit(string f_strApName)
+	public virtual bool GetEnableAttachPointEdit(string f_strApName)
 	{
 		return this.dicAttachPoint[f_strApName].bEditable;
 	}
 
-	public void SetAttachPoint(string apname, Vector3 vc, Quaternion q, bool f_bTemp)
+	public virtual void SetAttachPoint(string apname, Vector3 vc, Quaternion q, bool f_bTemp)
 	{
 		TAttachPoint tattachPoint = new TAttachPoint();
 		float num = (vc - this.DefVert[0]).sqrMagnitude;
@@ -1050,7 +1084,7 @@ public class TMorph
 		}
 	}
 
-	public void SetAttachPointOffsetLocal(string apname, VtxAttachPos f_vap)
+	public virtual void SetAttachPointOffsetLocal(string apname, VtxAttachPos f_vap)
 	{
 		TAttachPoint tattachPoint = this.dicAttachPoint[apname];
 		tattachPoint.vidx = f_vap.vidx;
@@ -1061,7 +1095,7 @@ public class TMorph
 		tattachPoint.bw = this.m_bws[tattachPoint.vidx];
 	}
 
-	public bool CopyAttachObjPoint(string apname)
+	public virtual bool CopyAttachObjPoint(string apname)
 	{
 		TAttachPoint tattachPoint = this.dicAttachPoint[apname];
 		TMorph.TempAttachPos tempAttachPos = new TMorph.TempAttachPos();
@@ -1073,7 +1107,7 @@ public class TMorph
 		return true;
 	}
 
-	public bool PastAttachObjPoint(string apname)
+	public virtual bool PastAttachObjPoint(string apname)
 	{
 		TAttachPoint tattachPoint = this.dicAttachPoint[apname];
 		TMorph.TempAttachPos tempAttachPos = null;
@@ -1090,7 +1124,7 @@ public class TMorph
 		return true;
 	}
 
-	public void SetAttachPointWorld(string apname, Vector3 vWorldPos, Quaternion qWorldRot, Vector3 vScaleRate)
+	public virtual void SetAttachPointWorld(string apname, Vector3 vWorldPos, Quaternion qWorldRot, Vector3 vScaleRate)
 	{
 		TAttachPoint tattachPoint = this.dicAttachPoint[apname];
 		if (!tattachPoint.bEditable)
@@ -1132,7 +1166,7 @@ public class TMorph
 		Debug.DrawLine(vector, vWorldPos, Color.cyan);
 	}
 
-	public bool GetAttachPoint(string apname, out Vector3 vWorldPos, out Quaternion qWorldRot, out Vector3 vScaleRate, bool f_bTemp = false)
+	public virtual bool GetAttachPoint(string apname, out Vector3 vWorldPos, out Quaternion qWorldRot, out Vector3 vScaleRate, bool f_bTemp = false)
 	{
 		if (!this.dicAttachPoint.ContainsKey(apname))
 		{
@@ -1176,7 +1210,7 @@ public class TMorph
 		return true;
 	}
 
-	public bool ResetAttachPoint(string apname)
+	public virtual bool ResetAttachPoint(string apname)
 	{
 		if (!this.dicAttachPoint.ContainsKey(apname))
 		{
@@ -1193,7 +1227,7 @@ public class TMorph
 		return true;
 	}
 
-	public void ReclucPointWorldAndScreen(Camera cam = null)
+	public virtual void ReclucPointWorldAndScreen(Camera cam = null)
 	{
 		bool flag = cam != null;
 		for (int i = 0; i < this.VCount; i++)
@@ -1409,7 +1443,7 @@ public class TMorph
 		return num5;
 	}
 
-	public void OnApplicationQuit()
+	public virtual void OnApplicationQuit()
 	{
 		Debug.LogError("TMorph OnApplicationQuit");
 		this.m_mesh.vertices = this.m_vOriVert;

File diff suppressed because it is too large
+ 1046 - 0
Assembly-CSharp/TMorphBone.cs


File diff suppressed because it is too large
+ 1831 - 0
Assembly-CSharp/TMorphSkin.cs


+ 69 - 0
Assembly-CSharp/ThighTwist.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ThighTwist : ATwistCtrl
+{
+	public ThighTwist(bool is_left, TBody body) : base((!is_left) ? Maid.AutoTwist.ThighR : Maid.AutoTwist.ThighL, body)
+	{
+		string str;
+		if (body.IsCrcBody)
+		{
+			str = "Bip01";
+		}
+		else
+		{
+			str = (body.boMAN ? "ManBip" : "Bip01");
+		}
+		string str2 = (!is_left) ? " R Thigh" : " L Thigh";
+		base.bone = body.GetBone(str + str2);
+		base.mrBone = base.GetMRBone(str + str2);
+		this.Pelvis = body.GetBone(str + " Pelvis");
+		if (body.IsCrcBody)
+		{
+			for (int i = 0; i < 5; i++)
+			{
+				string name = (!is_left) ? string.Format("ThighTwist{0}_R", i + 1) : string.Format("ThighTwist{0}_L", i + 1);
+				Transform transform = base.bone.Find(name);
+				if (transform)
+				{
+					Transform transform2 = base.mrBone.Find(name);
+					if (transform2)
+					{
+						base.twistBones.Add(new KeyValuePair<Transform, Transform>(transform2, transform));
+					}
+				}
+			}
+			string text = (!is_left) ? "Hip_R" : "Hip_L";
+			Transform bone = body.GetBone(text);
+			Transform mrbone = base.GetMRBone(text);
+			if (bone && mrbone)
+			{
+				this.HipPair = new KeyValuePair<Transform, Transform>(mrbone, bone);
+			}
+		}
+	}
+
+	public override void ApplyTwist()
+	{
+		Quaternion quaternion = base.bone.parent.rotation * base.mrBone.localRotation;
+		quaternion = Quaternion.FromToRotation(quaternion * Vector3.right, base.bone.right) * quaternion;
+		for (int i = 0; i < base.twistBones.Count; i++)
+		{
+			KeyValuePair<Transform, Transform> keyValuePair = base.twistBones[i];
+			float t = (float)(i + 1) / (float)base.twistBones.Count;
+			keyValuePair.Value.rotation = Quaternion.Lerp(quaternion, base.bone.rotation, t);
+		}
+		if (base.twistBones.Count > 0 && this.HipPair.Key && this.HipPair.Value)
+		{
+			this.HipPair.Value.localRotation = this.HipPair.Key.localRotation;
+			this.HipPair.Value.rotation = Quaternion.Lerp(this.HipPair.Value.rotation, base.twistBones[0].Value.rotation, 0.67f);
+		}
+	}
+
+	private KeyValuePair<Transform, Transform> HipPair;
+
+	private const float HIP_BLEND_VAL = 0.67f;
+
+	private Transform Pelvis;
+}

File diff suppressed because it is too large
+ 13 - 0
Assembly-CSharp/TitleCtrl.cs


+ 261 - 0
Assembly-CSharp/TongueCtrl.cs

@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using kt.Utility;
+using UnityEngine;
+
+public class TongueCtrl
+{
+	public TongueCtrl(TBodySkin tgt_face, GameObject face_obj)
+	{
+		TongueCtrl $this = this;
+		this.face = tgt_face;
+		this.body = this.face.body;
+		Action<string> action = delegate(string bone_name)
+		{
+			Transform transform = face_obj.transform.SearchChildByName(bone_name);
+			$this.BoneDataDic[transform] = new TongueCtrl.BoneData(transform);
+		};
+		action("Bero1");
+		action("Bero2");
+		action("Bero3");
+		action("Bero4");
+		action("Bero5");
+		action("Bero_nub");
+		foreach (TongueCtrl.FaceMorph faceMorph in (TongueCtrl.FaceMorph[])Enum.GetValues(typeof(TongueCtrl.FaceMorph)))
+		{
+			this.FaceMorphDataDic[faceMorph] = new TongueCtrl.MorphData(faceMorph, this.face.morph as TMorphSkin);
+		}
+	}
+
+	public void TongueReset()
+	{
+		this.LastIsEnable = this.isEnable;
+		this.isEnable = false;
+		this.IsFirstFrame = true;
+		this.BlendStatusReset();
+		foreach (TongueCtrl.BoneData boneData in this.BoneDataDic.Values)
+		{
+			Transform bone = boneData.bone;
+			boneData.chacheLocalPos = bone.localPosition;
+			boneData.chacheLocalAngles = bone.localEulerAngles;
+			bone.localPosition = boneData.initLocalPos;
+			bone.localEulerAngles = boneData.initLocalAngles;
+		}
+		foreach (KeyValuePair<TongueCtrl.FaceMorph, TongueCtrl.MorphData> keyValuePair in this.FaceMorphDataDic)
+		{
+			TongueCtrl.MorphData value = keyValuePair.Value;
+			value.SaveBlendBaseValue();
+			if (TongueCtrl.TongueUseMorph.Contains(keyValuePair.Key))
+			{
+				value.targetValue = 0f;
+			}
+		}
+	}
+
+	public void BlendStatusReset()
+	{
+		this.BlendWeight = 0f;
+		this.ElapsedTime = 0f;
+	}
+
+	public void SetTargetValue(TongueCtrl.FaceMorph morph, float value)
+	{
+		this.GetMorphData(morph).targetValue = value;
+	}
+
+	public TongueCtrl.MorphData GetMorphData(TongueCtrl.FaceMorph morph)
+	{
+		return this.FaceMorphDataDic[morph];
+	}
+
+	public void TongueUpdate()
+	{
+		bool flag = this.BlendWeight < 1f;
+		if (flag)
+		{
+			this.ElapsedTime += Time.deltaTime;
+			this.BlendWeight = ((this.blendTime <= 0f) ? 1f : Mathf.Clamp01(this.ElapsedTime / this.blendTime));
+		}
+		if (this.isEnable)
+		{
+			foreach (TongueCtrl.FaceMorph key in TongueCtrl.TongueNotUseMorph)
+			{
+				this.FaceMorphDataDic[key].targetValue = 0f;
+				this.FaceMorphDataDic[key].Blend(this.BlendWeight);
+			}
+			foreach (TongueCtrl.FaceMorph key2 in TongueCtrl.TongueUseMorph)
+			{
+				this.FaceMorphDataDic[key2].Blend(this.BlendWeight);
+			}
+			bool boBallGAG = this.face.morph.boBallGAG;
+			bool boLookTooth = this.face.morph.boLookTooth;
+			bool boLipSync = this.face.morph.boLipSync;
+			this.face.morph.boBallGAG = false;
+			this.face.morph.boLookTooth = false;
+			this.face.morph.boLipSync = false;
+			this.face.morph.FixBlendValues_Face();
+			this.face.morph.boBallGAG = boBallGAG;
+			this.face.morph.boLookTooth = boLookTooth;
+			this.face.morph.boLipSync = boLipSync;
+		}
+		else
+		{
+			if (!flag || !this.LastIsEnable)
+			{
+				this.IsFirstFrame = false;
+				return;
+			}
+			if (this.IsFirstFrame)
+			{
+				foreach (TongueCtrl.FaceMorph key3 in TongueCtrl.TongueUseMorph)
+				{
+					this.FaceMorphDataDic[key3].targetValue = this.FaceMorphDataDic[key3].morphValue;
+				}
+			}
+			foreach (TongueCtrl.FaceMorph key4 in TongueCtrl.TongueUseMorph)
+			{
+				this.FaceMorphDataDic[key4].Blend(this.BlendWeight);
+			}
+			this.face.morph.FixBlendValues_Face();
+			foreach (TongueCtrl.BoneData boneData in this.BoneDataDic.Values)
+			{
+				Transform bone = boneData.bone;
+				Vector3 localPosition = Vector3.Lerp(boneData.chacheLocalPos, boneData.initLocalPos, this.BlendWeight);
+				Vector3 localEulerAngles = Vector3.Lerp(boneData.chacheLocalAngles, boneData.initLocalAngles, this.BlendWeight);
+				bone.localPosition = localPosition;
+				bone.localEulerAngles = localEulerAngles;
+			}
+		}
+		this.IsFirstFrame = false;
+	}
+
+	public static readonly TongueCtrl.FaceMorph[] TongueNotUseMorph = new TongueCtrl.FaceMorph[]
+	{
+		TongueCtrl.FaceMorph.TangA,
+		TongueCtrl.FaceMorph.TangOpen,
+		TongueCtrl.FaceMorph.TangOut,
+		TongueCtrl.FaceMorph.TangS,
+		TongueCtrl.FaceMorph.TangUp
+	};
+
+	public static readonly TongueCtrl.FaceMorph[] TongueUseMorph = new TongueCtrl.FaceMorph[]
+	{
+		TongueCtrl.FaceMorph.TangRoll,
+		TongueCtrl.FaceMorph.TangWidth,
+		TongueCtrl.FaceMorph.TangI,
+		TongueCtrl.FaceMorph.MouthFera,
+		TongueCtrl.FaceMorph.MouthFeraR,
+		TongueCtrl.FaceMorph.MouthA,
+		TongueCtrl.FaceMorph.MouthS
+	};
+
+	public readonly TBody body;
+
+	public readonly TBodySkin face;
+
+	private readonly Dictionary<TongueCtrl.FaceMorph, TongueCtrl.MorphData> FaceMorphDataDic = new Dictionary<TongueCtrl.FaceMorph, TongueCtrl.MorphData>();
+
+	public bool isEnable;
+
+	private bool LastIsEnable;
+
+	private float ElapsedTime;
+
+	public float blendTime = 0.5f;
+
+	private float BlendWeight;
+
+	private Dictionary<Transform, TongueCtrl.BoneData> BoneDataDic = new Dictionary<Transform, TongueCtrl.BoneData>();
+
+	private bool IsFirstFrame;
+
+	public enum FaceMorph
+	{
+		TangRoll,
+		TangWidth,
+		TangA,
+		TangI,
+		TangOpen,
+		TangOut,
+		TangS,
+		TangUp,
+		MouthFera,
+		MouthFeraR,
+		MouthA,
+		MouthS
+	}
+
+	public class MorphData
+	{
+		public MorphData(TongueCtrl.FaceMorph morph_type, TMorphSkin morph_skin)
+		{
+			this.morphName = morph_type.ToString().ToLower();
+			this.morph = morph_skin;
+		}
+
+		public int morphIndex
+		{
+			get
+			{
+				return (int)this.morph.hash[this.morphName];
+			}
+		}
+
+		public float morphValue
+		{
+			get
+			{
+				return this.morph.GetBlendValues(this.morphIndex);
+			}
+			private set
+			{
+				this.morph.SetBlendValues(this.morphIndex, value);
+			}
+		}
+
+		public void SaveBlendBaseValue()
+		{
+			this.BlendBaseValue = this.morph.GetBlendValues(this.morphIndex);
+		}
+
+		public void Blend(float weight)
+		{
+			float morphValue = Mathf.Lerp(this.BlendBaseValue, this.targetValue, weight);
+			this.morphValue = morphValue;
+		}
+
+		public void ApplyTargetValue()
+		{
+			this.morphValue = this.targetValue;
+		}
+
+		public readonly TMorphSkin morph;
+
+		public readonly string morphName;
+
+		private float BlendBaseValue;
+
+		public float targetValue;
+	}
+
+	private class BoneData
+	{
+		public BoneData(Transform tongue_bone)
+		{
+			this.bone = tongue_bone;
+			this.initLocalPos = this.bone.localPosition;
+			this.initLocalAngles = this.bone.localEulerAngles;
+		}
+
+		public readonly Transform bone;
+
+		public readonly Vector3 initLocalPos;
+
+		public readonly Vector3 initLocalAngles;
+
+		public Vector3 chacheLocalPos;
+
+		public Vector3 chacheLocalAngles;
+	}
+}

+ 9 - 2
Assembly-CSharp/TouchAction_Mgr.cs

@@ -133,7 +133,7 @@ public class TouchAction_Mgr : PartsMgrBase
 						}
 						if (!this.m_ActionParam[maid].m_VibeObj)
 						{
-							this.m_ActionParam[maid].m_VibeObj = maid.body0.GetSlot(34).obj_tr;
+							this.m_ActionParam[maid].m_VibeObj = maid.body0.GetSlot(43).obj_tr;
 							this.m_ActionParam[maid].VibeAudio.Init(AudioSourceMgr.Type.Se, true, GameMain.Instance.SoundMgr, this.m_ActionParam[maid].m_VibeObj);
 						}
 						if (GameMain.Instance.MainCamera.IsFadeOut())
@@ -466,7 +466,14 @@ public class TouchAction_Mgr : PartsMgrBase
 				GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(GameObject.Find("AudioSe(Clone)"));
 				this.m_ActionParam[maid].VibeAudio = gameObject2.GetComponent<AudioSourceMgr>();
 				this.m_ActionParam[maid].VibeAudio.name = "VibeSE";
-				MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Touch);
+				if (maid.body0.IsCrcBody)
+				{
+					MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Crc);
+				}
+				else
+				{
+					MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Touch);
+				}
 				maid.SetProp(MPN.accvag, "accVag_VibePink_I_.menu", 0, true, false);
 				maid.AllProcPropSeqStart();
 				num++;

+ 117 - 0
Assembly-CSharp/Tuple.2.cs

@@ -0,0 +1,117 @@
+using System;
+
+public sealed class Tuple<T1, T2>
+{
+	public Tuple(T1 item1, T2 item2)
+	{
+		this.item1 = item1;
+		this.item2 = item2;
+	}
+
+	public T1 Item1
+	{
+		get
+		{
+			return this.item1;
+		}
+	}
+
+	public T2 Item2
+	{
+		get
+		{
+			return this.item2;
+		}
+	}
+
+	public override string ToString()
+	{
+		return string.Format("Tuple({0}, {1})", this.Item1, this.Item2);
+	}
+
+	public override int GetHashCode()
+	{
+		int num = 17;
+		int num2 = num * 23;
+		int num3;
+		if (this.item1 == null)
+		{
+			num3 = 0;
+		}
+		else
+		{
+			T1 t = this.item1;
+			num3 = t.GetHashCode();
+		}
+		num = num2 + num3;
+		int num4 = num * 23;
+		int num5;
+		if (this.item2 == null)
+		{
+			num5 = 0;
+		}
+		else
+		{
+			T2 t2 = this.item2;
+			num5 = t2.GetHashCode();
+		}
+		return num4 + num5;
+	}
+
+	public override bool Equals(object o)
+	{
+		if (!(o is Tuple<T1, T2>))
+		{
+			return false;
+		}
+		Tuple<T1, T2> b = (Tuple<T1, T2>)o;
+		return this == b;
+	}
+
+	public bool Equals(Tuple<T1, T2> other)
+	{
+		return this == other;
+	}
+
+	public static bool operator ==(Tuple<T1, T2> a, Tuple<T1, T2> b)
+	{
+		if (object.ReferenceEquals(a, null))
+		{
+			return object.ReferenceEquals(b, null);
+		}
+		if (a.item1 == null && b.item1 != null)
+		{
+			return false;
+		}
+		if (a.item2 == null && b.item2 != null)
+		{
+			return false;
+		}
+		T1 t = a.item1;
+		bool result;
+		if (t.Equals(b.item1))
+		{
+			T2 t2 = a.item2;
+			result = t2.Equals(b.item2);
+		}
+		else
+		{
+			result = false;
+		}
+		return result;
+	}
+
+	public static bool operator !=(Tuple<T1, T2> a, Tuple<T1, T2> b)
+	{
+		return !(a == b);
+	}
+
+	public void Unpack(Action<T1, T2> unpackerDelegate)
+	{
+		unpackerDelegate(this.Item1, this.Item2);
+	}
+
+	private readonly T1 item1;
+
+	private readonly T2 item2;
+}

+ 133 - 0
Assembly-CSharp/Tuple.3.cs

@@ -0,0 +1,133 @@
+using System;
+
+public sealed class Tuple<T1, T2, T3>
+{
+	public Tuple(T1 item1, T2 item2, T3 item3)
+	{
+		this.item1 = item1;
+		this.item2 = item2;
+		this.item3 = item3;
+	}
+
+	public T1 Item1
+	{
+		get
+		{
+			return this.item1;
+		}
+	}
+
+	public T2 Item2
+	{
+		get
+		{
+			return this.item2;
+		}
+	}
+
+	public T3 Item3
+	{
+		get
+		{
+			return this.item3;
+		}
+	}
+
+	public override int GetHashCode()
+	{
+		int num = 17;
+		int num2 = num * 23;
+		int num3;
+		if (this.item1 == null)
+		{
+			num3 = 0;
+		}
+		else
+		{
+			T1 t = this.item1;
+			num3 = t.GetHashCode();
+		}
+		num = num2 + num3;
+		int num4 = num * 23;
+		int num5;
+		if (this.item2 == null)
+		{
+			num5 = 0;
+		}
+		else
+		{
+			T2 t2 = this.item2;
+			num5 = t2.GetHashCode();
+		}
+		num = num4 + num5;
+		int num6 = num * 23;
+		int num7;
+		if (this.item3 == null)
+		{
+			num7 = 0;
+		}
+		else
+		{
+			T3 t3 = this.item3;
+			num7 = t3.GetHashCode();
+		}
+		return num6 + num7;
+	}
+
+	public override bool Equals(object o)
+	{
+		if (!(o is Tuple<T1, T2, T3>))
+		{
+			return false;
+		}
+		Tuple<T1, T2, T3> b = (Tuple<T1, T2, T3>)o;
+		return this == b;
+	}
+
+	public static bool operator ==(Tuple<T1, T2, T3> a, Tuple<T1, T2, T3> b)
+	{
+		if (object.ReferenceEquals(a, null))
+		{
+			return object.ReferenceEquals(b, null);
+		}
+		if (a.item1 == null && b.item1 != null)
+		{
+			return false;
+		}
+		if (a.item2 == null && b.item2 != null)
+		{
+			return false;
+		}
+		if (a.item3 == null && b.item3 != null)
+		{
+			return false;
+		}
+		T1 t = a.item1;
+		if (t.Equals(b.item1))
+		{
+			T2 t2 = a.item2;
+			if (t2.Equals(b.item2))
+			{
+				T3 t3 = a.item3;
+				return t3.Equals(b.item3);
+			}
+		}
+		return false;
+	}
+
+	public static bool operator !=(Tuple<T1, T2, T3> a, Tuple<T1, T2, T3> b)
+	{
+		return !(a == b);
+	}
+
+	public void Unpack(Action<T1, T2, T3> unpackerDelegate)
+	{
+		unpackerDelegate(this.Item1, this.Item2, this.Item3);
+	}
+
+	private readonly T1 item1;
+
+	private readonly T2 item2;
+
+	private readonly T3 item3;
+}

+ 164 - 0
Assembly-CSharp/Tuple.4.cs

@@ -0,0 +1,164 @@
+using System;
+
+public sealed class Tuple<T1, T2, T3, T4>
+{
+	public Tuple(T1 item1, T2 item2, T3 item3, T4 item4)
+	{
+		this.item1 = item1;
+		this.item2 = item2;
+		this.item3 = item3;
+		this.item4 = item4;
+	}
+
+	public T1 Item1
+	{
+		get
+		{
+			return this.item1;
+		}
+	}
+
+	public T2 Item2
+	{
+		get
+		{
+			return this.item2;
+		}
+	}
+
+	public T3 Item3
+	{
+		get
+		{
+			return this.item3;
+		}
+	}
+
+	public T4 Item4
+	{
+		get
+		{
+			return this.item4;
+		}
+	}
+
+	public override int GetHashCode()
+	{
+		int num = 17;
+		int num2 = num * 23;
+		int num3;
+		if (this.item1 == null)
+		{
+			num3 = 0;
+		}
+		else
+		{
+			T1 t = this.item1;
+			num3 = t.GetHashCode();
+		}
+		num = num2 + num3;
+		int num4 = num * 23;
+		int num5;
+		if (this.item2 == null)
+		{
+			num5 = 0;
+		}
+		else
+		{
+			T2 t2 = this.item2;
+			num5 = t2.GetHashCode();
+		}
+		num = num4 + num5;
+		int num6 = num * 23;
+		int num7;
+		if (this.item3 == null)
+		{
+			num7 = 0;
+		}
+		else
+		{
+			T3 t3 = this.item3;
+			num7 = t3.GetHashCode();
+		}
+		num = num6 + num7;
+		int num8 = num * 23;
+		int num9;
+		if (this.item4 == null)
+		{
+			num9 = 0;
+		}
+		else
+		{
+			T4 t4 = this.item4;
+			num9 = t4.GetHashCode();
+		}
+		return num8 + num9;
+	}
+
+	public override bool Equals(object o)
+	{
+		if (o.GetType() != typeof(Tuple<T1, T2, T3, T4>))
+		{
+			return false;
+		}
+		Tuple<T1, T2, T3, T4> b = (Tuple<T1, T2, T3, T4>)o;
+		return this == b;
+	}
+
+	public static bool operator ==(Tuple<T1, T2, T3, T4> a, Tuple<T1, T2, T3, T4> b)
+	{
+		if (object.ReferenceEquals(a, null))
+		{
+			return object.ReferenceEquals(b, null);
+		}
+		if (a.item1 == null && b.item1 != null)
+		{
+			return false;
+		}
+		if (a.item2 == null && b.item2 != null)
+		{
+			return false;
+		}
+		if (a.item3 == null && b.item3 != null)
+		{
+			return false;
+		}
+		if (a.item4 == null && b.item4 != null)
+		{
+			return false;
+		}
+		T1 t = a.item1;
+		if (t.Equals(b.item1))
+		{
+			T2 t2 = a.item2;
+			if (t2.Equals(b.item2))
+			{
+				T3 t3 = a.item3;
+				if (t3.Equals(b.item3))
+				{
+					T4 t4 = a.item4;
+					return t4.Equals(b.item4);
+				}
+			}
+		}
+		return false;
+	}
+
+	public static bool operator !=(Tuple<T1, T2, T3, T4> a, Tuple<T1, T2, T3, T4> b)
+	{
+		return !(a == b);
+	}
+
+	public void Unpack(Action<T1, T2, T3, T4> unpackerDelegate)
+	{
+		unpackerDelegate(this.Item1, this.Item2, this.Item3, this.Item4);
+	}
+
+	private readonly T1 item1;
+
+	private readonly T2 item2;
+
+	private readonly T3 item3;
+
+	private readonly T4 item4;
+}

+ 40 - 0
Assembly-CSharp/Tuple.cs

@@ -0,0 +1,40 @@
+using System;
+
+public static class Tuple
+{
+	public static Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 second)
+	{
+		return new Tuple<T1, T2>(item1, second);
+	}
+
+	public static Tuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 second, T3 third)
+	{
+		return new Tuple<T1, T2, T3>(item1, second, third);
+	}
+
+	public static Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 item1, T2 second, T3 third, T4 fourth)
+	{
+		return new Tuple<T1, T2, T3, T4>(item1, second, third, fourth);
+	}
+
+	public static void Unpack<T1, T2>(this Tuple<T1, T2> tuple, out T1 ref1, out T2 ref2)
+	{
+		ref1 = tuple.Item1;
+		ref2 = tuple.Item2;
+	}
+
+	public static void Unpack<T1, T2, T3>(this Tuple<T1, T2, T3> tuple, out T1 ref1, out T2 ref2, T3 ref3)
+	{
+		ref1 = tuple.Item1;
+		ref2 = tuple.Item2;
+		ref3 = tuple.Item3;
+	}
+
+	public static void Unpack<T1, T2, T3, T4>(this Tuple<T1, T2, T3, T4> tuple, out T1 ref1, out T2 ref2, T3 ref3, T4 ref4)
+	{
+		ref1 = tuple.Item1;
+		ref2 = tuple.Item2;
+		ref3 = tuple.Item3;
+		ref4 = tuple.Item4;
+	}
+}

+ 38 - 0
Assembly-CSharp/UTY.cs

@@ -393,6 +393,18 @@ public class UTY : MonoBehaviour
 		ColorPalette.WriteColorTableTexture(UTY.m_colStatus, ref f_texDest);
 	}
 
+	public static void SaveImage(Texture f_texSrc, string f_strFileName = null)
+	{
+		if (f_texSrc is Texture2D)
+		{
+			UTY.SaveImage(f_texSrc as Texture2D, f_strFileName);
+		}
+		else if (f_texSrc is RenderTexture)
+		{
+			UTY.SaveImage(f_texSrc as RenderTexture, f_strFileName, TextureFormat.ARGB32);
+		}
+	}
+
 	public static void SaveImage(RenderTexture f_rtSrc, string f_strFileName = null, TextureFormat f_TexFormat = TextureFormat.ARGB32)
 	{
 		Texture2D texture2D = new Texture2D(f_rtSrc.width, f_rtSrc.height, f_TexFormat, false);
@@ -484,6 +496,32 @@ public class UTY : MonoBehaviour
 		return str2 + str;
 	}
 
+	public static void DirectorySafeDelete(string path, string[] reqExt, SearchOption opt)
+	{
+		if (!Directory.Exists(path))
+		{
+			Debug.LogWarning("del directory does not exist. -> " + path);
+			return;
+		}
+		List<string> list = new List<string>();
+		foreach (string str in reqExt)
+		{
+			string[] files = Directory.GetFiles(path, "*." + str, opt);
+			list.AddRange(files);
+		}
+		foreach (string path2 in list)
+		{
+			File.Delete(path2);
+		}
+		string[] fileSystemEntries = Directory.GetFileSystemEntries(path);
+		if (fileSystemEntries == null || fileSystemEntries.Length == 0)
+		{
+			Directory.Delete(path);
+			return;
+		}
+		Debug.LogWarning("del directory does not empty. -> " + path);
+	}
+
 	private static System.Random rnd;
 
 	private static string m_strEscapePattern = "(\\\\|/|:|\\*|\\?|\"|\\<|\\>|\\||\\.|\\,)";

+ 65 - 0
Assembly-CSharp/UndressDance_Mgr.cs

@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using Dance;
+using MaidExtension;
 using UnityEngine;
 using wf;
 
@@ -46,6 +47,11 @@ public class UndressDance_Mgr : PartsMgrBase
 		this.m_MaidGrid = this.m_ItemWindow.transform.Find("MaidIcon").GetComponent<UIGrid>();
 		this.m_MaidTabPanel = this.m_MaidGrid.gameObject.GetComponent<UIWFTabPanel>();
 		KasaiUtility.CsvRead("csv_rhythm_action/undress_parts_data.nei", new Action<CsvParser, int, int>(this.ReadPartsData), 0, 1, null);
+		if (this.m_HannugiButton != null)
+		{
+			this.m_HannugiButton.SetActive(true);
+			this.m_HannugiButton.transform.SetParent(this.m_ItemGrid.transform, false);
+		}
 		this.m_ItemGrid.repositionNow = true;
 		KasaiUtility.CsvRead("csv_rhythm_action/undress_level2_data.nei", new Action<CsvParser, int, int>(this.ReadLevel2Key), 0, 1, null);
 		KasaiUtility.CsvRead("csv_rhythm_action/undress_face_data.nei", new Action<CsvParser, int, int>(this.ReadFaceSetting), 0, 1, null);
@@ -112,6 +118,19 @@ public class UndressDance_Mgr : PartsMgrBase
 			}
 			break;
 		}
+		case 5:
+			foreach (string value2 in csv.GetCellAsString(cx, cy).Split(new char[]
+			{
+				','
+			}))
+			{
+				MPN mpn = (MPN)Enum.Parse(typeof(MPN), value2);
+				if (mpn != MPN.null_mpn)
+				{
+					this.m_MpnPartsData.Last<KeyValuePair<MPN, UndressDance_Mgr.PartsData>>().Value.Mpnlist.Add(mpn);
+				}
+			}
+			break;
 		}
 		if (cx == csv.max_cell_x - 1)
 		{
@@ -246,6 +265,7 @@ public class UndressDance_Mgr : PartsMgrBase
 		{
 			undressItem.UpdateState(maid);
 		}
+		this.UpdateHannugiButtonState();
 	}
 
 	private void AllDreass()
@@ -283,6 +303,45 @@ public class UndressDance_Mgr : PartsMgrBase
 		}
 	}
 
+	public void OnClickHannugiButton()
+	{
+		if (this.m_HannugiButton == null || this.m_SelectedMaid == null || !this.m_SelectedMaid.IsCrcBody)
+		{
+			return;
+		}
+		bool flag = this.m_SelectedMaid.mekureController.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+		this.m_SelectedMaid.mekureController.SetEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake, !flag, null);
+		this.UpdateHannugiButtonState();
+	}
+
+	private void UpdateHannugiButtonState()
+	{
+		if (this.m_HannugiButton == null || this.m_SelectedMaid == null)
+		{
+			return;
+		}
+		bool activeSelf = this.m_HannugiButton.activeSelf;
+		this.m_HannugiButton.SetActive(this.m_SelectedMaid.IsCrcBody);
+		if (!activeSelf && this.m_HannugiButton.activeSelf)
+		{
+			this.m_ItemGrid.repositionNow = true;
+		}
+		if (!this.m_HannugiButton.activeSelf)
+		{
+			return;
+		}
+		UIButton componentInChildren = this.m_HannugiButton.GetComponentInChildren<UIButton>();
+		componentInChildren.isEnabled = this.m_SelectedMaid.mekureController.IsSupportedCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+		if (!componentInChildren.isEnabled)
+		{
+			return;
+		}
+		bool flag = this.m_SelectedMaid.mekureController.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+		Color defaultColor = componentInChildren.defaultColor;
+		defaultColor.a = ((!flag) ? 0.5f : 1f);
+		componentInChildren.defaultColor = defaultColor;
+	}
+
 	private UndressDance_Mgr.UndressLevel GetUndressLevel(bool release_force2 = false)
 	{
 		UndressDance_Mgr.SexsualData sexsualData = this.m_MaidSexsualData[this.SelectMaid];
@@ -666,6 +725,10 @@ public class UndressDance_Mgr : PartsMgrBase
 	private UIButton m_AlldressButton;
 
 	[SerializeField]
+	[Header("半脱ぎボタン")]
+	private GameObject m_HannugiButton;
+
+	[SerializeField]
 	private float m_FaceChangeTime = 5f;
 
 	private IEnumerator m_WaitCoroutine;
@@ -728,6 +791,8 @@ public class UndressDance_Mgr : PartsMgrBase
 	{
 		public List<TBody.SlotID> SlotIDlist = new List<TBody.SlotID>();
 
+		public List<MPN> Mpnlist = new List<MPN>();
+
 		public Texture DefaultIcon;
 
 		public int SexsualPoint;

+ 155 - 10
Assembly-CSharp/UndressingManager.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using MaidExtension;
 using UnityEngine;
 
 public class UndressingManager : MonoBehaviour
@@ -66,11 +67,85 @@ public class UndressingManager : MonoBehaviour
 								}
 							}
 							undressingData2.call_scenario = csvParser.GetCellAsString(num++, j);
+							cellAsString3 = csvParser.GetCellAsString(num++, j);
+							if (!string.IsNullOrEmpty(cellAsString3))
+							{
+								string[] array2 = cellAsString3.Split(new char[]
+								{
+									','
+								});
+								for (int l = 0; l < array2.Length; l++)
+								{
+									MPN mpn = MPN.null_mpn;
+									try
+									{
+										mpn = (MPN)Enum.Parse(typeof(MPN), array2[l]);
+									}
+									catch
+									{
+										NDebug.Assert("mpn enum parse error.\n" + array2[l], false);
+									}
+									if (mpn != MPN.null_mpn)
+									{
+										undressingData2.target_newbody_mpn_id_list.Add(mpn);
+									}
+								}
+							}
 						}
 					}
 				}
 			}
 		}
+		if (this.hannugiButton != null)
+		{
+			EventDelegate.Add(this.hannugiButton.onClick, delegate()
+			{
+				if (this.all_maid_data_ == null || this.all_maid_data_.Length <= 0)
+				{
+					return;
+				}
+				bool flag = false;
+				foreach (Maid maid in this.all_maid_data_)
+				{
+					if (!(maid == null) && maid.IsCrcBody && maid.mekureController.IsSupportedCostumeType(MaidCostumeChangeController.CostumeType.Hadake))
+					{
+						flag = maid.mekureController.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+						break;
+					}
+				}
+				foreach (Maid maid2 in this.all_maid_data_)
+				{
+					if (!(maid2 == null))
+					{
+						maid2.mekureController.SetEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake, !flag, null);
+					}
+				}
+				this.UpdateHannugiButton();
+			});
+		}
+	}
+
+	public void UpdateHannugiButton()
+	{
+		if (this.hannugiButton == null)
+		{
+			return;
+		}
+		foreach (Maid maid in this.all_maid_data_)
+		{
+			if (!(maid == null) && maid.IsCrcBody && maid.mekureController.IsSupportedCostumeType(MaidCostumeChangeController.CostumeType.Hadake))
+			{
+				this.hannugiButton.isEnabled = maid.mekureController.IsSupportedCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+				if (this.hannugiButton.isEnabled)
+				{
+					bool flag = maid.mekureController.IsEnabledCostumeType(MaidCostumeChangeController.CostumeType.Hadake);
+					Color defaultColor = this.hannugiButton.defaultColor;
+					defaultColor.a = ((!flag) ? 0.5f : 1f);
+					this.hannugiButton.defaultColor = defaultColor;
+					break;
+				}
+			}
+		}
 	}
 
 	public void SetCallBackEvent(UndressingManager.OnClickEventDelegate func)
@@ -81,6 +156,27 @@ public class UndressingManager : MonoBehaviour
 	public void SetMaid(Maid maid, Maid[] linked_maid_array)
 	{
 		this.maid_ = maid;
+		UIGrid component = base.GetComponent<UIGrid>();
+		if (this.maid_.IsCrcBody)
+		{
+			component.cellWidth = 92f;
+			if (this.hannugiButton != null)
+			{
+				this.hannugiButton.gameObject.SetActive(true);
+			}
+		}
+		else
+		{
+			component.cellWidth = 100f;
+			if (this.hannugiButton != null)
+			{
+				this.hannugiButton.gameObject.SetActive(false);
+			}
+		}
+		Behaviour behaviour = component;
+		bool flag = true;
+		component.repositionNow = flag;
+		behaviour.enabled = flag;
 		foreach (KeyValuePair<UndressingManager.UnitType, UndressingManager.UndressingData> keyValuePair in this.unit_dic_)
 		{
 			UndressingManager.UndressingData value = keyValuePair.Value;
@@ -104,6 +200,7 @@ public class UndressingManager : MonoBehaviour
 			list.Insert(0, this.maid_);
 			this.all_maid_data_ = list.ToArray();
 		}
+		this.UpdateHannugiButton();
 		this.ApplyAllMaid();
 	}
 
@@ -189,6 +286,9 @@ public class UndressingManager : MonoBehaviour
 	[SerializeField]
 	public List<UndressingManager.UnitData> UnitDataList = new List<UndressingManager.UnitData>();
 
+	[SerializeField]
+	private UIButton hannugiButton;
+
 	private Dictionary<UndressingManager.UnitType, UndressingManager.UndressingData> unit_dic_ = new Dictionary<UndressingManager.UnitType, UndressingManager.UndressingData>();
 
 	private Maid maid_;
@@ -268,13 +368,32 @@ public class UndressingManager : MonoBehaviour
 			{
 				return;
 			}
+			if (this.target_newbody_mpn_id_list[0] == MPN.acchead)
+			{
+				bool mask = maid.body0.GetMask(MPN.acchead);
+				bool mask2 = maid.body0.GetMask(MPN.wear);
+			}
 			bool flag = false;
-			for (int i = 0; i < this.target_sloat_id_list.Count; i++)
+			if (maid.body0.IsCrcBody)
 			{
-				if (maid.body0.GetSlotLoaded(this.target_sloat_id_list[i]))
+				for (int i = 0; i < this.target_newbody_mpn_id_list.Count; i++)
 				{
-					flag = true;
-					break;
+					if (maid.body0.GetSlotLoaded(this.target_newbody_mpn_id_list[i]))
+					{
+						flag = true;
+						break;
+					}
+				}
+			}
+			else
+			{
+				for (int j = 0; j < this.target_sloat_id_list.Count; j++)
+				{
+					if (maid.body0.GetSlotLoaded(this.target_sloat_id_list[j]))
+					{
+						flag = true;
+						break;
+					}
 				}
 			}
 			if (!flag)
@@ -284,12 +403,26 @@ public class UndressingManager : MonoBehaviour
 				return;
 			}
 			bool flag2 = true;
-			for (int j = 0; j < this.target_sloat_id_list.Count; j++)
+			if (maid.body0.IsCrcBody)
 			{
-				if (maid.body0.GetMask(this.target_sloat_id_list[j]))
+				for (int k = 0; k < this.target_newbody_mpn_id_list.Count; k++)
 				{
-					flag2 = false;
-					break;
+					if (maid.body0.GetMask(this.target_newbody_mpn_id_list[k]))
+					{
+						flag2 = false;
+						break;
+					}
+				}
+			}
+			else
+			{
+				for (int l = 0; l < this.target_sloat_id_list.Count; l++)
+				{
+					if (maid.body0.GetMask(this.target_sloat_id_list[l]))
+					{
+						flag2 = false;
+						break;
+					}
 				}
 			}
 			this.mask_mode = ((!flag2) ? UndressingManager.MaskStatus.Off : UndressingManager.MaskStatus.On);
@@ -314,9 +447,19 @@ public class UndressingManager : MonoBehaviour
 				return;
 			}
 			bool flag = this.mask_mode == UndressingManager.MaskStatus.On;
-			for (int i = 0; i < this.target_sloat_id_list.Count; i++)
+			if (maid.body0.IsCrcBody)
+			{
+				for (int i = 0; i < this.target_newbody_mpn_id_list.Count; i++)
+				{
+					maid.body0.SetMask(this.target_newbody_mpn_id_list[i], !flag);
+				}
+			}
+			else
 			{
-				maid.body0.SetMask(this.target_sloat_id_list[i], !flag);
+				for (int j = 0; j < this.target_sloat_id_list.Count; j++)
+				{
+					maid.body0.SetMask(this.target_sloat_id_list[j], !flag);
+				}
 			}
 		}
 
@@ -324,6 +467,8 @@ public class UndressingManager : MonoBehaviour
 
 		public List<TBody.SlotID> target_sloat_id_list = new List<TBody.SlotID>();
 
+		public List<MPN> target_newbody_mpn_id_list = new List<MPN>();
+
 		public string call_scenario = string.Empty;
 
 		public Color button_default_color;

+ 16 - 1
Assembly-CSharp/UndressingWindow.cs

@@ -55,7 +55,7 @@ public class UndressingWindow : BaseMaidPhotoWindow
 	public override void Start()
 	{
 		base.Start();
-		this.MekureFront.mgr = (this.MekureBack.mgr = (this.Zurasi.mgr = base.mgr));
+		this.MekureFront.mgr = (this.MekureBack.mgr = (this.Zurasi.mgr = (this.Hadake.mgr = base.mgr)));
 		this.MekureFront.onClick.Add(delegate(WFCheckBox check_box)
 		{
 			this.MekureBack.UpdateGui();
@@ -70,6 +70,10 @@ public class UndressingWindow : BaseMaidPhotoWindow
 		{
 			this.OnStoreDataUpdate();
 		});
+		this.Hadake.onClick.Add(delegate(WFCheckBox check_box)
+		{
+			this.OnStoreDataUpdate();
+		});
 		this.noCharaActive.ChangeMode(true, true);
 	}
 
@@ -109,6 +113,10 @@ public class UndressingWindow : BaseMaidPhotoWindow
 			{
 				"check_box_zurasi",
 				this.Zurasi
+			},
+			{
+				"check_box_hadake",
+				this.Hadake
 			}
 		})
 		{
@@ -149,6 +157,7 @@ public class UndressingWindow : BaseMaidPhotoWindow
 		this.MekureFront.SetMaid(maid);
 		this.MekureBack.SetMaid(maid);
 		this.Zurasi.SetMaid(maid);
+		this.Hadake.SetMaid(maid);
 		this.OnStoreDataUpdate();
 	}
 
@@ -180,6 +189,10 @@ public class UndressingWindow : BaseMaidPhotoWindow
 			{
 				"check_box_zurasi",
 				this.Zurasi
+			},
+			{
+				"check_box_hadake",
+				this.Hadake
 			}
 		})
 		{
@@ -203,6 +216,8 @@ public class UndressingWindow : BaseMaidPhotoWindow
 
 	public WindowPartsMekureCheckBox Zurasi;
 
+	public WindowPartsMekureCheckBox Hadake;
+
 	private Dictionary<string, UIButton> unit_dic_ = new Dictionary<string, UIButton>();
 
 	private PhotoNoCharaActive noCharaActive;

+ 8 - 1
Assembly-CSharp/VRChoices.cs

@@ -132,7 +132,14 @@ public class VRChoices : MonoBehaviour
 				{
 					NDebug.Assert("VR選択肢でメイドがBusyです。", false);
 				}
-				MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Touch);
+				if (maid.body0.IsCrcBody)
+				{
+					MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Crc);
+				}
+				else
+				{
+					MaidColliderCollect.AddCollider(maid, MaidColliderCollect.ColliderType.Touch);
+				}
 			}
 			if (flag)
 			{

+ 8 - 1
Assembly-CSharp/VRTouchComm.cs

@@ -69,7 +69,14 @@ public class VRTouchComm : MonoBehaviour
 			this.m_VR_Kag_Mng_Fast.LoadScript(ScriptManager.ReplacePersonal(maid2, tag_data.GetTagProperty("file").AsString()));
 			this.m_VR_Kag_Mng_Fast.Start();
 			this.m_VR_Kag_Mng_Fast.Update();
-			MaidColliderCollect.AddCollider(vrtouchData.TgtMaid, MaidColliderCollect.ColliderType.Touch);
+			if (maid.IsCrcBody)
+			{
+				MaidColliderCollect.AddCollider(vrtouchData.TgtMaid, MaidColliderCollect.ColliderType.Crc);
+			}
+			else
+			{
+				MaidColliderCollect.AddCollider(vrtouchData.TgtMaid, MaidColliderCollect.ColliderType.Touch);
+			}
 			if (this.m_Touch_Mgr == null)
 			{
 				this.m_Touch_Mgr = new VRTouchMgr();

+ 89 - 0
Assembly-CSharp/Vector3Int.cs

@@ -0,0 +1,89 @@
+using System;
+
+public struct Vector3Int
+{
+	public Vector3Int(int x, int y, int z)
+	{
+		this.m_x = x;
+		this.m_y = y;
+		this.m_z = z;
+	}
+
+	public int x
+	{
+		get
+		{
+			return this.m_x;
+		}
+		set
+		{
+			this.m_x = value;
+		}
+	}
+
+	public int y
+	{
+		get
+		{
+			return this.m_y;
+		}
+		set
+		{
+			this.m_y = value;
+		}
+	}
+
+	public int z
+	{
+		get
+		{
+			return this.m_z;
+		}
+		set
+		{
+			this.m_z = value;
+		}
+	}
+
+	public void Set(int x, int y, int z)
+	{
+		this.m_x = x;
+		this.m_y = y;
+		this.m_z = z;
+	}
+
+	public override bool Equals(object obj)
+	{
+		Vector3Int vector3Int = (Vector3Int)obj;
+		return this.x == vector3Int.x && this.y == vector3Int.y && this.z == vector3Int.z;
+	}
+
+	public static bool operator ==(Vector3Int a, Vector3Int b)
+	{
+		return a.Equals(b);
+	}
+
+	public static bool operator !=(Vector3Int a, Vector3Int b)
+	{
+		return !a.Equals(b);
+	}
+
+	public override int GetHashCode()
+	{
+		return 0;
+	}
+
+	public static Vector3Int zero
+	{
+		get
+		{
+			return new Vector3Int(0, 0, 0);
+		}
+	}
+
+	private int m_x;
+
+	private int m_y;
+
+	private int m_z;
+}

+ 13 - 2
Assembly-CSharp/Webs.cs

@@ -8,7 +8,7 @@ using UnityEngine;
 
 public class Webs : MonoBehaviour
 {
-	public void Init()
+	public bool Init()
 	{
 		int num = 49553;
 		try
@@ -27,10 +27,12 @@ public class Webs : MonoBehaviour
 				ex.Message
 			}));
 			this.m_listener = null;
+			return false;
 		}
+		return true;
 	}
 
-	public void OnDestroy()
+	public void Uninit()
 	{
 		if (this.m_listener != null)
 		{
@@ -39,6 +41,11 @@ public class Webs : MonoBehaviour
 		this.m_listener = null;
 	}
 
+	public void OnDestroy()
+	{
+		this.Uninit();
+	}
+
 	private void Listening()
 	{
 		if (Webs.nsWEB == null)
@@ -202,6 +209,10 @@ public class Webs : MonoBehaviour
 						}
 					}.Start();
 				}
+				else
+				{
+					UnityEngine.Debug.LogError("Launcher not found. -> " + text8);
+				}
 			}
 			catch (Exception ex2)
 			{

+ 12 - 6
Assembly-CSharp/WindowPartsBoneCheckBox.cs

@@ -64,14 +64,12 @@ public class WindowPartsBoneCheckBox : MonoBehaviour
 		Dictionary<string, string> maidStoreData = this.pose_edit_window_.GetMaidStoreData(this.mgr.select_maid);
 		if (check_box == this.CheckBoxMuneLPhysics)
 		{
-			this.mgr.select_maid.body0.jbMuneL.enabled = !check_box.check;
-			this.mgr.select_maid.body0.MuneYureL((float)((!this.mgr.select_maid.body0.jbMuneL.enabled) ? 0 : 1));
+			this.mgr.select_maid.body0.SetMuneYureLWithEnable(!check_box.check);
 			maidStoreData["use_mune_key_l"] = check_box.check.ToString();
 		}
 		else
 		{
-			this.mgr.select_maid.body0.jbMuneR.enabled = !check_box.check;
-			this.mgr.select_maid.body0.MuneYureR((float)((!this.mgr.select_maid.body0.jbMuneR.enabled) ? 0 : 1));
+			this.mgr.select_maid.body0.SetMuneYureR(!check_box.check);
 			maidStoreData["use_mune_key_r"] = check_box.check.ToString();
 		}
 		this.OnMotionUpdate();
@@ -205,8 +203,16 @@ public class WindowPartsBoneCheckBox : MonoBehaviour
 		}
 		if (this.BoneSetType == IKManager.BoneSetType.Body)
 		{
-			this.mgr.select_maid.body0.jbMuneL.enabled = !bool.Parse(maidStoreData["use_mune_key_l"]);
-			this.mgr.select_maid.body0.jbMuneR.enabled = !bool.Parse(maidStoreData["use_mune_key_r"]);
+			if (this.mgr.select_maid.body0.IsCrcBody)
+			{
+				this.mgr.select_maid.body0.dbMuneL.isDynamicOn = !bool.Parse(maidStoreData["use_mune_key_l"]);
+				this.mgr.select_maid.body0.dbMuneR.isDynamicOn = !bool.Parse(maidStoreData["use_mune_key_r"]);
+			}
+			else
+			{
+				this.mgr.select_maid.body0.jbMuneL.enabled = !bool.Parse(maidStoreData["use_mune_key_l"]);
+				this.mgr.select_maid.body0.jbMuneR.enabled = !bool.Parse(maidStoreData["use_mune_key_r"]);
+			}
 		}
 		if (this.pose_edit_window_.ik_mgr != null)
 		{

+ 18 - 9
Assembly-CSharp/WindowPartsFaceMorph.cs

@@ -53,7 +53,10 @@ public class WindowPartsFaceMorph : MonoBehaviour
 				for (int k = 0; k < this.propValInput[j].SliderAndInput.Length; k++)
 				{
 					WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet = this.propValInput[j].SliderAndInput[k];
-					storeData.Add("morph_val_" + sliderAndInputSet.Name, this.GetValue(maid, sliderAndInputSet.Name).ToString("G9"));
+					if (maid.IsCrcBody || !(sliderAndInputSet.Name == "tanga"))
+					{
+						storeData.Add("morph_val_" + sliderAndInputSet.Name, this.GetValue(maid, sliderAndInputSet.Name).ToString("G9"));
+					}
 				}
 			}
 		}
@@ -64,7 +67,10 @@ public class WindowPartsFaceMorph : MonoBehaviour
 				for (int m = 0; m < this.propValInput[l].SliderAndInput.Length; m++)
 				{
 					WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet2 = this.propValInput[l].SliderAndInput[m];
-					this.SetValue(maid, sliderAndInputSet2.Name, float.Parse(storeData["morph_val_" + sliderAndInputSet2.Name]));
+					if (maid.IsCrcBody || !(sliderAndInputSet2.Name == "tanga"))
+					{
+						this.SetValue(maid, sliderAndInputSet2.Name, float.Parse(storeData["morph_val_" + sliderAndInputSet2.Name]));
+					}
 				}
 			}
 		}
@@ -157,13 +163,16 @@ public class WindowPartsFaceMorph : MonoBehaviour
 			for (int j = 0; j < this.propValInput[i].SliderAndInput.Length; j++)
 			{
 				string name = this.propValInput[i].SliderAndInput[j].Name;
-				PhotoSliderAndInput sliderAndInput = this.propValInput[i].GetSliderAndInput(name);
-				sliderAndInput.ResetNum = this.backupBlendSets[maid.status.guid][this.selectData.setting_name][this.GetBlendIdx(maid.body0.Face, blendIdDic, name)];
-				List<Action<float>> onChangeValue = sliderAndInput.onChangeValue;
-				sliderAndInput.onChangeValue = new List<Action<float>>();
-				sliderAndInput.value = this.GetValue(maid, name);
-				sliderAndInput.onChangeValue = onChangeValue;
-				this.faceWindow.GetMaidStoreData(maid)["morph_val_" + name] = sliderAndInput.value.ToString("G9");
+				if (maid.IsCrcBody || !(name == "tanga"))
+				{
+					PhotoSliderAndInput sliderAndInput = this.propValInput[i].GetSliderAndInput(name);
+					sliderAndInput.ResetNum = this.backupBlendSets[maid.status.guid][this.selectData.setting_name][this.GetBlendIdx(maid.body0.Face, blendIdDic, name)];
+					List<Action<float>> onChangeValue = sliderAndInput.onChangeValue;
+					sliderAndInput.onChangeValue = new List<Action<float>>();
+					sliderAndInput.value = this.GetValue(maid, name);
+					sliderAndInput.onChangeValue = onChangeValue;
+					this.faceWindow.GetMaidStoreData(maid)["morph_val_" + name] = sliderAndInput.value.ToString("G9");
+				}
 			}
 		}
 	}

+ 1 - 1
Assembly-CSharp/WindowPartsFingerPreset.cs

@@ -182,7 +182,7 @@ public class WindowPartsFingerPreset : MonoBehaviour
 	{
 		WindowPartsFingerBlend.Type blendType = tareget_blend.BlendType;
 		FingerBlend.BaseFinger baseFingerClass = tareget_blend.GetBaseFingerClass(tareget_blend.mgr.select_maid, blendType);
-		XElement xelement = new XElement("GameVersion", 1550);
+		XElement xelement = new XElement("GameVersion", 1570);
 		XElement xelement2 = new XElement("RightData", blendType == WindowPartsFingerBlend.Type.RightArm || blendType == WindowPartsFingerBlend.Type.RightLeg);
 		XElement xelement3 = new XElement("BinaryData", Convert.ToBase64String(baseFingerClass.GetBinary()));
 		XNode[] contents = new XNode[]

+ 25 - 4
Assembly-CSharp/WindowPartsMekureCheckBox.cs

@@ -73,6 +73,10 @@ public class WindowPartsMekureCheckBox : WFCheckBox
 		{
 			return false;
 		}
+		if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Hadake && !maid.IsCrcBody)
+		{
+			return false;
+		}
 		string[] category_array = this.category_array;
 		for (int i = 0; i < category_array.Length; i++)
 		{
@@ -120,10 +124,22 @@ public class WindowPartsMekureCheckBox : WFCheckBox
 					"onepiece"
 				};
 			}
+			if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Zurasi)
+			{
+				return new string[]
+				{
+					"panz",
+					"mizugi"
+				};
+			}
 			return new string[]
 			{
-				"panz",
-				"mizugi"
+				"wear",
+				"onepiece",
+				"mizugi_top",
+				"mizugi",
+				"bra",
+				"slip"
 			};
 		}
 	}
@@ -140,7 +156,11 @@ public class WindowPartsMekureCheckBox : WFCheckBox
 			{
 				return "めくれスカート後ろ";
 			}
-			return "パンツずらし";
+			if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Zurasi)
+			{
+				return "パンツずらし";
+			}
+			return "はだけ";
 		}
 	}
 
@@ -154,6 +174,7 @@ public class WindowPartsMekureCheckBox : WFCheckBox
 	{
 		MekureFront,
 		MekureBack,
-		Zurasi
+		Zurasi,
+		Hadake
 	}
 }

+ 68 - 0
Assembly-CSharp/WristTwist.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class WristTwist : ATwistCtrl
+{
+	public WristTwist(bool is_left, TBody body) : base((!is_left) ? Maid.AutoTwist.WristR : Maid.AutoTwist.WristL, body)
+	{
+		string str;
+		if (body.IsCrcBody)
+		{
+			str = "Bip01";
+		}
+		else
+		{
+			str = (body.boMAN ? "ManBip" : "Bip01");
+		}
+		string str2 = (!is_left) ? " R Hand" : " L Hand";
+		base.bone = body.GetBone(str + str2);
+		base.mrBone = base.GetMRBone(str + str2);
+		if (body.IsCrcBody)
+		{
+			for (int i = 0; i < 6; i++)
+			{
+				string name = (!is_left) ? string.Format("ForeTwist{0}_R", i + 1) : string.Format("ForeTwist{0}_L", i + 1);
+				Transform transform = base.bone.parent.Find(name);
+				if (transform)
+				{
+					Transform transform2 = base.mrBone.parent.Find(name);
+					if (transform2)
+					{
+						base.twistBones.Add(new KeyValuePair<Transform, Transform>(transform2, transform));
+					}
+				}
+			}
+		}
+	}
+
+	public override void ApplyTwist()
+	{
+		Vector3 vector = base.bone.rotation * Vector3.forward;
+		Vector3 vector2 = base.bone.parent.rotation * base.mrBone.localRotation * Vector3.forward;
+		Vector3 normalized = (base.bone.position - base.bone.parent.position).normalized;
+		vector2 = (vector2 - normalized * Vector3.Dot(vector2, normalized)).normalized;
+		vector = (vector - normalized * Vector3.Dot(vector, normalized)).normalized;
+		float f = Vector3.Dot(vector2, vector);
+		float num = Mathf.Acos(f) * 57.29578f;
+		if (float.IsNaN(num))
+		{
+			num = 0f;
+		}
+		else
+		{
+			Vector3 lhs = Vector3.Cross(normalized, vector2);
+			if (Vector3.Dot(lhs, vector) < 0f)
+			{
+				num = -num;
+			}
+		}
+		for (int i = 0; i < base.twistBones.Count; i++)
+		{
+			KeyValuePair<Transform, Transform> keyValuePair = base.twistBones[i];
+			float num2 = (float)i / (float)(base.twistBones.Count - 1);
+			keyValuePair.Value.localRotation = keyValuePair.Key.localRotation;
+			keyValuePair.Value.rotation = Quaternion.AngleAxis(num * num2, normalized) * keyValuePair.Value.rotation;
+		}
+	}
+}

+ 59 - 14
Assembly-CSharp/YotogiManager.cs

@@ -1,5 +1,7 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
+using MaidExtension;
 using MaidStatus;
 using MaidStatus.CsvData;
 using Schedule;
@@ -452,8 +454,11 @@ public class YotogiManager : WfScreenManager
 			{
 				stockMaid.body0.MuneYureL(1f);
 				stockMaid.body0.MuneYureR(1f);
-				stockMaid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-				stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+				stockMaid.fullBodyIK.AllIKDetach(0f);
+				if (stockMaid.body0.IsCrcBody)
+				{
+					stockMaid.body0.KupaReset();
+				}
 				TBodySkin tbodySkin = stockMaid.body0.goSlot[0];
 				if (tbodySkin != null && tbodySkin.kupaCtrl != null)
 				{
@@ -466,13 +471,22 @@ public class YotogiManager : WfScreenManager
 			Maid stockMan = characterMgr.GetStockMan(j);
 			if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
 			{
-				stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-				stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-				TBodySkin tbodySkin2 = this.maid.body0.goSlot[0];
+				stockMan.fullBodyIK.AllIKDetach(0f);
+				TBodySkin tbodySkin2 = stockMan.body0.goSlot[0];
 				if (tbodySkin2 != null && tbodySkin2.kupaCtrl != null)
 				{
 					tbodySkin2.kupaCtrl.ResetAll();
 				}
+				Maid pairMan = stockMan.pairMan;
+				if (pairMan && pairMan.IsCrcBody && pairMan.body0.isLoadedBody && pairMan.Visible)
+				{
+					pairMan.fullBodyIK.AllIKDetach(0f);
+					tbodySkin2 = pairMan.body0.goSlot[0];
+					if (tbodySkin2 != null && tbodySkin2.kupaCtrl != null)
+					{
+						tbodySkin2.kupaCtrl.ResetAll();
+					}
+				}
 			}
 		}
 		string[] array = new string[]
@@ -507,6 +521,29 @@ public class YotogiManager : WfScreenManager
 				{
 					maid.ResetProp(array[l], true);
 				}
+				MaidCostumeChangeController maidCostumeChangeController = new MaidCostumeChangeController(maid);
+				IEnumerator enumerator = Enum.GetValues(typeof(MaidCostumeChangeController.CostumeType)).GetEnumerator();
+				try
+				{
+					while (enumerator.MoveNext())
+					{
+						object obj = enumerator.Current;
+						MaidCostumeChangeController.CostumeType costumeType = (MaidCostumeChangeController.CostumeType)obj;
+						if (costumeType != MaidCostumeChangeController.CostumeType.Hadake)
+						{
+							maidCostumeChangeController.SetEnabledCostumeType(costumeType, false, null);
+						}
+					}
+				}
+				finally
+				{
+					IDisposable disposable;
+					if ((disposable = (enumerator as IDisposable)) != null)
+					{
+						disposable.Dispose();
+					}
+				}
+				maid.mekureController.Reset(null);
 				maid.AllProcPropSeqStart();
 			}
 		}
@@ -751,7 +788,15 @@ public class YotogiManager : WfScreenManager
 		int num = 0;
 		if (this.is_script_call_ && !this.is_free_mode)
 		{
-			num = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime).Count;
+			List<Maid> list = new List<Maid>();
+			foreach (Maid maid in ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime))
+			{
+				if (this.maid.IsCrcBody == maid.IsCrcBody)
+				{
+					list.Add(maid);
+				}
+			}
+			num = list.Count;
 			if (num == 0)
 			{
 				num = 1;
@@ -762,7 +807,7 @@ public class YotogiManager : WfScreenManager
 			for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
 			{
 				Maid stockMaid = characterMgr.GetStockMaid(i);
-				if (stockMaid != null && stockMaid.status.heroineType != HeroineType.Sub)
+				if (stockMaid != null && this.maid.status.heroineType != HeroineType.Sub && this.maid.IsCrcBody == stockMaid.IsCrcBody)
 				{
 					num++;
 				}
@@ -781,21 +826,21 @@ public class YotogiManager : WfScreenManager
 		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
 		if (this.is_script_call_ && !this.is_free_mode)
 		{
-			List<Maid> yotogiMaids = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
-			for (int i = 0; i < yotogiMaids.Count; i++)
+			List<Maid> list2 = new List<Maid>();
+			foreach (Maid maid in ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime))
 			{
-				if (yotogiMaids[i] != this.maid_)
+				if (maid != this.maid && this.maid.IsCrcBody == maid.IsCrcBody)
 				{
-					list.Add(yotogiMaids[i]);
+					list.Add(maid);
 				}
 			}
 		}
 		else
 		{
-			for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
+			for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
 			{
-				Maid stockMaid = characterMgr.GetStockMaid(j);
-				if (stockMaid != null && this.maid_ != stockMaid && stockMaid.status.heroineType != HeroineType.Sub)
+				Maid stockMaid = characterMgr.GetStockMaid(i);
+				if (stockMaid != null && this.maid != stockMaid && stockMaid.status.heroineType != HeroineType.Sub && this.maid.IsCrcBody == stockMaid.IsCrcBody)
 				{
 					list.Add(stockMaid);
 				}

+ 2 - 4
Assembly-CSharp/YotogiOldManager.cs

@@ -302,8 +302,7 @@ public class YotogiOldManager : WfScreenManager
 			{
 				stockMaid.body0.MuneYureL(1f);
 				stockMaid.body0.MuneYureR(1f);
-				stockMaid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-				stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+				stockMaid.fullBodyIK.AllIKDetach(0f);
 			}
 		}
 		for (int j = 0; j < characterMgr.GetStockManCount(); j++)
@@ -311,8 +310,7 @@ public class YotogiOldManager : WfScreenManager
 			Maid stockMan = characterMgr.GetStockMan(j);
 			if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
 			{
-				stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
-				stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
+				stockMan.fullBodyIK.AllIKDetach(0f);
 			}
 		}
 		string[] array = new string[]

+ 1 - 1
Assembly-CSharp/YotogiOldSkillSelectWaitMotion.cs

@@ -83,7 +83,7 @@ public static class YotogiOldSkillSelectWaitMotion
 			scriptMgr.is_motion_blend = false;
 			bool compatibilityMode = scriptMgr.compatibilityMode;
 			scriptMgr.compatibilityMode = true;
-			scriptMgr.LoadMotionScript(0, false, data.motion_script_file, data.motion_script_label, string.Empty, string.Empty, false, true, false);
+			scriptMgr.LoadMotionScript(0, false, data.motion_script_file, data.motion_script_label, string.Empty, string.Empty, false, true, false, false);
 			scriptMgr.compatibilityMode = compatibilityMode;
 			scriptMgr.is_motion_blend = true;
 			maid.FaceAnime(data.face_name, 0f, 0);

+ 1 - 1
Assembly-CSharp/YotogiSkillSelectWaitMotion.cs

@@ -57,7 +57,7 @@ public static class YotogiSkillSelectWaitMotion
 			YotogiSkillSelectWaitMotion.Data data = YotogiSkillSelectWaitMotion.GetData(maid);
 			ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
 			scriptMgr.is_motion_blend = false;
-			scriptMgr.LoadMotionScript(0, false, data.motion_script_file, data.motion_script_label, string.Empty, string.Empty, false, true, false);
+			scriptMgr.LoadMotionScript(0, false, data.motion_script_file, data.motion_script_label, string.Empty, string.Empty, false, true, false, false);
 			scriptMgr.is_motion_blend = true;
 			maid.FaceAnime(data.face_name, 0f, 0);
 			maid.FaceBlend("無し");

+ 17 - 2
Assembly-CSharp/com/workman/cm3d2/scene/dailyEtc/DailyAPI.cs

@@ -210,7 +210,15 @@ namespace com.workman.cm3d2.scene.dailyEtc
 				if (isActive)
 				{
 					MaidColliderCollect maidColliderCollect = MaidColliderCollect.AddColliderCollect(PrivateModeMgr.Instance.PrivateMaid);
-					List<CapsuleCollider> list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+					List<CapsuleCollider> list = new List<CapsuleCollider>();
+					if (PrivateModeMgr.Instance.PrivateMaid.body0.IsCrcBody)
+					{
+						list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Crc);
+					}
+					else
+					{
+						list = maidColliderCollect.AddCollider(MaidColliderCollect.ColliderType.Grab);
+					}
 					for (int i = 0; i < list.Count; i++)
 					{
 						ColliderEventVR colliderEventVR = list[i].gameObject.AddComponent<ColliderEventVR>();
@@ -229,7 +237,14 @@ namespace com.workman.cm3d2.scene.dailyEtc
 					Maid privateMaid = PrivateModeMgr.Instance.PrivateMaid;
 					if (privateMaid != null && privateMaid.GetComponent<MaidColliderCollect>() != null)
 					{
-						privateMaid.GetComponent<MaidColliderCollect>().RemoveCollider(MaidColliderCollect.ColliderType.Grab);
+						if (privateMaid.body0.IsCrcBody)
+						{
+							privateMaid.GetComponent<MaidColliderCollect>().RemoveCollider(MaidColliderCollect.ColliderType.Crc);
+						}
+						else
+						{
+							privateMaid.GetComponent<MaidColliderCollect>().RemoveCollider(MaidColliderCollect.ColliderType.Grab);
+						}
 						UnityEngine.Object.Destroy(privateMaid.GetComponent<MaidColliderCollect>());
 					}
 				}

+ 19 - 3
Assembly-CSharp/jiggleBone.cs

@@ -3,12 +3,13 @@ using UnityEngine;
 
 public class jiggleBone : MonoBehaviour
 {
-	private void Awake()
+	public void Init(TBody tbody)
 	{
+		this.m_tbody = tbody;
 		Vector3 vector = base.transform.position + base.transform.TransformDirection(new Vector3(this.boneAxis.x * this.targetDistance, this.boneAxis.y * this.targetDistance, this.boneAxis.z * this.targetDistance));
 		this.dynamicPos = vector;
 		this.defQtn = base.transform.localRotation;
-		if (base.transform.name == "Mune_R")
+		if (!this.m_tbody.IsCrcBody && base.transform.name == "Mune_R")
 		{
 			this.MuneL_y = -1f;
 		}
@@ -172,7 +173,18 @@ public class jiggleBone : MonoBehaviour
 		}
 		num6 *= num7 * this.BlendValueON;
 		num6 += 3.1415927f;
-		this.m_trSub.localRotation = Quaternion.EulerRotation(0f, 0f, num6);
+		if (this.m_tbody.IsCrcBody)
+		{
+			this.m_trSub.localRotation = Quaternion.Euler(0f, 0f, -25f + 50f * this.MuneDir) * Quaternion.Euler(0f, 0f, num6);
+		}
+		else
+		{
+			this.m_trSub.localRotation = Quaternion.EulerRotation(0f, 0f, num6);
+		}
+	}
+
+	private void Update()
+	{
 	}
 
 	public bool debugMode;
@@ -255,6 +267,10 @@ public class jiggleBone : MonoBehaviour
 
 	private Transform m_trSub;
 
+	private TBody m_tbody;
+
+	public float MuneDir = 0.5f;
+
 	public bool boWarpInit;
 
 	private float m_fBackBlendValueON2;

+ 20 - 0
Assembly-CSharp/kt/ISaveLoadBinary.cs

@@ -0,0 +1,20 @@
+using System;
+using System.IO;
+
+namespace kt
+{
+	public interface ISaveLoadBinary
+	{
+		string Header { get; }
+
+		int Version { get; }
+
+		string DirectoryPath { get; set; }
+
+		string FileName { get; set; }
+
+		void Save(BinaryWriter writer);
+
+		void Load(BinaryReader reader, int version);
+	}
+}

+ 52 - 0
Assembly-CSharp/kt/PermTempAction.2.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt
+{
+	public class PermTempAction<T0>
+	{
+		public void Add(Action<T0> callback, bool is_temp = false)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic[callback] = is_temp;
+			}
+		}
+
+		public void Remove(Action<T0> callback)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic.Remove(callback);
+			}
+		}
+
+		public void Clear()
+		{
+			this.CallBackFlagDic.Clear();
+		}
+
+		public void Invoke(T0 t0)
+		{
+			List<Action<T0>> list = new List<Action<T0>>();
+			foreach (KeyValuePair<Action<T0>, bool> keyValuePair in this.CallBackFlagDic)
+			{
+				Action<T0> key = keyValuePair.Key;
+				if (keyValuePair.Value || key == null)
+				{
+					list.Add(key);
+				}
+				if (key != null)
+				{
+					key(t0);
+				}
+			}
+			for (int i = 0; i < list.Count; i++)
+			{
+				this.CallBackFlagDic.Remove(list[i]);
+			}
+		}
+
+		private Dictionary<Action<T0>, bool> CallBackFlagDic = new Dictionary<Action<T0>, bool>();
+	}
+}

+ 52 - 0
Assembly-CSharp/kt/PermTempAction.3.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt
+{
+	public class PermTempAction<T0, T1>
+	{
+		public void Add(Action<T0, T1> callback, bool is_temp = false)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic[callback] = is_temp;
+			}
+		}
+
+		public void Remove(Action<T0, T1> callback)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic.Remove(callback);
+			}
+		}
+
+		public void Clear()
+		{
+			this.CallBackFlagDic.Clear();
+		}
+
+		public void Invoke(T0 t0, T1 t1)
+		{
+			List<Action<T0, T1>> list = new List<Action<T0, T1>>();
+			foreach (KeyValuePair<Action<T0, T1>, bool> keyValuePair in this.CallBackFlagDic)
+			{
+				Action<T0, T1> key = keyValuePair.Key;
+				if (keyValuePair.Value || key == null)
+				{
+					list.Add(key);
+				}
+				if (key != null)
+				{
+					key(t0, t1);
+				}
+			}
+			for (int i = 0; i < list.Count; i++)
+			{
+				this.CallBackFlagDic.Remove(list[i]);
+			}
+		}
+
+		private Dictionary<Action<T0, T1>, bool> CallBackFlagDic = new Dictionary<Action<T0, T1>, bool>();
+	}
+}

+ 52 - 0
Assembly-CSharp/kt/PermTempAction.4.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt
+{
+	public class PermTempAction<T0, T1, T2>
+	{
+		public void Add(Action<T0, T1, T2> callback, bool is_temp = false)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic[callback] = is_temp;
+			}
+		}
+
+		public void Remove(Action<T0, T1, T2> callback)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic.Remove(callback);
+			}
+		}
+
+		public void Clear()
+		{
+			this.CallBackFlagDic.Clear();
+		}
+
+		public void Invoke(T0 t0, T1 t1, T2 t2)
+		{
+			List<Action<T0, T1, T2>> list = new List<Action<T0, T1, T2>>();
+			foreach (KeyValuePair<Action<T0, T1, T2>, bool> keyValuePair in this.CallBackFlagDic)
+			{
+				Action<T0, T1, T2> key = keyValuePair.Key;
+				if (keyValuePair.Value || key == null)
+				{
+					list.Add(key);
+				}
+				if (key != null)
+				{
+					key(t0, t1, t2);
+				}
+			}
+			for (int i = 0; i < list.Count; i++)
+			{
+				this.CallBackFlagDic.Remove(list[i]);
+			}
+		}
+
+		private Dictionary<Action<T0, T1, T2>, bool> CallBackFlagDic = new Dictionary<Action<T0, T1, T2>, bool>();
+	}
+}

+ 52 - 0
Assembly-CSharp/kt/PermTempAction.5.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt
+{
+	public class PermTempAction<T0, T1, T2, T3>
+	{
+		public void Add(Action<T0, T1, T2, T3> callback, bool is_temp = false)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic[callback] = is_temp;
+			}
+		}
+
+		public void Remove(Action<T0, T1, T2, T3> callback)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic.Remove(callback);
+			}
+		}
+
+		public void Clear()
+		{
+			this.CallBackFlagDic.Clear();
+		}
+
+		public void Invoke(T0 t0, T1 t1, T2 t2, T3 t3)
+		{
+			List<Action<T0, T1, T2, T3>> list = new List<Action<T0, T1, T2, T3>>();
+			foreach (KeyValuePair<Action<T0, T1, T2, T3>, bool> keyValuePair in this.CallBackFlagDic)
+			{
+				Action<T0, T1, T2, T3> key = keyValuePair.Key;
+				if (keyValuePair.Value || key == null)
+				{
+					list.Add(key);
+				}
+				if (key != null)
+				{
+					key(t0, t1, t2, t3);
+				}
+			}
+			for (int i = 0; i < list.Count; i++)
+			{
+				this.CallBackFlagDic.Remove(list[i]);
+			}
+		}
+
+		private Dictionary<Action<T0, T1, T2, T3>, bool> CallBackFlagDic = new Dictionary<Action<T0, T1, T2, T3>, bool>();
+	}
+}

+ 52 - 0
Assembly-CSharp/kt/PermTempAction.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt
+{
+	public class PermTempAction
+	{
+		public void Add(Action callback, bool is_temp = false)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic[callback] = is_temp;
+			}
+		}
+
+		public void Remove(Action callback)
+		{
+			if (callback != null)
+			{
+				this.CallBackFlagDic.Remove(callback);
+			}
+		}
+
+		public void Clear()
+		{
+			this.CallBackFlagDic.Clear();
+		}
+
+		public void Invoke()
+		{
+			List<Action> list = new List<Action>();
+			foreach (KeyValuePair<Action, bool> keyValuePair in this.CallBackFlagDic)
+			{
+				Action key = keyValuePair.Key;
+				if (keyValuePair.Value || key == null)
+				{
+					list.Add(key);
+				}
+				if (key != null)
+				{
+					key();
+				}
+			}
+			for (int i = 0; i < list.Count; i++)
+			{
+				this.CallBackFlagDic.Remove(list[i]);
+			}
+		}
+
+		private Dictionary<Action, bool> CallBackFlagDic = new Dictionary<Action, bool>();
+	}
+}

+ 175 - 0
Assembly-CSharp/kt/Physics/ANativeColliderBase.cs

@@ -0,0 +1,175 @@
+using System;
+using System.IO;
+using kt.Utility;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	public abstract class ANativeColliderBase : MonoBehaviour
+	{
+		public abstract NativeColliderStatus status { get; protected set; }
+
+		public virtual Vector3 worldCenter
+		{
+			get
+			{
+				return base.transform.TransformPoint(this.status.center);
+			}
+		}
+
+		protected virtual void Awake()
+		{
+			NativeColliderStatus status = this.status;
+			status.onBeforeSerialize = (Action)Delegate.Combine(status.onBeforeSerialize, new Action(delegate()
+			{
+				if (this == null)
+				{
+					return;
+				}
+				this.status.name = base.name;
+				this.status.parentName = ((!(base.transform.parent != null)) ? string.Empty : base.transform.parent.name);
+				this.status.localPosition = base.transform.localPosition;
+				this.status.localRotation = base.transform.localRotation;
+				this.status.localScale = base.transform.localScale;
+			}));
+			NativeColliderStatus status2 = this.status;
+			status2.onAfterDeserialize = (Action)Delegate.Combine(status2.onAfterDeserialize, new Action(this.SetTransformFromStatus));
+		}
+
+		public virtual bool Collide(ref Vector3 position, float radius, NativeColliderStatus.Bound bound)
+		{
+			NativeColliderStatus.Bound bound2 = this.status.bound;
+			this.status.bound = bound;
+			bool result = this.Collide(ref position, radius);
+			this.status.bound = bound2;
+			return result;
+		}
+
+		public virtual bool Collide(ref Vector3 position, float radius)
+		{
+			return false;
+		}
+
+		public bool Collide(ANativeColliderBase collider, out Vector3 normal)
+		{
+			normal = Vector3.zero;
+			switch (collider.status.colliderType)
+			{
+			case NativeColliderStatus.ColliderType.Plane:
+				return this.CollidePlane(collider as NativePlaneCollider, ref normal);
+			case NativeColliderStatus.ColliderType.Capsule:
+				return this.CollideCapsule(collider as NativeCapsuleCollider, ref normal);
+			case NativeColliderStatus.ColliderType.Sphere:
+				return this.CollideSphere(collider as NativeSphereCollider, ref normal);
+			case NativeColliderStatus.ColliderType.MaidPropCol:
+				return this.CollideMaidPropCol(collider as NativeMaidPropCollider, ref normal);
+			default:
+				return false;
+			}
+		}
+
+		protected virtual bool CollidePlane(NativePlaneCollider plane, ref Vector3 normal)
+		{
+			bool flag = plane.Collide(this, out normal);
+			if (flag)
+			{
+				normal = -normal;
+			}
+			return flag;
+		}
+
+		protected virtual bool CollideCapsule(NativeCapsuleCollider capsule, ref Vector3 normal)
+		{
+			return false;
+		}
+
+		protected virtual bool CollideSphere(NativeSphereCollider sphere, ref Vector3 normal)
+		{
+			Vector3 worldCenter = sphere.worldCenter;
+			float radius = sphere.sphereStatus.radius;
+			bool flag = this.Collide(ref worldCenter, radius, NativeColliderStatus.Bound.Outside);
+			if (flag)
+			{
+				normal = worldCenter - sphere.worldCenter;
+			}
+			return flag;
+		}
+
+		protected virtual bool CollideMaidPropCol(NativeMaidPropCollider mp_col, ref Vector3 normal)
+		{
+			return this.CollideCapsule(mp_col, ref normal);
+		}
+
+		public float GetLossyScale()
+		{
+			return Mathf.Abs(base.transform.lossyScale.x);
+		}
+
+		public abstract void Save(StreamWriter writer);
+
+		protected void Save<T>(StreamWriter writer) where T : NativeColliderStatus
+		{
+			T t = this.status as T;
+			string value = JsonUtility.ToJson(t);
+			writer.Write(value);
+		}
+
+		public abstract void Load(StreamReader reader, Transform parent_search_root);
+
+		protected void Load<T>(StreamReader reader, Transform parent_search_root) where T : NativeColliderStatus
+		{
+			this.ParentSearchRoot = parent_search_root;
+			string json = reader.ReadToEnd();
+			this.status = JsonUtility.FromJson<T>(json);
+		}
+
+		public T GetStatus<T>() where T : NativeColliderStatus
+		{
+			return this.status as T;
+		}
+
+		public void SetStatus(NativeColliderStatus status, TBody body)
+		{
+			Transform transform = null;
+			if (body)
+			{
+				transform = body.GetBone(status.parentName);
+				if (transform)
+				{
+					transform = transform.parent;
+				}
+			}
+			this.SetStatus(status, transform);
+		}
+
+		public virtual void SetStatus(NativeColliderStatus status, Transform parent_search_root = null)
+		{
+			if (status == null)
+			{
+				return;
+			}
+			this.status = status;
+			this.ParentSearchRoot = parent_search_root;
+			this.SetTransformFromStatus();
+		}
+
+		private void SetTransformFromStatus()
+		{
+			base.name = this.status.name;
+			if (this.ParentSearchRoot && !string.IsNullOrEmpty(this.status.parentName))
+			{
+				Transform transform = this.ParentSearchRoot.SearchChildByName(this.status.parentName);
+				if (base.transform.parent != transform)
+				{
+					DebugUtility.Assert.IsNotNull<Transform>(transform, "物理体親ボーンがありません。");
+					base.transform.SetParent(transform, false);
+				}
+			}
+			base.transform.localPosition = this.status.localPosition;
+			base.transform.localRotation = this.status.localRotation;
+			base.transform.localScale = this.status.localScale;
+		}
+
+		private Transform ParentSearchRoot;
+	}
+}

+ 235 - 0
Assembly-CSharp/kt/Physics/NativeCapsuleCollider.cs

@@ -0,0 +1,235 @@
+using System;
+using System.IO;
+using kt.Utility;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	public class NativeCapsuleCollider : ANativeColliderBase
+	{
+		public virtual NativeCapsuleColliderStatus capsuleStatus
+		{
+			get
+			{
+				return this.CapsuleStatus;
+			}
+		}
+
+		public override NativeColliderStatus status
+		{
+			get
+			{
+				return this.CapsuleStatus;
+			}
+			protected set
+			{
+				this.CapsuleStatus = (value as NativeCapsuleColliderStatus);
+			}
+		}
+
+		public Vector3 localDirection
+		{
+			get
+			{
+				Vector3 vector = MathUtility.GetPrimitiveVector(this.capsuleStatus.direction);
+				if (this.capsuleStatus.isDirectionInverse)
+				{
+					vector = -vector;
+				}
+				return vector;
+			}
+		}
+
+		public Vector3 worldDirection
+		{
+			get
+			{
+				return base.transform.TransformDirection(this.localDirection);
+			}
+		}
+
+		public Vector3 startPos
+		{
+			get
+			{
+				return this.worldCenter - this.worldDirection * this.capsuleStatus.height / 2f;
+			}
+		}
+
+		public Vector3 endPos
+		{
+			get
+			{
+				return this.worldCenter + this.worldDirection * this.capsuleStatus.height / 2f;
+			}
+		}
+
+		public virtual float startRadius
+		{
+			get
+			{
+				return this.capsuleStatus.startRadius * base.GetLossyScale();
+			}
+		}
+
+		public virtual float endRadius
+		{
+			get
+			{
+				return this.capsuleStatus.endRadius * base.GetLossyScale();
+			}
+		}
+
+		public override bool Collide(ref Vector3 position, float radius)
+		{
+			Vector3 lhs = position - this.startPos;
+			float num = Vector3.Dot(lhs, this.worldDirection);
+			Vector3 a = Vector3.zero;
+			Vector3 vector = Vector3.zero;
+			float num2;
+			if (num < 0f || num * num > (this.endPos - this.startPos).sqrMagnitude)
+			{
+				vector = ((num >= 0f) ? this.endPos : this.startPos);
+				a = position - vector;
+				num2 = ((num >= 0f) ? this.endRadius : this.startRadius);
+			}
+			else
+			{
+				vector = this.startPos + this.worldDirection * num;
+				a = position - vector;
+				if (this.capsuleStatus.height > 0f)
+				{
+					num2 = Mathf.Lerp(this.startRadius, this.endRadius, Mathf.Clamp01(num / this.capsuleStatus.height));
+				}
+				else
+				{
+					num2 = Mathf.Max(this.startRadius, this.endRadius);
+				}
+			}
+			if (this.status.bound == NativeColliderStatus.Bound.Outside)
+			{
+				float num3 = num2 + radius;
+				if (a.sqrMagnitude > num3 * num3)
+				{
+					return false;
+				}
+				float magnitude = a.magnitude;
+				if (magnitude > 0f)
+				{
+					position = vector + a / magnitude * num3;
+				}
+			}
+			else
+			{
+				float num4 = Mathf.Max(num2 - radius, 0f);
+				if (a.sqrMagnitude < num4 * num4)
+				{
+					return false;
+				}
+				float magnitude2 = a.magnitude;
+				if (magnitude2 > 0f)
+				{
+					position = vector + a / magnitude2 * num4;
+				}
+			}
+			return true;
+		}
+
+		protected override bool CollideCapsule(NativeCapsuleCollider capsule, ref Vector3 normal)
+		{
+			Vector3 zero = Vector3.zero;
+			float radius = 0f;
+			bool flag;
+			if (!this.IsIntersectProjection(capsule, ref zero, ref radius))
+			{
+				Vector3 b = zero;
+				flag = this.Collide(ref zero, radius);
+				if (flag)
+				{
+					normal = zero - b;
+				}
+				if (MathUtility.IsVector3NaN(normal))
+				{
+					flag = false;
+					normal = Vector3.zero;
+				}
+				return flag;
+			}
+			if (!capsule.IsIntersectProjection(this, ref zero, ref radius))
+			{
+				Vector3 b2 = zero;
+				flag = capsule.Collide(ref zero, radius);
+				if (flag)
+				{
+					normal = -(zero - b2);
+				}
+				if (MathUtility.IsVector3NaN(normal))
+				{
+					flag = false;
+					normal = Vector3.zero;
+				}
+				return flag;
+			}
+			Vector3 vector = Vector3.Cross(this.worldDirection, capsule.worldDirection).normalized;
+			float num = Vector3.Dot(capsule.startPos - this.startPos, vector);
+			if (num < 0f)
+			{
+				vector = -vector;
+				num = Mathf.Abs(num);
+			}
+			float num2 = Mathf.Max(this.startRadius, this.endRadius);
+			num2 += Mathf.Max(capsule.startRadius, capsule.endRadius);
+			if (num > num2)
+			{
+				return false;
+			}
+			flag = true;
+			Vector3 vector2 = capsule.startPos - vector * num;
+			Vector3 vector3 = capsule.endPos - vector * num;
+			float d = Vector3.Dot(this.startPos - vector2, capsule.worldDirection);
+			float num3 = Vector3.Distance(this.startPos, vector2 + capsule.worldDirection * d);
+			float d2 = Vector3.Dot(this.endPos - vector2, capsule.worldDirection);
+			float num4 = Vector3.Distance(this.endPos, vector2 + capsule.worldDirection * d2);
+			float num5 = num3 / (num3 + num4);
+			Vector3 a = this.startPos + this.worldDirection * this.capsuleStatus.height * num5;
+			float num6 = (capsule.capsuleStatus.height <= 0f) ? 0f : (Vector3.Dot(a - capsule.startPos, capsule.worldDirection) / capsule.capsuleStatus.height);
+			Vector3 vector4 = capsule.startPos + capsule.worldDirection * capsule.capsuleStatus.height * num6;
+			float num7 = Mathf.Lerp(this.startRadius, this.endRadius, num5);
+			num7 += Mathf.Lerp(capsule.startRadius, capsule.endRadius, num6);
+			if (num > num7)
+			{
+				return false;
+			}
+			normal = vector * (num7 - num);
+			if (MathUtility.IsVector3NaN(normal))
+			{
+				flag = false;
+				normal = Vector3.zero;
+			}
+			return flag;
+		}
+
+		private bool IsIntersectProjection(NativeCapsuleCollider capsule, ref Vector3 near_point, ref float near_radius)
+		{
+			Vector3 worldDirection = this.worldDirection;
+			Vector3 lhs = Vector3.Cross(worldDirection, capsule.startPos - this.startPos);
+			Vector3 rhs = Vector3.Cross(worldDirection, capsule.endPos - this.startPos);
+			near_radius = ((lhs.sqrMagnitude > rhs.sqrMagnitude) ? capsule.endRadius : capsule.startRadius);
+			near_point = ((lhs.sqrMagnitude > rhs.sqrMagnitude) ? capsule.endPos : capsule.startPos);
+			return Vector3.Dot(lhs, rhs) < 0f;
+		}
+
+		public override void Save(StreamWriter writer)
+		{
+			base.Save<NativeCapsuleColliderStatus>(writer);
+		}
+
+		public override void Load(StreamReader reader, Transform parent_search_root)
+		{
+			base.Load<NativeCapsuleColliderStatus>(reader, parent_search_root);
+		}
+
+		[SerializeField]
+		private NativeCapsuleColliderStatus CapsuleStatus = new NativeCapsuleColliderStatus();
+	}
+}

+ 30 - 0
Assembly-CSharp/kt/Physics/NativeCapsuleColliderStatus.cs

@@ -0,0 +1,30 @@
+using System;
+using kt.Utility;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	[Serializable]
+	public class NativeCapsuleColliderStatus : NativeColliderStatus
+	{
+		public NativeCapsuleColliderStatus()
+		{
+			this.colliderType = NativeColliderStatus.ColliderType.Capsule;
+		}
+
+		[Header("コライダーの方向")]
+		public MathUtility.VectorType direction = MathUtility.VectorType.Y;
+
+		[Header("コライダー方向を反転させるか")]
+		public bool isDirectionInverse;
+
+		[Header("始点側の半径")]
+		public float startRadius = 0.5f;
+
+		[Header("終点側の半径")]
+		public float endRadius = 0.5f;
+
+		[Header("長さ")]
+		public float height;
+	}
+}

+ 78 - 0
Assembly-CSharp/kt/Physics/NativeColliderStatus.cs

@@ -0,0 +1,78 @@
+using System;
+using kt.Serialization;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	[Serializable]
+	public class NativeColliderStatus : ASerializationVersionControl
+	{
+		public override int FixVersion
+		{
+			get
+			{
+				return 1000;
+			}
+		}
+
+		public override void OnBeforeSerialize()
+		{
+			base.OnBeforeSerialize();
+			if (this.onBeforeSerialize != null)
+			{
+				this.onBeforeSerialize();
+			}
+		}
+
+		public override void OnAfterDeserialize()
+		{
+			base.OnAfterDeserialize();
+			if (this.onAfterDeserialize != null)
+			{
+				this.onAfterDeserialize();
+			}
+		}
+
+		[ReadOnly]
+		public NativeColliderStatus.ColliderType colliderType;
+
+		[HideInInspector]
+		public string parentName;
+
+		[HideInInspector]
+		public string name;
+
+		[HideInInspector]
+		public Vector3 localPosition = Vector3.zero;
+
+		[HideInInspector]
+		public Quaternion localRotation = Quaternion.identity;
+
+		[HideInInspector]
+		public Vector3 localScale = Vector3.one;
+
+		public Vector3 center = Vector3.zero;
+
+		public NativeColliderStatus.Bound bound;
+
+		[NonSerialized]
+		public Action onBeforeSerialize;
+
+		[NonSerialized]
+		public Action onAfterDeserialize;
+
+		public enum ColliderType
+		{
+			Plane,
+			Capsule,
+			Sphere,
+			MaidPropCol
+		}
+
+		public enum Bound
+		{
+			Outside,
+			Inside
+		}
+	}
+}

+ 186 - 0
Assembly-CSharp/kt/Physics/NativeMaidPropCollider.cs

@@ -0,0 +1,186 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	public class NativeMaidPropCollider : NativeCapsuleCollider
+	{
+		public Maid chara { get; private set; }
+
+		public NativeMaidPropColliderStatus maidPropStatus
+		{
+			get
+			{
+				return this.MaidPropStatus;
+			}
+		}
+
+		public override NativeCapsuleColliderStatus capsuleStatus
+		{
+			get
+			{
+				return this.MaidPropStatus;
+			}
+		}
+
+		public override NativeColliderStatus status
+		{
+			get
+			{
+				return this.MaidPropStatus;
+			}
+			protected set
+			{
+				this.MaidPropStatus = (value as NativeMaidPropColliderStatus);
+			}
+		}
+
+		public override Vector3 worldCenter
+		{
+			get
+			{
+				float maxPropValue = this.GetMaxPropValue(this.maidPropStatus.centerMpnList);
+				return base.transform.TransformPoint(Vector3.Lerp(this.maidPropStatus.center, this.maidPropStatus.centerRateMax, maxPropValue));
+			}
+		}
+
+		public float startRadiusRate
+		{
+			get
+			{
+				return this.GetMaxPropValue(this.maidPropStatus.startRadiusMpnList);
+			}
+		}
+
+		public override float startRadius
+		{
+			get
+			{
+				return Mathf.Lerp(this.maidPropStatus.startRadius, this.maidPropStatus.maxStartRadius, this.startRadiusRate) * base.GetLossyScale();
+			}
+		}
+
+		public float endRadiusRate
+		{
+			get
+			{
+				return this.GetMaxPropValue(this.maidPropStatus.endRadiusMpnList);
+			}
+		}
+
+		public override float endRadius
+		{
+			get
+			{
+				return Mathf.Lerp(this.maidPropStatus.endRadius, this.maidPropStatus.maxEndRadius, this.endRadiusRate) * base.GetLossyScale();
+			}
+		}
+
+		public void SetChara(Maid chara)
+		{
+			if (!chara)
+			{
+				return;
+			}
+			if (this.chara)
+			{
+				this.chara.body0.onBoneMorphApply.Remove(new Action<string, float>(this.SetPropValueBoneMorph));
+				this.chara.body0.onVertexMorphApply.Remove(new Action<string, float>(this.SetPropValueVerTex));
+			}
+			this.chara = chara;
+			this.chara.body0.onBoneMorphApply.Add(new Action<string, float>(this.SetPropValueBoneMorph), false);
+			this.chara.body0.onVertexMorphApply.Add(new Action<string, float>(this.SetPropValueVerTex), false);
+			this.InitPropValue(this.maidPropStatus.centerMpnList);
+			this.InitPropValue(this.maidPropStatus.startRadiusMpnList);
+			this.InitPropValue(this.maidPropStatus.endRadiusMpnList);
+		}
+
+		private void InitPropValue(List<MPN> mpn_list)
+		{
+			foreach (MPN mpn in mpn_list)
+			{
+				MaidProp prop = this.chara.GetProp(mpn);
+				if (prop != null)
+				{
+					this.PropValueDic[mpn] = Mathf.InverseLerp((float)prop.min, (float)prop.max, (float)prop.value);
+				}
+			}
+		}
+
+		private void SetPropValue(MPN mpn, float val)
+		{
+			if (!this.PropValueDic.ContainsKey(mpn))
+			{
+				return;
+			}
+			MaidProp prop = this.chara.GetProp(mpn);
+			if (prop != null)
+			{
+				this.PropValueDic[mpn] = Mathf.InverseLerp((float)prop.min, (float)prop.max, (float)prop.value);
+			}
+		}
+
+		private void SetPropValueBoneMorph(string tag, float val)
+		{
+			foreach (MPN mpn in this.PropValueDic.Keys)
+			{
+				if (tag == mpn.ToString())
+				{
+					this.SetPropValue(mpn, val);
+					break;
+				}
+			}
+		}
+
+		private void SetPropValueVerTex(string tag, float val)
+		{
+			foreach (MPN mpn in this.PropValueDic.Keys)
+			{
+				if (tag == mpn.ToString().ToLower())
+				{
+					this.SetPropValue(mpn, val);
+					break;
+				}
+			}
+		}
+
+		private float GetMaxPropValue(List<MPN> mpn_list)
+		{
+			float num = 0f;
+			foreach (MPN key in mpn_list)
+			{
+				if (this.PropValueDic.ContainsKey(key))
+				{
+					num = Mathf.Max(num, this.PropValueDic[key]);
+				}
+			}
+			return num;
+		}
+
+		public override void Save(StreamWriter writer)
+		{
+			base.Save<NativeMaidPropColliderStatus>(writer);
+		}
+
+		public override void Load(StreamReader reader, Transform parent_search_root)
+		{
+			base.Load<NativeMaidPropColliderStatus>(reader, parent_search_root);
+		}
+
+		public override void SetStatus(NativeColliderStatus status, Transform parent_search_root = null)
+		{
+			base.SetStatus(status, parent_search_root);
+			this.PropValueDic.Clear();
+			this.InitPropValue(this.maidPropStatus.centerMpnList);
+			this.InitPropValue(this.maidPropStatus.startRadiusMpnList);
+			this.InitPropValue(this.maidPropStatus.endRadiusMpnList);
+		}
+
+		[SerializeField]
+		private NativeMaidPropColliderStatus MaidPropStatus = new NativeMaidPropColliderStatus();
+
+		private Dictionary<MPN, float> PropValueDic = new Dictionary<MPN, float>();
+	}
+}

+ 27 - 0
Assembly-CSharp/kt/Physics/NativeMaidPropColliderStatus.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	[Serializable]
+	public class NativeMaidPropColliderStatus : NativeCapsuleColliderStatus
+	{
+		public NativeMaidPropColliderStatus()
+		{
+			this.colliderType = NativeColliderStatus.ColliderType.MaidPropCol;
+		}
+
+		public List<MPN> centerMpnList = new List<MPN>();
+
+		public Vector3 centerRateMax = Vector3.zero;
+
+		public List<MPN> startRadiusMpnList = new List<MPN>();
+
+		public float maxStartRadius = 1f;
+
+		public List<MPN> endRadiusMpnList = new List<MPN>();
+
+		public float maxEndRadius = 1f;
+	}
+}

+ 126 - 0
Assembly-CSharp/kt/Physics/NativePlaneCollider.cs

@@ -0,0 +1,126 @@
+using System;
+using System.IO;
+using kt.Utility;
+using Newtonsoft.Json.Serialization;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	public class NativePlaneCollider : ANativeColliderBase
+	{
+		public NativePlaneColliderStatus planeStatus
+		{
+			get
+			{
+				return this.PlaneStatus;
+			}
+		}
+
+		public override NativeColliderStatus status
+		{
+			get
+			{
+				return this.PlaneStatus;
+			}
+			protected set
+			{
+				this.PlaneStatus = (value as NativePlaneColliderStatus);
+			}
+		}
+
+		public Vector3 localDirection
+		{
+			get
+			{
+				Vector3 vector = MathUtility.GetPrimitiveVector(this.planeStatus.direction);
+				if (this.planeStatus.isDirectionInverse)
+				{
+					vector = -vector;
+				}
+				return vector;
+			}
+		}
+
+		public Vector3 worldDirection
+		{
+			get
+			{
+				return base.transform.TransformDirection(this.localDirection);
+			}
+		}
+
+		public override bool Collide(ref Vector3 position, float radius)
+		{
+			Plane plane = new Plane(this.worldDirection, this.worldCenter);
+			float num = plane.GetDistanceToPoint(position) - radius;
+			if (this.status.bound == NativeColliderStatus.Bound.Outside)
+			{
+				if (num < 0f)
+				{
+					position -= this.worldDirection * num;
+					return true;
+				}
+			}
+			else if (num > 0f)
+			{
+				position -= this.worldDirection * num;
+				return true;
+			}
+			return false;
+		}
+
+		protected override bool CollidePlane(NativePlaneCollider plane, ref Vector3 normal)
+		{
+			Vector3 worldCenter = plane.worldCenter;
+			bool flag = this.Collide(ref worldCenter, 0f, NativeColliderStatus.Bound.Outside);
+			if (flag)
+			{
+				normal = worldCenter - plane.worldCenter;
+			}
+			return flag;
+		}
+
+		protected override bool CollideCapsule(NativeCapsuleCollider capsule, ref Vector3 normal)
+		{
+			float hit_diff = -1f;
+			Vector3 hit_normal = Vector3.zero;
+			Newtonsoft.Json.Serialization.Func<Vector3, float, bool> func = delegate(Vector3 pos, float radius)
+			{
+				Vector3 hit_normal = Vector3.zero;
+				Vector3 b = pos;
+				if (this.Collide(ref pos, radius, NativeColliderStatus.Bound.Outside))
+				{
+					hit_normal = pos - b;
+					if (hit_diff < 0f || hit_diff < hit_normal.sqrMagnitude)
+					{
+						hit_diff = hit_normal.sqrMagnitude;
+						hit_normal = hit_normal;
+					}
+					return true;
+				}
+				return false;
+			};
+			bool flag = func(capsule.startPos, capsule.capsuleStatus.startRadius);
+			bool flag2 = func(capsule.endPos, capsule.capsuleStatus.endRadius);
+			if (flag || flag2)
+			{
+				normal = hit_normal;
+				return true;
+			}
+			return false;
+		}
+
+		public override void Save(StreamWriter writer)
+		{
+			base.Save<NativePlaneColliderStatus>(writer);
+		}
+
+		public override void Load(StreamReader reader, Transform parent_search_root)
+		{
+			base.Load<NativePlaneColliderStatus>(reader, parent_search_root);
+		}
+
+		[SerializeField]
+		private NativePlaneColliderStatus PlaneStatus = new NativePlaneColliderStatus();
+	}
+}

+ 18 - 0
Assembly-CSharp/kt/Physics/NativePlaneColliderStatus.cs

@@ -0,0 +1,18 @@
+using System;
+using kt.Utility;
+
+namespace kt.Physics
+{
+	[Serializable]
+	public class NativePlaneColliderStatus : NativeColliderStatus
+	{
+		public NativePlaneColliderStatus()
+		{
+			this.colliderType = NativeColliderStatus.ColliderType.Plane;
+		}
+
+		public MathUtility.VectorType direction = MathUtility.VectorType.Y;
+
+		public bool isDirectionInverse;
+	}
+}

+ 92 - 0
Assembly-CSharp/kt/Physics/NativeSphereCollider.cs

@@ -0,0 +1,92 @@
+using System;
+using System.IO;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	public class NativeSphereCollider : ANativeColliderBase
+	{
+		public NativeSphereColliderStatus sphereStatus
+		{
+			get
+			{
+				return this.SphereStatus;
+			}
+		}
+
+		public override NativeColliderStatus status
+		{
+			get
+			{
+				return this.SphereStatus;
+			}
+			protected set
+			{
+				this.SphereStatus = (value as NativeSphereColliderStatus);
+			}
+		}
+
+		public float radius
+		{
+			get
+			{
+				return this.sphereStatus.radius * base.GetLossyScale();
+			}
+		}
+
+		public override bool Collide(ref Vector3 position, float radius)
+		{
+			Vector3 a = position - this.worldCenter;
+			if (this.status.bound == NativeColliderStatus.Bound.Outside)
+			{
+				float num = this.radius + radius;
+				if (a.sqrMagnitude > num * num)
+				{
+					return false;
+				}
+				float magnitude = a.magnitude;
+				if (magnitude > 0f)
+				{
+					position += a / magnitude * num;
+				}
+			}
+			else
+			{
+				float num2 = Mathf.Max(radius - radius, 0f);
+				if (a.sqrMagnitude < num2 * num2)
+				{
+					return false;
+				}
+				float magnitude2 = a.magnitude;
+				if (magnitude2 > 0f)
+				{
+					position = a / magnitude2 * num2;
+				}
+			}
+			return true;
+		}
+
+		protected override bool CollideCapsule(NativeCapsuleCollider capsule, ref Vector3 normal)
+		{
+			bool flag = capsule.Collide(this, out normal);
+			if (flag)
+			{
+				normal = -normal;
+			}
+			return flag;
+		}
+
+		public override void Save(StreamWriter writer)
+		{
+			base.Save<NativeSphereColliderStatus>(writer);
+		}
+
+		public override void Load(StreamReader reader, Transform parent_search_root)
+		{
+			base.Load<NativeSphereColliderStatus>(reader, parent_search_root);
+		}
+
+		[SerializeField]
+		private NativeSphereColliderStatus SphereStatus = new NativeSphereColliderStatus();
+	}
+}

+ 17 - 0
Assembly-CSharp/kt/Physics/NativeSphereColliderStatus.cs

@@ -0,0 +1,17 @@
+using System;
+using UnityEngine;
+
+namespace kt.Physics
+{
+	[Serializable]
+	public class NativeSphereColliderStatus : NativeColliderStatus
+	{
+		public NativeSphereColliderStatus()
+		{
+			this.colliderType = NativeColliderStatus.ColliderType.Sphere;
+		}
+
+		[Header("半径")]
+		public float radius = 0.5f;
+	}
+}

+ 27 - 0
Assembly-CSharp/kt/Serialization/ASerializationVersionControl.cs

@@ -0,0 +1,27 @@
+using System;
+using UnityEngine;
+
+namespace kt.Serialization
+{
+	[Serializable]
+	public abstract class ASerializationVersionControl : ISerializationCallbackReceiver
+	{
+		public ASerializationVersionControl()
+		{
+			this.version = this.FixVersion;
+		}
+
+		public abstract int FixVersion { get; }
+
+		public virtual void OnAfterDeserialize()
+		{
+		}
+
+		public virtual void OnBeforeSerialize()
+		{
+			this.version = this.FixVersion;
+		}
+
+		public int version;
+	}
+}

+ 198 - 0
Assembly-CSharp/kt/Utility/DebugUtility.cs

@@ -0,0 +1,198 @@
+using System;
+using System.Diagnostics;
+using UnityEngine;
+
+namespace kt.Utility
+{
+	public static class DebugUtility
+	{
+		public static void LogErrorFromException(Exception exception)
+		{
+			DebugUtility.LogErrorFromException(null, exception);
+		}
+
+		public static void LogErrorFromException(string message, Exception exception)
+		{
+			if (!string.IsNullOrEmpty(message))
+			{
+				UnityEngine.Debug.LogError(message);
+			}
+			UnityEngine.Debug.LogException(exception);
+		}
+
+		public static void MessageBox(string f_strTitle, string f_strMsg)
+		{
+			NUty.WinMessageBox(NUty.GetWindowHandle(), f_strMsg, f_strTitle, 0);
+		}
+
+		public static void DrawAxis(Vector3 pos, Quaternion rot, Color x_color, Color y_color, Color z_color, float line_length = 0.0625f)
+		{
+			UnityEngine.Debug.DrawLine(pos, pos + rot * Vector3.right * line_length, x_color);
+			UnityEngine.Debug.DrawLine(pos, pos + rot * Vector3.up * line_length, y_color);
+			UnityEngine.Debug.DrawLine(pos, pos + rot * Vector3.forward * line_length, z_color);
+		}
+
+		public static void DrawAxis(Vector3 pos, Quaternion rot, float line_length = 0.0625f)
+		{
+			DebugUtility.DrawAxis(pos, rot, Color.red, Color.green, Color.blue, line_length);
+		}
+
+		public static void DrawObjAxis(Transform obj_trans, Color x_color, Color y_color, Color z_color, float line_length = 0.0625f)
+		{
+			DebugUtility.DrawAxis(obj_trans.position, obj_trans.rotation, x_color, y_color, z_color, line_length);
+		}
+
+		public static void DrawObjAxis(Transform obj_trans, float ray_length = 0.0625f)
+		{
+			DebugUtility.DrawObjAxis(obj_trans, Color.red, Color.green, Color.blue, ray_length);
+		}
+
+		public static void DrawSquare(Vector3 pos, Quaternion rot, Vector3 forward_axis, Color axis_col, Color square_col, float size = 0.025f)
+		{
+			UnityEngine.Debug.DrawRay(pos, rot * forward_axis * size, axis_col);
+			rot *= Quaternion.FromToRotation(Vector3.forward, forward_axis);
+			Vector3 vector = pos + rot * (Vector3.right + Vector3.up) * size;
+			Vector3 vector2 = pos + rot * (Vector3.right + Vector3.down) * size;
+			Vector3 vector3 = pos + rot * (Vector3.left + Vector3.down) * size;
+			Vector3 vector4 = pos + rot * (Vector3.left + Vector3.up) * size;
+			UnityEngine.Debug.DrawLine(vector, vector2, square_col);
+			UnityEngine.Debug.DrawLine(vector2, vector3, square_col);
+			UnityEngine.Debug.DrawLine(vector3, vector4, square_col);
+			UnityEngine.Debug.DrawLine(vector4, vector, square_col);
+		}
+
+		public static void DrawSquare(Vector3 pos, Quaternion rot, Vector3 forward_axis, float size = 0.025f)
+		{
+			DebugUtility.DrawSquare(pos, rot, forward_axis, Color.blue, Color.white, size);
+		}
+
+		public static void DrawSquare(Vector3 pos, Quaternion rot, float size = 0.025f)
+		{
+			DebugUtility.DrawSquare(pos, rot, Vector3.forward, Color.blue, Color.white, size);
+		}
+
+		public static void Vec3DetailLog(Vector3 vec)
+		{
+			UnityEngine.Debug.LogFormat("({0}, {1}, {2})", new object[]
+			{
+				vec.x,
+				vec.y,
+				vec.z
+			});
+		}
+
+		public static class Assert
+		{
+			public static void IsTrue(bool condition)
+			{
+				DebugUtility.Assert.Call(condition, "Assertion failed. Value was False.");
+			}
+
+			public static void IsTrue(bool condition, string message)
+			{
+				DebugUtility.Assert.Call(condition, message);
+			}
+
+			public static void IsFalse(bool condition)
+			{
+				DebugUtility.Assert.Call(!condition, "Assertion failed. Value was True.");
+			}
+
+			public static void IsFalse(bool condition, string message)
+			{
+				DebugUtility.Assert.Call(!condition, message);
+			}
+
+			public static void IsNull<T>(T value) where T : class
+			{
+				DebugUtility.Assert.Call(value == null, "Assertion failed. Value was not Null.");
+			}
+
+			public static void IsNull(UnityEngine.Object value, string message)
+			{
+				DebugUtility.Assert.Call(value == null, message);
+			}
+
+			public static void IsNull<T>(T value, string message) where T : class
+			{
+				DebugUtility.Assert.Call(value == null, message);
+			}
+
+			public static void IsNotNull<T>(T value) where T : class
+			{
+				DebugUtility.Assert.Call(value != null, "Assertion failed. Value was Null.");
+			}
+
+			public static void IsNotNull(UnityEngine.Object value, string message)
+			{
+				DebugUtility.Assert.Call(value != null, message);
+			}
+
+			public static void IsNotNull<T>(T value, string message) where T : class
+			{
+				DebugUtility.Assert.Call(value != null, message);
+			}
+
+			public static void Call(bool condition, string message)
+			{
+				if (condition)
+				{
+					return;
+				}
+				DebugUtility.Assert.Call(message);
+			}
+
+			public static void Call(string message)
+			{
+				if (message == null)
+				{
+					message = string.Empty;
+				}
+				StackFrame stackFrame = new StackFrame(1, true);
+				string fileName = stackFrame.GetFileName();
+				int fileLineNumber = stackFrame.GetFileLineNumber();
+				string f_strMsg = string.Concat(new object[]
+				{
+					fileName,
+					"(",
+					fileLineNumber,
+					") \n",
+					message
+				});
+				UnityEngine.Debug.LogError("Assert! " + message);
+				DebugUtility.MessageBox("Error", f_strMsg);
+				UnityEngine.Debug.Break();
+				Application.Quit();
+			}
+
+			public static void Call(bool condition, Func<string> messageCallback)
+			{
+				if (condition)
+				{
+					return;
+				}
+				DebugUtility.Assert.Call(messageCallback);
+			}
+
+			public static void Call(Func<string> messageCallback)
+			{
+				StackFrame stackFrame = new StackFrame(1, true);
+				string fileName = stackFrame.GetFileName();
+				int fileLineNumber = stackFrame.GetFileLineNumber();
+				string text = (messageCallback == null) ? string.Empty : messageCallback();
+				string f_strMsg = string.Concat(new object[]
+				{
+					fileName,
+					"(",
+					fileLineNumber,
+					") \n",
+					text
+				});
+				UnityEngine.Debug.LogError("Assert! " + text);
+				DebugUtility.MessageBox("Error", f_strMsg);
+				UnityEngine.Debug.Break();
+				Application.Quit();
+			}
+		}
+	}
+}

+ 279 - 0
Assembly-CSharp/kt/Utility/MathUtility.cs

@@ -0,0 +1,279 @@
+using System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+using UnityEngine;
+
+namespace kt.Utility
+{
+	public static class MathUtility
+	{
+		public static float VolumeToDecibel(float volume)
+		{
+			return 20f * Mathf.Log10(Mathf.Clamp(volume, 0.0001f, 1f));
+		}
+
+		public static float DecibelToVolume(float db)
+		{
+			float num = Mathf.Pow(10f, Mathf.Clamp(db, -80f, 0f) / 20f);
+			return (num > 0.0001f) ? num : 0f;
+		}
+
+		public static float MillisecondToSecond(int millisecond)
+		{
+			return (float)millisecond / 1000f;
+		}
+
+		public static int SecondToMillisecond(float second)
+		{
+			return Mathf.FloorToInt(second * 1000f);
+		}
+
+		public static int RoundToDigits(int num, int maxDigits)
+		{
+			int[] array = new int[]
+			{
+				0,
+				9,
+				99,
+				999,
+				9999,
+				99999,
+				999999,
+				9999999,
+				99999999,
+				999999999
+			};
+			return Mathf.Clamp(num, 0, array[(array.Length >= maxDigits) ? 0 : maxDigits]);
+		}
+
+		public static bool Approximately(Vector2 objA, Vector2 objB)
+		{
+			return Mathf.Approximately(objA.x, objB.x) && Mathf.Approximately(objA.y, objB.y);
+		}
+
+		public static bool Approximately(Vector3 objA, Vector3 objB)
+		{
+			return Mathf.Approximately(objA.x, objB.x) && Mathf.Approximately(objA.y, objB.y) && Mathf.Approximately(objA.z, objB.z);
+		}
+
+		public static float Normalize(float val, float valmin, float valmax, float min = 0f, float max = 1f)
+		{
+			return (val - valmin) / (valmax - valmin) * (max - min) + min;
+		}
+
+		public static double Normalize(double val, double valmin, double valmax, double min = 0.0, double max = 1.0)
+		{
+			return (val - valmin) / (valmax - valmin) * (max - min) + min;
+		}
+
+		public static float Sin01(float a, float b, bool is_reverse = false, bool is_repeat = false)
+		{
+			return MathUtility.Sin01(a / b, is_reverse, is_repeat);
+		}
+
+		public static float Sin01(float t, bool is_reverse = false, bool is_repeat = false)
+		{
+			if (!is_repeat)
+			{
+				t = Mathf.Clamp01(t);
+			}
+			if (!is_reverse)
+			{
+				return Mathf.Abs(Mathf.Sin(t * 90f * 0.017453292f));
+			}
+			return 1f - Mathf.Abs(Mathf.Sin(t * 90f * 0.017453292f));
+		}
+
+		public static Vector3 Bezier(Vector3 p0, Vector3 p1, Vector3 c, float t)
+		{
+			Vector3 a = Vector3.Lerp(p0, c, t);
+			Vector3 b = Vector3.Lerp(c, p1, t);
+			return Vector3.Lerp(a, b, t);
+		}
+
+		public static Vector3 Hermite(Vector3 p0, Vector3 p1, Vector3 v0, Vector3 v1, float t)
+		{
+			Vector3 a = 2f * p0 + -2f * p1 + v0 + v1;
+			Vector3 a2 = -3f * p0 + 3f * p1 + -2f * v0 - v1;
+			float num = t * t;
+			float d = num * t;
+			return a * d + a2 * num + v0 * t + p0;
+		}
+
+		public static Vector3 Catmul(List<Vector3> point_list, float t)
+		{
+			if (point_list.Count == 0)
+			{
+				return Vector3.zero;
+			}
+			if (point_list.Count == 1)
+			{
+				return point_list[0];
+			}
+			float num = (float)(point_list.Count - 1) * t;
+			int num2 = Mathf.FloorToInt(num);
+			float t2 = num - (float)num2;
+			if (num2 >= point_list.Count - 1)
+			{
+				num2 = point_list.Count - 2;
+				t2 = 1f;
+			}
+			Vector3 p = point_list[num2];
+			Vector3 p2 = point_list[num2 + 1];
+			Vector3 v = Vector3.zero;
+			if (num2 > 0)
+			{
+				v = 0.5f * (point_list[num2 + 1] - point_list[num2 - 1]);
+			}
+			else
+			{
+				v = point_list[num2 + 1] - point_list[num2];
+			}
+			Vector3 v2 = Vector3.zero;
+			if (num2 < point_list.Count - 2)
+			{
+				v2 = 0.5f * (point_list[num2 + 2] - point_list[num2]);
+			}
+			else
+			{
+				v2 = point_list[num2 + 1] - point_list[num2];
+			}
+			return MathUtility.Hermite(p, p2, v, v2, t2);
+		}
+
+		public static Vector3 Vec3Parse(string str, char split_ch = ',')
+		{
+			str = Regex.Replace(str, "[()]", string.Empty);
+			str = Regex.Replace(str, "[ \u3000]", string.Empty);
+			string[] array = str.Split(new char[]
+			{
+				split_ch
+			});
+			Vector3 zero = Vector3.zero;
+			zero.x = float.Parse(array[0]);
+			zero.y = float.Parse(array[1]);
+			zero.z = float.Parse(array[2]);
+			return zero;
+		}
+
+		public static float AngleClamp360(float angle)
+		{
+			if (Mathf.Abs(angle) >= 360f)
+			{
+				if (angle > 0f)
+				{
+					angle -= (float)(Mathf.FloorToInt(angle / 360f) * 360);
+				}
+				else
+				{
+					angle += (float)(Mathf.FloorToInt(angle / 360f) * 360);
+				}
+			}
+			else if (angle < 0f)
+			{
+				angle += 360f;
+			}
+			return angle;
+		}
+
+		public static Vector3 AngleClamp360(Vector3 angle)
+		{
+			angle.x = MathUtility.AngleClamp360(angle.x);
+			angle.y = MathUtility.AngleClamp360(angle.y);
+			angle.z = MathUtility.AngleClamp360(angle.z);
+			return angle;
+		}
+
+		public static float AngleClamp180(float angle)
+		{
+			if (Mathf.Abs(angle) > 180f)
+			{
+				if (angle > 0f)
+				{
+					angle -= (float)(Mathf.FloorToInt(angle / 180f) * 360);
+				}
+				else
+				{
+					angle += (float)(Mathf.FloorToInt(angle / 180f) * 360);
+				}
+			}
+			return angle;
+		}
+
+		public static Vector3 AngleClamp180(Vector3 angle)
+		{
+			angle.x = MathUtility.AngleClamp180(angle.x);
+			angle.y = MathUtility.AngleClamp180(angle.y);
+			angle.z = MathUtility.AngleClamp180(angle.z);
+			return angle;
+		}
+
+		public static float GetValue(this Vector3 vector, MathUtility.VectorType type)
+		{
+			return vector[(int)type];
+		}
+
+		public static Vector3 GetPrimitiveVector(MathUtility.VectorType type)
+		{
+			if (type == MathUtility.VectorType.X)
+			{
+				return Vector3.right;
+			}
+			if (type != MathUtility.VectorType.Y)
+			{
+				return Vector3.forward;
+			}
+			return Vector3.up;
+		}
+
+		public static int RatioToPercentage(float ratio, bool is_clamp = false)
+		{
+			int num = Mathf.FloorToInt(ratio * 100f);
+			if (is_clamp)
+			{
+				num = Mathf.Clamp(num, 0, 100);
+			}
+			return num;
+		}
+
+		public static float PercentageToRatio(int percentage, bool is_clamp = false)
+		{
+			float num = (float)percentage / 100f;
+			if (is_clamp)
+			{
+				num = Mathf.Clamp01(num);
+			}
+			return num;
+		}
+
+		public static float FloorDecimal(float value, int decimal_point)
+		{
+			float num = 1f;
+			for (int i = 0; i < decimal_point; i++)
+			{
+				num *= 10f;
+			}
+			return Mathf.Floor(value * num) / num;
+		}
+
+		public static Vector3 FloorVec3Decimal(Vector3 value, int decimal_point)
+		{
+			value.x = MathUtility.FloorDecimal(value.x, decimal_point);
+			value.y = MathUtility.FloorDecimal(value.y, decimal_point);
+			value.z = MathUtility.FloorDecimal(value.z, decimal_point);
+			return value;
+		}
+
+		public static bool IsVector3NaN(Vector3 vector)
+		{
+			return float.IsNaN(vector.x) || float.IsNaN(vector.y) || float.IsNaN(vector.z);
+		}
+
+		public enum VectorType
+		{
+			X,
+			Y,
+			Z
+		}
+	}
+}

+ 297 - 0
Assembly-CSharp/kt/Utility/UnityUtility.cs

@@ -0,0 +1,297 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+
+namespace kt.Utility
+{
+	public static class UnityUtility
+	{
+		public static GameObject GetChildObject(Transform transform, string hierarchyPath)
+		{
+			if (transform == null)
+			{
+				return GameObject.Find(hierarchyPath);
+			}
+			return (!transform.Find(hierarchyPath)) ? null : transform.Find(hierarchyPath).gameObject;
+		}
+
+		public static GameObject GetChildObject(GameObject obj, string hierarchyPath)
+		{
+			return UnityUtility.GetChildObject((!obj) ? null : obj.transform, hierarchyPath);
+		}
+
+		public static GameObject GetChildObject(string hierarchyPath)
+		{
+			return UnityUtility.GetChildObject(null, hierarchyPath);
+		}
+
+		public static T GetChildObject<T>(Transform transform, string hierarchyPath) where T : Component
+		{
+			GameObject childObject = UnityUtility.GetChildObject(transform, hierarchyPath);
+			return (!childObject) ? ((T)((object)null)) : childObject.GetComponent<T>();
+		}
+
+		public static T GetChildObject<T>(GameObject obj, string hierarchyPath) where T : Component
+		{
+			return UnityUtility.GetChildObject<T>((!obj) ? null : obj.transform, hierarchyPath);
+		}
+
+		public static List<Transform> GetAllChildren(Transform transform, bool include_self = false)
+		{
+			List<Transform> list = new List<Transform>();
+			if (include_self)
+			{
+				list.Add(transform);
+			}
+			for (int i = 0; i < transform.childCount; i++)
+			{
+				Transform child = transform.GetChild(i);
+				list.Add(child);
+				list.AddRange(UnityUtility.GetAllChildren(child, false));
+			}
+			return list;
+		}
+
+		public static Transform SearchChild(this Transform transform, Predicate<Transform> match)
+		{
+			if (match(transform))
+			{
+				return transform;
+			}
+			for (int i = 0; i < transform.childCount; i++)
+			{
+				Transform transform2 = transform.GetChild(i).SearchChild(match);
+				if (transform2)
+				{
+					return transform2;
+				}
+			}
+			return null;
+		}
+
+		public static Transform SearchChildByName(this Transform transform, string search_name)
+		{
+			return transform.SearchChild((Transform ch) => ch.name == search_name);
+		}
+
+		public static string GetObjectTreePath(GameObject obj)
+		{
+			string text = string.Empty;
+			if (obj == null)
+			{
+				return text;
+			}
+			text += obj.name;
+			while (obj.transform.parent != null)
+			{
+				obj = obj.transform.parent.gameObject;
+				text = obj.name + "/" + text;
+			}
+			return text;
+		}
+
+		public static string GetHierarchyPath(Transform trans, Transform root_obj = null, bool include_rootobj_path = true)
+		{
+			if (trans == root_obj)
+			{
+				return string.Empty;
+			}
+			string text = trans.gameObject.name;
+			Transform parent = trans.parent;
+			while (parent != root_obj && parent != null)
+			{
+				text = parent.name + "/" + text;
+				parent = parent.parent;
+			}
+			if (include_rootobj_path)
+			{
+				text = root_obj.name + "/" + text;
+			}
+			return text;
+		}
+
+		public static bool IsChild(Transform parent, Transform child)
+		{
+			Func<Transform, Transform, Transform> Search = null;
+			Search = delegate(Transform checkParent, Transform target)
+			{
+				if (checkParent == target)
+				{
+					return target;
+				}
+				for (int i = 0; i < checkParent.childCount; i++)
+				{
+					Transform transform = Search(checkParent.GetChild(i), checkParent);
+					if (transform != null)
+					{
+						return transform;
+					}
+				}
+				return null;
+			};
+			return Search(parent, child) == child;
+		}
+
+		public static string SaveImage(Texture f_texSrc, string f_strFileName = null)
+		{
+			if (f_texSrc is Texture2D)
+			{
+				return UnityUtility.SaveImage(f_texSrc as Texture2D, f_strFileName);
+			}
+			if (f_texSrc is RenderTexture)
+			{
+				return UnityUtility.SaveImage(f_texSrc as RenderTexture, f_strFileName, TextureFormat.ARGB32);
+			}
+			return string.Empty;
+		}
+
+		public static string SaveImage(RenderTexture f_rtSrc, string f_strFileName = null, TextureFormat f_TexFormat = TextureFormat.ARGB32)
+		{
+			if (f_rtSrc == null)
+			{
+				return string.Empty;
+			}
+			string text = f_strFileName;
+			if (string.IsNullOrEmpty(text))
+			{
+				text = "img" + DateTime.Now.ToString("yyyyMMddHHmmss.fff") + ".png";
+			}
+			Texture2D texture2D = new Texture2D(f_rtSrc.width, f_rtSrc.height, f_TexFormat, false);
+			RenderTexture active = RenderTexture.active;
+			RenderTexture.active = f_rtSrc;
+			texture2D.ReadPixels(new Rect(0f, 0f, (float)f_rtSrc.width, (float)f_rtSrc.height), 0, 0);
+			RenderTexture.active = active;
+			byte[] bytes = texture2D.EncodeToPNG();
+			File.WriteAllBytes(text, bytes);
+			UnityEngine.Object.Destroy(texture2D);
+			return text;
+		}
+
+		public static string SaveImage(Texture2D f_texSrc, string f_strFileName = null)
+		{
+			if (f_texSrc == null)
+			{
+				return string.Empty;
+			}
+			RenderTexture renderTexture = new RenderTexture(f_texSrc.width, f_texSrc.height, 0, RenderTextureFormat.ARGB32);
+			RenderTexture active = RenderTexture.active;
+			Graphics.Blit(f_texSrc, renderTexture);
+			RenderTexture.active = active;
+			string result = UnityUtility.SaveImage(renderTexture, f_strFileName, TextureFormat.ARGB32);
+			UnityEngine.Object.Destroy(renderTexture);
+			return result;
+		}
+
+		public static Sprite CreateSpriteFromImageFile(string pngFilePath)
+		{
+			if (string.IsNullOrEmpty(pngFilePath))
+			{
+				return null;
+			}
+			if (!File.Exists(pngFilePath))
+			{
+				return null;
+			}
+			Texture2D texture2D = null;
+			try
+			{
+				byte[] array = File.ReadAllBytes(pngFilePath);
+				if (array == null || array.Length == 0)
+				{
+					return null;
+				}
+				texture2D = new Texture2D(32, 32);
+				texture2D.LoadImage(array);
+			}
+			catch (Exception ex)
+			{
+				Debug.LogError(ex.Message + "\n\n" + ex.StackTrace);
+				return null;
+			}
+			if (texture2D == null || texture2D.width == 0 || texture2D.height == 0)
+			{
+				return null;
+			}
+			Sprite sprite = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), default(Vector2));
+			sprite.name = Path.GetFileName(pngFilePath);
+			return sprite;
+		}
+
+		public static Texture2D CreateTexture2DFromRenderTexture(RenderTexture render_tex)
+		{
+			Texture2D texture2D = new Texture2D(render_tex.width, render_tex.height, TextureFormat.ARGB32, false);
+			RenderTexture active = RenderTexture.active;
+			RenderTexture.active = render_tex;
+			texture2D.ReadPixels(new Rect(0f, 0f, (float)render_tex.width, (float)render_tex.height), 0, 0);
+			texture2D.Apply();
+			RenderTexture.active = active;
+			return texture2D;
+		}
+
+		public static Color SetColorR(Color target, float r)
+		{
+			Color result = target;
+			result.r = r;
+			return result;
+		}
+
+		public static Color SetColorG(Color target, float g)
+		{
+			Color result = target;
+			result.g = g;
+			return result;
+		}
+
+		public static Color SetColorB(Color target, float b)
+		{
+			Color result = target;
+			result.b = b;
+			return result;
+		}
+
+		public static Color SetAlpha(Color target, float alpha)
+		{
+			Color result = target;
+			result.a = alpha;
+			return result;
+		}
+
+		public static Quaternion InverseTransformRotation(this Transform transform, Quaternion rot)
+		{
+			return Quaternion.Inverse(transform.rotation) * rot;
+		}
+
+		public static void RemoveAllComponents<T>(this GameObject gameObject) where T : MonoBehaviour
+		{
+			T[] components = gameObject.GetComponents<T>();
+			if (components != null)
+			{
+				foreach (T t in components)
+				{
+					UnityEngine.Object.DestroyImmediate(t);
+				}
+			}
+		}
+
+		public class PosRotScale
+		{
+			public PosRotScale()
+			{
+			}
+
+			public PosRotScale(UnityUtility.PosRotScale prs)
+			{
+				this.position = prs.position;
+				this.scale = prs.scale;
+				this.rotation = prs.rotation;
+			}
+
+			public Vector3 position;
+
+			public Vector3 scale;
+
+			public Quaternion rotation;
+		}
+	}
+}

+ 33 - 0
Assembly-CSharp/kt/ik/BodyOffsetIKParam.cs

@@ -0,0 +1,33 @@
+using System;
+using UnityEngine;
+
+namespace kt.ik
+{
+	public class BodyOffsetIKParam : IKAttachParam
+	{
+		public BodyOffsetIKParam(Maid src_chara, Maid target_chara) : base(src_chara, target_chara)
+		{
+		}
+
+		public string posBaseBoneName
+		{
+			get
+			{
+				return (!this.posBaseBone) ? string.Empty : this.posBaseBone.name;
+			}
+			set
+			{
+				if (this.srcChara)
+				{
+					this.posBaseBone = this.srcChara.body0.GetBone(value);
+				}
+			}
+		}
+
+		public IKBodyOffsetCtrl.HeightFitType heightFitType = IKBodyOffsetCtrl.HeightFitType.None;
+
+		public Transform posBaseBone;
+
+		public Vector3 addOffset = Vector3.zero;
+	}
+}

+ 144 - 0
Assembly-CSharp/kt/ik/IKAttachParam.cs

@@ -0,0 +1,144 @@
+using System;
+using UnityEngine;
+
+namespace kt.ik
+{
+	public class IKAttachParam
+	{
+		public IKAttachParam(Maid src_chara = null, Maid target_chara = null)
+		{
+			this.srcChara = src_chara;
+			this.targetChara = target_chara;
+			this.offsetEnable.Reset();
+		}
+
+		public int slotNo
+		{
+			get
+			{
+				return (!this.targetChara || !this.targetChara.body0.IsSlotNo(this.slotName)) ? -1 : this.targetChara.body0.GetSlotNo(this.slotName);
+			}
+		}
+
+		public string axisBoneName
+		{
+			get
+			{
+				return (!this.axisBone) ? string.Empty : this.axisBone.name;
+			}
+			set
+			{
+				if (this.targetChara)
+				{
+					this.axisBone = this.targetChara.body0.GetBone(value);
+				}
+			}
+		}
+
+		public string targetBoneName
+		{
+			get
+			{
+				return (this.odoguObj || !this.attachTarget) ? string.Empty : this.attachTarget.name;
+			}
+			set
+			{
+				if (this.targetChara)
+				{
+					this.attachTarget = this.targetChara.body0.GetBone(value);
+				}
+			}
+		}
+
+		public GameObject odoguObj { get; private set; }
+
+		public string odoguName
+		{
+			get
+			{
+				return (!this.odoguObj) ? string.Empty : this.odoguObj.name;
+			}
+			set
+			{
+				this.odoguObj = GameMain.Instance.BgMgr.GetPrefabFromBg(value);
+				if (this.odoguObj && !this.attachTarget)
+				{
+					this.attachTarget = this.odoguObj.transform;
+				}
+			}
+		}
+
+		public string odoguTgtName
+		{
+			get
+			{
+				return (!this.odoguObj || !this.attachTarget) ? string.Empty : this.attachTarget.name;
+			}
+			set
+			{
+				if (!this.odoguObj)
+				{
+					return;
+				}
+				Transform exists = this.odoguObj.transform.Find(value);
+				if (exists)
+				{
+					this.attachTarget = exists;
+				}
+			}
+		}
+
+		public string attachIKName
+		{
+			get
+			{
+				return this.AttachIKName;
+			}
+			set
+			{
+				if (!this.targetChara)
+				{
+					return;
+				}
+				this.AttachIKName = value;
+				AIKCtrl ikctrl = this.targetChara.body0.fullBodyIK.GetIKCtrl(this.AttachIKName);
+				if (ikctrl)
+				{
+					this.attachTarget = ikctrl.bone;
+				}
+			}
+		}
+
+		public Maid srcChara;
+
+		public Maid targetChara;
+
+		public AIKCtrl.IKAttachType attachType = AIKCtrl.IKAttachType.NewPoint;
+
+		public AIKCtrl.IKExecTiming execTiming;
+
+		public Transform attachTarget;
+
+		public string slotName = string.Empty;
+
+		public string attachPointName = string.Empty;
+
+		public Transform axisBone;
+
+		private string AttachIKName = string.Empty;
+
+		public AIKCtrl.PosRotPair virtualPosRot = new AIKCtrl.PosRotPair(Vector3.zero, Quaternion.identity);
+
+		public Vector3 offset = Vector3.zero;
+
+		public bool doAnimation;
+
+		public AIKCtrl.Vec3Enable offsetEnable;
+
+		public float blendTime;
+
+		public AIKCtrl.PosOffsetType posOffsetType;
+
+		public bool bodyPull = true;
+	}
+}

+ 268 - 0
Assembly-CSharp/kt/ik/IKColliderSaveLoader.cs

@@ -0,0 +1,268 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using kt.Physics;
+using kt.Serialization;
+using UnityEngine;
+
+namespace kt.ik
+{
+	public class IKColliderSaveLoader : MonoBehaviour
+	{
+		public string directoryPath
+		{
+			get
+			{
+				return this.DirectoryPath;
+			}
+			set
+			{
+				this.DirectoryPath = value;
+			}
+		}
+
+		public string fileName
+		{
+			get
+			{
+				return this.FileName;
+			}
+			set
+			{
+				this.FileName = value;
+			}
+		}
+
+		public PermTempAction onPostLoad
+		{
+			get
+			{
+				return this.OnPostLoad;
+			}
+		}
+
+		private void UpdateColliderMetaArray()
+		{
+			this.ColliderMetaArray = (from e in base.GetComponentsInChildren<IKColliderMeta>()
+			where base.gameObject != e.gameObject
+			select e).ToArray<IKColliderMeta>();
+			foreach (IKColliderMeta ikcolliderMeta in this.ColliderMetaArray)
+			{
+				this.IKEffectorColliderDic[ikcolliderMeta.effectorType] = ikcolliderMeta.colliderList;
+			}
+		}
+
+		public void ColliderSave()
+		{
+			this.UpdateColliderMetaArray();
+			KasaiUtility.FileSave(this.directoryPath + this.fileName, new Action<StreamWriter>(this.Save));
+		}
+
+		public void ColliderLoad()
+		{
+			KasaiUtility.FileLoadGameData(this.fileName, delegate(StreamReader reader)
+			{
+				this.UpdateColliderMetaArray();
+				if (this.ColliderMetaArray != null)
+				{
+					for (int i = 0; i < this.ColliderMetaArray.Length; i++)
+					{
+						foreach (ANativeColliderBase anativeColliderBase in this.ColliderMetaArray[i].colliderList)
+						{
+							if (anativeColliderBase)
+							{
+								UnityEngine.Object.DestroyImmediate(anativeColliderBase.gameObject);
+							}
+						}
+					}
+				}
+				this.IKEffectorColliderDic.Clear();
+				this.Load(reader);
+				this.onPostLoad.Invoke();
+			}, null);
+		}
+
+		public void Save(StreamWriter writer)
+		{
+			IKColliderSaveLoader.IKColliderDataPackage ikcolliderDataPackage = new IKColliderSaveLoader.IKColliderDataPackage();
+			foreach (KeyValuePair<FullBodyIKMgr.IKEffectorType, List<ANativeColliderBase>> keyValuePair in this.IKEffectorColliderDic)
+			{
+				IKColliderSaveLoader.IKColliderData ikcolliderData = new IKColliderSaveLoader.IKColliderData();
+				ikcolliderData.effectorType = keyValuePair.Key;
+				ikcolliderData.colliderStatusList = (from col in keyValuePair.Value
+				select col.status).ToList<NativeColliderStatus>();
+				ikcolliderDataPackage.dataList.Add(ikcolliderData);
+			}
+			string value = JsonUtility.ToJson(ikcolliderDataPackage, true);
+			writer.Write(value);
+		}
+
+		public void Load(StreamReader reader)
+		{
+			string json = reader.ReadToEnd();
+			IKColliderSaveLoader.IKColliderDataPackage ikcolliderDataPackage = JsonUtility.FromJson<IKColliderSaveLoader.IKColliderDataPackage>(json);
+			foreach (IKColliderSaveLoader.IKColliderData ikcolliderData in ikcolliderDataPackage.dataList)
+			{
+				string name = string.Format("IK_{0}_Collider", ikcolliderData.effectorType);
+				this.IKEffectorColliderDic[ikcolliderData.effectorType] = new List<ANativeColliderBase>();
+				ANativeColliderBase anativeColliderBase = null;
+				foreach (NativeColliderStatus nativeColliderStatus in ikcolliderData.colliderStatusList)
+				{
+					switch (nativeColliderStatus.colliderType)
+					{
+					case NativeColliderStatus.ColliderType.Plane:
+						anativeColliderBase = new GameObject(name).AddComponent<NativePlaneCollider>();
+						break;
+					case NativeColliderStatus.ColliderType.Capsule:
+						anativeColliderBase = new GameObject(name).AddComponent<NativeCapsuleCollider>();
+						break;
+					case NativeColliderStatus.ColliderType.Sphere:
+						anativeColliderBase = new GameObject(name).AddComponent<NativeSphereCollider>();
+						break;
+					}
+					if (anativeColliderBase != null)
+					{
+						anativeColliderBase.SetStatus(nativeColliderStatus, this.fullbodyIK.body);
+						this.IKEffectorColliderDic[ikcolliderData.effectorType].Add(anativeColliderBase);
+					}
+				}
+			}
+		}
+
+		public List<ANativeColliderBase> GetColliderList(FullBodyIKMgr.IKEffectorType effector_type)
+		{
+			if (this.IKEffectorColliderDic.ContainsKey(effector_type))
+			{
+				return this.IKEffectorColliderDic[effector_type];
+			}
+			return null;
+		}
+
+		private string DirectoryPath = Path.GetFullPath("./GameData/system_gp003/collider/");
+
+		private string FileName = "ik_collider.ikcol";
+
+		public FullBodyIKMgr fullbodyIK;
+
+		private IKColliderMeta[] ColliderMetaArray;
+
+		private Dictionary<FullBodyIKMgr.IKEffectorType, List<ANativeColliderBase>> IKEffectorColliderDic = new Dictionary<FullBodyIKMgr.IKEffectorType, List<ANativeColliderBase>>();
+
+		private PermTempAction OnPostLoad = new PermTempAction();
+
+		[Serializable]
+		public class IKColliderData : ASerializationVersionControl
+		{
+			public IKColliderData()
+			{
+			}
+
+			public IKColliderData(KeyValuePair<FullBodyIKMgr.IKEffectorType, List<NativeColliderStatus>> pair)
+			{
+				this.effectorType = pair.Key;
+				this.colliderStatusList = pair.Value;
+			}
+
+			public override int FixVersion
+			{
+				get
+				{
+					return 1000;
+				}
+			}
+
+			public override void OnBeforeSerialize()
+			{
+				base.OnBeforeSerialize();
+				this.StatusJsonStrList = new List<string>();
+				for (int i = 0; i < this.colliderStatusList.Count; i++)
+				{
+					NativeColliderStatus nativeColliderStatus = this.colliderStatusList[i];
+					string text = string.Empty;
+					switch (nativeColliderStatus.colliderType)
+					{
+					case NativeColliderStatus.ColliderType.Plane:
+						text = JsonUtility.ToJson(nativeColliderStatus as NativePlaneColliderStatus);
+						break;
+					case NativeColliderStatus.ColliderType.Capsule:
+						text = JsonUtility.ToJson(nativeColliderStatus as NativeCapsuleColliderStatus);
+						break;
+					case NativeColliderStatus.ColliderType.Sphere:
+						text = JsonUtility.ToJson(nativeColliderStatus as NativeSphereColliderStatus);
+						break;
+					case NativeColliderStatus.ColliderType.MaidPropCol:
+						text = JsonUtility.ToJson(nativeColliderStatus as NativeMaidPropColliderStatus);
+						break;
+					}
+					if (!string.IsNullOrEmpty(text))
+					{
+						this.StatusJsonStrList.Add(text);
+					}
+				}
+			}
+
+			public override void OnAfterDeserialize()
+			{
+				base.OnAfterDeserialize();
+				this.colliderStatusList.Clear();
+				for (int i = 0; i < this.StatusJsonStrList.Count; i++)
+				{
+					string json = this.StatusJsonStrList[i];
+					NativeColliderStatus nativeColliderStatus = JsonUtility.FromJson<NativeColliderStatus>(json);
+					switch (nativeColliderStatus.colliderType)
+					{
+					case NativeColliderStatus.ColliderType.Plane:
+					{
+						NativePlaneColliderStatus item = JsonUtility.FromJson<NativePlaneColliderStatus>(json);
+						this.colliderStatusList.Add(item);
+						break;
+					}
+					case NativeColliderStatus.ColliderType.Capsule:
+					{
+						NativeCapsuleColliderStatus item2 = JsonUtility.FromJson<NativeCapsuleColliderStatus>(json);
+						this.colliderStatusList.Add(item2);
+						break;
+					}
+					case NativeColliderStatus.ColliderType.Sphere:
+					{
+						NativeSphereColliderStatus item3 = JsonUtility.FromJson<NativeSphereColliderStatus>(json);
+						this.colliderStatusList.Add(item3);
+						break;
+					}
+					case NativeColliderStatus.ColliderType.MaidPropCol:
+					{
+						NativeMaidPropColliderStatus item4 = JsonUtility.FromJson<NativeMaidPropColliderStatus>(json);
+						this.colliderStatusList.Add(item4);
+						break;
+					}
+					}
+				}
+				this.StatusJsonStrList.Clear();
+				this.StatusJsonStrList = null;
+			}
+
+			public FullBodyIKMgr.IKEffectorType effectorType;
+
+			[NonSerialized]
+			public List<NativeColliderStatus> colliderStatusList = new List<NativeColliderStatus>();
+
+			[SerializeField]
+			private List<string> StatusJsonStrList;
+		}
+
+		[Serializable]
+		public class IKColliderDataPackage : ASerializationVersionControl
+		{
+			public override int FixVersion
+			{
+				get
+				{
+					return 1000;
+				}
+			}
+
+			public List<IKColliderSaveLoader.IKColliderData> dataList = new List<IKColliderSaveLoader.IKColliderData>();
+		}
+	}
+}

+ 242 - 0
Assembly-CSharp/kt/ik/IKScriptHelper.cs

@@ -0,0 +1,242 @@
+using System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+using kt.Utility;
+using UnityEngine;
+
+namespace kt.ik
+{
+	public static class IKScriptHelper
+	{
+		public static IKAttachParam GetIKAttachParam(KagTagSupport tagData, Maid src_chara, Maid target_chara = null)
+		{
+			IKAttachParam ikattachParam = new IKAttachParam(src_chara, target_chara);
+			IKScriptHelper.SetIKAttachParam(ikattachParam, tagData);
+			return ikattachParam;
+		}
+
+		public static void SetIKAttachParam(IKAttachParam param, KagTagSupport tagData)
+		{
+			param.offset = Vector3.zero;
+			if (tagData.IsValid("offsetx"))
+			{
+				param.offset.x = tagData.GetTagProperty("offsetx").AsReal();
+			}
+			if (tagData.IsValid("offsety"))
+			{
+				param.offset.y = tagData.GetTagProperty("offsety").AsReal();
+			}
+			if (tagData.IsValid("offsetz"))
+			{
+				param.offset.z = tagData.GetTagProperty("offsetz").AsReal();
+			}
+			param.attachType = ((!param.srcChara.body0.IsCrcBody) ? AIKCtrl.IKAttachType.Point : AIKCtrl.IKAttachType.NewPoint);
+			if (tagData.IsValid("attach_type"))
+			{
+				string value = tagData.GetTagProperty("attach_type").AsString();
+				param.attachType = (AIKCtrl.IKAttachType)Enum.Parse(typeof(AIKCtrl.IKAttachType), value);
+				if (param.srcChara.body0.IsCrcBody && param.attachType == AIKCtrl.IKAttachType.Point)
+				{
+					param.attachType = AIKCtrl.IKAttachType.NewPoint;
+				}
+			}
+			if (param.attachType == AIKCtrl.IKAttachType.NewPoint)
+			{
+				param.posOffsetType = AIKCtrl.PosOffsetType.OffsetTarget;
+				if (tagData.IsValid("offset_world"))
+				{
+					param.posOffsetType = AIKCtrl.PosOffsetType.OffsetWorld;
+				}
+				else if (tagData.IsValid("offset_bone"))
+				{
+					param.posOffsetType = AIKCtrl.PosOffsetType.OffsetBone;
+				}
+			}
+			if (tagData.IsValid("blend"))
+			{
+				param.blendTime = MathUtility.MillisecondToSecond(tagData.GetTagProperty("blend").AsInteger());
+			}
+			else if (tagData.IsValid("blendtime"))
+			{
+				param.blendTime = MathUtility.MillisecondToSecond(tagData.GetTagProperty("blendtime").AsInteger());
+			}
+			else
+			{
+				param.blendTime = param.srcChara.fullBodyIK.blendTime;
+			}
+			if (tagData.IsValid("disable"))
+			{
+				string[] array = tagData.GetTagProperty("disable").AsString().Split(new char[]
+				{
+					','
+				});
+				int i = 0;
+				while (i < array.Length)
+				{
+					string text = array[i];
+					string text2 = text.ToLower();
+					if (text2 != null)
+					{
+						if (!(text2 == "x"))
+						{
+							if (!(text2 == "y"))
+							{
+								if (text2 == "z")
+								{
+									param.offsetEnable.enableZ = false;
+								}
+							}
+							else
+							{
+								param.offsetEnable.enableY = false;
+							}
+						}
+						else
+						{
+							param.offsetEnable.enableX = false;
+						}
+					}
+					IL_288:
+					i++;
+					continue;
+					goto IL_288;
+				}
+			}
+			param.doAnimation = false;
+			if (tagData.IsValid("do_animation"))
+			{
+				param.doAnimation = true;
+			}
+			param.bodyPull = (param.attachType == AIKCtrl.IKAttachType.NewPoint);
+			if (param.attachType == AIKCtrl.IKAttachType.NewPoint)
+			{
+				param.bodyPull = !tagData.IsValid("pull_off");
+			}
+		}
+
+		public static InsertIKParam GetInsertIKParam(KagTagSupport tagData, Maid src_chara = null, Maid target_chara = null)
+		{
+			InsertIKParam insertIKParam = new InsertIKParam(src_chara, target_chara);
+			IKScriptHelper.SetInsertIKParam(insertIKParam, tagData);
+			return insertIKParam;
+		}
+
+		public static void SetInsertIKParam(InsertIKParam param, KagTagSupport tagData)
+		{
+			IKScriptHelper.SetIKAttachParam(param, tagData);
+			param.insertBefore = MathUtility.Vec3Parse(tagData.GetTagProperty("insert_before").AsString(), ',').normalized;
+			param.insertAfter = MathUtility.Vec3Parse(tagData.GetTagProperty("insert_after").AsString(), ',').normalized;
+			if (param.attachTarget && AutoKupaCtrl.InsertBoneMorphDic.ContainsKey(param.attachTarget.name))
+			{
+				AutoKupaCtrl.MorphType morph_type = AutoKupaCtrl.InsertBoneMorphDic[param.attachTarget.name];
+				param.kupaCtrl = param.targetChara.body0.GetKupaCtrl(morph_type);
+				if (param.kupaCtrl != null)
+				{
+					param.kupaCtrl.SetInsertParamFromScript(tagData);
+				}
+			}
+		}
+
+		public static PenisIKParam GetPenisIKParam(KagTagSupport tagData, Maid src_chara, Maid target_chara)
+		{
+			PenisIKParam penisIKParam = new PenisIKParam(src_chara, target_chara);
+			IKScriptHelper.SetPenisIKPatam(penisIKParam, tagData);
+			return penisIKParam;
+		}
+
+		public static void SetPenisIKPatam(PenisIKParam param, KagTagSupport tagData)
+		{
+			IKScriptHelper.SetInsertIKParam(param, tagData);
+			param.sensorLength = 0f;
+			if (tagData.IsValid("sensorlength"))
+			{
+				param.sensorLength = tagData.GetTagProperty("sensorlength").AsReal();
+			}
+			param.isNotEscape = tagData.IsValid("notescape");
+			param.isForciblyBend = tagData.IsValid("forcebend");
+			param.alwaysLookTarget = tagData.IsValid("alwayslook");
+			if (tagData.IsValid("scaling"))
+			{
+				string[] array = tagData.GetTagProperty("scaling").AsString().Split(new char[]
+				{
+					' '
+				});
+				foreach (string text in array)
+				{
+					string[] array3 = text.Split(new char[]
+					{
+						':'
+					});
+					string key = array3[0];
+					float value = MathUtility.PercentageToRatio(int.Parse(array3[1]), false);
+					param.boneNameScaleValPair.Add(new KeyValuePair<string, float>(key, value));
+				}
+			}
+			if (tagData.IsValid("motionctrlbone"))
+			{
+				param.motionCtrlBoneName = tagData.GetTagProperty("motionctrlbone").AsString();
+				if (tagData.IsValid("motionctrlweight"))
+				{
+					param.motionCtrlWeight = MathUtility.PercentageToRatio(tagData.GetTagProperty("motionctrlweight").AsInteger(), false);
+				}
+			}
+		}
+
+		public static BodyOffsetIKParam GetBodyIKParam(KagTagSupport tagData, Maid src_chara, Maid target_chara = null)
+		{
+			BodyOffsetIKParam bodyOffsetIKParam = new BodyOffsetIKParam(src_chara, target_chara);
+			IKScriptHelper.SetBodyIKPatam(bodyOffsetIKParam, tagData);
+			return bodyOffsetIKParam;
+		}
+
+		public static void SetBodyIKPatam(BodyOffsetIKParam param, KagTagSupport tagData)
+		{
+			IKScriptHelper.SetIKAttachParam(param, tagData);
+			param.attachType = AIKCtrl.IKAttachType.NewPoint;
+			param.posOffsetType = AIKCtrl.PosOffsetType.OffsetTarget;
+			if (tagData.IsValid("heighttype"))
+			{
+				param.heightFitType = (IKBodyOffsetCtrl.HeightFitType)Enum.Parse(typeof(IKBodyOffsetCtrl.HeightFitType), tagData.GetTagProperty("heighttype").AsString());
+			}
+			param.posBaseBoneName = tagData.GetTagProperty("srcbone").AsString();
+			if (tagData.IsValid("addoffset"))
+			{
+				param.addOffset = MathUtility.Vec3Parse(tagData.GetTagProperty("addoffset").AsString(), ',');
+			}
+		}
+
+		public static string ConvertColliderNameToIKName(string name)
+		{
+			string text = Regex.Replace(name, "左|右", string.Empty);
+			if (text != null)
+			{
+				if (!(text == "上腕"))
+				{
+					if (!(text == "前腕"))
+					{
+						if (!(text == "腿"))
+						{
+							if (text == "脛")
+							{
+								name = name.Replace("脛", "足");
+							}
+						}
+						else
+						{
+							name = name.Replace("腿", "膝");
+						}
+					}
+					else
+					{
+						name = name.Replace("前腕", "手");
+					}
+				}
+				else
+				{
+					name = name.Replace("上腕", "肘");
+				}
+			}
+			return name;
+		}
+	}
+}

+ 18 - 0
Assembly-CSharp/kt/ik/InsertIKParam.cs

@@ -0,0 +1,18 @@
+using System;
+using UnityEngine;
+
+namespace kt.ik
+{
+	public class InsertIKParam : IKAttachParam
+	{
+		public InsertIKParam(Maid src_chara, Maid target_chara) : base(src_chara, target_chara)
+		{
+		}
+
+		public Vector3 insertBefore = Vector3.back;
+
+		public Vector3 insertAfter = Vector3.forward;
+
+		public AutoKupaCtrl kupaCtrl;
+	}
+}

+ 26 - 0
Assembly-CSharp/kt/ik/PenisIKParam.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace kt.ik
+{
+	public class PenisIKParam : InsertIKParam
+	{
+		public PenisIKParam(Maid src_chara, Maid target_chara) : base(src_chara, target_chara)
+		{
+		}
+
+		public float sensorLength;
+
+		public bool isNotEscape;
+
+		public bool isForciblyBend;
+
+		public bool alwaysLookTarget;
+
+		public List<KeyValuePair<string, float>> boneNameScaleValPair = new List<KeyValuePair<string, float>>();
+
+		public string motionCtrlBoneName = string.Empty;
+
+		public float motionCtrlWeight;
+	}
+}

+ 1 - 1
Assembly-CSharp/scoutmode/ScoutMaidData.cs

@@ -107,7 +107,7 @@ namespace scoutmode
 			}
 			using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(pressetBinary)))
 			{
-				GameMain.Instance.CharacterMgr.PresetSet(maid, GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, string.Empty));
+				GameMain.Instance.CharacterMgr.PresetSet(maid, GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, string.Empty), false);
 			}
 			using (BinaryReader binaryReader2 = new BinaryReader(new MemoryStream(this.statusBinary)))
 			{

+ 1 - 1
Assembly-CSharp/uGUICharacterSelectManager.cs

@@ -24,7 +24,7 @@ public class uGUICharacterSelectManager : MonoBehaviour
 		{
 			Maid stockMaid = characterMgr.GetStockMaid(i);
 			Status status = stockMaid.status;
-			if (status.specialRelation == SpecialRelation.Married)
+			if (status.specialRelation == SpecialRelation.Married && !stockMaid.IsCrcBody)
 			{
 				drawList.Add(stockMaid);
 			}

+ 6 - 3
Assembly-CSharp/uGUIKaraokeSelect.cs

@@ -382,11 +382,14 @@ public class uGUIKaraokeSelect : MonoBehaviour
 		List<KaraokeDataManager.FoodData> list = new List<KaraokeDataManager.FoodData>();
 		foreach (KaraokeDataManager.FoodData foodData in foodDataArray)
 		{
-			if (foodData.ID != KaraokeDataManager.FoodData.ID_BUTTON_MAID_ADDITIONAL || KaraokeDataManager.IsEnablePersonalKaraoke003(GameMain.Instance.CharacterMgr.GetMaid(0)))
+			if (!foodData.isNewBodyBlock || !GameMain.Instance.CharacterMgr.GetMaid(0).IsCrcBody)
 			{
-				if (foodData.ID != KaraokeDataManager.FoodData.ID_BUTTON_MAID_ || KaraokeDataManager.IsEnablePersonalKaraoke004(GameMain.Instance.CharacterMgr.GetMaid(0)))
+				if (foodData.ID != KaraokeDataManager.FoodData.ID_BUTTON_MAID_ADDITIONAL || KaraokeDataManager.IsEnablePersonalKaraoke003(GameMain.Instance.CharacterMgr.GetMaid(0)))
 				{
-					list.Add(foodData);
+					if (foodData.ID != KaraokeDataManager.FoodData.ID_BUTTON_MAID_ || KaraokeDataManager.IsEnablePersonalKaraoke004(GameMain.Instance.CharacterMgr.GetMaid(0)))
+					{
+						list.Add(foodData);
+					}
 				}
 			}
 		}

+ 28 - 0
Assembly-CSharp/wf/Serialization/AJsonSerializationVersionControl.cs

@@ -0,0 +1,28 @@
+using System;
+using UnityEngine;
+
+namespace wf.Serialization
+{
+	[Serializable]
+	public abstract class AJsonSerializationVersionControl : ISerializationCallbackReceiver
+	{
+		public AJsonSerializationVersionControl()
+		{
+			this.version = this.FixVersion;
+		}
+
+		public abstract int FixVersion { get; }
+
+		public virtual void OnAfterDeserialize()
+		{
+		}
+
+		public virtual void OnBeforeSerialize()
+		{
+			this.version = this.FixVersion;
+		}
+
+		[SerializeField]
+		public int version;
+	}
+}