Sfoglia il codice sorgente

升级界面调整,词牌界面增加滑动 和 点击放大放开注释

huangxiaoyue 1 anno fa
parent
commit
87a78ba16b

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/CardData.cs

@@ -5,6 +5,7 @@ namespace GFGGame
     public class CardData
     {
         public int id;
+        public int index; //当前列表里的第几个
         public int lv;
         public int exp;
         public int star;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleLvUp/UI_RoleLvUpUI.cs

@@ -10,6 +10,7 @@ namespace UI.RoleLvUp
         public GGroup m_downTipsText;
         public GGraph m_holderTitle;
         public GTextField m_txtLv;
+        public GGraph m_holderTitleUp;
         public GTextField m_txtLastLv;
         public GTextField m_txtCurLv;
         public GGraph m_holderNumber;
@@ -65,6 +66,7 @@ namespace UI.RoleLvUp
             m_downTipsText = (GGroup)comp.GetChild("downTipsText");
             m_holderTitle = (GGraph)comp.GetChild("holderTitle");
             m_txtLv = (GTextField)comp.GetChild("txtLv");
+            m_holderTitleUp = (GGraph)comp.GetChild("holderTitleUp");
             m_txtLastLv = (GTextField)comp.GetChild("txtLastLv");
             m_txtCurLv = (GTextField)comp.GetChild("txtCurLv");
             m_holderNumber = (GGraph)comp.GetChild("holderNumber");
@@ -76,6 +78,7 @@ namespace UI.RoleLvUp
             m_downTipsText = null;
             m_holderTitle = null;
             m_txtLv = null;
+            m_holderTitleUp = null;
             m_txtLastLv = null;
             m_txtCurLv = null;
             m_holderNumber = null;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/Card/CardDetailView.cs

@@ -92,10 +92,12 @@ namespace GFGGame
 
             _ui.m_txtTips.visible = _ui.m_listCard.numItems == 0 ? true : false;
         }
+
         private void RenderListCardItem(int index, GObject obj)
         {
             UI_ListCardItem listItem = UI_ListCardItem.Proxy(obj);
             CardData data = (_ui.m_listCard.data as List<CardData>)[index];//CardDataManager.GetCardList(_ui.m_listRole.selectedIndex)[index];
+            data.index = index;
             listItem.target.data = data;
             listItem.m_comCard.m_loaCard.url = ResPathUtil.GetCardIconPath(data.resources[data.resIndex]);
             RarityIconController.UpdateRarityIcon(listItem.m_loaRarity, data.itemCfg.id, false);// ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + data.itemCfg.rarity);
@@ -116,6 +118,7 @@ namespace GFGGame
 
             UI_ListCardItem.ProxyEnd();
         }
+
         private void OnClickListCardItem(EventContext context)
         {
             ViewManager.Show<CardFosterView>((context.data as GObject).data, new object[] { ViewName.CARD_DETAIL_VIEW, _ui.m_listRole.selectedIndex });

+ 153 - 80
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -24,8 +24,10 @@ namespace GFGGame
         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 = 5;//字每行个数
+        private int nowIndex = 0;
         private bool refDodgeStar = true;
         private EffectUI _effectUI1;
         private EffectUI _effectUI3;
@@ -121,45 +123,62 @@ namespace GFGGame
             _ui.m_btnLeft.onClick.Add(OnClickBtnLeft);
             _ui.m_btnRight.onClick.Add(OnClickBtnRight);
 
-            // _ui.m_loaCard.onClick.Add(OnClickLoaCard);
+            //_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(onTouchImgCardEnd);
+            _ui.m_loaListener1.onTouchBegin.Add(onTouchCardBegin);
+            _ui.m_loaListener1.onTouchEnd.Add(onTouchImgCardEnd);
+            _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");
         }
 
+        private void RefLeftAndRight()
+        {
+            _ui.m_btnRight.grayed = false;
+            _ui.m_btnRight.touchable = true;
+            _ui.m_btnLeft.grayed = false;
+            _ui.m_btnLeft.touchable = true;
 
+            if (nowIndex <= 0)
+            {
+                _ui.m_btnLeft.grayed = true;
+                _ui.m_btnLeft.touchable = false;
+            }
+            else if (nowIndex >= cardList.Count)
+            {
+                _ui.m_btnRight.grayed = true;
+                _ui.m_btnRight.touchable = false;
+            }
+        }
 
         private void OnClickBtnLeft()
         {
-            _cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
-
-            UpdateCardRes();
-
-
-
+            nowIndex -= 1;
+            RefLeftAndRight();
+            _cardData = cardList[nowIndex];
+            RefCardFosterInfo();
         }
 
         private void OnClickBtnRight()
         {
-
-
-
-
+            nowIndex += 1;
+            RefLeftAndRight();
+            _cardData = cardList[nowIndex];
+            RefCardFosterInfo();
         }
 
-        protected override void OnShown()
+        private void RefCardFosterInfo()
         {
-            base.OnShown();
-
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
-            _cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
-            _comFosterBottom = _ui.m_ComFosterBottom;
-
             playAni = false;
 
             float imgInitHight = _ui.target.height - 570;//UI界面上小图时的高度
@@ -193,10 +212,22 @@ namespace GFGGame
             }
             _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("hc_bj_1");
+            List<object> dataList = viewData as List<object>;
 
+            _cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
+            nowIndex = _cardData.index;
+            _comFosterBottom = _ui.m_ComFosterBottom;
 
