UndressDance_Mgr.cs 23 KB

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