DressUpView.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. namespace GFGGame
  6. {
  7. public class DressUpView : BaseView
  8. {
  9. public const int BOTTOM_BLANK = 20;
  10. public const int RIGHT_BLANK = 36;
  11. private const int SORT_BY_HIGH_RARITY = 0;
  12. private const int SORT_BY_LOW_RARITY = 1;
  13. private const int SORT_BY_GET_TIME = 2;
  14. private UI_DressUpUI _ui;
  15. private float listType1X = 0;
  16. private float partsListX = 0;
  17. private DressUpListType currentListType;
  18. private int[] _currentList2;
  19. private GameObject _scenePrefab;
  20. private GameObject _sceneObject;
  21. private List<int> _currentList3;
  22. private int _currentMenuType;
  23. private int _rarityIndex = SORT_BY_HIGH_RARITY;
  24. private UI_TypeItem listTypeItem_FreedomDress;
  25. public override void Dispose()
  26. {
  27. if (_scenePrefab != null)
  28. {
  29. GameObject.Destroy(_scenePrefab);
  30. _scenePrefab = null;
  31. }
  32. UI_TypeItem.ClearProxy();
  33. base.Dispose();
  34. }
  35. protected override void Init()
  36. {
  37. base.Init();
  38. packageName = UI_DressUpUI.PACKAGE_NAME;
  39. _ui = UI_DressUpUI.Create();
  40. viewCom = _ui.target;
  41. isfullScreen = true;
  42. _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
  43. }
  44. protected override void OnInit()
  45. {
  46. base.OnInit();
  47. _ui.m_btnLastStep.visible = false;
  48. _ui.m_btnNextStep.visible = false;
  49. _ui.m_btnSearch.visible = true;
  50. _ui.m_btnPhoto.visible = true;
  51. _ui.m_btnAction.visible = false;
  52. _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  53. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  54. InitLists();
  55. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  56. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  57. _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  58. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  59. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  60. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  61. _ui.m_touchPad.onClick.Add(OnTouchPad);
  62. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  63. _ui.m_btnSave.onClick.Add(OnClickBtnSave);
  64. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  65. _ui.m_btnAction.onClick.Add(OnClickBtnAction);
  66. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  67. _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  68. _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  69. _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  70. _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
  71. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  72. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
  73. EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  74. }
  75. protected override void OnShown()
  76. {
  77. base.OnShown();
  78. _rarityIndex = SORT_BY_HIGH_RARITY;
  79. MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DRESS_UP, "mp3"));
  80. _ui.m_comListType1.target.x = _ui.target.width;
  81. _ui.m_comListType2.target.x = _ui.target.width;
  82. _ui.m_partsList.target.x = _ui.target.width;
  83. this.showListType1();
  84. if (_sceneObject == null)
  85. {
  86. _sceneObject = GameObject.Instantiate(_scenePrefab);
  87. EquipDataCache.cacher.setSceneObj(_sceneObject);
  88. }
  89. _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
  90. EquipDataCache.cacher.PutOnCurrentSuitSaved();
  91. GuideController.TryGuideDressUpViewMenuType1(_ui.m_comListType1.m_listType);
  92. GuideController.TryGuideDressUpViewMenuType2(_ui.m_btnPhoto);
  93. Timers.inst.AddUpdate(UpdateToCheckGuide);
  94. }
  95. protected override void OnHide()
  96. {
  97. base.OnHide();
  98. listTypeItem_FreedomDress = null;
  99. Timers.inst.Remove(UpdateToCheckGuide);
  100. GuideController.HideGuide();
  101. MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  102. if (_sceneObject != null)
  103. {
  104. GameObject.Destroy(_sceneObject);
  105. _sceneObject = null;
  106. }
  107. }
  108. private void OnClickBtnBack()
  109. {
  110. Reset();
  111. GuideController.TryCompleteGuide(ConstGuideId.DRESS_UP_VIEW_BTN_BACK);
  112. this.Hide();
  113. ViewManager.Show(ViewName.MAINUI_VIEW);
  114. }
  115. private void OnClickBtnHome()
  116. {
  117. GameController.GoBackToMainView();
  118. Reset();
  119. }
  120. private void Reset()
  121. {
  122. DressUpMenuItemDataManager.dressFilterType = DressFilterType.None;
  123. DressUpMenuItemDataManager.selectRarityList.Clear();
  124. DressUpMenuItemDataManager.selectScoreList.Clear();
  125. DressUpMenuItemDataManager.selectTagList.Clear();
  126. DressUpMenuItemDataManager.dressSearchTxt = "";
  127. }
  128. private void OnComboBoxChanged()
  129. {
  130. EquipDataCache.cacher.PutOnSuitSaved(_ui.m_comboBox.selectedIndex);
  131. }
  132. private void OnClickListType1Item(EventContext context)
  133. {
  134. GuideController.HideGuide();
  135. GObject typeItem = (GObject)context.data as GObject;
  136. int order = (int)typeItem.data;
  137. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  138. if (item1.subMenusArr.Length > 0)
  139. {
  140. this.showListType2(item1.subMenusArr);
  141. }
  142. else
  143. {
  144. this.showListParts(item1.type);
  145. GuideController.TryGuideDressUpViewMenuPart(_ui.m_partsList.m_list);
  146. }
  147. this.hideListType1();
  148. UpdateListPartsSelected();
  149. }
  150. private void OnClickListType2Item(EventContext context)
  151. {
  152. GObject typeItem = (GObject)context.data as GObject;
  153. int order = (int)typeItem.data;
  154. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  155. this.showListParts(item2.type);
  156. this.hideListType2();
  157. }
  158. private void OnClickPartsListItem(EventContext context)
  159. {
  160. GuideController.TryGuideByGuideId(_ui.m_btnSave, ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG, 1, false, "搭配好的服饰,可以保存随时查看");
  161. GObject listItem = (GObject)context.data as GObject;
  162. int id = (int)listItem.data;
  163. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  164. {
  165. EquipDataCache.cacher.PutOnSuitCfg(id, true, false);
  166. UpdateBtnAction();
  167. }
  168. else
  169. {
  170. EquipDataCache.cacher.TryCancelSuit(id);
  171. EquipDataCache.cacher.AddOrRemove(id, true);
  172. }
  173. UpdateListPartsSelected();
  174. }
  175. private void OnTouchPad()
  176. {
  177. if (this.currentListType == DressUpListType.List3)
  178. {
  179. if (_currentList2 != null)
  180. {
  181. this.showListType2();
  182. }
  183. else
  184. {
  185. this.showListType1();
  186. }
  187. this.hideListParts();
  188. }
  189. else if (this.currentListType == DressUpListType.List2)
  190. {
  191. this.showListType1();
  192. this.hideListType2();
  193. }
  194. }
  195. private void OnClickBtnDelete()
  196. {
  197. EquipDataCache.cacher.TakeOffAll();
  198. }
  199. private void OnClickBtnSave()
  200. {
  201. GuideController.TryCompleteGuide(ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG);
  202. GuideController.TryGuideByGuideId(_ui.m_btnBack, ConstGuideId.DRESS_UP_VIEW_BTN_BACK, 1, false, "保存成功,回主界面看看吧", 0, ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG);
  203. CustomSuitDataManager.SaveCurrentSuit(_ui.m_comboBox.selectedIndex);
  204. PromptController.Instance.ShowFloatTextPrompt("保存成功", MessageType.SUCCESS);
  205. }
  206. private void OnComboBoxRarityChanged()
  207. {
  208. _rarityIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  209. this.UpdatePartsListSort();
  210. }
  211. private void OnClickBtnAction()
  212. {
  213. if (!_ui.m_btnAction.grayed)
  214. {
  215. EquipDataCache.cacher.ChangeAction();
  216. }
  217. }
  218. private void OnClickBtnSearch()
  219. {
  220. ViewManager.Show<DressFilterView>(true, new object[] { ViewName.DRESS_UP_VIEW });
  221. }
  222. private void InitLists()
  223. {
  224. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  225. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  226. listType1X = _ui.m_comListType1.target.x;
  227. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width - DressUpView.RIGHT_BLANK;
  228. //一级菜单
  229. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  230. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  231. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
  232. float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
  233. if (_ui.m_comListType1.m_listType.height > maxHeight)
  234. {
  235. _ui.m_comListType1.m_listType.height = maxHeight;
  236. }
  237. }
  238. private void showListType1()
  239. {
  240. _currentList2 = null;
  241. currentListType = DressUpListType.List1;
  242. GTween.To(_ui.target.width, listType1X, 0.5f)
  243. .SetTarget(_ui.m_comListType1.target)
  244. .OnUpdate((GTweener t) =>
  245. {
  246. _ui.m_comListType1.target.x = t.value.x;
  247. });
  248. }
  249. private void hideListType1()
  250. {
  251. GTween.To(listType1X, _ui.target.width, 0.5f)
  252. .SetTarget(_ui.m_comListType1.target)
  253. .OnUpdate((GTweener t) =>
  254. {
  255. _ui.m_comListType1.target.x = t.value.x;
  256. });
  257. }
  258. private void showListType2(int[] menuStrArr = null)
  259. {
  260. currentListType = DressUpListType.List2;
  261. if (menuStrArr != null && menuStrArr.Length > 0)
  262. {
  263. int len = menuStrArr.Length;
  264. _currentList2 = menuStrArr.Clone() as int[];
  265. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  266. _ui.m_comListType2.m_listType.numItems = len;
  267. //_ui.m_comListType2.m_listType2.ResizeToFit(_ui.m_comListType2.m_listType2.numItems);
  268. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  269. if (_ui.m_comListType2.m_listType.height > maxHeight)
  270. {
  271. _ui.m_comListType2.m_listType.height = maxHeight;
  272. }
  273. }
  274. GTween.To(_ui.target.width, listType1X, 0.5f)
  275. .SetTarget(_ui.m_comListType2.target)
  276. .OnUpdate((GTweener t) =>
  277. {
  278. _ui.m_comListType2.target.x = t.value.x;
  279. });
  280. }
  281. private void hideListType2()
  282. {
  283. GTween.To(listType1X, _ui.target.width, 0.5f)
  284. .SetTarget(_ui.m_comListType2.target)
  285. .OnUpdate((GTweener t) =>
  286. {
  287. _ui.m_comListType2.target.x = t.value.x;
  288. });
  289. }
  290. private void showListParts(int type)
  291. {
  292. _currentMenuType = type;
  293. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  294. {
  295. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  296. if (_rarityIndex >= SORT_BY_GET_TIME)
  297. {
  298. _rarityIndex = SORT_BY_HIGH_RARITY;
  299. }
  300. }
  301. else
  302. {
  303. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  304. }
  305. this.UpdatePartsListSort();
  306. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  307. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;// - DressUpView.BOTTOM_BLANK;
  308. if (_ui.m_partsList.m_list.height > maxHeight)
  309. {
  310. _ui.m_partsList.m_list.height = maxHeight;
  311. }
  312. currentListType = DressUpListType.List3;
  313. GTween.To(_ui.target.width, partsListX, 0.5f)
  314. .SetTarget(_ui.m_partsList)
  315. .OnUpdate((GTweener t) =>
  316. {
  317. _ui.m_partsList.target.x = t.value.x;
  318. });
  319. UpdateBtnAction();
  320. }
  321. private void hideListParts()
  322. {
  323. _currentMenuType = 0;
  324. UpdateBtnAction();
  325. GTween.To(partsListX, _ui.target.width, 0.5f)
  326. .SetTarget(_ui.m_partsList)
  327. .OnUpdate((GTweener t) =>
  328. {
  329. _ui.m_partsList.target.x = t.value.x;
  330. });
  331. }
  332. private void ListType1Item(int index, GObject item)
  333. {
  334. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  335. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  336. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  337. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  338. typeItem.target.data = item1.id;
  339. typeItem.m_imgNeed.visible = false;
  340. }
  341. private void ListType2Item(int index, GObject item)
  342. {
  343. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  344. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  345. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  346. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  347. typeItem.target.data = item2.id;
  348. typeItem.m_imgNeed.visible = false;
  349. }
  350. private void ListPartsItem(int index, GObject item)
  351. {
  352. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  353. int id = (int)_currentList3[index];
  354. string iconRes = "";
  355. string partName = "";
  356. string ext = "png";
  357. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  358. {
  359. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  360. iconRes = suitCfg.res;
  361. partName = suitCfg.name;
  362. listItem.m_iconSelected.visible = false;
  363. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  364. listItem.m_ScoreType.visible = false;
  365. }
  366. else
  367. {
  368. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  369. iconRes = itemCfg.res;
  370. partName = itemCfg.name;
  371. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  372. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  373. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
  374. listItem.m_ScoreType.visible = true;
  375. int mainScore;
  376. int mainValuel;
  377. ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  378. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + mainScore);
  379. }
  380. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  381. listItem.m_txtTitle.text = partName;
  382. listItem.target.data = id;
  383. listItem.m_txtScore.visible = false;
  384. //listItem.m_ScoreType.visible = true;
  385. listItem.m_imgNeed.visible = false;
  386. }
  387. private void UpdateListPartsSelected()
  388. {
  389. int count = _ui.m_partsList.m_list.numChildren;
  390. for (int i = 0; i < count; i++)
  391. {
  392. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  393. int id = (int)listItem.target.data;
  394. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  395. {
  396. listItem.m_iconSelected.visible = EquipDataCache.cacher.suitId > 0 && id == EquipDataCache.cacher.suitId;
  397. }
  398. else
  399. {
  400. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  401. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && EquipDataCache.cacher.suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == EquipDataCache.cacher.suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  402. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && EquipDataCache.cacher.suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  403. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  404. }
  405. }
  406. }
  407. private void UpdatePartsListSort()
  408. {
  409. if (_currentMenuType == 0) return;
  410. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  411. {
  412. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  413. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  414. {
  415. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  416. }
  417. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  418. {
  419. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  420. }
  421. else
  422. {
  423. _currentList3.Reverse();
  424. }
  425. }
  426. else
  427. {
  428. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  429. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  430. {
  431. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  432. }
  433. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  434. {
  435. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  436. }
  437. else
  438. {
  439. _currentList3.Reverse();
  440. }
  441. }
  442. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  443. {
  444. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  445. }
  446. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  447. {
  448. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  449. }
  450. _ui.m_partsList.m_list.RemoveChildrenToPool();
  451. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  452. }
  453. private void UpdateBtnAction()
  454. {
  455. _ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG);
  456. if (_ui.m_btnAction.visible)
  457. {
  458. _ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitPicRes;
  459. }
  460. }
  461. private void OnClickBtnShow()
  462. {
  463. Timers.inst.Remove(SetBtnShowVisable);
  464. _ui.m_c1.selectedIndex = 0;
  465. _ui.m_btnHide.visible = true;
  466. _ui.m_btnShow.visible = false;
  467. _ui.m_loaShow.visible = false;
  468. }
  469. private void OnClickBtnHide()
  470. {
  471. _ui.m_c1.selectedIndex = 1;
  472. _ui.m_btnHide.visible = false;
  473. _ui.m_btnShow.visible = true;
  474. _ui.m_loaShow.visible = true;
  475. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  476. }
  477. private void OnClickLoaShow()
  478. {
  479. Timers.inst.Remove(SetBtnShowVisable);
  480. _ui.m_btnShow.alpha = 1;
  481. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  482. _ui.m_btnShow.enabled = true;
  483. }
  484. private void OnClickBtnPhoto()
  485. {
  486. if (!ViewManager.Show<PhotographView>())
  487. {
  488. return;
  489. }
  490. _ui.target.visible = false;
  491. this._sceneObject.gameObject.SetActive(false);
  492. }
  493. private void UpdateScene()
  494. {
  495. _ui.target.visible = true;
  496. this._sceneObject.gameObject.SetActive(true);
  497. EquipDataCache.cacher.setSceneObj(_sceneObject);
  498. }
  499. private void SetBtnShowVisable(object param)
  500. {
  501. _ui.m_btnShow.enabled = false;
  502. GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  503. }
  504. private void UpdateToCheckGuide(object param)
  505. {
  506. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  507. if (listTypeItem_FreedomDress == null && GuideDataManager.GetGuideCountCopy(ConstGuideId.FREEDOM_DRESS) <= 0)
  508. {
  509. int len = _ui.m_comListType1.m_listType.numChildren;
  510. for (int i = 0; i < len; i++)
  511. {
  512. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  513. if (item != null)
  514. {
  515. int menuID = (int)item.target.data;
  516. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  517. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  518. {
  519. listTypeItem_FreedomDress = item;
  520. _ui.m_comListType1.m_listType.ScrollToView(i);
  521. break;
  522. }
  523. }
  524. }
  525. }
  526. if (listTypeItem_FreedomDress != null) GuideController.TryGuide(listTypeItem_FreedomDress.target, ConstGuideId.FREEDOM_DRESS, 3, "套装分类里,可以查看集齐成套的服饰");
  527. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FREEDOM_DRESS, 4, "点击一键换上", true, 0);
  528. GuideController.TryGuide(_ui.m_btnSave, ConstGuideId.FREEDOM_DRESS, 5, "搭配好的服饰,可以保存随时查看");
  529. GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.FREEDOM_DRESS, 6, "保存成功,回主界面看看吧");
  530. GuideController.TryCompleteGuide(ConstGuideId.FREEDOM_DRESS, 6);
  531. GuideController.TryGuide(_ui.m_btnPhoto, ConstGuideId.PHOTOGRAPH, 3, "点击拍照");
  532. }
  533. }
  534. }