123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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<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()
- {
- 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();
- }
- }
- }
|