| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 | using System;using System.Collections;using System.Collections.Generic;using System.Linq;using FairyGUI;using UI.ClothingFoster;using UnityEngine;namespace GFGGame{    public class SuitPropertyShowView : BaseWindow    {        private UI_SuitPropertyShowUI _ui;        // private Dictionary<string, int> _data = new Dictionary<string, int>();        // List<int> _dataList = new List<int>(); StudentDictionary.Values.ToList();        List<KeyValuePair<int, string>> _dataList;// = new List<KeyValuePair<string, int>>();        public override void Dispose()        {            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            packageName = UI_SuitPropertyShowUI.PACKAGE_NAME;            _ui = UI_SuitPropertyShowUI.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"));        }        protected override void OnHide()        {            base.OnHide();            // _dataList.Clear();        }    }}
 |