UndressDance_Mgr.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using Dance;
  6. using UnityEngine;
  7. using wf;
  8. public class UndressDance_Mgr : PartsMgrBase
  9. {
  10. public static UndressDance_Mgr Instance { get; private set; }
  11. public Maid SelectMaid
  12. {
  13. get
  14. {
  15. return this.m_SelectedMaid;
  16. }
  17. }
  18. protected override void Start()
  19. {
  20. UndressDance_Mgr.Instance = this;
  21. this.m_ItemWindow.transform.localPosition = this.m_DeactiveOffset;
  22. this.m_ItemWindow.SetActive(false);
  23. base.Start();
  24. base.IsActive &= (DanceMain.SelectDanceData != null);
  25. if (!base.IsActive)
  26. {
  27. base.gameObject.SetActive(false);
  28. return;
  29. }
  30. base.transform.parent.gameObject.layer = base.gameObject.layer;
  31. foreach (UndressDance_Mgr.IconColor iconColor in this.m_IconColData)
  32. {
  33. this.m_LevelColPair.Add(iconColor.Level, iconColor.IconCol);
  34. }
  35. this.m_TakeEventColl = this.m_TakeEvent.GetComponent<BoxCollider>();
  36. UIEventTrigger component = this.m_TakeEvent.GetComponent<UIEventTrigger>();
  37. EventDelegate.Add(component.onHoverOver, new EventDelegate.Callback(this.ShowItemWindow));
  38. EventDelegate.Add(component.onHoverOut, new EventDelegate.Callback(this.CursorRecet));
  39. this.m_HoverCheckObj.Add(this.m_ItemWindow.transform.Find("BG").gameObject);
  40. this.m_HoverCheckObj.Add(this.m_CloseButton.gameObject);
  41. EventDelegate.Add(this.m_CloseButton.onClick, new EventDelegate.Callback(this.HideItemWindow));
  42. this.m_ItemGrid = this.m_ItemWindow.transform.Find("ItemGrid").GetComponent<UIGrid>();
  43. this.m_MaidGrid = this.m_ItemWindow.transform.Find("MaidIcon").GetComponent<UIGrid>();
  44. this.m_MaidTabPanel = this.m_MaidGrid.gameObject.GetComponent<UIWFTabPanel>();
  45. KasaiUtility.CsvRead("csv_rhythm_action/undress_parts_data.nei", new Action<CsvParser, int, int>(this.ReadPartsData), 0, 1, null);
  46. this.m_ItemGrid.repositionNow = true;
  47. KasaiUtility.CsvRead("csv_rhythm_action/undress_level2_data.nei", new Action<CsvParser, int, int>(this.ReadLevel2Key), 0, 1, null);
  48. KasaiUtility.CsvRead("csv_rhythm_action/undress_face_data.nei", new Action<CsvParser, int, int>(this.ReadFaceSetting), 0, 1, null);
  49. this.m_HoverCheckObj.Add(this.m_AlldressButton.gameObject);
  50. this.m_HoverCheckObj.Add(this.m_AllundressButton.gameObject);
  51. EventDelegate.Add(this.m_AlldressButton.onClick, new EventDelegate.Callback(this.AllDreass));
  52. EventDelegate.Add(this.m_AllundressButton.onClick, new EventDelegate.Callback(this.AllUndreass));
  53. if (GameMain.Instance.VRMode && GameMain.Instance.VRDeviceTypeID == GameMain.VRDeviceType.RIFT_TOUCH)
  54. {
  55. AVRControllerButtons controller_buttons = GameMain.Instance.OvrMgr.ovr_obj.right_controller.controller_buttons;
  56. AVRControllerButtons controller_buttons2 = GameMain.Instance.OvrMgr.ovr_obj.left_controller.controller_buttons;
  57. this.m_ControllerInputFlag.Add(controller_buttons, false);
  58. this.m_ControllerInputFlag.Add(controller_buttons2, false);
  59. }
  60. if (GameMain.Instance.VRMode)
  61. {
  62. this.ShowItemWindow();
  63. }
  64. }
  65. private void ReadPartsData(CsvParser csv, int cx, int cy)
  66. {
  67. switch (cx)
  68. {
  69. case 0:
  70. {
  71. MPN key = (MPN)Enum.Parse(typeof(MPN), csv.GetCellAsString(cx, cy));
  72. this.m_MpnPartsData.Add(key, new UndressDance_Mgr.PartsData());
  73. break;
  74. }
  75. case 1:
  76. foreach (string value in csv.GetCellAsString(cx, cy).Split(new char[]
  77. {
  78. ','
  79. }))
  80. {
  81. this.m_MpnPartsData.Last<KeyValuePair<MPN, UndressDance_Mgr.PartsData>>().Value.SlotIDlist.Add((TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), value));
  82. }
  83. break;
  84. case 2:
  85. {
  86. string text = csv.GetCellAsString(cx, cy);
  87. if (text.IndexOf(".tex") < 0)
  88. {
  89. text += ".tex";
  90. }
  91. if (!GameUty.FileSystem.IsExistentFile(text))
  92. {
  93. Debug.LogError("アイコンファイル[" + text + "]が見つかりませんでした");
  94. }
  95. Texture2D defaultIcon = ImportCM.CreateTexture(text);
  96. this.m_MpnPartsData.Last<KeyValuePair<MPN, UndressDance_Mgr.PartsData>>().Value.DefaultIcon = defaultIcon;
  97. break;
  98. }
  99. case 3:
  100. this.m_MpnPartsData.Last<KeyValuePair<MPN, UndressDance_Mgr.PartsData>>().Value.SexsualPoint = csv.GetCellAsInteger(cx, cy);
  101. break;
  102. case 4:
  103. {
  104. bool flag = csv.GetCellAsString(cx, cy) == "○";
  105. if (Product.VBA && !flag)
  106. {
  107. return;
  108. }
  109. break;
  110. }
  111. }
  112. if (cx == csv.max_cell_x - 1)
  113. {
  114. this.CreatePartsIcon(this.m_MpnPartsData.Last<KeyValuePair<MPN, UndressDance_Mgr.PartsData>>().Key);
  115. }
  116. }
  117. private void CreatePartsIcon(MPN mpn)
  118. {
  119. GameObject gameObject = Utility.CreatePrefab(this.m_ItemGrid.gameObject, "SceneDance/Rhythm_Action/Prefab/UndressDance/ItemIcon", true);
  120. this.m_HoverCheckObj.Add(gameObject);
  121. UndressItem component = gameObject.GetComponent<UndressItem>();
  122. component.Init(mpn);
  123. this.m_ItemUIList.Add(mpn, component);
  124. }
  125. private void ReadLevel2Key(CsvParser csv, int cx, int cy)
  126. {
  127. if (cx == 1)
  128. {
  129. this.m_Level2KeyList.Add(new List<MPN>());
  130. foreach (string value in csv.GetCellAsString(cx, cy).Split(new char[]
  131. {
  132. ','
  133. }))
  134. {
  135. this.m_Level2KeyList.Last<List<MPN>>().Add((MPN)Enum.Parse(typeof(MPN), value));
  136. }
  137. }
  138. }
  139. private void ReadFaceSetting(CsvParser csv, int cx, int cy)
  140. {
  141. switch (cx)
  142. {
  143. case 0:
  144. {
  145. UndressDance_Mgr.UndressLevel undressLevel = (UndressDance_Mgr.UndressLevel)Enum.Parse(typeof(UndressDance_Mgr.UndressLevel), csv.GetCellAsString(cx, cy));
  146. this.m_FaceSetting.Add(undressLevel, new UndressDance_Mgr.FaceDataBase());
  147. this.m_FaceSetting.Last<KeyValuePair<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>>().Value.Level = undressLevel;
  148. break;
  149. }
  150. case 1:
  151. if (csv.IsCellToExistData(cx, cy))
  152. {
  153. this.m_FaceSetting.Last<KeyValuePair<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>>().Value.SexualPoint = csv.GetCellAsInteger(cx, cy);
  154. }
  155. break;
  156. case 2:
  157. if (csv.IsCellToExistData(cx, cy))
  158. {
  159. this.m_FaceSetting.Last<KeyValuePair<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>>().Value.Face = csv.GetCellAsString(cx, cy).Split(new char[]
  160. {
  161. ','
  162. }).ToList<string>();
  163. }
  164. break;
  165. case 3:
  166. this.m_FaceSetting.Last<KeyValuePair<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>>().Value.FaceBlend = csv.GetCellAsString(cx, cy);
  167. break;
  168. case 4:
  169. if (csv.IsCellToExistData(cx, cy))
  170. {
  171. this.m_FaceSetting.Last<KeyValuePair<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>>().Value.Probability = csv.GetCellAsInteger(cx, cy);
  172. }
  173. break;
  174. }
  175. }
  176. private void CursorRecet()
  177. {
  178. this.m_IsCursorOn = false;
  179. }
  180. private void WindowMove(float time)
  181. {
  182. this.m_MoveEnd = false;
  183. this.m_ItemWindow.transform.localPosition = Vector3.Lerp(Vector3.zero, this.m_DeactiveOffset, KasaiUtility.SinRate01(time, this.m_UIShowTime, this.m_IsWindowActive, false));
  184. }
  185. private void MoveEnd()
  186. {
  187. this.m_MoveEnd = true;
  188. if (!this.m_IsWindowActive)
  189. {
  190. this.m_ItemWindow.SetActive(false);
  191. }
  192. else
  193. {
  194. this.m_IsCursorOn = true;
  195. }
  196. this.m_TakeEventColl.enabled = !this.m_IsWindowActive;
  197. }
  198. private void ShowItemWindow()
  199. {
  200. if (!this.m_MoveEnd)
  201. {
  202. return;
  203. }
  204. if (this.m_IsCursorOn)
  205. {
  206. return;
  207. }
  208. if (!this.m_IsWindowActive)
  209. {
  210. this.m_IsWindowActive = true;
  211. this.m_ItemWindow.SetActive(true);
  212. base.StartCoroutine(KasaiUtility.TimeCroutine(this.m_UIShowTime, new Action<float>(this.WindowMove), new Action(this.MoveEnd)));
  213. }
  214. }
  215. private void HideItemWindow()
  216. {
  217. if (!this.m_MoveEnd)
  218. {
  219. return;
  220. }
  221. this.m_IsWindowActive = false;
  222. base.StartCoroutine(KasaiUtility.TimeCroutine(this.m_UIShowTime, new Action<float>(this.WindowMove), new Action(this.MoveEnd)));
  223. }
  224. private void MaidSelect()
  225. {
  226. Maid maid = this.m_MaidIconList[UIWFTabButton.current];
  227. if (this.m_SelectedMaid == maid)
  228. {
  229. return;
  230. }
  231. this.m_SelectedMaid = maid;
  232. foreach (UndressItem undressItem in this.m_ItemUIList.Values)
  233. {
  234. undressItem.UpdateState(maid);
  235. }
  236. }
  237. private void AllDreass()
  238. {
  239. if (this.m_ForceLevel2)
  240. {
  241. this.SetMaidFace(UndressDance_Mgr.UndressLevel.None);
  242. this.m_ForceLevel2 = false;
  243. }
  244. if (this.m_ItemUIList.Values.All((UndressItem e) => !e.IsUndress))
  245. {
  246. return;
  247. }
  248. foreach (UndressItem undressItem in this.m_ItemUIList.Values)
  249. {
  250. undressItem.SetMaidMask(this.m_SelectedMaid, false);
  251. }
  252. }
  253. private void AllUndreass()
  254. {
  255. if (this.m_ItemUIList.Values.All((UndressItem e) => e.IsUndress))
  256. {
  257. return;
  258. }
  259. this.m_ForceLevel2 = false;
  260. foreach (UndressItem undressItem in this.m_ItemUIList.Values)
  261. {
  262. undressItem.SetMaidMask(this.m_SelectedMaid, true);
  263. }
  264. if (this.GetUndressLevel(false) != UndressDance_Mgr.UndressLevel.Level2)
  265. {
  266. this.m_ForceLevel2 = true;
  267. this.SetMaidFace(UndressDance_Mgr.UndressLevel.Level2);
  268. }
  269. }
  270. private UndressDance_Mgr.UndressLevel GetUndressLevel(bool release_force2 = false)
  271. {
  272. UndressDance_Mgr.SexsualData sexsualData = this.m_MaidSexsualData[this.SelectMaid];
  273. UndressDance_Mgr.UndressLevel undressLevel = UndressDance_Mgr.UndressLevel.None;
  274. int sexsualPoint = sexsualData.SexsualPoint;
  275. foreach (UndressDance_Mgr.FaceDataBase faceDataBase in this.m_FaceSetting.Values)
  276. {
  277. if (faceDataBase.SexualPoint > 0 && sexsualPoint >= faceDataBase.SexualPoint)
  278. {
  279. undressLevel = faceDataBase.Level;
  280. }
  281. }
  282. if (undressLevel == UndressDance_Mgr.UndressLevel.Level1)
  283. {
  284. if (release_force2)
  285. {
  286. this.m_ForceLevel2 = false;
  287. }
  288. foreach (List<MPN> list in this.m_Level2KeyList)
  289. {
  290. bool flag = true;
  291. foreach (MPN key in list)
  292. {
  293. flag &= (this.m_ItemUIList.ContainsKey(key) && this.m_ItemUIList[key].IsUndress);
  294. if (!flag)
  295. {
  296. break;
  297. }
  298. }
  299. if (flag || this.m_ForceLevel2)
  300. {
  301. undressLevel = UndressDance_Mgr.UndressLevel.Level2;
  302. break;
  303. }
  304. }
  305. }
  306. return undressLevel;
  307. }
  308. private void SetFaceBlend(UndressDance_Mgr.UndressLevel level)
  309. {
  310. string faceBlend = this.m_FaceSetting[level].FaceBlend;
  311. TMorph.AddBlendType addBlendType = TMorph.AddBlendType.None;
  312. if (faceBlend.IndexOf("頬1") >= 0 || faceBlend.IndexOf("頬1") >= 0)
  313. {
  314. addBlendType |= TMorph.AddBlendType.Cheek1;
  315. }
  316. if (faceBlend.IndexOf("頬2") >= 0 || faceBlend.IndexOf("頬2") >= 0)
  317. {
  318. addBlendType |= TMorph.AddBlendType.Cheek2;
  319. }
  320. if (faceBlend.IndexOf("頬3") >= 0 || faceBlend.IndexOf("頬3") >= 0)
  321. {
  322. addBlendType |= TMorph.AddBlendType.Cheek3;
  323. }
  324. if (faceBlend.IndexOf("涙1") >= 0 || faceBlend.IndexOf("涙1") >= 0)
  325. {
  326. addBlendType |= TMorph.AddBlendType.Tear1;
  327. }
  328. if (faceBlend.IndexOf("涙2") >= 0 || faceBlend.IndexOf("涙2") >= 0)
  329. {
  330. addBlendType |= TMorph.AddBlendType.Tear2;
  331. }
  332. if (faceBlend.IndexOf("涙3") >= 0 || faceBlend.IndexOf("涙3") >= 0)
  333. {
  334. addBlendType |= TMorph.AddBlendType.Tear3;
  335. }
  336. if (faceBlend.IndexOf("赤面") >= 0)
  337. {
  338. addBlendType |= TMorph.AddBlendType.Blush;
  339. }
  340. if (faceBlend.IndexOf("ショック") >= 0)
  341. {
  342. addBlendType |= TMorph.AddBlendType.Shock;
  343. }
  344. if (faceBlend.IndexOf("玉涙") >= 0)
  345. {
  346. addBlendType |= TMorph.AddBlendType.TearBig;
  347. }
  348. this.SelectMaid.body0.Face.morph.SetValueOriginalBlendSet(addBlendType);
  349. this.SelectMaid.FaceBlend("オリジナル");
  350. }
  351. private IEnumerator FaceUpdate(UndressDance_Mgr.UndressLevel level)
  352. {
  353. UndressDance_Mgr.FaceDataBase face_data = this.m_FaceSetting[level];
  354. Maid maid = this.SelectMaid;
  355. RhythmAction_Mgr.Instance.SetMaidFaceBlendStop(maid, true);
  356. this.SetFaceBlend(level);
  357. if (face_data.Face.Count <= 0)
  358. {
  359. RhythmAction_Mgr.Instance.SetMaidFaceStop(maid, false);
  360. yield break;
  361. }
  362. RhythmAction_Mgr.Instance.SetMaidFaceStop(maid, true);
  363. float timer = 0f;
  364. int face_index = UnityEngine.Random.Range(0, face_data.Face.Count);
  365. maid.FaceAnime(face_data.Face[face_index], 1f, 0);
  366. for (;;)
  367. {
  368. timer += RhythmAction_Mgr.Instance.DanceDeltaTime;
  369. if (timer > this.m_FaceChangeTime)
  370. {
  371. timer = 0f;
  372. int num = UnityEngine.Random.Range(0, 100);
  373. if (num < face_data.Probability)
  374. {
  375. face_index = UnityEngine.Random.Range(0, face_data.Face.Count);
  376. RhythmAction_Mgr.Instance.SetMaidFaceStop(maid, true);
  377. maid.FaceAnime(face_data.Face[face_index], 1f, 0);
  378. }
  379. else
  380. {
  381. RhythmAction_Mgr.Instance.SetMaidFaceStop(maid, false);
  382. }
  383. }
  384. yield return null;
  385. }
  386. yield break;
  387. }
  388. private IEnumerator InputCheck()
  389. {
  390. for (;;)
  391. {
  392. if (RhythmAction_Mgr.Instance.DanceMaid.Count > 1)
  393. {
  394. bool flag = Input.GetKeyDown(KeyCode.RightArrow);
  395. bool flag2 = Input.GetKeyDown(KeyCode.LeftArrow);
  396. if (GameMain.Instance.VRMode && !flag2 && !flag && GameMain.Instance.VRDeviceTypeID != GameMain.VRDeviceType.NON)
  397. {
  398. AVRController left_controller = GameMain.Instance.OvrMgr.ovr_obj.left_controller.controller;
  399. AVRController right_controller = GameMain.Instance.OvrMgr.ovr_obj.right_controller.controller;
  400. AVRControllerButtons left_input = GameMain.Instance.OvrMgr.ovr_obj.left_controller.controller_buttons;
  401. AVRControllerButtons right_input = GameMain.Instance.OvrMgr.ovr_obj.right_controller.controller_buttons;
  402. GameMain.VRDeviceType vrdeviceTypeID = GameMain.Instance.VRDeviceTypeID;
  403. if (vrdeviceTypeID != GameMain.VRDeviceType.VIVE)
  404. {
  405. if (vrdeviceTypeID == GameMain.VRDeviceType.RIFT_TOUCH)
  406. {
  407. Func<bool, bool> func = delegate(bool is_right)
  408. {
  409. bool flag5 = false;
  410. if (is_right)
  411. {
  412. flag5 |= (left_input.GetAxis().x > 0.5f && !this.m_ControllerInputFlag[left_input] && left_controller.HandDanceMode);
  413. flag5 |= (right_input.GetAxis().x > 0.5f && !this.m_ControllerInputFlag[right_input] && right_controller.HandDanceMode);
  414. }
  415. else
  416. {
  417. flag5 |= (left_input.GetAxis().x < -0.5f && !this.m_ControllerInputFlag[left_input] && left_controller.HandDanceMode);
  418. flag5 |= (right_input.GetAxis().x < -0.5f && !this.m_ControllerInputFlag[right_input] && right_controller.HandDanceMode);
  419. }
  420. return flag5;
  421. };
  422. flag2 = func(false);
  423. flag = func(true);
  424. this.m_ControllerInputFlag[left_input] = (Mathf.Abs(left_input.GetAxis().x) > 0.5f);
  425. this.m_ControllerInputFlag[right_input] = (Mathf.Abs(right_input.GetAxis().x) > 0.5f);
  426. }
  427. }
  428. else
  429. {
  430. Func<bool, bool> func2 = delegate(bool is_right)
  431. {
  432. bool flag5 = false;
  433. if (is_right)
  434. {
  435. flag5 |= (left_input.GetAxis().x > 0.5f && left_input.GetPressDown(AVRControllerButtons.BTN.STICK_PAD) && left_controller.HandDanceMode);
  436. flag5 |= (right_input.GetAxis().x > 0.5f && right_input.GetPressDown(AVRControllerButtons.BTN.STICK_PAD) && right_controller.HandDanceMode);
  437. }
  438. else
  439. {
  440. flag5 |= (left_input.GetAxis().x < -0.5f && left_input.GetPressDown(AVRControllerButtons.BTN.STICK_PAD) && left_controller.HandDanceMode);
  441. flag5 |= (right_input.GetAxis().x < -0.5f && right_input.GetPressDown(AVRControllerButtons.BTN.STICK_PAD) && right_controller.HandDanceMode);
  442. }
  443. return flag5;
  444. };
  445. flag2 = func2(false);
  446. flag = func2(true);
  447. }
  448. }
  449. if (flag || flag2)
  450. {
  451. UIWFTabButton[] array = this.m_MaidIconList.Keys.ToArray<UIWFTabButton>();
  452. for (int i = 0; i < this.m_MaidIconList.Count; i++)
  453. {
  454. if (!(array[i] != this.m_MaidTabPanel.GetSelectButtonObject()))
  455. {
  456. bool flag3 = false;
  457. if (flag)
  458. {
  459. flag3 = (i + 1 < this.m_MaidIconList.Count);
  460. }
  461. else if (flag2)
  462. {
  463. flag3 = (i - 1 >= 0);
  464. }
  465. if (flag3)
  466. {
  467. int num = (!flag) ? (i - 1) : (i + 1);
  468. this.m_MaidTabPanel.Select(array[num]);
  469. if (this.m_IsWindowActive)
  470. {
  471. GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Click);
  472. }
  473. }
  474. break;
  475. }
  476. }
  477. }
  478. }
  479. if (this.m_IsWindowActive && !GameMain.Instance.VRMode)
  480. {
  481. bool flag4 = UICamera.hoveredObject && this.m_HoverCheckObj.Contains(UICamera.hoveredObject);
  482. if (!flag4 && this.m_WaitCoroutine == null)
  483. {
  484. this.m_IsCursorOn = false;
  485. this.m_WaitCoroutine = KasaiUtility.TimeCroutine(this.m_HidewaitTime, null, new Action(this.HideItemWindow));
  486. base.StartCoroutine(this.m_WaitCoroutine);
  487. }
  488. else if (flag4 && this.m_WaitCoroutine != null)
  489. {
  490. this.m_IsCursorOn = true;
  491. base.StopCoroutine(this.m_WaitCoroutine);
  492. this.m_WaitCoroutine = null;
  493. }
  494. foreach (UndressDance_Mgr.MpnKeyData mpnKeyData in this.m_MpnInputPair)
  495. {
  496. if (this.m_ItemUIList.ContainsKey(mpnKeyData.Mpn) && this.m_ItemUIList[mpnKeyData.Mpn].IsEnable)
  497. {
  498. if (Input.GetKeyDown(mpnKeyData.InputKey))
  499. {
  500. this.m_ItemUIList[mpnKeyData.Mpn].SwitchMask();
  501. GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Click);
  502. }
  503. }
  504. }
  505. }
  506. yield return null;
  507. }
  508. yield break;
  509. }
  510. private IEnumerator TweeenNull()
  511. {
  512. yield return null;
  513. foreach (UIWFTabButton uiwftabButton in this.m_MaidIconList.Keys)
  514. {
  515. uiwftabButton.tweenTarget = null;
  516. }
  517. yield break;
  518. }
  519. private void SetMaidFace(UndressDance_Mgr.UndressLevel level)
  520. {
  521. if (!DanceSetting.Settings.UndressFaceOn)
  522. {
  523. return;
  524. }
  525. this.m_MaidSexsualData[this.SelectMaid].Level = level;
  526. if (this.m_FaceCroutine != null)
  527. {
  528. base.StopCoroutine(this.m_FaceCroutine);
  529. this.m_FaceCroutine = null;
  530. }
  531. this.m_MaidSexsualData[this.SelectMaid].Icon.color = this.m_LevelColPair[level];
  532. if (level != UndressDance_Mgr.UndressLevel.None)
  533. {
  534. this.m_FaceCroutine = this.FaceUpdate(level);
  535. base.StartCoroutine(this.m_FaceCroutine);
  536. }
  537. else
  538. {
  539. RhythmAction_Mgr.Instance.SetMaidFaceStop(this.SelectMaid, false);
  540. RhythmAction_Mgr.Instance.SetMaidFaceBlendStop(this.SelectMaid, false);
  541. }
  542. }
  543. public override void StartAction()
  544. {
  545. List<Maid> list = new List<Maid>(RhythmAction_Mgr.Instance.FactOrderList);
  546. list.Reverse();
  547. foreach (Maid maid in list)
  548. {
  549. foreach (UndressItem undressItem in this.m_ItemUIList.Values)
  550. {
  551. undressItem.AddMaidData(maid);
  552. }
  553. GameObject gameObject = Utility.CreatePrefab(this.m_MaidGrid.gameObject, "SceneDance/Rhythm_Action/Prefab/UndressDance/MaidIcon", true);
  554. Transform transform = gameObject.transform.Find("IconMask/Icon");
  555. this.m_HoverCheckObj.Add(transform.gameObject);
  556. transform.GetComponent<UITexture>().mainTexture = maid.GetThumIcon();
  557. UIWFTabButton component = transform.GetComponent<UIWFTabButton>();
  558. this.m_MaidIconList.Add(component, maid);
  559. EventDelegate.Add(component.onClick, new EventDelegate.Callback(this.MaidSelect));
  560. this.m_MaidSexsualData.Add(maid, new UndressDance_Mgr.SexsualData());
  561. this.m_MaidSexsualData[maid].Icon = transform.GetComponent<UITexture>();
  562. }
  563. this.m_MaidGrid.repositionNow = true;
  564. this.m_MaidTabPanel.UpdateChildren();
  565. this.m_MaidTabPanel.Select(this.m_MaidIconList.Last<KeyValuePair<UIWFTabButton, Maid>>().Key);
  566. base.StartCoroutine(this.InputCheck());
  567. base.StartCoroutine(this.TweeenNull());
  568. }
  569. public override void EndAction()
  570. {
  571. foreach (Maid maid in RhythmAction_Mgr.Instance.DanceMaid)
  572. {
  573. maid.body0.SetMaskMode(TBody.MaskMode.None);
  574. maid.FaceBlend("無し");
  575. }
  576. }
  577. public UndressDance_Mgr.PartsData GetPartsData(MPN mpn)
  578. {
  579. NDebug.Assert(this.m_MpnPartsData.ContainsKey(mpn), string.Format("UndressDance_Mgr.GetPartsData:リスト内に{0}は存在しません", mpn));
  580. return this.m_MpnPartsData[mpn];
  581. }
  582. public void ChangeSexsualPoint(MPN mpn)
  583. {
  584. if (!DanceSetting.Settings.UndressFaceOn)
  585. {
  586. return;
  587. }
  588. UndressDance_Mgr.UndressLevel level = this.m_MaidSexsualData[this.SelectMaid].Level;
  589. this.m_MaidSexsualData[this.SelectMaid].SexsualPoint += ((!this.m_ItemUIList[mpn].IsUndress) ? (-this.m_MpnPartsData[mpn].SexsualPoint) : this.m_MpnPartsData[mpn].SexsualPoint);
  590. if (this.m_MaidSexsualData[this.SelectMaid].SexsualPoint < 0)
  591. {
  592. this.m_MaidSexsualData[this.SelectMaid].SexsualPoint = 0;
  593. }
  594. UndressDance_Mgr.UndressLevel undressLevel = this.GetUndressLevel(true);
  595. if (level != undressLevel)
  596. {
  597. this.SetMaidFace(undressLevel);
  598. }
  599. }
  600. private const float m_InputBorder = 0.5f;
  601. [SerializeField]
  602. [Header("非アクティブ時のウィンドウのオフセット")]
  603. private Vector3 m_DeactiveOffset;
  604. [SerializeField]
  605. private UIButton m_CloseButton;
  606. [SerializeField]
  607. private GameObject m_TakeEvent;
  608. private BoxCollider m_TakeEventColl;
  609. [SerializeField]
  610. [Header("アイテムウィンドウ")]
  611. private GameObject m_ItemWindow;
  612. private UIGrid m_ItemGrid;
  613. private UIGrid m_MaidGrid;
  614. private UIWFTabPanel m_MaidTabPanel;
  615. [SerializeField]
  616. [Header("ウィンドウの移動時間")]
  617. private float m_UIShowTime = 0.5f;
  618. [SerializeField]
  619. private float m_HidewaitTime = 2f;
  620. [SerializeField]
  621. [Header("全脱衣ボタン")]
  622. private UIButton m_AllundressButton;
  623. [SerializeField]
  624. [Header("全着衣ボタン")]
  625. private UIButton m_AlldressButton;
  626. [SerializeField]
  627. private float m_FaceChangeTime = 5f;
  628. private IEnumerator m_WaitCoroutine;
  629. private bool m_IsWindowActive;
  630. private bool m_MoveEnd = true;
  631. private List<GameObject> m_HoverCheckObj = new List<GameObject>();
  632. private Dictionary<MPN, UndressDance_Mgr.PartsData> m_MpnPartsData = new Dictionary<MPN, UndressDance_Mgr.PartsData>();
  633. private Maid m_SelectedMaid;
  634. private Dictionary<MPN, UndressItem> m_ItemUIList = new Dictionary<MPN, UndressItem>();
  635. private Dictionary<UIWFTabButton, Maid> m_MaidIconList = new Dictionary<UIWFTabButton, Maid>();
  636. private bool m_IsCursorOn;
  637. [SerializeField]
  638. [Header("ショートカットキーと各Mpnの割り当て")]
  639. private List<UndressDance_Mgr.MpnKeyData> m_MpnInputPair = new List<UndressDance_Mgr.MpnKeyData>
  640. {
  641. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad1),
  642. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad2),
  643. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad3),
  644. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad4),
  645. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad5),
  646. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad6),
  647. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad7),
  648. new UndressDance_Mgr.MpnKeyData(KeyCode.Keypad8)
  649. };
  650. private Dictionary<AVRControllerButtons, bool> m_ControllerInputFlag = new Dictionary<AVRControllerButtons, bool>();
  651. private List<List<MPN>> m_Level2KeyList = new List<List<MPN>>();
  652. private Dictionary<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase> m_FaceSetting = new Dictionary<UndressDance_Mgr.UndressLevel, UndressDance_Mgr.FaceDataBase>();
  653. private Dictionary<Maid, UndressDance_Mgr.SexsualData> m_MaidSexsualData = new Dictionary<Maid, UndressDance_Mgr.SexsualData>();
  654. private IEnumerator m_FaceCroutine;
  655. [SerializeField]
  656. [Header("各レベルのアイコン色")]
  657. private List<UndressDance_Mgr.IconColor> m_IconColData = new List<UndressDance_Mgr.IconColor>
  658. {
  659. new UndressDance_Mgr.IconColor(UndressDance_Mgr.UndressLevel.None),
  660. new UndressDance_Mgr.IconColor(UndressDance_Mgr.UndressLevel.Level0),
  661. new UndressDance_Mgr.IconColor(UndressDance_Mgr.UndressLevel.Level1),
  662. new UndressDance_Mgr.IconColor(UndressDance_Mgr.UndressLevel.Level2)
  663. };
  664. private Dictionary<UndressDance_Mgr.UndressLevel, Color> m_LevelColPair = new Dictionary<UndressDance_Mgr.UndressLevel, Color>();
  665. private bool m_ForceLevel2;
  666. public class PartsData
  667. {
  668. public List<TBody.SlotID> SlotIDlist = new List<TBody.SlotID>();
  669. public Texture DefaultIcon;
  670. public int SexsualPoint;
  671. }
  672. [Serializable]
  673. private class MpnKeyData
  674. {
  675. public MpnKeyData(KeyCode key)
  676. {
  677. this.InputKey = key;
  678. }
  679. public MPN Mpn;
  680. public KeyCode InputKey;
  681. }
  682. private enum UndressLevel
  683. {
  684. None,
  685. Level0,
  686. Level1,
  687. Level2
  688. }
  689. private class FaceDataBase
  690. {
  691. public int SexualPoint;
  692. public UndressDance_Mgr.UndressLevel Level;
  693. public List<string> Face = new List<string>();
  694. public string FaceBlend = string.Empty;
  695. public int Probability;
  696. }
  697. private class SexsualData
  698. {
  699. public int SexsualPoint;
  700. public UndressDance_Mgr.UndressLevel Level;
  701. public UITexture Icon;
  702. }
  703. [Serializable]
  704. private class IconColor
  705. {
  706. public IconColor(UndressDance_Mgr.UndressLevel level)
  707. {
  708. this.Level = level;
  709. }
  710. public UndressDance_Mgr.UndressLevel Level;
  711. public Color IconCol = Color.white;
  712. }
  713. }