123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using System;
- using System.Collections;
- using FairyGUI;
- using UI.ClothingFoster;
- using UI.CommonGame;
- namespace GFGGame
- {
- public class ClothingFosterFinishView : BaseWindow
- {
- private UI_ClothingFosterFinishUI _ui;
- private int _suitId;
- private int _index;
- private SortedList _lastPropertyList;
- private SortedList _curPropertyList;
- public override void Dispose()
- {
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_ClothingFosterFinishUI.PACKAGE_NAME;
- _ui = UI_ClothingFosterFinishUI.Create();
- this.viewCom = _ui.target;
- this.viewCom.Center();
- this.modal = true;
- // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
- _ui.m_loaBg.onClick.Add(this.Hide);
- }
- protected override void OnShown()
- {
- base.OnShown();
- _suitId = (int)(this.viewData as object[])[0];
- _index = (int)(this.viewData as object[])[1];
- _ui.m_grpRenew.visible = false;
- _ui.m_loaBg.touchable = false;
- _ui.m_img.fillAmount = 0;
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gxhd_bjbj");
- _lastPropertyList = (this.viewData as object[])[2] as SortedList;
- SuitFosterDataManager.Instance.GetPropertyData(_suitId, _index, out _curPropertyList, out SortedList _addPropertyList);
- SuitFosterData data = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId);
- SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
- int count = ConstDressUpScoreType.scoreTypeList().Count;
- for (int i = 0; i < count; i++)
- {
- int score = i + 1;
- UI_ListPropertyItem comPrpperty = UI_ListPropertyItem.Proxy(_ui.target.GetChild("comProperty" + i));
- int property = (int)_lastPropertyList[score];
- comPrpperty.m_txtProperty.text = StringUtil.GetColorText(property.ToString(), "#5B4A3B");
- comPrpperty.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
- UI_ListPropertyItem.ProxyEnd();
- UI_ListPropertyItem comAddPrpperty = UI_ListPropertyItem.Proxy(_ui.target.GetChild("comAddProperty" + i));
- int addProperty = (int)_curPropertyList[score];
- comAddPrpperty.m_txtProperty.text = StringUtil.GetColorText(addProperty.ToString(), addProperty == property ? "#5B4A3B" : "#FFDE9E");
- comAddPrpperty.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
- UI_ListPropertyItem.ProxyEnd();
- }
- _ui.m_grpProperty.visible = true;
- _ui.m_t0.Play(() =>
- {
- int num = 0;
- Timers.inst.Add(0.01f, 100, (param) =>
- {
- num++;
- _ui.m_img.fillAmount += 0.1f;
- if (num == 10)
- {
- _ui.m_grpAddProperty.visible = true;
- _ui.m_t1.Play(() =>
- {
- _ui.m_grpRenew.visible = data.maintainStep >= cfg.renewOpenLv;
- _ui.m_loaBg.touchable = true;
- });
- }
- });
- });
- }
- protected override void OnHide()
- {
- base.OnHide();
- _ui.m_img.fillAmount = 0;
- _ui.m_grpRenew.visible = false;
- _ui.m_grpProperty.visible = false;
- _ui.m_grpAddProperty.visible = false;
- }
- }
- }
|