-            List<CardData> cardList = CardDataManager.GetCardListByRarity(0);
+            RefCardFosterInfo();
+
+            cardList = CardDataManager.GetCardListByRarity(0);
             if (CardDataManager.isFilter == true)
             {
                 //筛选
@@ -309,7 +340,6 @@ namespace GFGGame
                     _ui.m_comImgCard.target.scrollPane.SetPercX(0.5f, false);
                 }
             }
-
         }
         private void RenderListPropertyItem(int index, GObject obj)
         {
@@ -321,7 +351,7 @@ namespace GFGGame
         }
 
         /***********************************************************升级***************************************************/
-        private void UpdateUpLvView(bool isPreview = false, int lv = 0, int exp = 0)
+        private void UpdateUpLvView(bool isPreview = false, int lv = 0, int exp = 0, bool effLight = false)
         {
 
             _showLv = isPreview == true ? lv : _cardData.lv;
@@ -336,8 +366,11 @@ namespace GFGGame
 
             _comFosterBottom.m_barLv.max = cardLvCfg.needExp;
             _comFosterBottom.m_barLv.value = _showExp;
-            EffectUIPool.Recycle(_effectUI6);
-            _effectUI6 = EffectUIPool.CreateEffectUI(_comFosterBottom.m_holderbarLv, "ui_Activity", "SX_JinDuTiao");
+
+            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();
@@ -614,10 +647,9 @@ namespace GFGGame
                         ViewManager.Show<CardUpView>(new object[] { _cardData.scores, "lv", lv, _showLv , _cardData.id }, new object[] { ViewName.CARD_FOSTER_VIEW, _cardData });
                     }
                     this.UpdateCommon();
-                    this.UpdateUpLvView();
+                    this.UpdateUpLvView(false, 0, 0, true);
                     this.ClearItemsCountList();
                     LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.CI_PAI, 2);
-
                 }
             }
         }
@@ -966,89 +998,130 @@ namespace GFGGame
 
             ViewManager.Show<CardSkillView>(new object[] { _cardData.id, skillCfgs[_comFosterBottom.m_listSkill.selectedIndex].skillId });
         }
+        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)
+                    OnClickBtnRight();
+            }
+            else if (diffValueX < - 20 && showCard == false)
+            {
+                if (nowIndex > 0)
+                    OnClickBtnLeft(); 
+            }
+            else if (diffValueX <= 20 && diffValueX >= - 20)
+                OnClickComCard();
+        }
+
+        private void onTouchImgCardEnd(EventContext context)
+        {
+            InputEvent inputEvent = (InputEvent)context.data;
+            float diffValueX = touchBeginX - inputEvent.x;
+            if (diffValueX > 20 && showCard == false)
+            {
+                if (nowIndex < cardList.Count)
+                    OnClickBtnRight();
+            }
+            else if (diffValueX < - 20 && showCard == false)
+            {
+                if (nowIndex > 0)
+                    OnClickBtnLeft();
+            }
+            else if(diffValueX <= 20 && diffValueX >= - 20)
+                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;
-                //});
+                _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;
-                //});
+                _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;
+                _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;
+                _ui.m_loaListener.visible = false;
 
-                //float scale = _ui.target.height / 1920;
-                //_ui.m_comCard.target.scrollPane.viewWidth = 1080 / scale;
-                //_ui.m_comCard.target.scrollPane.SetPercX(0.5f, true);
+                float scale = _ui.target.height / 1920;
+                _ui.m_comCard.target.scrollPane.viewWidth = 1080 / 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.SetValue("scale", scale, scale);
+                _ui.m_t0.SetValue("normal", _cardScale, _cardScale);
 
-                //_ui.m_t0.Play(() =>
-                //{
-                //    playAni = false;
+                _ui.m_t0.Play(() =>
+                {
+                    playAni = false;
 
-                //});
+                });
                 showCard = true;
-
             }
         }
         private void OnClickBtnStroy()

+ 8 - 2
GameClient/Assets/Game/HotUpdate/Views/RoleLvUp/RoleLvUpView.cs

@@ -13,6 +13,7 @@ namespace GFGGame
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
 
         public override void Dispose()
         {
@@ -20,6 +21,8 @@ namespace GFGGame
             _effectUI1 = null;
             EffectUIPool.Recycle(_effectUI2);
             _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
 
             if (_ui != null)
             {
@@ -37,7 +40,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             this.viewCom.Center();
             this.modal = true;
-            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+            //viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
             AddEffect();
         }
 
@@ -80,8 +83,11 @@ namespace GFGGame
             //升级成功特效
             _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_sj", "SJ");
 
+            //升级成功特效上层
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderTitleUp, "ui_sj", "SJ_top_number");
+
             //等级特效
-            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderNumber, "ui_sj", "SJ_Number");
+            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holderNumber, "ui_sj", "SJ_Number");
         }
     }
 }

BIN
GameClient/Assets/ResIn/UI/Card/Card_fui.bytes


BIN
GameClient/Assets/ResIn/UI/RoleLvUp/RoleLvUp_fui.bytes


+ 1 - 1
GameClient/Assets/ThirdParty/FairyGUI/Scripts/UI/Window.cs

@@ -190,7 +190,7 @@ namespace FairyGUI
         {
             GRoot.inst.ShowWindow(this);
             GRoot.inst.modalLayer.color = Color.black;
-            // GRoot.inst.modalLayer.alpha = 0.6f;
+            GRoot.inst.modalLayer.alpha = 0.8f;
         }
 
         /// <summary>