12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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<string, int>> _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);
- item.m_txtShow.text = string.Format("{0}: {1}%", _dataList[index].Key, _dataList[index].Value);
- }
- protected override void OnHide()
- {
- base.OnHide();
- // _dataList.Clear();
- }
- }
- }
|