| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | using FairyGUI;using System.Collections;using System.Collections.Generic;using UI.Card;using UI.CommonGame;using UnityEngine;namespace GFGGame{    public class CardUpView : BaseWindow    {        private UI_CardUpUI _ui;        private Dictionary<int, int> _scores;        private string _type;        private int _lastNum;        private int _curNum;        public override void Dispose()        {            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            _ui = UI_CardUpUI.Create();            this.viewCom = _ui.target;            this.viewCom.Center();            this.modal = true;            //MakeFullScreen(_ui);            _ui.m_listProperty.itemRenderer = RenderListPropertyItem;        }        protected override void OnShown()        {            base.OnShown();            _scores = (Dictionary<int, int>)(viewData as object[])[0];            _type = (string)(viewData as object[])[1];            _lastNum = (int)(viewData as object[])[2];            _curNum = (int)(viewData as object[])[3];            _ui.m_listProperty.numItems = _scores.Count;            if (_type == "lv")            {                _ui.m_c1.selectedIndex = 0;                _ui.m_txtLast.text = string.Format("Lv{0}", _lastNum);                _ui.m_txtNow.text = string.Format("Lv{0}", _curNum);            }            else            {                _ui.m_c1.selectedIndex = 1;                _ui.m_txtLast.text = string.Format("{0}星", _lastNum);                _ui.m_txtNow.text = string.Format("{0}星", _curNum);            }        }        private void RenderListPropertyItem(int index, GObject obj)        {            UI_ListPropertyItem listItem = UI_ListPropertyItem.Proxy(obj);            listItem.m_txtProperty.text = _scores[index + 1].ToString();            listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));            UI_ListPropertyItem.ProxyEnd();        }        //private void OnClickBtnBack()        //{        //    ViewManager.GoBackFrom(ViewName.CARD_UP_VIEW);        //}        protected override void OnHide()        {            base.OnHide();        }    }}
 |