using System; using System.Collections; using System.Collections.Generic; using System.Linq; using FairyGUI; using UI.ClothingFoster; using UnityEngine; namespace GFGGame { public class ClothingPropertyShowView : BaseWindow { private UI_ClothingropertyShowUI _ui; // private Dictionary _data = new Dictionary(); // List _dataList = new List(); StudentDictionary.Values.ToList(); List> _dataList;// = new List>(); public override void Dispose() { if (_ui != null) { _ui.Dispose(); _ui = null; } base.Dispose(); } protected override void OnInit() { base.OnInit(); packageName = UI_ClothingropertyShowUI.PACKAGE_NAME; _ui = UI_ClothingropertyShowUI.Create(); this.viewCom = _ui.target; this.viewCom.Center(); this.modal = true; _ui.m_listPropertyShow.itemRenderer = ListPropertyShowItemRender; } protected override void OnShown() { base.OnShown(); int suitId = (int)(this.viewData as object[])[0]; int index = (int)(this.viewData as object[])[1]; // _dataList = SuitFosterDataManager.Instance.GetPropertyPercentData(suitId, index); // _ui.m_listPropertyShow.numItems = _dataList.Count; } private void ListPropertyShowItemRender(int index, GObject obj) { UI_ListPropertyShowItem item = UI_ListPropertyShowItem.Proxy(obj); ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_dataList[index].Key); string type = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).name; item.m_txtShow.text = string.Format("{0} {1}%", type, StringUtil.GetColorText(_dataList[index].Value.ToString(), "#B66352")); UI_ListPropertyShowItem.ProxyEnd(); } protected override void OnHide() { base.OnHide(); // _dataList.Clear(); } } }