| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 | using UI.CommonGame;using FairyGUI;using UnityEngine;using UI.LuckyBox;namespace GFGGame{    public class GetSuitItemVIew : BaseWindow    {        private UI_GetSuitItemUI _ui;        private EffectUI _effectUI1;        private DressUpObjUI _dressUpObjUI;        public override void Dispose()        {            EffectUIPool.Recycle(_effectUI1);            _effectUI1 = null;            if (_dressUpObjUI != null)            {                _dressUpObjUI.Dispose();                _dressUpObjUI = null;            }            if (_dressUpObjUI != null)            {                _dressUpObjUI.Dispose();                _dressUpObjUI = null;            }            if (_ui != null)            {                _ui.Dispose();                _ui = null;            }            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            _ui = UI_GetSuitItemUI.Create();            this.viewCom = _ui.target;            isfullScreen = true;            _dressUpObjUI = new DressUpObjUI("SceneDressUp",onShowAction);            _ui.m_bg.onClick.Add(OnClickBg);            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderEffect, "ui_ck", "ui_ck_tz");        }        void onShowAction()        {            EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_ANIMATION_WAIT);        }        protected override void OnShown()        {            base.OnShown();            GRoot.inst.touchable = true;            int suitId = (int)viewData;            if(suitId == 202025)            {                _ui.m_icon.x = -600;            }            else            {                _ui.m_icon.x = 0;            }            UpdateView(suitId);        }        protected override void OnHide()        {            base.OnHide();            if (this.viewCom == null || this.viewCom.root == null)            {                Timers.inst.CallLater((object param) =>                {                    GetSuitItemController.TryShow(0);                });            }            TryCompleteGuide();        }        private void OnClickBg()        {            if (!GetSuitItemController.isAuto)            {                Hide();                EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_SHOW_VIEW_CLOSE);            }        }        private void UpdateItem(int itemdId)        {            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(_ui.m_item);            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemdId);            itemUI.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);            string itemName = itemCfg.name;            itemUI.m_comIcon.m_txtName.text = itemName;            RarityIconController.UpdateRarityIcon(itemUI.m_comIcon.m_rarity, itemdId, false);            itemUI.target.data = itemdId;            itemUI.target.onClick.Clear();            itemUI.target.onClick.Add(OnClickItemUI);            UI_LuckyBoxBonusItem.ProxyEnd();        }        private void OnClickItemUI(EventContext context)        {            GComponent item = context.sender as GComponent;            int itemID = (int)item.data;            GoodsItemTipsController.ShowItemTips(itemID);        }        private void UpdateView(int suitId)        {            _ui.m_holderEffect.visible = true;            int count = 0;//套装当前拥有的部件数量            int totalCount = 1;            // int suitId = 0;            _ui.m_bg.url = ResPathUtil.GetBgImgPath("bg_zhuxian");            DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitId, out count, out totalCount);            if (suitId > 0)            {                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);                _ui.m_txtName.text = "套装·" + suitCfg.name;                int targetY = (int)(_ui.m_item.y + _ui.m_item.height + 50);            }            // UpdateItem(itemId);            bool showAction = SuitCfgArray.Instance.CheckSuitHasAction(suitId) && DressUpMenuSuitDataManager.CheckSuitHasActionRes(suitId);            _dressUpObjUI.ResetSceneObj(115, false, true, null,  false);            _dressUpObjUI.dressUpObj.PutOnSuitCfg(suitId, showAction, null, false, false);            _dressUpObjUI.UpdateWrapper(_ui.m_holder);        }    }}
 |