MultipleMaids.IK.cs 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. using System.IO;
  2. using UnityEngine;
  3. namespace CM3D2.MultipleMaids.Plugin
  4. {
  5. public partial class MultipleMaids
  6. {
  7. private void SetIKInit6(int k)
  8. {
  9. gHead2[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  10. gHead2[k].GetComponent<Renderer>().enabled = false;
  11. mHead2[k] = gHead2[k].AddComponent<MouseDrag5>();
  12. mHead2[k].obj = gHead2[k];
  13. gHead2[k].transform.localScale = new Vector3(0.2f, 0.24f, 0.2f);
  14. gHead2[k].layer = 8;
  15. gMaid2[k] = GameObject.CreatePrimitive(PrimitiveType.Capsule);
  16. gMaid2[k].GetComponent<Renderer>().enabled = false;
  17. mMaid2[k] = gMaid2[k].AddComponent<MouseDrag5>();
  18. mMaid2[k].obj = gMaid2[k];
  19. gMaid2[k].transform.localScale = new Vector3(0.2f, 0.3f, 0.24f);
  20. gMaid2[k].layer = 8;
  21. }
  22. private void SetIKInit7(int k)
  23. {
  24. gIKMuneL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  25. gIKMuneL[k].GetComponent<Renderer>().enabled = false;
  26. mIKMuneL[k] = gIKMuneL[k].AddComponent<MouseDrag>();
  27. mIKMuneL[k].obj = gIKMuneL[k];
  28. gIKMuneL[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  29. gIKMuneL[k].layer = 8;
  30. gIKMuneR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  31. gIKMuneR[k].GetComponent<Renderer>().enabled = false;
  32. mIKMuneR[k] = gIKMuneR[k].AddComponent<MouseDrag>();
  33. mIKMuneR[k].obj = gIKMuneR[k];
  34. gIKMuneR[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  35. gIKMuneR[k].layer = 8;
  36. }
  37. private void SetIKInit5(int k)
  38. {
  39. gIKHandL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  40. gIKHandL[k].GetComponent<Renderer>().enabled = false;
  41. mIKHandL[k] = gIKHandL[k].AddComponent<MouseDrag4>();
  42. mIKHandL[k].obj = gIKHandL[k];
  43. gIKHandL[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  44. gIKHandR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  45. gIKHandR[k].GetComponent<Renderer>().enabled = false;
  46. mIKHandR[k] = gIKHandR[k].AddComponent<MouseDrag4>();
  47. mIKHandR[k].obj = gIKHandR[k];
  48. gIKHandR[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  49. }
  50. private void SetIKInit4(int k)
  51. {
  52. gHead[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  53. gHead[k].GetComponent<Renderer>().enabled = false;
  54. mHead[k] = gHead[k].AddComponent<MouseDrag3>();
  55. mHead[k].obj = gHead[k];
  56. gHead[k].transform.localScale = new Vector3(0.2f, 0.24f, 0.2f);
  57. gJotai[k] = GameObject.CreatePrimitive(PrimitiveType.Capsule);
  58. gJotai[k].GetComponent<Renderer>().enabled = false;
  59. mJotai[k] = gJotai[k].AddComponent<MouseDrag3>();
  60. mJotai[k].obj = gJotai[k];
  61. gJotai[k].transform.localScale = new Vector3(0.2f, 0.19f, 0.24f);
  62. gJotai[k].layer = 8;
  63. gKahuku[k] = GameObject.CreatePrimitive(PrimitiveType.Capsule);
  64. gKahuku[k].GetComponent<Renderer>().enabled = false;
  65. mKahuku[k] = gKahuku[k].AddComponent<MouseDrag3>();
  66. mKahuku[k].obj = gKahuku[k];
  67. gKahuku[k].transform.localScale = new Vector3(0.2f, 0.15f, 0.24f);
  68. gKahuku[k].layer = 8;
  69. }
  70. private void SetIKInit3(int k)
  71. {
  72. gMaid[k] = GameObject.CreatePrimitive(PrimitiveType.Capsule);
  73. gMaid[k].GetComponent<Renderer>().enabled = false;
  74. mMaid[k] = gMaid[k].AddComponent<MouseDrag2>();
  75. mMaid[k].obj = gMaid[k];
  76. gMaid[k].transform.localScale = new Vector3(0.2f, 0.3f, 0.24f);
  77. gMaid[k].layer = 8;
  78. gMaidC[k] = GameObject.CreatePrimitive(PrimitiveType.Cube);
  79. gMaidC[k].GetComponent<Renderer>().enabled = true;
  80. mMaidC[k] = gMaidC[k].AddComponent<MouseDrag2>();
  81. mMaidC[k].obj = gMaidC[k];
  82. gMaidC[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  83. gMaidC[k].GetComponent<Renderer>().material =
  84. new Material(Shader.Find("Transparent/Diffuse")) { color = new Color(0.5f, 0.5f, 1f, 0.8f) };
  85. gMaidC[k].layer = 8;
  86. }
  87. private void SetIKInit2(int k)
  88. {
  89. for (int index = 0; index < 30; ++index)
  90. {
  91. gFinger[k, index] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  92. if (index % 3 != 0)
  93. {
  94. ;
  95. }
  96. mFinger[k, index] = gFinger[k, index].AddComponent<MouseDrag>();
  97. mFinger[k, index].obj = gFinger[k, index];
  98. float num = 0.0f;
  99. switch (index)
  100. {
  101. case 0:
  102. case 15:
  103. num = 0.024f;
  104. break;
  105. case 1:
  106. case 16:
  107. num = 0.018f;
  108. break;
  109. case 2:
  110. case 17:
  111. num = 0.014f;
  112. break;
  113. case 3:
  114. case 6:
  115. case 9:
  116. case 18:
  117. case 21:
  118. case 24:
  119. num = 0.017f;
  120. break;
  121. case 4:
  122. case 7:
  123. case 10:
  124. case 19:
  125. case 22:
  126. case 25:
  127. num = 0.015f;
  128. break;
  129. case 5:
  130. case 8:
  131. case 11:
  132. case 20:
  133. case 23:
  134. case 26:
  135. num = 0.013f;
  136. break;
  137. case 12:
  138. case 27:
  139. num = 0.015f;
  140. break;
  141. case 13:
  142. case 28:
  143. num = 0.013f;
  144. break;
  145. case 14:
  146. case 29:
  147. num = 0.012f;
  148. break;
  149. }
  150. gFinger[k, index].transform.localScale = new Vector3(num, num, num);
  151. Material material = new Material(Shader.Find("Transparent/Diffuse"));
  152. gFinger[k, index].GetComponent<Renderer>().material = material;
  153. gFinger[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
  154. }
  155. for (int index = 0; index < 12; ++index)
  156. {
  157. gFinger2[k, index] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  158. mFinger2[k, index] = gFinger2[k, index].AddComponent<MouseDrag>();
  159. mFinger2[k, index].obj = gFinger2[k, index];
  160. float num = 0.0f;
  161. switch (index)
  162. {
  163. case 0:
  164. case 6:
  165. num = 0.017f;
  166. break;
  167. case 1:
  168. case 7:
  169. num = 0.016f;
  170. break;
  171. case 2:
  172. case 8:
  173. num = 0.024f;
  174. break;
  175. case 3:
  176. case 9:
  177. num = 0.017f;
  178. break;
  179. case 4:
  180. case 10:
  181. num = 0.024f;
  182. break;
  183. case 5:
  184. case 11:
  185. num = 0.018f;
  186. break;
  187. }
  188. gFinger2[k, index].transform.localScale = new Vector3(num, num, num);
  189. Material material = new Material(Shader.Find("Transparent/Diffuse"));
  190. gFinger2[k, index].GetComponent<Renderer>().material = material;
  191. gFinger2[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
  192. }
  193. }
  194. private void SetIKInit(int k)
  195. {
  196. Material material = new Material(Shader.Find("Transparent/Diffuse"))
  197. {
  198. color = new Color(0.4f, 0.4f, 1f, 0.3f)
  199. };
  200. m_material2 = new Material(Shader.Find("Transparent/Diffuse"))
  201. {
  202. color = new Color(0.4f, 0.4f, 1f, 0.26f)
  203. };
  204. m_material3 = new Material(Shader.Find("Transparent/Diffuse"))
  205. {
  206. color = new Color(0.4f, 0.4f, 1f, 0.36f)
  207. };
  208. gHandL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  209. gHandL[k].GetComponent<Renderer>().enabled = false;
  210. gHandL[k].layer = 8;
  211. mHandL[k] = gHandL[k].AddComponent<MouseDrag>();
  212. mHandL[k].obj = gHandL[k];
  213. gArmL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  214. gArmL[k].GetComponent<Renderer>().enabled = false;
  215. gArmL[k].layer = 8;
  216. mArmL[k] = gArmL[k].AddComponent<MouseDrag>();
  217. mArmL[k].obj = gArmL[k];
  218. gFootL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  219. gFootL[k].GetComponent<Renderer>().enabled = false;
  220. gFootL[k].layer = 8;
  221. mFootL[k] = gFootL[k].AddComponent<MouseDrag>();
  222. mFootL[k].obj = gFootL[k];
  223. gHizaL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  224. gHizaL[k].GetComponent<Renderer>().enabled = false;
  225. gHizaL[k].layer = 8;
  226. mHizaL[k] = gHizaL[k].AddComponent<MouseDrag>();
  227. mHizaL[k].obj = gHizaL[k];
  228. gHandR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  229. gHandR[k].GetComponent<Renderer>().enabled = false;
  230. gHandR[k].layer = 8;
  231. mHandR[k] = gHandR[k].AddComponent<MouseDrag>();
  232. mHandR[k].obj = gHandR[k];
  233. gArmR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  234. gArmR[k].GetComponent<Renderer>().enabled = false;
  235. gArmR[k].layer = 8;
  236. mArmR[k] = gArmR[k].AddComponent<MouseDrag>();
  237. mArmR[k].obj = gArmR[k];
  238. gFootR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  239. gFootR[k].GetComponent<Renderer>().enabled = false;
  240. gFootR[k].layer = 8;
  241. mFootR[k] = gFootR[k].AddComponent<MouseDrag>();
  242. mFootR[k].obj = gFootR[k];
  243. gHizaR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  244. gHizaR[k].GetComponent<Renderer>().enabled = false;
  245. gHizaR[k].layer = 8;
  246. mHizaR[k] = gHizaR[k].AddComponent<MouseDrag>();
  247. mHizaR[k].obj = gHizaR[k];
  248. gClavicleL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  249. gClavicleL[k].GetComponent<Renderer>().enabled = false;
  250. gClavicleL[k].layer = 8;
  251. mClavicleL[k] = gClavicleL[k].AddComponent<MouseDrag>();
  252. mClavicleL[k].obj = gClavicleL[k];
  253. gClavicleR[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  254. gClavicleR[k].GetComponent<Renderer>().enabled = false;
  255. gClavicleR[k].layer = 8;
  256. mClavicleR[k] = gClavicleR[k].AddComponent<MouseDrag>();
  257. mClavicleR[k].obj = gClavicleR[k];
  258. if (!isBone[k])
  259. {
  260. gHandL[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  261. gHandR[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  262. gArmL[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  263. gArmR[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
  264. gFootL[k].transform.localScale = new Vector3(0.15f, 0.15f, 0.15f);
  265. gFootR[k].transform.localScale = new Vector3(0.15f, 0.15f, 0.15f);
  266. gHizaL[k].transform.localScale = new Vector3(0.15f, 0.15f, 0.15f);
  267. gHizaR[k].transform.localScale = new Vector3(0.15f, 0.15f, 0.15f);
  268. gClavicleL[k].transform.localScale = new Vector3(0.13f, 0.13f, 0.13f);
  269. mClavicleR[k].transform.localScale = new Vector3(0.13f, 0.13f, 0.13f);
  270. }
  271. else
  272. {
  273. gHandL[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  274. gHandR[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  275. gArmL[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  276. gArmR[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  277. gFootL[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  278. gFootR[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  279. gHizaL[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  280. gHizaR[k].transform.localScale = new Vector3(0.07f, 0.07f, 0.07f);
  281. gClavicleL[k].transform.localScale = new Vector3(0.06f, 0.06f, 0.06f);
  282. gClavicleR[k].transform.localScale = new Vector3(0.06f, 0.06f, 0.06f);
  283. gHandL[k].GetComponent<Renderer>().enabled = true;
  284. gHandR[k].GetComponent<Renderer>().enabled = true;
  285. gArmL[k].GetComponent<Renderer>().enabled = true;
  286. gArmR[k].GetComponent<Renderer>().enabled = true;
  287. gFootL[k].GetComponent<Renderer>().enabled = true;
  288. gFootR[k].GetComponent<Renderer>().enabled = true;
  289. gHizaL[k].GetComponent<Renderer>().enabled = true;
  290. gHizaR[k].GetComponent<Renderer>().enabled = true;
  291. gClavicleL[k].GetComponent<Renderer>().enabled = true;
  292. gClavicleR[k].GetComponent<Renderer>().enabled = true;
  293. gHandL[k].GetComponent<Renderer>().material = m_material2;
  294. gHandR[k].GetComponent<Renderer>().material = m_material2;
  295. gArmL[k].GetComponent<Renderer>().material = m_material2;
  296. gArmR[k].GetComponent<Renderer>().material = m_material2;
  297. gFootL[k].GetComponent<Renderer>().material = m_material2;
  298. gFootR[k].GetComponent<Renderer>().material = m_material2;
  299. gHizaL[k].GetComponent<Renderer>().material = m_material2;
  300. gHizaR[k].GetComponent<Renderer>().material = m_material2;
  301. gClavicleL[k].GetComponent<Renderer>().material = m_material2;
  302. gClavicleR[k].GetComponent<Renderer>().material = m_material2;
  303. }
  304. GameObject handLGizmo = new GameObject();
  305. handLGizmo.transform.SetParent(transform, false);
  306. gizmoHandL[k] = handLGizmo.AddComponent<GizmoRender>();
  307. gizmoHandL[k].eRotate = true;
  308. gizmoHandL[k].offsetScale = 0.25f;
  309. gizmoHandL[k].lineRSelectedThick = 0.25f;
  310. gizmoHandL[k].Visible = false;
  311. GameObject handRGizmo = new GameObject();
  312. handRGizmo.transform.SetParent(transform, false);
  313. gizmoHandR[k] = handRGizmo.AddComponent<GizmoRender>();
  314. gizmoHandR[k].eRotate = true;
  315. gizmoHandR[k].offsetScale = 0.25f;
  316. gizmoHandR[k].lineRSelectedThick = 0.25f;
  317. gizmoHandR[k].Visible = false;
  318. GameObject footLGizmo = new GameObject();
  319. footLGizmo.transform.SetParent(transform, false);
  320. gizmoFootL[k] = footLGizmo.AddComponent<GizmoRender>();
  321. gizmoFootL[k].eRotate = true;
  322. gizmoFootL[k].offsetScale = 0.25f;
  323. gizmoFootL[k].lineRSelectedThick = 0.25f;
  324. gizmoFootL[k].Visible = false;
  325. GameObject footRGizmo = new GameObject();
  326. footRGizmo.transform.SetParent(transform, false);
  327. gizmoFootR[k] = footRGizmo.AddComponent<GizmoRender>();
  328. gizmoFootR[k].eRotate = true;
  329. gizmoFootR[k].offsetScale = 0.25f;
  330. gizmoFootR[k].lineRSelectedThick = 0.25f;
  331. gizmoFootR[k].Visible = false;
  332. GameObject neckGizmo = new GameObject();
  333. neckGizmo.transform.SetParent(transform, false);
  334. gizmoNeck[k] = neckGizmo.AddComponent<GizmoRender>();
  335. gizmoNeck[k].eRotate = true;
  336. gizmoNeck[k].offsetScale = 0.2f;
  337. gizmoNeck[k].lineRSelectedThick = 0.25f;
  338. gizmoNeck[k].Visible = false;
  339. GameObject pelvisGizmo = new GameObject();
  340. pelvisGizmo.transform.SetParent(transform, false);
  341. gizmoPelvis[k] = pelvisGizmo.AddComponent<GizmoRender>();
  342. gizmoPelvis[k].eRotate = true;
  343. gizmoPelvis[k].offsetScale = 0.2f;
  344. gizmoPelvis[k].lineRSelectedThick = 0.25f;
  345. gizmoPelvis[k].Visible = false;
  346. gNeck[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  347. gNeck[k].GetComponent<Renderer>().material = material;
  348. gNeck[k].layer = 8;
  349. mNeck[k] = gNeck[k].AddComponent<MouseDrag3>();
  350. mNeck[k].obj = gNeck[k];
  351. gNeck[k].transform.localScale = new Vector3(0.055f, 0.055f, 0.055f);
  352. gNeck[k].SetActive(false);
  353. gSpine[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  354. gSpine[k].GetComponent<Renderer>().material = material;
  355. gSpine[k].layer = 8;
  356. mSpine[k] = gSpine[k].AddComponent<MouseDrag3>();
  357. mSpine[k].obj = gSpine[k];
  358. gSpine[k].transform.localScale = new Vector3(0.04f, 0.04f, 0.04f);
  359. gSpine[k].SetActive(false);
  360. gSpine0a[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  361. gSpine0a[k].GetComponent<Renderer>().material = material;
  362. gSpine0a[k].layer = 8;
  363. mSpine0a[k] = gSpine0a[k].AddComponent<MouseDrag3>();
  364. mSpine0a[k].obj = gSpine0a[k];
  365. gSpine0a[k].transform.localScale = new Vector3(0.04f, 0.04f, 0.04f);
  366. gSpine0a[k].SetActive(false);
  367. gSpine1a[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  368. gSpine1a[k].GetComponent<Renderer>().material = material;
  369. gSpine1a[k].layer = 8;
  370. mSpine1a[k] = gSpine1a[k].AddComponent<MouseDrag3>();
  371. mSpine1a[k].obj = gSpine1a[k];
  372. gSpine1a[k].transform.localScale = new Vector3(0.04f, 0.04f, 0.04f);
  373. gSpine1a[k].SetActive(false);
  374. gSpine1[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  375. gSpine1[k].GetComponent<Renderer>().material = material;
  376. gSpine1[k].layer = 8;
  377. mSpine1[k] = gSpine1[k].AddComponent<MouseDrag3>();
  378. mSpine1[k].obj = gSpine1[k];
  379. gSpine1[k].transform.localScale = new Vector3(0.04f, 0.04f, 0.04f);
  380. gSpine1[k].SetActive(false);
  381. gPelvis[k] = GameObject.CreatePrimitive(PrimitiveType.Cube);
  382. gPelvis[k].GetComponent<Renderer>().material = m_material3;
  383. gPelvis[k].layer = 8;
  384. mPelvis[k] = gPelvis[k].AddComponent<MouseDrag3>();
  385. mPelvis[k].obj = gPelvis[k];
  386. gPelvis[k].transform.localScale = new Vector3(0.045f, 0.045f, 0.045f);
  387. gPelvis[k].SetActive(false);
  388. }
  389. private void SetIK(Maid maid, int i)
  390. {
  391. Head = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Neck", true);
  392. Head1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Neck", true);
  393. Head2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Head", true);
  394. Head3[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 HeadNub", true);
  395. IKHandL[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "_IK_handL", true);
  396. IKHandR[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "_IK_handR", true);
  397. IKMuneL[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Mune_L", true);
  398. IKMuneLSub[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Mune_L_sub", true);
  399. IKMuneR[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Mune_R", true);
  400. IKMuneRSub[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Mune_R_sub", true);
  401. Spine = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine", true);
  402. Spine0a = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine0a", true);
  403. Spine1 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine1", true);
  404. Spine1a = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine1a", true);
  405. Pelvis = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Pelvis", true);
  406. Neck[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Neck", true);
  407. Pelvis2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01", true);
  408. Spine12[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine1", true);
  409. Spine0a2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine0a", true);
  410. Spine2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine", true);
  411. Spine1a2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 Spine1a", true);
  412. HandL1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Hand", true);
  413. UpperArmL1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L UpperArm", true);
  414. ForearmL1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Forearm", true);
  415. HandR1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Hand", true);
  416. UpperArmR1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R UpperArm", true);
  417. ForearmR1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Forearm", true);
  418. HandL2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Foot", true);
  419. UpperArmL2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Thigh", true);
  420. ForearmL2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Calf", true);
  421. HandR2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Foot", true);
  422. UpperArmR2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Thigh", true);
  423. ForearmR2[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Calf", true);
  424. ClavicleL1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Clavicle", true);
  425. ClavicleR1[i] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Clavicle", true);
  426. Finger[i, 0] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger0", true);
  427. Finger[i, 1] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger01", true);
  428. Finger[i, 2] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger02", true);
  429. Finger[i, 3] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger0Nub", true);
  430. Finger[i, 4] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger1", true);
  431. Finger[i, 5] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger11", true);
  432. Finger[i, 6] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger12", true);
  433. Finger[i, 7] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger1Nub", true);
  434. Finger[i, 8] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger2", true);
  435. Finger[i, 9] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger21", true);
  436. Finger[i, 10] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger22", true);
  437. Finger[i, 11] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger2Nub", true);
  438. Finger[i, 12] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger3", true);
  439. Finger[i, 13] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger31", true);
  440. Finger[i, 14] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger32", true);
  441. Finger[i, 15] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger3Nub", true);
  442. Finger[i, 16] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger4", true);
  443. Finger[i, 17] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger41", true);
  444. Finger[i, 18] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger42", true);
  445. Finger[i, 19] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Finger4Nub", true);
  446. Finger[i, 20] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger0", true);
  447. Finger[i, 21] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger01", true);
  448. Finger[i, 22] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger02", true);
  449. Finger[i, 23] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger0Nub", true);
  450. Finger[i, 24] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger1", true);
  451. Finger[i, 25] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger11", true);
  452. Finger[i, 26] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger12", true);
  453. Finger[i, 27] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger1Nub", true);
  454. Finger[i, 28] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger2", true);
  455. Finger[i, 29] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger21", true);
  456. Finger[i, 30] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger22", true);
  457. Finger[i, 31] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger2Nub", true);
  458. Finger[i, 32] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger3", true);
  459. Finger[i, 33] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger31", true);
  460. Finger[i, 34] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger32", true);
  461. Finger[i, 35] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger3Nub", true);
  462. Finger[i, 36] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger4", true);
  463. Finger[i, 37] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger41", true);
  464. Finger[i, 38] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger42", true);
  465. Finger[i, 39] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Finger4Nub", true);
  466. Finger2[i, 0] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0", true);
  467. Finger2[i, 1] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe01", true);
  468. Finger2[i, 2] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0Nub", true);
  469. Finger2[i, 3] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1", true);
  470. Finger2[i, 4] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe11", true);
  471. Finger2[i, 5] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1Nub", true);
  472. Finger2[i, 6] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2", true);
  473. Finger2[i, 7] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe21", true);
  474. Finger2[i, 8] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2Nub", true);
  475. Finger2[i, 9] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0", true);
  476. Finger2[i, 10] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe01", true);
  477. Finger2[i, 11] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0Nub", true);
  478. Finger2[i, 12] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1", true);
  479. Finger2[i, 13] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe11", true);
  480. Finger2[i, 14] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1Nub", true);
  481. Finger2[i, 15] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2", true);
  482. Finger2[i, 16] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe21", true);
  483. Finger2[i, 17] = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2Nub", true);
  484. }
  485. private void CopyIK(Maid maid, int i, Maid maid2, int i2)
  486. {
  487. poseIndex[i] = poseIndex[i2];
  488. if (!maid || !maid.Visible)
  489. {
  490. return;
  491. }
  492. string[] strArray = poseArray[poseIndex[i]].Split(',');
  493. isStop[i] = false;
  494. if (strArray[0].Contains("_momi") || strArray[0].Contains("paizuri_"))
  495. {
  496. maid.body0.MuneYureL(0.0f);
  497. maid.body0.MuneYureR(0.0f);
  498. }
  499. else
  500. {
  501. maid.body0.MuneYureL(1f);
  502. maid.body0.MuneYureR(1f);
  503. }
  504. if (strArray[0].Contains("MultipleMaidsPose"))
  505. {
  506. string path = strArray[0].Split('/')[1];
  507. byte[] numArray = new byte[0];
  508. try
  509. {
  510. using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
  511. {
  512. numArray = new byte[fileStream.Length];
  513. fileStream.Read(numArray, 0, numArray.Length);
  514. }
  515. }
  516. catch { }
  517. if (0 < numArray.Length)
  518. {
  519. long hashCode = Path.GetFileName(path).GetHashCode();
  520. maid.body0.CrossFade(hashCode.ToString(), numArray, false, false, false, 0.0f, 1f);
  521. Maid.AutoTwist[] autoTwistArray = new Maid.AutoTwist[6]
  522. {
  523. Maid.AutoTwist.ShoulderL, Maid.AutoTwist.ShoulderR, Maid.AutoTwist.WristL, Maid.AutoTwist.WristR,
  524. Maid.AutoTwist.ThighL, Maid.AutoTwist.ThighR
  525. };
  526. foreach (Maid.AutoTwist f_eType in autoTwistArray)
  527. {
  528. maid.SetAutoTwist(f_eType, true);
  529. }
  530. }
  531. }
  532. else
  533. {
  534. if (strArray[0].StartsWith("p") && int.TryParse(strArray[0].Substring(1), out int result))
  535. {
  536. loadPose[i] = strArray[0];
  537. }
  538. else if (!strArray[0].StartsWith("dance_"))
  539. {
  540. maidArray[i].CrossFade(strArray[0] + ".anm", false, true, false, 0.0f, 1f);
  541. }
  542. else
  543. {
  544. if (!maid.body0.m_Bones.GetComponent<Animation>().GetClip(strArray[0] + ".anm"))
  545. {
  546. maid.body0.LoadAnime(strArray[0] + ".anm", GameUty.FileSystem, strArray[0] + ".anm", false, false);
  547. }
  548. maid.body0.m_Bones.GetComponent<Animation>().Play(strArray[0] + ".anm");
  549. }
  550. }
  551. if (strArray.Length > 1)
  552. {
  553. maid.body0.m_Bones.GetComponent<Animation>()[strArray[0] + ".anm"].time = float.Parse(strArray[1]);
  554. isStop[i] = true;
  555. if (strArray.Length > 2)
  556. {
  557. CMT.SearchObjName(maidArray[i].body0.m_Bones.transform, "Bip01", true);
  558. isPoseIti[i] = true;
  559. poseIti[i] = maidArray[i].transform.position;
  560. maidArray[i].transform.position = new Vector3(100f, 100f, 100f);
  561. }
  562. }
  563. }
  564. private void CopyIK2(Maid maid, int i, Maid maid2, int i2)
  565. {
  566. isStop[i] = true;
  567. isLock[i] = true;
  568. maid.transform.position = new Vector3(maid.transform.position.x, maid2.transform.position.y, maid.transform.position.z);
  569. SetIK(maid2, i2);
  570. Transform transform1 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe0", true);
  571. Transform transform2 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe0", true);
  572. Transform transform3 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe01", true);
  573. Transform transform4 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe01", true);
  574. Transform transform5 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe0Nub", true);
  575. Transform transform6 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe0Nub", true);
  576. Transform transform7 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe1", true);
  577. Transform transform8 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe1", true);
  578. Transform transform9 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe11", true);
  579. Transform transform10 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe11", true);
  580. Transform transform11 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe1Nub", true);
  581. Transform transform12 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe1Nub", true);
  582. Transform transform13 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe2", true);
  583. Transform transform14 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe2", true);
  584. Transform transform15 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe21", true);
  585. Transform transform16 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe21", true);
  586. Transform transform17 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 L Toe2Nub", true);
  587. Transform transform18 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01 R Toe2Nub", true);
  588. Transform transform19 = CMT.SearchObjName(maid2.body0.m_Bones.transform, "Bip01", true);
  589. Vector3 eulerAngles1 = Head.eulerAngles;
  590. Vector3 eulerAngles2 = Spine.eulerAngles;
  591. Vector3 eulerAngles3 = Spine0a.eulerAngles;
  592. Vector3 eulerAngles4 = Spine1.eulerAngles;
  593. Vector3 eulerAngles5 = Spine1a.eulerAngles;
  594. Vector3 eulerAngles6 = Pelvis.eulerAngles;
  595. Vector3 eulerAngles7 = ClavicleL1[i2].eulerAngles;
  596. Vector3 eulerAngles8 = ClavicleR1[i2].eulerAngles;
  597. Vector3 localEulerAngles1 = transform1.localEulerAngles;
  598. Vector3 localEulerAngles2 = transform2.localEulerAngles;
  599. Vector3 localEulerAngles3 = transform3.localEulerAngles;
  600. Vector3 localEulerAngles4 = transform4.localEulerAngles;
  601. Vector3 localEulerAngles5 = transform5.localEulerAngles;
  602. Vector3 localEulerAngles6 = transform6.localEulerAngles;
  603. Vector3 localEulerAngles7 = transform7.localEulerAngles;
  604. Vector3 localEulerAngles8 = transform8.localEulerAngles;
  605. Vector3 localEulerAngles9 = transform9.localEulerAngles;
  606. Vector3 localEulerAngles10 = transform10.localEulerAngles;
  607. Vector3 localEulerAngles11 = transform11.localEulerAngles;
  608. Vector3 localEulerAngles12 = transform12.localEulerAngles;
  609. Vector3 localEulerAngles13 = transform13.localEulerAngles;
  610. Vector3 localEulerAngles14 = transform14.localEulerAngles;
  611. Vector3 localEulerAngles15 = transform15.localEulerAngles;
  612. Vector3 localEulerAngles16 = transform16.localEulerAngles;
  613. Vector3 localEulerAngles17 = transform17.localEulerAngles;
  614. Vector3 localEulerAngles18 = transform18.localEulerAngles;
  615. Vector3 eulerAngles9 = transform19.eulerAngles;
  616. Vector3 localEulerAngles19 = HandL1[i2].localEulerAngles;
  617. Vector3 localEulerAngles20 = HandR1[i2].localEulerAngles;
  618. Vector3 localEulerAngles21 = HandL2[i2].localEulerAngles;
  619. Vector3 localEulerAngles22 = HandR2[i2].localEulerAngles;
  620. Vector3[] vector3Array = new Vector3[40];
  621. for (int index = 0; index < 20; ++index)
  622. {
  623. vector3Array[index] = Finger[i2, index].localEulerAngles;
  624. }
  625. for (int index = 20; index < 40; ++index)
  626. {
  627. vector3Array[index] = Finger[i2, index].localEulerAngles;
  628. }
  629. Vector3 eulerAngles10 = UpperArmL1[i2].eulerAngles;
  630. Vector3 eulerAngles11 = ForearmL1[i2].eulerAngles;
  631. Vector3 eulerAngles12 = UpperArmR1[i2].eulerAngles;
  632. Vector3 eulerAngles13 = ForearmR1[i2].eulerAngles;
  633. Vector3 eulerAngles14 = UpperArmL2[i2].eulerAngles;
  634. Vector3 eulerAngles15 = ForearmL2[i2].eulerAngles;
  635. Vector3 eulerAngles16 = UpperArmR2[i2].eulerAngles;
  636. Vector3 eulerAngles17 = ForearmR2[i2].eulerAngles;
  637. maid.transform.localEulerAngles = maid2.transform.localEulerAngles;
  638. SetIK(maid, i);
  639. Transform transform20 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0", true);
  640. Transform transform21 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0", true);
  641. Transform transform22 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe01", true);
  642. Transform transform23 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe01", true);
  643. Transform transform24 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0Nub", true);
  644. Transform transform25 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0Nub", true);
  645. Transform transform26 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1", true);
  646. Transform transform27 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1", true);
  647. Transform transform28 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe11", true);
  648. Transform transform29 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe11", true);
  649. Transform transform30 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1Nub", true);
  650. Transform transform31 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1Nub", true);
  651. Transform transform32 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2", true);
  652. Transform transform33 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2", true);
  653. Transform transform34 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe21", true);
  654. Transform transform35 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe21", true);
  655. Transform transform36 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2Nub", true);
  656. Transform transform37 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2Nub", true);
  657. CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01", true).eulerAngles = eulerAngles9;
  658. Pelvis.eulerAngles = eulerAngles6;
  659. Spine.eulerAngles = eulerAngles2;
  660. Spine0a.eulerAngles = eulerAngles3;
  661. Spine1.eulerAngles = eulerAngles4;
  662. Spine1a.eulerAngles = eulerAngles5;
  663. ClavicleL1[i].eulerAngles = eulerAngles7;
  664. ClavicleR1[i].eulerAngles = eulerAngles8;
  665. Head.eulerAngles = eulerAngles1;
  666. HandL1[i].localEulerAngles = localEulerAngles19;
  667. HandR1[i].localEulerAngles = localEulerAngles20;
  668. HandL2[i].localEulerAngles = localEulerAngles21;
  669. HandR2[i].localEulerAngles = localEulerAngles22;
  670. for (int index = 0; index < 20; ++index)
  671. {
  672. Finger[i, index].localEulerAngles = vector3Array[index];
  673. }
  674. for (int index = 20; index < 40; ++index)
  675. {
  676. Finger[i, index].localEulerAngles = vector3Array[index];
  677. }
  678. transform20.localEulerAngles = localEulerAngles1;
  679. transform21.localEulerAngles = localEulerAngles2;
  680. transform22.localEulerAngles = localEulerAngles3;
  681. transform23.localEulerAngles = localEulerAngles4;
  682. transform24.localEulerAngles = localEulerAngles5;
  683. transform25.localEulerAngles = localEulerAngles6;
  684. transform26.localEulerAngles = localEulerAngles7;
  685. transform27.localEulerAngles = localEulerAngles8;
  686. transform28.localEulerAngles = localEulerAngles9;
  687. transform29.localEulerAngles = localEulerAngles10;
  688. transform30.localEulerAngles = localEulerAngles11;
  689. transform31.localEulerAngles = localEulerAngles12;
  690. transform32.localEulerAngles = localEulerAngles13;
  691. transform33.localEulerAngles = localEulerAngles14;
  692. transform34.localEulerAngles = localEulerAngles15;
  693. transform35.localEulerAngles = localEulerAngles16;
  694. transform36.localEulerAngles = localEulerAngles17;
  695. transform37.localEulerAngles = localEulerAngles18;
  696. UpperArmL1[i].eulerAngles = eulerAngles10;
  697. UpperArmR1[i].eulerAngles = eulerAngles12;
  698. ForearmL1[i].eulerAngles = eulerAngles11;
  699. ForearmR1[i].eulerAngles = eulerAngles13;
  700. UpperArmL2[i].eulerAngles = eulerAngles14;
  701. UpperArmR2[i].eulerAngles = eulerAngles16;
  702. ForearmL2[i].eulerAngles = eulerAngles15;
  703. ForearmR2[i].eulerAngles = eulerAngles17;
  704. }
  705. private void SetHanten(Maid maid, int i)
  706. {
  707. SetIK(maid, i);
  708. int num = pHandL[selectMaidIndex];
  709. pHandL[selectMaidIndex] = pHandR[selectMaidIndex];
  710. pHandR[selectMaidIndex] = num;
  711. isStop[i] = true;
  712. isLock[i] = true;
  713. Transform transform1 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Hip_L", true);
  714. Transform transform2 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Hip_R", true);
  715. Transform transform3 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0", true);
  716. Transform transform4 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0", true);
  717. Transform transform5 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe01", true);
  718. Transform transform6 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe01", true);
  719. Transform transform7 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe0Nub", true);
  720. Transform transform8 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe0Nub", true);
  721. Transform transform9 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1", true);
  722. Transform transform10 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1", true);
  723. Transform transform11 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe11", true);
  724. Transform transform12 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe11", true);
  725. Transform transform13 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe1Nub", true);
  726. Transform transform14 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe1Nub", true);
  727. Transform transform15 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2", true);
  728. Transform transform16 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2", true);
  729. Transform transform17 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe21", true);
  730. Transform transform18 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe21", true);
  731. Transform transform19 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 L Toe2Nub", true);
  732. Transform transform20 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01 R Toe2Nub", true);
  733. Transform transform21 = CMT.SearchObjName(maid.body0.m_Bones.transform, "Bip01", true);
  734. Vector3 eulerAngles1 = Head.eulerAngles;
  735. Vector3 eulerAngles2 = Spine.eulerAngles;
  736. Vector3 eulerAngles3 = Spine0a.eulerAngles;
  737. Vector3 eulerAngles4 = Spine1.eulerAngles;
  738. Vector3 eulerAngles5 = Spine1a.eulerAngles;
  739. Vector3 eulerAngles6 = Pelvis.eulerAngles;
  740. Vector3 eulerAngles7 = ClavicleL1[i].eulerAngles;
  741. Vector3 eulerAngles8 = ClavicleR1[i].eulerAngles;
  742. Vector3 eulerAngles9 = transform1.eulerAngles;
  743. Vector3 eulerAngles10 = transform2.eulerAngles;
  744. Vector3 localEulerAngles1 = transform3.localEulerAngles;
  745. Vector3 localEulerAngles2 = transform4.localEulerAngles;
  746. Vector3 localEulerAngles3 = transform5.localEulerAngles;
  747. Vector3 localEulerAngles4 = transform6.localEulerAngles;
  748. Vector3 localEulerAngles5 = transform7.localEulerAngles;
  749. Vector3 localEulerAngles6 = transform8.localEulerAngles;
  750. Vector3 localEulerAngles7 = transform9.localEulerAngles;
  751. Vector3 localEulerAngles8 = transform10.localEulerAngles;
  752. Vector3 localEulerAngles9 = transform11.localEulerAngles;
  753. Vector3 localEulerAngles10 = transform12.localEulerAngles;
  754. Vector3 localEulerAngles11 = transform13.localEulerAngles;
  755. Vector3 localEulerAngles12 = transform14.localEulerAngles;
  756. Vector3 localEulerAngles13 = transform15.localEulerAngles;
  757. Vector3 localEulerAngles14 = transform16.localEulerAngles;
  758. Vector3 localEulerAngles15 = transform17.localEulerAngles;
  759. Vector3 localEulerAngles16 = transform18.localEulerAngles;
  760. Vector3 localEulerAngles17 = transform19.localEulerAngles;
  761. Vector3 localEulerAngles18 = transform20.localEulerAngles;
  762. Vector3 eulerAngles11 = transform21.eulerAngles;
  763. Vector3 localEulerAngles19 = HandL1[i].localEulerAngles;
  764. Vector3 localEulerAngles20 = HandR1[i].localEulerAngles;
  765. Vector3 localEulerAngles21 = HandL2[i].localEulerAngles;
  766. Vector3 localEulerAngles22 = HandR2[i].localEulerAngles;
  767. Vector3[] vector3Array = new Vector3[40];
  768. for (int index = 0; index < 20; ++index)
  769. {
  770. vector3Array[index] = Finger[i, index].localEulerAngles;
  771. }
  772. for (int index = 20; index < 40; ++index)
  773. {
  774. vector3Array[index] = Finger[i, index].localEulerAngles;
  775. }
  776. Vector3 eulerAngles12 = UpperArmL1[i].eulerAngles;
  777. Vector3 eulerAngles13 = ForearmL1[i].eulerAngles;
  778. Vector3 eulerAngles14 = UpperArmR1[i].eulerAngles;
  779. Vector3 eulerAngles15 = ForearmR1[i].eulerAngles;
  780. Vector3 eulerAngles16 = UpperArmL2[i].eulerAngles;
  781. Vector3 eulerAngles17 = ForearmL2[i].eulerAngles;
  782. Vector3 eulerAngles18 = UpperArmR2[i].eulerAngles;
  783. Vector3 eulerAngles19 = ForearmR2[i].eulerAngles;
  784. transform21.eulerAngles = new Vector3((float)(360.0 - (eulerAngles11.x + 270.0) - 270.0),
  785. (float)(360.0 - (eulerAngles11.y + 90.0) - 90.0),
  786. 360f - eulerAngles11.z);
  787. transform1.eulerAngles = getHanten(eulerAngles10);
  788. transform2.eulerAngles = getHanten(eulerAngles9);
  789. Pelvis.eulerAngles = getHanten(eulerAngles6);
  790. Spine.eulerAngles = getHanten(eulerAngles2);
  791. Spine0a.eulerAngles = getHanten(eulerAngles3);
  792. Spine1.eulerAngles = getHanten(eulerAngles4);
  793. Spine1a.eulerAngles = getHanten(eulerAngles5);
  794. ClavicleL1[i].eulerAngles = getHanten(eulerAngles8);
  795. ClavicleR1[i].eulerAngles = getHanten(eulerAngles7);
  796. Head.eulerAngles = getHanten(eulerAngles1);
  797. HandR1[i].localEulerAngles = getHanten2(localEulerAngles19);
  798. HandL1[i].localEulerAngles = getHanten2(localEulerAngles20);
  799. HandR2[i].localEulerAngles = getHanten2(localEulerAngles21);
  800. HandL2[i].localEulerAngles = getHanten2(localEulerAngles22);
  801. for (int index = 0; index < 20; ++index)
  802. {
  803. Finger[i, index].localEulerAngles = getHanten2(vector3Array[index + 20]);
  804. }
  805. for (int index = 20; index < 40; ++index)
  806. {
  807. Finger[i, index].localEulerAngles = getHanten2(vector3Array[index - 20]);
  808. }
  809. transform4.localEulerAngles = getHanten2(localEulerAngles1);
  810. transform3.localEulerAngles = getHanten2(localEulerAngles2);
  811. transform6.localEulerAngles = getHanten2(localEulerAngles3);
  812. transform5.localEulerAngles = getHanten2(localEulerAngles4);
  813. transform8.localEulerAngles = getHanten2(localEulerAngles5);
  814. transform7.localEulerAngles = getHanten2(localEulerAngles6);
  815. transform10.localEulerAngles = getHanten2(localEulerAngles7);
  816. transform9.localEulerAngles = getHanten2(localEulerAngles8);
  817. transform12.localEulerAngles = getHanten2(localEulerAngles9);
  818. transform11.localEulerAngles = getHanten2(localEulerAngles10);
  819. transform14.localEulerAngles = getHanten2(localEulerAngles11);
  820. transform13.localEulerAngles = getHanten2(localEulerAngles12);
  821. transform16.localEulerAngles = getHanten2(localEulerAngles13);
  822. transform15.localEulerAngles = getHanten2(localEulerAngles14);
  823. transform18.localEulerAngles = getHanten2(localEulerAngles15);
  824. transform17.localEulerAngles = getHanten2(localEulerAngles16);
  825. transform20.localEulerAngles = getHanten2(localEulerAngles17);
  826. transform19.localEulerAngles = getHanten2(localEulerAngles18);
  827. UpperArmR1[i].eulerAngles = getHanten(eulerAngles12);
  828. UpperArmL1[i].eulerAngles = getHanten(eulerAngles14);
  829. ForearmR1[i].eulerAngles = getHanten(eulerAngles13);
  830. ForearmL1[i].eulerAngles = getHanten(eulerAngles15);
  831. UpperArmR2[i].eulerAngles = getHanten(eulerAngles16);
  832. UpperArmL2[i].eulerAngles = getHanten(eulerAngles18);
  833. ForearmR2[i].eulerAngles = getHanten(eulerAngles17);
  834. ForearmL2[i].eulerAngles = getHanten(eulerAngles19);
  835. }
  836. }
  837. }