FreeSkillSelectOld.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using wf;
  6. using Yotogis;
  7. public class FreeSkillSelectOld : MonoBehaviour
  8. {
  9. public void Awake()
  10. {
  11. if (this.update_obj_dic_ != null)
  12. {
  13. return;
  14. }
  15. this.update_obj_dic_ = new Dictionary<string, FreeSkillSelectOld.UpdateObject>();
  16. Func<GameObject, FreeSkillSelectOld.UpdateObject> func = delegate(GameObject top_obj)
  17. {
  18. GameObject childObject = UTY.GetChildObject(top_obj, "Content", false);
  19. FreeSkillSelectOld.UpdateObject updateObject = new FreeSkillSelectOld.UpdateObject();
  20. updateObject.storage_obj = UTY.GetChildObject(childObject, "StorageRoom", true);
  21. updateObject.arrow_obj = UTY.GetChildObject(top_obj, "Arrow", false);
  22. updateObject.ui_panel = childObject.GetComponent<UIPanel>();
  23. updateObject.scroll_view = childObject.GetComponent<UIScrollView>();
  24. updateObject.button_parent = UTY.GetChildObject(childObject, "GridParent", false);
  25. updateObject.ui_grid = updateObject.button_parent.GetComponent<UIGrid>();
  26. updateObject.tab_panel = updateObject.button_parent.GetComponent<UIWFTabPanel>();
  27. return updateObject;
  28. };
  29. string[] array = new string[]
  30. {
  31. "TypeCategoryViewer",
  32. "CategoryViewer",
  33. "SkillSelectViewer",
  34. "LevelViewer",
  35. "StageSelectViewer"
  36. };
  37. string[] array2 = new string[]
  38. {
  39. "タイプ",
  40. "カテゴリー",
  41. "スキル",
  42. "レベル",
  43. "ステージ"
  44. };
  45. for (int i = 0; i < array.Length; i++)
  46. {
  47. this.update_obj_dic_.Add(array2[i], func(UTY.GetChildObject(base.gameObject, array[i], false)));
  48. }
  49. }
  50. public void Start()
  51. {
  52. }
  53. public void SetMaid(Maid maid)
  54. {
  55. this.maid_ = maid;
  56. }
  57. public void SetYotogiManager(YotogiOldManager yotogi_mgr)
  58. {
  59. this.yotogi_mgr_ = yotogi_mgr;
  60. }
  61. public void CreateInstanceButton()
  62. {
  63. if (this.button_data_list_ != null)
  64. {
  65. return;
  66. }
  67. this.button_data_list_ = FreeSkillSelectOld.CreateButtonData(this.maid_);
  68. FreeSkillSelectOld.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
  69. FreeSkillSelectOld.UpdateObject updateObject2 = this.update_obj_dic_["タイプ"];
  70. FreeSkillSelectOld.UpdateObject updateObject3 = this.update_obj_dic_["レベル"];
  71. foreach (KeyValuePair<string, FreeSkillSelectOld.UpdateObject> keyValuePair in this.update_obj_dic_)
  72. {
  73. FreeSkillSelectOld.UpdateObject value = keyValuePair.Value;
  74. value.Clear();
  75. value.Update();
  76. }
  77. int grade_id = 99;
  78. List<KeyValuePair<YotogiOld.StageData, bool>> playableStageList = YotogiOld.GetPlayableStageList(grade_id, null);
  79. for (int i = 0; i < playableStageList.Count; i++)
  80. {
  81. if (playableStageList[i].Value)
  82. {
  83. GameObject gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/StageSelect/Prefab/Old/StageUnit", true);
  84. gameObject.name = playableStageList[i].Key.stage.ToString();
  85. YotogiOldStageUnit component = gameObject.GetComponent<YotogiOldStageUnit>();
  86. component.SetStageData(playableStageList[i].Key, playableStageList[i].Value);
  87. component.SetOnSelectEvent(new YotogiOldStageUnit.OnSelectEvent(this.OnClickStageEvent));
  88. component.is_change_bg = false;
  89. }
  90. }
  91. updateObject.Update();
  92. GameObject button_parent = updateObject3.button_parent;
  93. for (int j = 0; j < 3; j++)
  94. {
  95. EventDelegate onclick_event = new EventDelegate(this, "OnClickLevelBtnEvent");
  96. UIWFTabButton uiwftabButton = this.CreateTypeAndCategoryButton(updateObject3, "Lv." + (j + 1).ToString(), true, onclick_event);
  97. uiwftabButton.name = (j + 1).ToString();
  98. }
  99. updateObject3.Update();
  100. List<Transform> childList = updateObject3.ui_grid.GetChildList();
  101. for (int k = 0; k < childList.Count; k++)
  102. {
  103. UIWFTabButton componentInChildren = childList[k].gameObject.GetComponentInChildren<UIWFTabButton>();
  104. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  105. {
  106. updateObject3.tab_panel.Select(componentInChildren);
  107. break;
  108. }
  109. }
  110. GameObject button_parent2 = updateObject2.button_parent;
  111. for (int l = 0; l < this.button_data_list_.Count; l++)
  112. {
  113. FreeSkillSelectOld.ButtonData buttonData = this.button_data_list_[l];
  114. EventDelegate eventDelegate = new EventDelegate(this, "OnClickTypeBtnEvent");
  115. eventDelegate.parameters[0].value = buttonData;
  116. buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject2, buttonData.name, 0 < this.button_data_list_[l].children_list.Count, eventDelegate);
  117. }
  118. updateObject2.Update();
  119. childList = updateObject2.ui_grid.GetChildList();
  120. for (int m = 0; m < childList.Count; m++)
  121. {
  122. UIWFTabButton componentInChildren2 = childList[m].gameObject.GetComponentInChildren<UIWFTabButton>();
  123. if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
  124. {
  125. updateObject2.tab_panel.Select(componentInChildren2);
  126. break;
  127. }
  128. }
  129. }
  130. public void SelectSkill(Skill.Old.Data skill, YotogiOld.Stage stage = YotogiOld.Stage.サロン)
  131. {
  132. if (skill == null)
  133. {
  134. return;
  135. }
  136. FreeSkillSelectOld.ButtonData buttonData = null;
  137. FreeSkillSelectOld.ButtonData buttonData2 = null;
  138. FreeSkillSelectOld.ButtonData buttonData3 = null;
  139. bool flag = true;
  140. int num = 0;
  141. while (num < this.button_data_list_.Count && flag)
  142. {
  143. buttonData = this.button_data_list_[num];
  144. int num2 = 0;
  145. while (num2 < buttonData.children_list.Count && flag)
  146. {
  147. buttonData2 = buttonData.children_list[num2];
  148. int num3 = 0;
  149. while (num3 < buttonData2.children_list.Count && flag)
  150. {
  151. buttonData3 = buttonData2.children_list[num3];
  152. if (buttonData3.skill_data == skill)
  153. {
  154. flag = false;
  155. }
  156. num3++;
  157. }
  158. num2++;
  159. }
  160. num++;
  161. }
  162. if (flag)
  163. {
  164. return;
  165. }
  166. if (!buttonData.tab_button_obj.isSelected)
  167. {
  168. this.update_obj_dic_["タイプ"].tab_panel.Select(buttonData.tab_button_obj);
  169. }
  170. if (!buttonData2.tab_button_obj.isSelected)
  171. {
  172. this.update_obj_dic_["カテゴリー"].tab_panel.Select(buttonData2.tab_button_obj);
  173. }
  174. this.user_request_stage = stage;
  175. if (!buttonData3.tab_button_obj.isSelected)
  176. {
  177. this.update_obj_dic_["スキル"].tab_panel.Select(buttonData3.tab_button_obj);
  178. }
  179. }
  180. public void FixSkill()
  181. {
  182. if (this.yotogi_mgr_ == null || this.yotogi_mgr_.maid == null)
  183. {
  184. return;
  185. }
  186. YotogiOldStageSelectManager.SelectStage(YotogiOld.stage_data_list[this.select_stage]);
  187. Skill.Old.Data[] playSkillArray = new Skill.Old.Data[]
  188. {
  189. this.select_skill
  190. };
  191. this.yotogi_mgr_.SetPlaySkillArray(playSkillArray);
  192. }
  193. private void CreateCategory(FreeSkillSelectOld.ButtonData type_button_data)
  194. {
  195. FreeSkillSelectOld.UpdateObject updateObject = this.update_obj_dic_["カテゴリー"];
  196. updateObject.MoveStorageRoom(true);
  197. updateObject.Clear();
  198. GameObject button_parent = updateObject.button_parent;
  199. bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
  200. int i = 0;
  201. while (i < type_button_data.children_list.Count)
  202. {
  203. FreeSkillSelectOld.ButtonData buttonData = type_button_data.children_list[i];
  204. if (!lockNTRPlay)
  205. {
  206. goto IL_87;
  207. }
  208. YotogiOld.Category category = (YotogiOld.Category)Enum.Parse(typeof(YotogiOld.Category), buttonData.name);
  209. if (category != YotogiOld.Category.交換 && category != YotogiOld.Category.乱交)
  210. {
  211. goto IL_87;
  212. }
  213. IL_E7:
  214. i++;
  215. continue;
  216. IL_87:
  217. bool flag = buttonData.children_list != null && 0 < buttonData.children_list.Count;
  218. EventDelegate eventDelegate = null;
  219. if (flag)
  220. {
  221. eventDelegate = new EventDelegate(this, "OnClickCategoryBtnEvent");
  222. eventDelegate.parameters[0].value = buttonData;
  223. }
  224. buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject, buttonData.name, flag, eventDelegate);
  225. goto IL_E7;
  226. }
  227. updateObject.Update();
  228. List<Transform> childList = updateObject.ui_grid.GetChildList();
  229. for (int j = 0; j < childList.Count; j++)
  230. {
  231. UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  232. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  233. {
  234. updateObject.tab_panel.Select(componentInChildren);
  235. break;
  236. }
  237. }
  238. }
  239. private void CreateSkill(FreeSkillSelectOld.ButtonData skill_button_data)
  240. {
  241. FreeSkillSelectOld.UpdateObject updateObject = this.update_obj_dic_["スキル"];
  242. updateObject.MoveStorageRoom(true);
  243. updateObject.Clear();
  244. GameObject button_parent = updateObject.button_parent;
  245. for (int i = 0; i < skill_button_data.children_list.Count; i++)
  246. {
  247. FreeSkillSelectOld.ButtonData buttonData = skill_button_data.children_list[i];
  248. if (buttonData.skill_data != null)
  249. {
  250. EventDelegate eventDelegate = new EventDelegate(this, "OnClickSkillBtnEvent");
  251. eventDelegate.parameters[0].value = buttonData;
  252. buttonData.tab_button_obj = this.CreateSkillButton(buttonData.skill_data, eventDelegate);
  253. }
  254. }
  255. updateObject.Update();
  256. List<Transform> childList = updateObject.ui_grid.GetChildList();
  257. for (int j = 0; j < childList.Count; j++)
  258. {
  259. UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  260. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  261. {
  262. updateObject.tab_panel.Select(componentInChildren);
  263. break;
  264. }
  265. }
  266. }
  267. private void CreateStage(Skill.Old.Data skill_data)
  268. {
  269. FreeSkillSelectOld.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
  270. YotogiOld.Stage stage = this.user_request_stage;
  271. UIWFTabButton uiwftabButton = null;
  272. updateObject.tab_panel.ResetSelect();
  273. List<Transform> childList = updateObject.ui_grid.GetChildList();
  274. for (int i = 0; i < childList.Count; i++)
  275. {
  276. YotogiOldStageUnit component = childList[i].gameObject.GetComponent<YotogiOldStageUnit>();
  277. UIWFTabButton componentInChildren = childList[i].gameObject.GetComponentInChildren<UIWFTabButton>();
  278. if (componentInChildren.isSelected)
  279. {
  280. componentInChildren.SetSelect(false);
  281. }
  282. if (componentInChildren.isEnabled != skill_data.IsExecStage(component.stage_data.stage))
  283. {
  284. componentInChildren.isEnabled = skill_data.IsExecStage(component.stage_data.stage);
  285. if (componentInChildren.isEnabled)
  286. {
  287. component.thumbnail_sprite.color = new Color(1f, 1f, 1f, 1f);
  288. }
  289. else
  290. {
  291. component.thumbnail_sprite.color = new Color(0.6f, 0.6f, 0.6f, 1f);
  292. }
  293. }
  294. if (stage == component.stage_data.stage && componentInChildren.isEnabled)
  295. {
  296. uiwftabButton = componentInChildren;
  297. }
  298. }
  299. if (uiwftabButton != null)
  300. {
  301. updateObject.tab_panel.Select(uiwftabButton);
  302. }
  303. else
  304. {
  305. for (int j = 0; j < childList.Count; j++)
  306. {
  307. UIWFTabButton componentInChildren2 = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  308. if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
  309. {
  310. updateObject.tab_panel.Select(componentInChildren2);
  311. break;
  312. }
  313. }
  314. this.user_request_stage = stage;
  315. }
  316. }
  317. private UIWFTabButton CreateSkillButton(Skill.Old.Data skill_data, EventDelegate onclick_event)
  318. {
  319. if (skill_data == null)
  320. {
  321. return null;
  322. }
  323. FreeSkillSelectOld.UpdateObject updateObject = this.update_obj_dic_["スキル"];
  324. GameObject gameObject = updateObject.MoveButtonParent();
  325. if (gameObject == null)
  326. {
  327. gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/FreeMode/FreeSkillButton", true);
  328. }
  329. UTY.GetChildObject(gameObject, "title", false).GetComponent<UILabel>().text = skill_data.name;
  330. gameObject.name = skill_data.name;
  331. UIWFTabButton component = UTY.GetChildObject(gameObject, "BG", false).GetComponent<UIWFTabButton>();
  332. if (onclick_event != null)
  333. {
  334. component.onClick.Add(onclick_event);
  335. }
  336. return component;
  337. }
  338. private UIWFTabButton CreateTypeAndCategoryButton(FreeSkillSelectOld.UpdateObject update_obj, string name, bool enabled, EventDelegate onclick_event)
  339. {
  340. GameObject gameObject = update_obj.MoveButtonParent();
  341. if (gameObject == null)
  342. {
  343. gameObject = Utility.CreatePrefab(update_obj.button_parent, "SceneYotogi/SkillSelect/Prefab/CategoryBtn", true);
  344. }
  345. UTY.GetChildObject(gameObject, "Label", false).GetComponent<UILabel>().text = name;
  346. UIWFTabButton component = UTY.GetChildObject(gameObject, "Button", false).GetComponent<UIWFTabButton>();
  347. gameObject.name = name;
  348. component.isEnabled = enabled;
  349. if (enabled && onclick_event != null)
  350. {
  351. component.onClick.Add(onclick_event);
  352. }
  353. return component;
  354. }
  355. private void OnClickTypeBtnEvent(FreeSkillSelectOld.ButtonData type_btn_data)
  356. {
  357. this.update_obj_dic_["タイプ"].UpdateArrow(type_btn_data.tab_button_obj.gameObject);
  358. this.CreateCategory(type_btn_data);
  359. }
  360. private void OnClickCategoryBtnEvent(FreeSkillSelectOld.ButtonData categorybtn_data)
  361. {
  362. this.update_obj_dic_["カテゴリー"].UpdateArrow(categorybtn_data.tab_button_obj.gameObject);
  363. this.CreateSkill(categorybtn_data);
  364. }
  365. private void OnClickSkillBtnEvent(FreeSkillSelectOld.ButtonData skill_data)
  366. {
  367. this.update_obj_dic_["スキル"].UpdateArrow(skill_data.tab_button_obj.gameObject);
  368. this.select_skill_ = skill_data.skill_data;
  369. this.CreateStage(skill_data.skill_data);
  370. }
  371. private void OnClickLevelBtnEvent()
  372. {
  373. this.update_obj_dic_["レベル"].UpdateArrow(UIButton.current.gameObject);
  374. this.yotogi_mgr_.fix_skill_level = int.Parse(UIButton.current.gameObject.name);
  375. }
  376. private void OnClickStageEvent(YotogiOldStageUnit stage_unit)
  377. {
  378. this.select_stage_ = (this.user_request_stage = stage_unit.stage_data.stage);
  379. this.FixSkill();
  380. }
  381. private static List<FreeSkillSelectOld.ButtonData> CreateButtonData(Maid maid)
  382. {
  383. List<FreeSkillSelectOld.ButtonData> list = new List<FreeSkillSelectOld.ButtonData>();
  384. Dictionary<string, KeyValuePair<FreeSkillSelectOld.ButtonData, Dictionary<string, FreeSkillSelectOld.ButtonData>>> type_data_dic = new Dictionary<string, KeyValuePair<FreeSkillSelectOld.ButtonData, Dictionary<string, FreeSkillSelectOld.ButtonData>>>();
  385. string[] array = new string[]
  386. {
  387. "通常",
  388. "お仕置き",
  389. "酔い"
  390. };
  391. for (int i = 0; i < array.Length; i++)
  392. {
  393. FreeSkillSelectOld.ButtonData buttonData = new FreeSkillSelectOld.ButtonData();
  394. buttonData.children_list = new List<FreeSkillSelectOld.ButtonData>();
  395. buttonData.name = array[i];
  396. list.Add(buttonData);
  397. type_data_dic.Add(array[i], new KeyValuePair<FreeSkillSelectOld.ButtonData, Dictionary<string, FreeSkillSelectOld.ButtonData>>(buttonData, new Dictionary<string, FreeSkillSelectOld.ButtonData>()));
  398. }
  399. for (int j = 0; j < list.Count; j++)
  400. {
  401. for (int k = 0; k < 9; k++)
  402. {
  403. FreeSkillSelectOld.ButtonData buttonData2 = list[j];
  404. FreeSkillSelectOld.ButtonData buttonData3 = new FreeSkillSelectOld.ButtonData();
  405. buttonData3.children_list = new List<FreeSkillSelectOld.ButtonData>();
  406. FreeSkillSelectOld.ButtonData buttonData4 = buttonData3;
  407. YotogiOld.Category category = (YotogiOld.Category)k;
  408. buttonData4.name = category.ToString();
  409. buttonData3.parent = buttonData2;
  410. buttonData2.children_list.Add(buttonData3);
  411. type_data_dic[list[j].name].Value.Add(buttonData3.name, buttonData3);
  412. }
  413. }
  414. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  415. int[] keyArray = maid.status.yotogiSkill.oldDatas.GetKeyArray();
  416. int l = 0;
  417. while (l < keyArray.Length)
  418. {
  419. Skill.Old.Data skillData = YotogiOld.GetSkillData(keyArray[l]);
  420. if (1 >= skillData.player_num)
  421. {
  422. goto IL_1D0;
  423. }
  424. int num = 0;
  425. for (int m = 0; m < characterMgr.GetMaidCount(); m++)
  426. {
  427. if (!(characterMgr.GetMaid(m) != null))
  428. {
  429. break;
  430. }
  431. num++;
  432. }
  433. if (num >= skillData.player_num)
  434. {
  435. goto IL_1D0;
  436. }
  437. IL_283:
  438. l++;
  439. continue;
  440. IL_1D0:
  441. if (!skillData.IsExecMaidForFreeMode(maid.status))
  442. {
  443. goto IL_283;
  444. }
  445. string key = "通常";
  446. if (skillData.drunk_skill)
  447. {
  448. key = "酔い";
  449. }
  450. else if (skillData.osioki_skill)
  451. {
  452. key = "お仕置き";
  453. }
  454. FreeSkillSelectOld.ButtonData buttonData5 = type_data_dic[key].Value[skillData.category.ToString()];
  455. if (buttonData5 != null)
  456. {
  457. FreeSkillSelectOld.ButtonData buttonData6 = new FreeSkillSelectOld.ButtonData();
  458. buttonData6.parent = buttonData5;
  459. buttonData6.name = skillData.name;
  460. buttonData6.skill_data = skillData;
  461. buttonData5.children_list.Add(buttonData6);
  462. goto IL_283;
  463. }
  464. goto IL_283;
  465. }
  466. Action<string> action = delegate(string name)
  467. {
  468. Dictionary<string, FreeSkillSelectOld.ButtonData> value = type_data_dic[name].Value;
  469. HashSet<string> hashSet = new HashSet<string>();
  470. List<FreeSkillSelectOld.ButtonData> list2 = new List<FreeSkillSelectOld.ButtonData>();
  471. foreach (KeyValuePair<string, FreeSkillSelectOld.ButtonData> keyValuePair in value)
  472. {
  473. if (keyValuePair.Value.children_list != null && 1 <= keyValuePair.Value.children_list.Count && !hashSet.Contains(keyValuePair.Key))
  474. {
  475. hashSet.Add(keyValuePair.Key);
  476. list2.Add(keyValuePair.Value);
  477. }
  478. }
  479. type_data_dic[name].Key.children_list = list2;
  480. };
  481. action("酔い");
  482. action("お仕置き");
  483. return list;
  484. }
  485. private static FreeSkillSelectOld.ButtonData GetButtonData(List<FreeSkillSelectOld.ButtonData> check_list, string name)
  486. {
  487. FreeSkillSelectOld.ButtonData result = null;
  488. if (check_list == null || string.IsNullOrEmpty(name))
  489. {
  490. return result;
  491. }
  492. for (int i = 0; i < check_list.Count; i++)
  493. {
  494. if (check_list[i] != null)
  495. {
  496. if (!string.IsNullOrEmpty(check_list[i].name) && check_list[i].name == name)
  497. {
  498. result = check_list[i];
  499. break;
  500. }
  501. }
  502. }
  503. return result;
  504. }
  505. public YotogiOld.Stage select_stage
  506. {
  507. get
  508. {
  509. return this.select_stage_;
  510. }
  511. }
  512. public Skill.Old.Data select_skill
  513. {
  514. get
  515. {
  516. return this.select_skill_;
  517. }
  518. }
  519. private Maid maid_;
  520. private List<FreeSkillSelectOld.ButtonData> button_data_list_;
  521. private Dictionary<string, FreeSkillSelectOld.UpdateObject> update_obj_dic_;
  522. private YotogiOldManager yotogi_mgr_;
  523. private Skill.Old.Data select_skill_;
  524. private YotogiOld.Stage select_stage_;
  525. private YotogiOld.Stage user_request_stage;
  526. private class ButtonData
  527. {
  528. public UIWFTabButton tab_button_obj;
  529. public FreeSkillSelectOld.ButtonData parent;
  530. public List<FreeSkillSelectOld.ButtonData> children_list;
  531. public string name;
  532. public Skill.Old.Data skill_data;
  533. }
  534. private class UpdateObject
  535. {
  536. public void Update()
  537. {
  538. this.ui_grid.Reposition();
  539. this.tab_panel.UpdateChildren();
  540. this.scroll_view.ResetPosition();
  541. this.ui_panel.UpdateAnchors();
  542. }
  543. public void MoveStorageRoom(bool click_event_clear)
  544. {
  545. if (this.storage_obj == null)
  546. {
  547. return;
  548. }
  549. Transform transform = this.button_parent.transform;
  550. Transform transform2 = this.storage_obj.transform;
  551. while (0 < transform.childCount)
  552. {
  553. GameObject gameObject = transform.GetChild(0).gameObject;
  554. UIWFTabButton componentInChildren = gameObject.GetComponentInChildren<UIWFTabButton>();
  555. if (componentInChildren != null)
  556. {
  557. componentInChildren.SetSelect(false);
  558. if (click_event_clear)
  559. {
  560. componentInChildren.onClick.Clear();
  561. }
  562. }
  563. gameObject.transform.SetParent(transform2, false);
  564. gameObject.transform.localPosition = Vector3.zero;
  565. }
  566. transform.DetachChildren();
  567. }
  568. public GameObject MoveButtonParent()
  569. {
  570. if (this.storage_obj == null)
  571. {
  572. return null;
  573. }
  574. GameObject gameObject = null;
  575. Transform transform = this.button_parent.transform;
  576. Transform transform2 = this.storage_obj.transform;
  577. if (0 < transform2.childCount)
  578. {
  579. gameObject = transform2.GetChild(0).gameObject;
  580. gameObject.transform.SetParent(transform, false);
  581. }
  582. return gameObject;
  583. }
  584. public GameObject MoveButtonParent(string object_name)
  585. {
  586. if (this.storage_obj == null || string.IsNullOrEmpty(object_name))
  587. {
  588. return null;
  589. }
  590. GameObject gameObject = null;
  591. Transform transform = this.button_parent.transform;
  592. Transform transform2 = this.storage_obj.transform;
  593. for (int i = 0; i < transform2.childCount; i++)
  594. {
  595. if (transform2.GetChild(i).name == object_name)
  596. {
  597. gameObject = transform2.GetChild(i).gameObject;
  598. gameObject.transform.SetParent(transform, false);
  599. break;
  600. }
  601. }
  602. return gameObject;
  603. }
  604. public void UpdateArrow(GameObject target_obj)
  605. {
  606. if (this.arrow_obj == null || target_obj == null)
  607. {
  608. return;
  609. }
  610. Vector3 position = target_obj.transform.TransformPoint(new Vector3(0f, 0f, 0f));
  611. Vector3 local_pos = this.arrow_obj.transform.parent.InverseTransformPoint(position);
  612. local_pos.x = this.arrow_obj.transform.localPosition.x;
  613. local_pos.y += 18f;
  614. Hashtable args = TweenHash.EaseOutQuint(TweenHash.Type.Position, local_pos, 0.3f);
  615. iTween.MoveTo(this.arrow_obj, args);
  616. }
  617. public void Clear()
  618. {
  619. Transform transform = this.button_parent.transform;
  620. for (int i = 0; i < transform.childCount; i++)
  621. {
  622. UnityEngine.Object.Destroy(transform.GetChild(i).gameObject);
  623. }
  624. transform.DetachChildren();
  625. }
  626. public GameObject button_parent;
  627. public UIGrid ui_grid;
  628. public UIWFTabPanel tab_panel;
  629. public UIScrollView scroll_view;
  630. public UIPanel ui_panel;
  631. public GameObject arrow_obj;
  632. public GameObject storage_obj;
  633. }
  634. }