| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | using System.Collections;using UnityEngine;using UI.ActivityGetYuanXiao;using FairyGUI;namespace GFGGame{    public class ActivityGetYuanXiaoTargetView : BaseWindow    {        private UI_ActivityGetYuanXiaoTargetUI _ui;        private PickUpGame _cfg;        public override void Dispose()        {            if (_ui != null)            {                _ui.Dispose();                _ui = null;            }            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            packageName = UI_ActivityGetYuanXiaoTargetUI.PACKAGE_NAME;            _ui = UI_ActivityGetYuanXiaoTargetUI.Create();            viewCom = _ui.target;            viewCom.Center();            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;            modal = true;            _ui.m_btnCancel.onClick.Add(OnBtnCancelClick);            _ui.m_btnConfirm.onClick.Add(OnBtnConfirmClick);            _ui.m_collectList.itemRenderer = CollectionListRenderer;        }        protected override void OnShown()        {            base.OnShown();            _cfg = (PickUpGame)viewData;            _ui.m_c1.selectedIndex = (_cfg.targetIdArr.Length == 0 ? 1 : 0);            if(_ui.m_c1.selectedIndex == 0)            {                _ui.m_collectList.numItems = _cfg.targetIdArr.Length;            }            else            {                InitScore();            }        }        private void OnBtnConfirmClick()        {            Hide();            EventAgent.DispatchEvent(ConstMessage.ACTIVITY_GETYUANXIAO_START);        }        private void OnBtnCancelClick()        {            Hide();        }        private void CollectionListRenderer(int index, GObject obj)        {            UI_gameTarget target = UI_gameTarget.Proxy(obj);            target.m_iconType.url = string.Format("ui://ActivityGetYuanXiao/yx_icon_{0}", _cfg.targetIdArr[index][0]);            int num = _cfg.targetIdArr[index][1];            target.m_num.text = num.ToString();            UI_gameTarget.ProxyEnd();        }        private void InitScore()        {            _ui.m_score.text = _cfg.targetScore.ToString();        }    }}
 |