UndressDance_Mgr.cs 23 KB

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