| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381 | using FairyGUI;using UI.Card;using UI.CommonGame;using UI_ComConsume = UI.Card.UI_ComConsume;using System.Collections.Generic;using UnityEngine;using System.Linq;using ET;using YooAsset;namespace GFGGame{    public class CardFosterView : BaseWindow    {        private enum Source        {            COMMON, // 由普通词牌界面进入            DISPLAY // 由词牌图鉴进入        }        private UI_CardFosterUI _ui;        private UI_ComFosterBottom _comFosterBottom;        private ValueBarController _valueBarController;        private UI_ComCost _comLvConsumeGold;        private UI_ComCostCurrencyWithHas _comStarCousumeGold;        private CardData _cardData = new CardData();        private List<CardStarCfg> _cardStarRewards = new List<CardStarCfg>();        private int _selectTab = 0;        private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();        private List<GGraph> _listEffectHolder = new List<GGraph>();        private List<CardData> _cardList = new List<CardData>();        private int _wordRow = 4;  //字行数        private int _wordNumber = 6;//字每行个数        private int _nowIndex = 0;        private bool _refDodgeStar = true;        private int _isAutoSelect = 0;        public string _fromUIType;  //来自哪个界面跳转进来        private EffectUI _effectUI1;        private EffectUI _effectUI3;        private EffectUI _effectUI4;        private EffectUI _effectUI5;        private EffectUI _effectUI6;        private EffectUI _effectUI7;        private EffectUI _effectUI8;        private EffectUI _effectUI9;        private EffectUI _effectUI10;        private GObject _consumeSelectItem;//选中的材料item        private int _consumeSelectIndex = 0;//0为减,1为加        private List<int> itemsCount;        private int[] upgradeCardItemsArr = GlobalCfgArray.globalCfg.upgradeCardItemsArr;        //private Timer _timer;        private const float _delay = 300;        private double _selectTimeCount = 0;//长按时间        private int _showLv = 0;        private int _showExp = 0;        private float _cardScale = 0.8f;        private bool showCard = false;        private bool playAni = false;        private Vector2 comCardImgResInitSize;        private Vector2 comCardImgResTargetSize;        public override void Dispose()        {            EffectUIPool.Recycle(_effectUI3);            _effectUI3 = null;            EffectUIPool.Recycle(_effectUI4);            _effectUI4 = null;            for (int i = 0; i < _listLongPress.Count; i++)            {                _listLongPress[i].Dispose();            }            _listLongPress.Clear();            if (_valueBarController != null)            {                _valueBarController.Dispose();                _valueBarController = null;            }            if (_ui != null)            {                _ui.Dispose();                _ui = null;            }            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            packageName = UI_CardFosterUI.PACKAGE_NAME;            _ui = UI_CardFosterUI.Create();            viewCom = _ui.target;            isfullScreen = true;            isReturnView = true;            //公共组件:返回,页签,属性列表            _ui.m_ComFosterTop.m_btnback.onClick.Add(OnClickBtnBack);            _ui.m_ComFosterTop.m_btnStarReward.onClick.Add(OnBtnStarRewardClick);            _ui.m_ComFosterBottom.m_ctrlTab.onChanged.Add(OnChangeCtrlTab);            _ui.m_ComFosterBottom.m_listProperty.itemRenderer = RenderListPropertyItem;            //卡面和故事界面            _ui.m_ComFosterTop.m_btnStory.onClick.Add(OnClickBtnStroy);            //升级升星按钮            _ui.m_ComFosterBottom.m_btnUpLv.onClick.Add(OnClickBtnUpLv);            _ui.m_ComFosterBottom.m_btnAll.onClick.Add(OnClcikBtnAll);            _ui.m_ComFosterBottom.m_btnClearAll.onClick.Add(OnClcikBtnClearAll);            _ui.m_ComFosterBottom.m_btnUpStar.onClick.Add(OnClickBtnUpStar);            _ui.m_ComFosterBottom.m_btnUpSkillLv.onClick.Add(OnBtnUpSkill);            _ui.m_ComFosterBottom.m_btnCheckAuto.onClick.Add(OnBtnCheckAuto);            //升级升星消耗材料列表            _ui.m_ComFosterBottom.m_listLvConsume.itemRenderer = RenderListLvConsumeItem;            _ui.m_ComFosterBottom.m_listStarConsume.itemRenderer = RenderListStarConsumeItem;            _ui.m_ComFosterBottom.m_listSkill.itemRenderer = RenderListSkillItem;            _ui.m_ComFosterBottom.m_listSkill.onClickItem.Add(OnClickListSkillItem);            //满星级后卡面列表            _ui.m_ComFosterBottom.m_listShowCard.itemRenderer = RenderListShowCardItem;            _ui.m_ComFosterBottom.m_listShowCard.onClickItem.Add(OnClickShowCardListItem);            _ui.m_btnLeft.onClick.Add(OnClickBtnLeft);            _ui.m_btnRight.onClick.Add(OnClickBtnRight);            _ui.m_cardSyntheticBtn.onClick.Add(OnClickBtnCardSyntheticView);            //_ui.m_loaCard.onClick.Add(OnClickLoaCard);            //_ui.m_loaListener1.onClick.Add(OnClickLoaCard);            //_ui.m_comImgCard.target.onClick.Add(OnClickLoaCard);            //_ui.m_loaListener.onClick.Add(OnClickComCard);            //_ui.m_comCard.target.onClick.Add(OnClickComCard);            _ui.m_comImgCard.target.onTouchBegin.Add(onTouchCardBegin);            _ui.m_comImgCard.target.onTouchEnd.Add(onTouchCardEnd);            _ui.m_loaListener1.onTouchBegin.Add(onTouchCardBegin);            _ui.m_loaListener1.onTouchEnd.Add(onTouchCardEnd);            _ui.m_loaListener.onTouchBegin.Add(onTouchCardBegin);            _ui.m_loaListener.onTouchEnd.Add(onTouchCardEnd);            _ui.m_comCard.target.onTouchBegin.Add(onTouchCardBegin);            _ui.m_comCard.target.onTouchEnd.Add(onTouchCardEnd);            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_ComFosterBottom.m_holderflower, "ui_Activity", "SX_Top_TX");            _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_ComFosterBottom.m_holderfBgEff, "ui_Activity", "SX_Down_TX");            _valueBarController = new ValueBarController(_ui.m_ComFosterTop.m_comValueBar, 5);            AdaptScreen();        }        private void RefLeftAndRight()        {            if (_nowIndex <= 0)            {                _ui.m_btnLeft.grayed = true;                _ui.m_btnLeft.touchable = false;            }            else            {                _ui.m_btnLeft.grayed = false;                _ui.m_btnLeft.touchable = true;            }            if (_nowIndex >= _cardList.Count - 1)            {                _ui.m_btnRight.grayed = true;                _ui.m_btnRight.touchable = false;            }            else            {                _ui.m_btnRight.grayed = false;                _ui.m_btnRight.touchable = true;            }            ItemCfg item = ItemCfgArray.Instance.GetCfg(_cardData.id);            if (item.syntheticTimes > 0)            {                _ui.m_cardSyntheticBtn.visible = true;            }            else            {                _ui.m_cardSyntheticBtn.visible = false;            }        }        private void OnClickBtnLeft()        {            _nowIndex -= 1;            RefLeftAndRight();            _cardData = _cardList[_nowIndex];            _cardData.fromUIType = _fromUIType;            RefCardFosterInfo();        }        private void OnClickBtnRight()        {            _nowIndex += 1;            RefLeftAndRight();            _cardData = _cardList[_nowIndex];            _cardData.fromUIType = _fromUIType;            RefCardFosterInfo();        }        private void RefCardFosterInfo()        {            playAni = false;            float imgInitHight = _ui.target.height - 570;//UI界面上小图时的高度            float imgIniWidth = CardDataManager.CardResInitWidth * imgInitHight / CardDataManager.CardResInitHight;//UI界面上小图时的宽度            _cardScale = imgIniWidth < _ui.target.width ? _ui.target.width / CardDataManager.CardResInitWidth : imgInitHight / CardDataManager.CardResInitHight;            comCardImgResInitSize = Vector2.zero;            comCardImgResTargetSize = Vector2.zero;            showCard = false;            Input.multiTouchEnabled = false;            this.ClearItemsCountList();            this.UpdateCommon();            this.UpdateNormal();            this.UpdateCardRes();            this.UpdateUpLvView();            this.UpdateUpStarView();            this.UpdateUpSkillView();            this.UpdateRedDot();            this.RefLeftAndRight();            _comFosterBottom.m_ctrlTab.selectedIndex = this._selectTab;            _comFosterBottom.m_listSkill.selectedIndex = 0;            _comFosterBottom.m_btnClearAll.visible = false;            List<CardStarCfg> cardStarCfgs = CardStarCfgArray.Instance.GetCfgsBycardId(_cardData.id);            _cardStarRewards.Clear();            for (int i = 0; i < cardStarCfgs.Count; i++)            {                if (cardStarCfgs[i].rewardsArr.Length > 0)                {                    _cardStarRewards.Add(cardStarCfgs[i]);                }            }            _ui.m_ComFosterTop.m_btnStarReward.visible = _cardStarRewards.Count > 0;            Timers.inst.AddUpdate(CheckGuide);        }        protected override void OnShown()        {            base.OnShown();            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("cp_beijing");            _comFosterBottom = _ui.m_ComFosterBottom;            _valueBarController.OnShown();            if (this.viewData != null)            {                _cardData = (CardData)this.viewData;                _fromUIType = _cardData.fromUIType;                _cardList.Clear();                if (_cardData.fromUIType != null && _cardData.fromUIType.Equals(typeof(CardGuideView).FullName))                {                    _ui.m_ComFosterBottom.m_c_from.selectedIndex = (int)Source.DISPLAY;                    _selectTab = 2; // 默认选中技能tab                    var listGuideCard = CardDataManager.GetAllCardIdListByRoleType(_cardData.pageIndex);                    for (int i = 0; i < listGuideCard.Count; i++)                    {                        var cardInfo = CardDataManager.GetCardDataById(listGuideCard[i]);                        if (cardInfo != null)                            _cardList.Add(cardInfo);                    }                }                else                {                    _ui.m_ComFosterBottom.m_c_from.selectedIndex = (int)Source.COMMON;                    _selectTab = 0;                    _cardList = CardDataManager.GetCardListByRoleType(_cardData.pageIndex);                    if (CardDataManager.isFilter == true)                    {                        //筛选                        _cardList = CardDataManager.FilterCardList(_cardList);                    }                    _cardList = CardDataManager.SortItemList(_cardList);                }            }            _ui.m_ComFosterTop.m_c1.selectedIndex = _ui.m_ComFosterBottom.m_c_from.selectedIndex;            _nowIndex = _cardData.index;            RefCardFosterInfo();        }        protected override void AddEventListener()        {            base.AddEventListener();            EventAgent.AddEventListener(ConstMessage.CARD_UP_SKILL, UpdateUpSkillView);            EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateItemChange);            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);            EventAgent.AddEventListener(ConstMessage.CARD_LEVEL_UP, ReferInfo);        }        private void ClearItemsCountList()        {            if (itemsCount == null)            {                itemsCount = new List<int>();            }            itemsCount.Clear();            for (int i = 0; i < upgradeCardItemsArr.Length; i++)            {                itemsCount.Add(0);            }        }        private void UpdateNormal()        {            _ui.m_ComFosterTop.m_btnStory.visible = CardDataManager.GetStoryCfgsById(_cardData.id).Count > 0 ? true : false;            RarityIconController.UpdateRarityIcon(_ui.m_ComFosterBottom.m_loaRarity, _cardData.id, false);            string names = _cardData.itemCfg.name;            _comFosterBottom.m_txtName0.text = "";            _comFosterBottom.m_txtName1.text = "";            _comFosterBottom.m_txtName2.text = "";            _comFosterBottom.m_txtName3.text = "";            _comFosterBottom.m_txtName4.text = "";            switch (names.Length)            {                case 1:                    _comFosterBottom.m_txtName0.text = names.Substring(0, 1);                    break;                case 2:                    _comFosterBottom.m_txtName0.text = names.Substring(0, 1);                    _comFosterBottom.m_txtName2.text = names.Substring(1, 1);                    break;                case 3:                    _comFosterBottom.m_txtName0.text = names.Substring(0, 1);                    _comFosterBottom.m_txtName1.text = names.Substring(1, 1);                    _comFosterBottom.m_txtName2.text = names.Substring(2, 1);                    break;                case 4:                    _comFosterBottom.m_txtName0.text = names.Substring(0, 1);                    _comFosterBottom.m_txtName1.text = names.Substring(1, 1);                    _comFosterBottom.m_txtName2.text = names.Substring(2, 1);                    _comFosterBottom.m_txtName3.text = names.Substring(3, 1);                    break;                default:                    _comFosterBottom.m_txtName0.text = names.Substring(0, 1);                    _comFosterBottom.m_txtName1.text = names.Substring(1, 1);                    _comFosterBottom.m_txtName2.text = names.Substring(2, 1);                    _comFosterBottom.m_txtName3.text = names.Substring(3, 1);                    _comFosterBottom.m_txtName4.text = names.Substring(4);                    break;            }        }        private void UpdateCommon()        {            _comFosterBottom.m_listProperty.numItems = _cardData.scores.Count;            _comLvConsumeGold = UI_ComCost.Proxy(_comFosterBottom.m_ComLvConsumeGold);            _comLvConsumeGold.m_txtNeed.text = "0";            _comLvConsumeGold.m_c1.selectedIndex = 1;            UI_ComCost.ProxyEnd();        }        private async void UpdateCardRes()        {            if (_effectUI1 != null)            {                EffectUIPool.Recycle(_effectUI1);                _effectUI1 = null;            }            string resName = _cardData.resources[_cardData.resIndex];            string resPath = ResPathUtil.GetCardAnimationPath(_cardData.resources[_cardData.resIndex]);            float imgInitHight = _ui.target.height - 570;//UI界面上小图时的高度            float imgIniWidth = 0;//UI界面上小图时的宽度            if (_cardData.itemCfg.animationCardStar > 0                && _cardData.star >= _cardData.itemCfg.animationCardStar                && YooAssets.CheckResExist(resPath))            {                await LoadManager.Instance.CheckResExsitedOrDownload(resPath);                _effectUI1 = new EffectUI();                _effectUI1.Reset(_ui.m_comCard.m_comCardHolder.m_holder, resName, resName, 100, EffectUIType.Card);                imgIniWidth = CardDataManager.CardResInitWidth * imgInitHight / CardDataManager.CardResInitHight;                _cardScale = imgIniWidth < _ui.target.width ? _ui.target.width / CardDataManager.CardResInitWidth : imgInitHight / CardDataManager.CardResInitHight;                _ui.m_comCard.m_comCardHolder.target.width = CardDataManager.CardResInitWidth;                _ui.m_comCard.m_comCardHolder.target.height = CardDataManager.CardResInitHight;                _ui.m_c1.selectedIndex = 1;                _ui.m_comCard.target.scrollPane.SetPercX(0.5f, false);                _ui.m_comCard.target.SetScale(_cardScale, _cardScale);            }            else            {                _ui.m_c1.selectedIndex = 0;                if (comCardImgResInitSize == Vector2.zero)                {                    CardDataManager.CardResInitWidth = 1440;                    CardDataManager.CardResInitHight = 1920;                    GLoader loaCard = _ui.m_comImgCard.m_ComCardImgRes.m_loaCard;                    loaCard.url = ResPathUtil.GetCardPath(_cardData.resources[_cardData.resIndex]);                    comCardImgResTargetSize = new Vector2((ViewGlobal.GetRealTopOffset() + _ui.target.height) * CardDataManager.CardResInitWidth / CardDataManager.CardResInitHight, (ViewGlobal.GetRealTopOffset() + _ui.target.height));                       imgIniWidth = CardDataManager.CardResInitWidth * imgInitHight / CardDataManager.CardResInitHight;                    _cardScale = imgIniWidth < _ui.target.width ? _ui.target.width / CardDataManager.CardResInitWidth : imgInitHight / CardDataManager.CardResInitHight;                    comCardImgResInitSize = new Vector2(CardDataManager.CardResInitWidth * _cardScale, CardDataManager.CardResInitHight * _cardScale);                    _ui.m_comImgCard.m_ComCardImgRes.target.size = comCardImgResInitSize;                    _ui.m_comImgCard.target.scrollPane.SetPercX(0.5f, false);                }            }        }        private void RenderListPropertyItem(int index, GObject obj)        {            UI_ListScoreItem listItem = UI_ListScoreItem.Proxy(obj);            listItem.m_txtProperty.text = _cardData.scores[index + 1].ToString();            listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));            UI_ListScoreItem.ProxyEnd();        }        /***********************************************************升级***************************************************/        private void UpdateUpLvView(bool isPreview = false, int lv = 0, int exp = 0, bool effLight = false)        {            _showLv = isPreview == true ? lv : _cardData.lv;            _showExp = isPreview == true ? exp : _cardData.exp;            CardLvlCfg cardLvCfg = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, _showLv);            if (cardLvCfg == null)            {                ET.Log.Error("词牌" + _cardData.id + " 没有  " + _showLv + "   级等级配置");                return;            }            _comFosterBottom.m_barLv.max = cardLvCfg.needExp;            _comFosterBottom.m_barLv.value = _showExp;            if (effLight)            {                EffectUIPool.Recycle(_effectUI6);                _effectUI6 = EffectUIPool.CreateEffectUI(_comFosterBottom.m_holderbarLv, "ui_Activity", "SX_JinDuTiao");            }            int maxLv = CardRarityCfgArray.Instance.GetCfg(_cardData.itemCfg.rarity).maxCardLvl;            _comFosterBottom.m_txtMaxLv.text = maxLv.ToString();            _comFosterBottom.m_txtCurLv.text = _showLv.ToString();            _comFosterBottom.m_txtMaxExp.text = cardLvCfg.needExp.ToString();            _comFosterBottom.m_txtCurExp.text = _showExp.ToString();            _comFosterBottom.m_ctrlFullLv.selectedIndex = CardDataManager.isFullLv(_cardData.id, _cardData.lv, false) ? 1 : 0;            if (isPreview == true)            {                return;            }            _comFosterBottom.m_listLvConsume.numItems = upgradeCardItemsArr.Length;        }        private void RenderListLvConsumeItem(int index, GObject obj)        {            UI_ComConsume listItem = UI_ComConsume.Proxy(obj);            CardLvlCfg cardLvCfg = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, _cardData.lv);            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(upgradeCardItemsArr[index]);            listItem.m_loaItem.url = ResPathUtil.GetIconPath(itemCfg);            listItem.m_txtNum.text = ItemDataManager.GetItemNum(itemCfg.id).ToString();            listItem.m_txtUseCount.text = "0";            listItem.target.data = index;            _listEffectHolder.Add(listItem.m_holderTouch);            if (listItem.m_btnMinus.data == null)            {                listItem.m_btnMinus.onTouchBegin.Add(OnClickItemConsumsBegin);                listItem.m_btnMinus.onTouchEnd.Add(OnClickItemLvConsumsEnd);            }            if (listItem.m_loaBg.data == null)            {                listItem.m_loaBg.onTouchBegin.Add(OnClickItemConsumsBegin);                listItem.m_loaBg.onTouchEnd.Add(OnClickItemLvConsumsEnd);                // LongPressGesture longPressGesture = new LongPressGesture(listItem.m_loaBg);                // longPressGesture.once = true;                // LongPressGesture.TRIGGER = 1f;                // longPressGesture.onAction.Add(OnClickItemLvConsumsEnd);                // // longPressGesture.onEnd.Add(OnLongEnd);                // _listLongPress.Add(longPressGesture);            }            listItem.m_btnMinus.data = 0;            listItem.m_loaBg.data = 1;            UI_ComConsume.ProxyEnd();        }        private void OnClickItemConsumsBegin(EventContext context)        {            // GObject obj, int type            GObject sender = context.sender as GObject;            int type = (int)sender.data;            GObject obj = sender.parent;            // UI_ComConsume listItem = UI_ComConsume.Proxy(obj);            int index = (int)obj.data;// (int)listItem.target.data;            int itemId = upgradeCardItemsArr[index];            _consumeSelectItem = obj;            _consumeSelectIndex = type;            if (type == 1)            {                if (IsUpLvLimit(itemId)) return;                if (ItemDataManager.GetItemNum(itemId) == 0)                {                    object[] sourceDatas = new object[] { itemId, new object[] { typeof(CardFosterView).FullName, _cardData } };                    GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);                }            }            OnTimedEvent(null);            Timers.inst.Add(0.3f, 0, OnTimedEvent);            EffectUIPool.Recycle(_effectUI5);            _effectUI5 = EffectUIPool.CreateEffectUI(_listEffectHolder[index], "ui_Activity", "SX_DianJi");        }        private void OnTimedEvent(object param)        {            _selectTimeCount += _delay;            if (_selectTimeCount >= 900)//大于900毫秒才算长按            {                if (_consumeSelectIndex == 0)                {                    UI_ComConsume listItem = UI_ComConsume.Proxy(_consumeSelectItem);                    bool pointIsOnComponent = CommonUtil.Instance.CheckPointIsOnComponent(listItem.m_btnMinus, CommonUtil.Instance.GetMouseV2Point());                    UI_ComConsume.ProxyEnd();                    if (!pointIsOnComponent)                    {                        Timers.inst.Remove(OnTimedEvent);                        return;                    }                    this.OnClickBtnMinus(_consumeSelectItem);                }                else                {                    int index = (int)_consumeSelectItem.data;                    int itemId = upgradeCardItemsArr[index];                    if (!CommonUtil.Instance.CheckPointIsOnComponent(_consumeSelectItem, CommonUtil.Instance.GetMouseV2Point()) || IsUpLvLimit(itemId))                    {                        Timers.inst.Remove(OnTimedEvent);                        return;                    }                    this.OnClickBtnPlusLvConsume(_consumeSelectItem);                }            }        }        private void OnClickItemLvConsumsEnd()        {            Timers.inst.Remove(OnTimedEvent);            _selectTimeCount = 0;            if (_consumeSelectIndex == 0)            {                this.OnClickBtnMinus(_consumeSelectItem);            }            else            {                this.OnClickBtnPlusLvConsume(_consumeSelectItem);            }        }        //返回值为此材料是否可继续消耗此材料继续升级        private bool OnClickBtnPlusLvConsume(GObject obj, bool showTips = true)        {            UI_ComConsume listItem = UI_ComConsume.Proxy(obj);            int index = (int)obj.data;            int itemId = upgradeCardItemsArr[index];            if (itemsCount[index] == ItemDataManager.GetItemNum(itemId))            {                Timers.inst.Remove(OnTimedEvent);                return false;            }            int maxLv = CardRarityCfgArray.Instance.GetCfg(_cardData.itemCfg.rarity).maxCardLvl;            int needExp = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, _showLv).needExp;            if (_showLv == maxLv && _comFosterBottom.m_barLv.value >= needExp)            {                Timers.inst.Remove(OnTimedEvent);                if (showTips == true)                {                    PromptController.Instance.ShowFloatTextPrompt("已达到最大等级");                }                return false;            }            if (IsUpLvLimit(itemId, false)) return false;            itemsCount[index] = itemsCount[index] + 1;            listItem.m_txtUseCount.text = itemsCount[index].ToString();            UI_ComConsume.ProxyEnd();            this.UpdatePreView();            return true;        }        private void OnClickBtnMinus(GObject obj)        {            UI_ComConsume listItem = UI_ComConsume.Proxy(obj);            int index = (int)listItem.target.data;            if (index >= itemsCount.Count || itemsCount[index] == 0)            {                Timers.inst.Remove(OnTimedEvent);                return;            }            itemsCount[index] = itemsCount[index] - 1;            listItem.m_txtUseCount.text = itemsCount[index].ToString();            UI_ComConsume.ProxyEnd();            this.UpdatePreView();        }        private void UpdatePreView()        {            int count = 0;//消耗金币数量            int hasExp = 0;//消耗材料提升的总经验            for (int i = 0; i < itemsCount.Count; i++)            {                if (itemsCount[i] == 0) continue;                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(upgradeCardItemsArr[i]);                count += itemCfg.cardUpLvGoldsArr[_cardData.itemCfg.rarity - 1][1] * itemsCount[i];                hasExp += itemCfg.cardUpLvExp * itemsCount[i];            }            _comLvConsumeGold = UI_ComCost.Proxy(_comFosterBottom.m_ComLvConsumeGold);            _comLvConsumeGold.m_txtNeed.text = count.ToString();            UI_ComCost.ProxyEnd();            _comFosterBottom.m_btnClearAll.visible = hasExp > 0;            int previewLv = 0;            int previewExp = 0;            CardDataManager.GetPreViewLvAndExp(_cardData.id, _cardData.lv, _cardData.exp, hasExp, out previewLv, out previewExp);            this.UpdateUpLvView(true, previewLv, previewExp);        }        private void OnClcikBtnAll()        {            int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;            if (_cardData.lv >= lvLimit)            {                PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级可继续升级词牌", CardDataManager.GetNextUpCardNeedRoleLv(_cardData.lv)));                return;            }            ViewManager.Show<CardUpLevelView>(_cardData);            //int cardUpLvGoldsNeed = 0;            //for (int i = 0; i < itemsCount.Count; i++)            //{            //    int[] cardUpLvGolds = ItemCfgArray.Instance.GetCfg(upgradeCardItemsArr[i]).cardUpLvGoldsArr[_cardData.itemCfg.rarity - 1];            //    long itemNum = ItemDataManager.GetItemNum(upgradeCardItemsArr[i]);            //    for (long j = 0; j < itemNum; j++)            //    {            //        if (ItemDataManager.GetItemNum(cardUpLvGolds[0]) < cardUpLvGoldsNeed + cardUpLvGolds[1] || this.OnClickBtnPlusLvConsume(_comFosterBottom.m_listLvConsume.GetChildAt(i), false) == false)            //        {            //            break;            //        }            //        cardUpLvGoldsNeed += cardUpLvGolds[1];            //    }            //}        }        private void OnClcikBtnClearAll()        {            this.ClearItemsCountList();            _comFosterBottom.m_listLvConsume.numItems = upgradeCardItemsArr.Length;            this.UpdatePreView();        }        private void OnClickBtnUpLv()        {            if (_effectUI7 != null)            {                EffectUIPool.Recycle(_effectUI7);                _effectUI7 = null;            }            //按钮点击特效            _effectUI7 = EffectUIPool.CreateEffectUI(_ui.m_ComFosterBottom.m_holderTouchFlower, "ui_Activity", "SX_DJ");            int itemMoneyId = ItemCfgArray.Instance.GetCfg(upgradeCardItemsArr[0]).cardUpLvGoldsArr[_cardData.itemCfg.rarity - 1][0];            _comLvConsumeGold = UI_ComCost.Proxy(_comFosterBottom.m_ComLvConsumeGold);            int itemMoneyNum = int.Parse(_comLvConsumeGold.m_txtNeed.text);            UI_ComCost.ProxyEnd();            if (itemMoneyNum == 0)            {                PromptController.Instance.ShowFloatTextPrompt("未选择升级材料");                return;            }            if (!ItemUtil.CheckItemEnough(itemMoneyId, itemMoneyNum))            {                long has = ItemDataManager.GetItemNum(itemMoneyId);                ItemUtil.BuyCurrency(itemMoneyId, itemMoneyNum - has);                return;            }            this.UpLv();        }        private async void UpLv()        {            // itemsCount.Clear();            int allConsume = 0;            for (int i = 0; i < itemsCount.Count; i++)            {                allConsume += itemsCount[i];            }            if (allConsume == 0)            {                PromptController.Instance.ShowFloatTextPrompt("未选中任何材料");                return;            }            if (CardDataManager.isFullLv(_cardData.id, _cardData.lv) == false)            {                int lv = _cardData.lv;                bool result = await CardSProxy.UpgradeCardLvl(_cardData.id, itemsCount);                if (result)                {                    if (_showLv - lv >= 1)                    {                        // this._selectTab = _comFosterBottom.m_ctrlTab.selectedIndex;                        ViewManager.Show<CardUpView>(new object[] { _cardData.scores, "lv", lv, _showLv, _cardData.id });                    }                    ReferInfo();                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.CI_PAI, 2);                }            }        }        private void ReferInfo()        {            this.UpdateCommon();            this.UpdateUpLvView(false, 0, 0, true);            this.ClearItemsCountList();        }        private bool IsUpLvLimit(int itemId, bool showTips = true)        {            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);            int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;            int maxLv = CardRarityCfgArray.Instance.GetCfg(_cardData.itemCfg.rarity).maxCardLvl;            lvLimit = Mathf.Min(lvLimit, maxLv);            int needExp = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, lvLimit).needExp;            if (_showLv >= lvLimit && _comFosterBottom.m_barLv.value + itemCfg.cardUpLvExp > needExp)            {                if (!showTips) return true;                if (_showLv < maxLv)                    PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级可继续升级词牌", CardDataManager.GetNextUpCardNeedRoleLv(_showLv)));                return true;            }            return false;        }        /***********************************************************升星***************************************************/        private void UpdateUpStarView()        {            CardStarCfg cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardData.id, _cardData.star);            if (cardStarCfg == null)            {                ET.Log.Error("词牌:" + _cardData.id + "   无" + _cardData.star + "星升星配置");                return;            }            _isAutoSelect = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsAutoSelect);            _comFosterBottom.m_btnCheckAuto.selected = _isAutoSelect == 1;            //升星后星数正5才不进入            if (_refDodgeStar || _cardData.star % 6 != 0)            {                UpdateUpStarOfStarAndText();            }            _refDodgeStar = true;            _comFosterBottom.m_btnRule.onClick.Add(RuleController.ShowRuleView);            _comFosterBottom.m_btnRule.data = 300021;            if (CardDataManager.isFullStar(_cardData.id, _cardData.star, false))            {                _comFosterBottom.m_ctrlFullStar.selectedIndex = 1;                _comFosterBottom.m_listShowCard.data = _cardData.resources;                _comFosterBottom.m_listShowCard.numItems = _cardData.resources.Count;                return;            }            else            {                _comFosterBottom.m_ctrlFullStar.selectedIndex = 0;                // List<CardStarCfg> starCfgs = CardStarCfgArray.Instance.GetCfgsBycardId(_cardData.id);                //_comFosterBottom.m_btnUpStar.data = 0;//data  0:材料不足,1:可以升级                ItemUtil.UpdateItemNeedNum(_comFosterBottom.m_comStarCousumeGold, cardStarCfg.costID, cardStarCfg.costNum);                _comFosterBottom.m_listStarConsume.data = cardStarCfg;                _comFosterBottom.m_listStarConsume.numItems = cardStarCfg.materiarsArr.Length;                _comFosterBottom.m_txtTips.text = _cardData.lv < cardStarCfg.needLv ? string.Format("需等级达到{0}级", cardStarCfg.needLv) : "";                _comFosterBottom.m_comStarCousumeGold.visible = _cardData.lv >= cardStarCfg.needLv;                //_comFosterBottom.m_btnUpStar.grayed = int.Parse(_comFosterBottom.m_btnUpStar.data.ToString()) == 0 ? true : false;                // _comFosterBottom.m_btnUpStar.GetChild("ani").asMovieClip.visible = false;// !_comFosterBottom.m_btnUpStar.grayed;            }        }        private void UpdateUpStarOfStarAndText()        {            UpdateUpStarOfStar();            UpdateUpStarOfText();        }        private void UpdateUpStarOfStar()        {            int starLevelDodge = _cardData.star / _wordNumber;            for (int i = 0; i < _wordRow; i++)            {                var dodgeStarObj = _comFosterBottom.target.GetChild("dodgeStar" + i);                UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(dodgeStarObj);                dodgeStar.m_lightType.selectedIndex = (starLevelDodge > i) ? 1 : 0;                dodgeStarObj.visible = i < _cardData.itemCfg.starDescArr.Length;                UI_ComDodgeStar.ProxyEnd();            }        }        private void UpdateUpStarOfText()        {            int starLevel = _cardData.star / _wordNumber;            _wordRow = _cardData.itemCfg.starDescArr.Length;            if (starLevel >= _wordRow)                starLevel = _wordRow - 1;            int index = starLevel * _wordNumber;            UI_ComStarItem comStarItem = UI_ComStarItem.Proxy(_comFosterBottom.target.GetChild("comStarItem"));            string starDesc = "";            for (int j = 0; j < _cardData.itemCfg.starDescArr[starLevel].Length; j++)            {                index++;                string str = _cardData.itemCfg.starDescArr[starLevel][j].ToString();                if (j < _cardData.itemCfg.starDescArr[starLevel].Length - 1)                    str += " /";                starDesc += index <= _cardData.star ? StringUtil.GetColorText(str, "#E5892F") : StringUtil.GetColorText(str, "#C8B693");            }            comStarItem.m_txtContent.text = starDesc;            UI_ComStarItem.ProxyEnd();        }        private void RenderListStarConsumeItem(int index, GObject obj)        {            UI_ComItem listItem = UI_ComItem.Proxy(obj);            CardStarCfg cardStarCfg = listItem.target.parent.data as CardStarCfg;            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cardStarCfg.materiarsArr[index][0]);            listItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);            listItem.m_CountType.selectedIndex = 1;            listItem.m_ButtonType.selectedIndex = 0;            listItem.m_QualityType.selectedIndex = 4;            int needCount = cardStarCfg.materiarsArr[index][1];            long hasCount = ItemDataManager.GetItemNum(cardStarCfg.materiarsArr[index][0]);            if (_isAutoSelect == 1)            {                if (index == 0)                    hasCount += ItemDataManager.GetItemNum(6003001);                else                    hasCount += ItemDataManager.GetItemNum(6003002);            }            listItem.m_txtDecomCount.text = StringUtil.GetColorText(hasCount.ToString(), hasCount < needCount ? "#D27869" : "#FFFFFF");// StringUtil.GetColorText(needCount.ToString(), hasCount < needCount ? "#D27869" : "#FDF3D7"); ;            listItem.m_txtDecomHasCount.text = "/" + needCount.ToString();   //;  hasCount.ToString();                 if (listItem.target.data == null)            {                listItem.target.onClick.Add(() => OnClickBtnPlusStarConsum(index));            }            // listItem.m_btnPlus.data = cardStarCfg.materiarsArr[index][0];            listItem.target.data = cardStarCfg.materiarsArr[index][0];            //if (CardDataManager.GetUpStarEnoughMaterial(_cardData.id) == false) return;            //_comFosterBottom.m_btnUpStar.data = hasCount >= needCount && ItemDataManager.GetItemNum(cardStarCfg.costID) >= cardStarCfg.costNum ? 1 : 0;            if (hasCount < needCount)            {                //材料不足显示加号                listItem.m_ButtonType.selectedIndex = 2;            }        }        private void RenderListShowCardItem(int index, GObject obj)        {            GButton listItem = obj as GButton;            GLoader loaStarCard = UI_ComStarCard.Proxy(listItem.GetChild("ComStarCard")).m_loaStarCard;            // string res = (listItem.parent.data as List<string>)[index];            if (index == _cardData.resIndex)            {                _comFosterBottom.m_listShowCard.selectedIndex = index;            }            loaStarCard.url = ResPathUtil.GetCardIconPath(_cardData.resources[index]);            listItem.data = index;        }        private async void OnClickShowCardListItem(EventContext context)        {            int resIndex = (int)(context.data as GObject).data;            if (resIndex != _cardData.resIndex)            {                bool result = await CardSProxy.ChangeCardRes(_cardData.id, resIndex);                if (result)                {                    this.UpdateCommon();                    this.UpdateCardRes();                }            }        }        private void OnClickBtnPlusStarConsum(int index)        {            int itemId = int.Parse(UI_ComStarConsume.Proxy(_comFosterBottom.m_listStarConsume.GetChildAt(index)).target.data.ToString());            //ViewManager.Show<ApproachOfItemView>(new object[] { itemId, new object[] { typeof(CardFosterView).FullName, _cardData } });            object[] sourceDatas = new object[] { itemId, new object[] { typeof(CardFosterView).FullName, _cardData } };            GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);        }        private void OnClickBtnUpStar()        {            if (_effectUI7 != null)            {                EffectUIPool.Recycle(_effectUI7);                _effectUI7 = null;            }            //按钮点击特效            _effectUI7 = EffectUIPool.CreateEffectUI(_ui.m_ComFosterBottom.m_holderTouchFlower, "ui_Activity", "SX_DJ");            CardStarCfg cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardData.id, _cardData.star);            if (_cardData.lv < cardStarCfg.needLv)            {                PromptController.Instance.ShowFloatTextPrompt("词牌等级不足");                return;            }            if (CardDataManager.isFullStar(_cardData.id, _cardData.star) == true)            {                return;            }            if (!ItemUtil.CheckItemEnough(cardStarCfg.costID, cardStarCfg.costNum))            {                long has = ItemDataManager.GetItemNum(cardStarCfg.costID);                ItemUtil.BuyCurrency(cardStarCfg.costID, cardStarCfg.costID - has);                return;            }            this.UpStar();        }        private async void UpStar()        {            _comFosterBottom.m_btnCheckAuto.selected = _isAutoSelect == 1;            bool result = await CardSProxy.UpgradeCardStar(_cardData.id, _comFosterBottom.m_btnCheckAuto.selected);            if (result)            {                UpdateCommon();                _refDodgeStar = false;                UpdateUpStarView();                UpdateCardRes();                // this._selectTab = _comFosterBottom.m_ctrlTab.selectedIndex;                LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.CI_PAI, 2);                UpdateRedDot();                if (_cardData.star % 6 == 0)                {                    int starLevelDodge = _cardData.star / _wordNumber;                    int starLevel = _cardData.star / _wordNumber - 1;                    UI_ComStarItem comStarItem = UI_ComStarItem.Proxy(_comFosterBottom.target.GetChild("comStarItem"));                    string starDesc = "";                    for (int j = 0; j < _cardData.itemCfg.starDescArr[starLevel].Length; j++)                    {                        string str = _cardData.itemCfg.starDescArr[starLevel][j].ToString();                        if (j < _cardData.itemCfg.starDescArr[starLevel].Length - 1)                            str += " /";                        starDesc += str;                    }                    comStarItem.m_txtContent.text = StringUtil.GetColorText(starDesc, "#E5892F");                    UI_ComStarItem.ProxyEnd();                    Timers.inst.Add(0.1f, 1, EffectTxetDisappear);                }                else                    OpenCardUp("starNormal");            }        }        private void EffectTxetDisappear(object param)        {            if (_effectUI8 != null)            {                EffectUIPool.Recycle(_effectUI8);                _effectUI8 = null;            }            _ui.m_touchLayer.touchable = true;            //升星字体特效            _effectUI8 = EffectUIPool.CreateEffectUI(_ui.m_ComFosterBottom.m_holderUpStar, "ui_Activity", "SX_Text_01");            _ui.m_ComFosterBottom.m_starItemAlpha.Play();            Timers.inst.Add(0.3f, 1, EffectTaril);        }        private void EffectTaril(object param)        {            if (_effectUI9 != null)            {                EffectUIPool.Recycle(_effectUI9);                _effectUI9 = null;            }            int starLevelDodge = _cardData.star / _wordNumber;            UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(_comFosterBottom.target.GetChild("dodgeStar" + (starLevelDodge - 1)));            //升星字体拖尾特效            _effectUI9 = EffectUIPool.CreateEffectUI(dodgeStar.m_holderUpStarMove, "ui_Activity", "SX_Text_Taril_02");            UI_ComDodgeStar.ProxyEnd();            UpdateUpStarOfText();            Timers.inst.Add(1.4f, 1, EffectStar);        }        private void EffectStar(object param)        {            if (_effectUI9 != null)            {                EffectUIPool.Recycle(_effectUI9);                _effectUI9 = null;            }            if (_effectUI10 != null)            {                EffectUIPool.Recycle(_effectUI10);                _effectUI10 = null;            }            int starLevelDodge = _cardData.star / _wordNumber;            UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(_comFosterBottom.target.GetChild("dodgeStar" + (starLevelDodge - 1)));            //星星特效            _effectUI10 = EffectUIPool.CreateEffectUI(dodgeStar.m_holderStarLight, "ui_Activity", "SX_Text_STAR_03");            UI_ComDodgeStar.ProxyEnd();            Timers.inst.Add(0.7f, 1, (obj) =>            {                if (_effectUI10 != null)                {                    EffectUIPool.Recycle(_effectUI10);                    _effectUI10 = null;                }                UpdateUpStarOfStar();                OpenCardUp("star");                _ui.m_touchLayer.touchable = false;            });        }        private void OpenCardUp(string strType)        {            ViewManager.Show<CardUpView>(new object[] { _cardData.scores, strType, _cardData.star - 1, _cardData.star, _cardData.id, _fromUIType });        }        /***********************************************************升技能***************************************************/        private void UpdateUpSkillView()        {            // RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnSkill, RedDotDataManager.Instance.GetCardSkillsRed(_cardData.id));            _comFosterBottom.m_listSkill.numItems = PassivitySkillCfgArray.Instance.GetCfgsBycardId(_cardData.id).Count;            _comFosterBottom.m_ctrlSkillCount.selectedIndex = _comFosterBottom.m_listSkill.numItems;        }        private void RenderListSkillItem(int index, GObject obj)        {            UI_ListSkillItem item = UI_ListSkillItem.Proxy(obj);            item.m_c1.selectedIndex = _comFosterBottom.m_c_from.selectedIndex;            if (_comFosterBottom.m_c_from.selectedIndex == (int)Source.DISPLAY)            {                item.target.mode = ButtonMode.Common;            }            else            {                item.target.mode = ButtonMode.Radio;            }            PassivitySkillCfg skillCfg = PassivitySkillCfgArray.Instance.GetCfgsBycardId(_cardData.id)[index];            int skillLv = SkillDataManager.Instance.GetCardSkillLv(_cardData.id, skillCfg.skillId);            CardData data = CardDataManager.GetCardDataById(InstanceZonesDataManager.currentCardId);            item.m_loaSkill.url = ResPathUtil.GetCardSkillPath(skillCfg.res);            item.m_txtName.text = skillCfg.name;            item.m_txtLv.text = string.Format("{0}级", skillLv);            PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, skillCfg.skillId);            // item.m_txtDesc.text = skillLvlCfg.describe;            // item.m_btnUp.visible = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv + 1, skillCfg.skillId) != null;            if (_ui.m_ComFosterBottom.m_c_from.selectedIndex == (int)Source.DISPLAY)            {                RedDotController.Instance.SetComRedDot(item.target, false);            }            else            {                RedDotController.Instance.SetComRedDot(item.target, RedDotDataManager.Instance.GetCardSkillRed(skillCfg.skillId), "", -26, 30);            }        }        private void OnBtnUpSkill()        {            List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(_cardData.id);            ViewManager.Show<CardSkillView>(new object[] { _cardData.id, skillCfgs[_comFosterBottom.m_listSkill.selectedIndex].skillId, _comFosterBottom.m_c_from.selectedIndex });        }        private void OnClickListSkillItem(EventContext eventContext)        {            int index = _comFosterBottom.m_listSkill.GetChildIndex(eventContext.data as GObject);            List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(_cardData.id);            ViewManager.Show<CardSkillView>(new object[] { _cardData.id, skillCfgs[index].skillId, _comFosterBottom.m_c_from.selectedIndex });        }        private void OnBtnCheckAuto()        {            var success = CardSProxy.SaveIsAutoSelect(_comFosterBottom.m_btnCheckAuto.selected);            CardStarCfg cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardData.id, _cardData.star);            if (cardStarCfg == null)            {                ET.Log.Error("词牌:" + _cardData.id + "   无" + _cardData.star + "星升星配置");                return;            }            if (_isAutoSelect == 0)                _isAutoSelect = 1;            else                _isAutoSelect = 0;            _comFosterBottom.m_listStarConsume.data = cardStarCfg;            _comFosterBottom.m_listStarConsume.numItems = cardStarCfg.materiarsArr.Length;        }        private float touchBeginX = 0;        private void onTouchCardBegin(EventContext context)        {            InputEvent inputEvent = (InputEvent)context.data;            touchBeginX = inputEvent.x;        }        private void onTouchCardEnd(EventContext context)        {            InputEvent inputEvent = (InputEvent)context.data;            float diffValueX = touchBeginX - inputEvent.x;            if (diffValueX > 20 && showCard == false)            {                if (_nowIndex < _cardList.Count - 1)                {                    OnClickBtnRight();                    RefLeftAndRight();                }            }            else if (diffValueX < -20 && showCard == false)            {                if (_nowIndex > 0)                {                    OnClickBtnLeft();                    RefLeftAndRight();                }            }            else if (diffValueX <= 20 && diffValueX >= -20)            {                if (_ui.m_c1.selectedIndex == 1)                    OnClickComCard();                else                    OnClickLoaCard();            }        }        private void OnClickLoaCard()        {            if (playAni) return;            playAni = true;            if (!showCard)            {                _ui.m_loaListener1.visible = false;                GTween.To(comCardImgResInitSize, comCardImgResTargetSize, 0.5f).SetTarget(_ui.m_comImgCard.m_ComCardImgRes).OnUpdate((GTweener t) =>                {                    _ui.m_comImgCard.m_ComCardImgRes.target.size = t.value.vec2;                });                GTween.To(_ui.m_comImgCard.target.scrollPane.posX, (comCardImgResTargetSize.x - _ui.target.width) / 2, 0.5f).SetTarget(_ui.m_comImgCard.target.scrollPane).OnUpdate((GTweener t) =>                {                    _ui.m_comImgCard.target.scrollPane.posX = t.value.x;                });                _ui.m_t0.Play(() =>                {                    playAni = false;                });                showCard = true;            }            else            {                _ui.m_loaListener1.visible = true;                _ui.m_t1.SetHook("scale", () =>                {                    GTween.To(comCardImgResTargetSize, comCardImgResInitSize, 0.5f).SetTarget(_ui.m_comImgCard.m_ComCardImgRes).OnUpdate((GTweener t) =>                   {                       _ui.m_comImgCard.m_ComCardImgRes.target.size = t.value.vec2;                   });                    GTween.To(_ui.m_comImgCard.target.scrollPane.posX, (comCardImgResInitSize.x - _ui.target.width) / 2, 0.5f).SetTarget(_ui.m_comImgCard.target.scrollPane).OnUpdate((GTweener t) =>                    {                        _ui.m_comImgCard.target.scrollPane.posX = t.value.x;                    });                });                _ui.m_t1.Play(() =>                {                    playAni = false;                });                showCard = false;            }        }        private void OnClickComCard()        {            if (playAni) return;            playAni = true;            if (showCard)            {                _ui.m_loaListener.visible = true;                _ui.m_comCard.target.scrollPane.SetPercX(0.5f, true);                float scale = _ui.m_comCard.target.scaleX;                _ui.m_t1.SetValue("scale", scale, scale);                _ui.m_t1.SetValue("normal", _cardScale, _cardScale);                _ui.m_t1.Play(() =>                {                    playAni = false;                });                showCard = false;            }            else            {                _ui.m_loaListener.visible = false;                float scale = _ui.target.height / CardDataManager.CardResInitHight;                _ui.m_comCard.target.scrollPane.viewWidth = _ui.target.width / scale;                _ui.m_comCard.target.scrollPane.SetPercX(0.5f, true);                _ui.m_t0.SetValue("scale", scale, scale);                _ui.m_t0.SetValue("normal", _cardScale, _cardScale);                _ui.m_t0.Play(() =>                {                    playAni = false;                });                showCard = true;            }        }        private void OnClickBtnStroy()        {            ViewManager.Show<CardStoryView>(_cardData);        }        private void OnChangeCtrlTab()        {            // _comLvConsumeGold = UI_ComCostCurrency.Proxy(_comFosterBottom.m_ComLvConsumeGold);            this.UpdateCommon();            if (_comFosterBottom.m_ctrlTab.selectedIndex == 0)            {                this.ClearItemsCountList();                this.UpdateUpLvView();            }            else if (_comFosterBottom.m_ctrlTab.selectedIndex == 1)            {                GuideCfg guideCfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.UP_CARD_STAR);                if (!InstanceZonesDataManager.CheckLevelPass(guideCfg.storyLevelId - 1))//防止升星引导前将材料耗光                {                    PromptController.Instance.ShowFloatTextPrompt("功能未开启");                    _comFosterBottom.m_ctrlTab.selectedIndex = _comFosterBottom.m_ctrlTab.previsousIndex;                    return;                }                this.UpdateUpStarView();            }            else            {                this.UpdateUpSkillView();            }            this._selectTab = _comFosterBottom.m_ctrlTab.selectedIndex;        }        private void UpdateItemChange()        {            _ui.m_ComFosterBottom.m_listLvConsume.numItems = _ui.m_ComFosterBottom.m_listLvConsume.numItems;            this.UpdateUpStarView();            this.UpdateUpSkillView();        }        private void OnBtnStarRewardClick()        {            ViewManager.Show<CardStarRewardView>(_cardStarRewards);        }        private void OnClickBtnBack()        {            ViewManager.GoBackFrom(typeof(CardFosterView).FullName);            this._selectTab = 0;        }        private void UpdateRedDot()        {            RedDotController.Instance.SetComRedDot(_ui.m_ComFosterTop.m_btnStarReward, RedDotDataManager.Instance.GetCardStarReward(_cardData.id));            RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnUpLv, RedDotDataManager.Instance.GetCardUpLvRed(_cardData.id), "", -74, 60);            RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnUpStar, RedDotDataManager.Instance.GetCardUpStarRed(_cardData.id), "", -74, 60);            //RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnLv, RedDotDataManager.Instance.GetCardUpLvRed(_cardData.id), "", 0, 0);            //RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnStar, RedDotDataManager.Instance.GetCardUpStarRed(_cardData.id), "", 0, 0);            RedDotController.Instance.SetComRedDot(_ui.m_ComFosterBottom.m_btnSkill, RedDotDataManager.Instance.GetCardSkillsRed(_cardData.id), "", 0, 0);            RedDotController.Instance.SetComRedDot(_ui.m_cardSyntheticBtn, RedDotDataManager.Instance.CheckCardCanSynthetic(_cardData.id),"",-10,10);        }        protected override void OnHide()        {            base.OnHide();            EffectUIPool.Recycle(_effectUI1);            _effectUI1 = null;            EffectUIPool.Recycle(_effectUI5);            _effectUI5 = null;            EffectUIPool.Recycle(_effectUI6);            _effectUI6 = null;            EffectUIPool.Recycle(_effectUI7);            _effectUI7 = null;            EffectUIPool.Recycle(_effectUI8);            _effectUI8 = null;            EffectUIPool.Recycle(_effectUI9);            _effectUI9 = null;            EffectUIPool.Recycle(_effectUI10);            _effectUI10 = null;            Timers.inst.Remove(CheckGuide);            Timers.inst.Remove(OnTimedEvent);            UI_ComCostCurrency.ProxyEnd();            UI_ComCostCurrencyWithHas.ProxyEnd();            // _comFosterBottom.m_listLvConsume.numItems = 0;            _valueBarController.OnHide();            _cardStarRewards.Clear();            Input.multiTouchEnabled = true;        }        protected override void RemoveEventListener()        {            base.RemoveEventListener();            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateUpStarView);            // EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnItemChangeListener);            EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateItemChange);            EventAgent.RemoveEventListener(ConstMessage.CARD_UP_SKILL, UpdateUpSkillView);            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);            EventAgent.RemoveEventListener(ConstMessage.CARD_LEVEL_UP, ReferInfo);        }        private void CheckGuide(object param)        {            if (GuideDataManager.IsGuideFinish(ConstGuideId.UP_CARD_LV) <= 0            || GuideDataManager.IsGuideFinish(ConstGuideId.UP_CARD_STAR) <= 0)            {                UpdateToCheckGuide(null);            }            else            {                Timers.inst.Remove(CheckGuide);            }            _ui.m_loaGuide.visible = false;        }        protected override void UpdateToCheckGuide(object param)        {            if (!ViewManager.CheckIsTopView(this.viewCom)) return;            GuideController.TryGuide(_ui.m_ComFosterBottom.m_btnAll, ConstGuideId.UP_CARD_LV, 4, "");            //GuideController.TryGuide(_ui.m_ComFosterBottom.m_btnUpLv, ConstGuideId.UP_CARD_LV, 5, "");            GuideController.TryGuide(_ui.m_ComFosterTop.m_btnback, ConstGuideId.UP_CARD_LV, 7, "让我们继续新旅程吧~");            GuideController.TryGuide(_ui.m_ComFosterBottom.m_btnStar, ConstGuideId.UP_CARD_STAR, 4, "");            GuideController.TryGuide(_ui.m_ComFosterBottom.m_btnUpStar, ConstGuideId.UP_CARD_STAR, 5, "");            GuideController.TryGuide(_ui.m_ComFosterTop.m_btnback, ConstGuideId.UP_CARD_STAR, 7, "返回主界面");        }        protected override void TryCompleteGuide()        {            base.TryCompleteGuide();            GuideController.TryCompleteGuideIndex(ConstGuideId.UP_CARD_LV, 7);            GuideController.TryCompleteGuide(ConstGuideId.UP_CARD_LV, 7);        }        private void AdaptScreen()        {            _ui.m_comImgCard.target.SetXY(_ui.m_comImgCard.target.x, _ui.m_comImgCard.target.y - ViewGlobal.GetRealTopOffset());            _ui.m_comImgCard.target.SetSize(_ui.m_comImgCard.target.width, ViewGlobal.GetRealTopOffset() + _ui.target.height);        }        private void OnClickBtnCardSyntheticView()        {              ViewManager.Show<CardSyntheticView>(new object[] { _cardData.id });        }    }}
 |