Browse Source

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong 1 year ago
parent
commit
77b1d8ef41

+ 9 - 2
GameClient/Assets/Game/HotUpdate/Controller/PromptController.cs

@@ -8,8 +8,8 @@ namespace GFGGame
 {
     public class PromptController : SingletonBase<PromptController>
     {
-
         private List<GComponent> _uis = new List<GComponent>();
+        private int showCount = 3;  //ÏÔʾ¶àÉÙÌõ
 
         public PromptController()
         {
@@ -69,7 +69,14 @@ namespace GFGGame
                 GComponent preui = _uis[_uis.Count - 1];
                 ui.x = preui.x;
                 ui.y = preui.y + 100;
+                if (_uis.Count >= showCount) {
+                    GComponent uiFirst = _uis[0];
+                    _uis.Remove(uiFirst);
+                    uiFirst.RemoveFromParent();
+                    uiFirst.Dispose();
+                }
             }
+
             ui.data = ET.TimeHelper.ClientNow() + 3000;
             _uis.Add(ui);
         }
@@ -78,7 +85,7 @@ namespace GFGGame
         {
             foreach (GComponent ui in _uis)
             {
-                ui.y -= 50;
+                ui.y -= 100;
             }
         }
     }

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_CompSuitItem.cs

@@ -8,8 +8,9 @@ namespace UI.FieldGuide
     {
         public GComponent target;
         public Controller m_c1;
-        public GLoader m_bg;
+        public Controller m_state;
         public GGraph m_holderBg;
+        public GLoader m_bg;
         public GLoader m_loaderPic;
         public UI_BonusBox m_loaderBonusBox;
         public GProgressBar m_progBar;
@@ -64,8 +65,9 @@ namespace UI.FieldGuide
         private void Init(GComponent comp)
         {
             m_c1 = comp.GetController("c1");
-            m_bg = (GLoader)comp.GetChild("bg");
+            m_state = comp.GetController("state");
             m_holderBg = (GGraph)comp.GetChild("holderBg");
+            m_bg = (GLoader)comp.GetChild("bg");
             m_loaderPic = (GLoader)comp.GetChild("loaderPic");
             m_loaderBonusBox = (UI_BonusBox)UI_BonusBox.Create(comp.GetChild("loaderBonusBox"));
             m_progBar = (GProgressBar)comp.GetChild("progBar");
@@ -76,8 +78,9 @@ namespace UI.FieldGuide
         public void Dispose(bool disposeTarget = false)
         {
             m_c1 = null;
-            m_bg = null;
+            m_state = null;
             m_holderBg = null;
+            m_bg = null;
             m_loaderPic = null;
             m_loaderBonusBox.Dispose();
             m_loaderBonusBox = null;

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -380,6 +380,8 @@ namespace GFGGame
                 _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]);
 

+ 18 - 15
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/SuitGuideDetailView.cs

@@ -16,6 +16,12 @@ namespace GFGGame
         private Dictionary<int, EffectUI> _effectUIDic = new Dictionary<int, EffectUI>();
         public override void Dispose()
         {
+            foreach (var v in _effectUIDic)
+            {
+                EffectUIPool.Recycle(v.Value);
+            }
+            _effectUIDic.Clear();
+
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -65,12 +71,6 @@ namespace GFGGame
         {
             base.OnHide();
 
-            foreach (var v in _effectUIDic)
-            {
-                EffectUIPool.Recycle(v.Value);
-            }
-            _effectUIDic.Clear();
-
             DressUpMenuItemDataManager.Clear();
 
             // 清空服装过滤界面选择
@@ -143,12 +143,6 @@ namespace GFGGame
                 _ui.m_progress.m_rate.SetVar("rate", "0").FlushVars();
             }
 
-            foreach (var v in _effectUIDic)
-            {
-                EffectUIPool.Recycle(v.Value);
-            }
-            _effectUIDic.Clear();
-
             _ui.m_listSuit.numItems = _suitIds.Count;
             _ui.m_listSuit.scrollPane.ScrollTop();
         }
@@ -158,11 +152,19 @@ namespace GFGGame
             UI_CompSuitItem listItem = UI_CompSuitItem.Proxy(item);
             int suitId = _suitIds[index];
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
+
+            if ((suitCfg.rarity - 1) == 3)
+            {
+                bool haveSuit = DressUpMenuSuitDataManager.CheckHaveSuit(suitId);
+                if (haveSuit && !_effectUIDic.ContainsKey(index))
+                {
+                    _effectUIDic.Add(index, EffectUIPool.CreateEffectUI(listItem.m_holderBg, "ui_KP", "KP_Other_Gold_Frame"));
+                }
+            }
+
             listItem.m_txtName.text = suitCfg.name;
             listItem.m_loaderPic.url = ResPathUtil.GetFieldGuideIconPath(suitCfg.res);
             listItem.m_c1.SetSelectedIndex(suitCfg.rarity - 1);
-            if((suitCfg.rarity - 1) == 3)
-                _effectUIDic.Add(index, EffectUIPool.CreateEffectUI(listItem.m_holderBg, "ui_KP", "KP_Other_Gold_Frame"));
             RarityIconController.UpdateRarityIcon(listItem.m_rarity, suitId, false, true);
             listItem.target.data = suitId;
             UpdateSuitStatusView(listItem);
@@ -194,7 +196,7 @@ namespace GFGGame
             listItem.m_progBar.max = totalCount;
             listItem.m_progBar.value = count;
             bool haveSuit = DressUpMenuSuitDataManager.CheckHaveSuit(suitId);
-            listItem.m_unlockMask.visible = !haveSuit;
+            listItem.m_state.selectedIndex = (haveSuit ? 0 : 1);
             int status = DressUpMenuSuitDataManager.GetSuitGuideBonusStatus(suitId);
             RedDotController.Instance.SetComRedDot(listItem.m_loaderBonusBox.target, status == ConstBonusStatus.CAN_GET, "", -3, -1);
             if (status == ConstBonusStatus.CAN_GET)
@@ -205,6 +207,7 @@ namespace GFGGame
             {
                 listItem.m_loaderBonusBox.m_loaderBonusBox.url = "ui://FieldGuide/tujian_lw_2";
             }
+
             listItem.m_bg.onClick.Clear();
             listItem.m_bg.onClick.Add(() =>
             {

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -554,7 +554,7 @@ namespace GFGGame
                             _dressUpObj.AddOrRemove(headAniCfg.faceId, true);
                             //_dressUpObjUI.UpdateWrapper(_ui.m_dialogHead.m_compDressUp.m_holder);
                         }
-                        ShowSelfHeadImg();
+                        _ui.m_dialogHead.m_compDressUp.target.visible = true;
                     }
                     _ui.m_dialogHead.target.visible = true;
                     _wordTextField = _ui.m_dialogHead.m_txtContent;
@@ -658,7 +658,7 @@ namespace GFGGame
         private async void ShowSelfHeadImg()
         {
             _ui.m_dialogHead.m_compDressUp.target.visible = false;
-            await Task.Delay(10);
+            await Task.Delay(80);
             _ui.m_dialogHead.m_compDressUp.target.visible = true;
         }
 

+ 26 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/TypingFadeEffectPro.cs

@@ -4,6 +4,7 @@ using UnityEngine;
 using FairyGUI;
 using System;
 using System.Threading.Tasks;
+using System.Threading;
 
 namespace GFGGame
 {
@@ -20,6 +21,8 @@ namespace GFGGame
         protected float showNextWordInternal = 0.06f;
         // 字符渐变时间
         protected float charFadeDuration = 0.15f;
+        // 异步函数的取消控制
+        private CancellationTokenSource _cancellationTokenSource;
 
         /// <summary>
         /// 
@@ -50,6 +53,7 @@ namespace GFGGame
             _printIndex = 0;
             _vertIndex = 0;
             _started = true;
+            _cancellationTokenSource = new CancellationTokenSource();
 
             int vertCount = _textField.graphics.mesh.vertexCount;
 
@@ -166,6 +170,7 @@ namespace GFGGame
             if (!_started)
                 return;
 
+            StopMyAsyncFunction();
             _started = false;
             _textField.graphics.meshModifier -= OnMeshModified;
             _textField.graphics.SetMeshDirty();
@@ -202,6 +207,13 @@ namespace GFGGame
             int listCnt = charPositions.Count;
             float timer = 0;
 
+            //for(int i=0;i<= listCnt - 1; i++)
+            //{
+            //    PrintFade(i, 0, _vertIndex);
+            //    _vertIndex += charPositions[_printIndex].vertCount;
+            //}
+            //_vertIndex = 0;
+
             while (true)
             {
                 if (!_started)
@@ -218,7 +230,7 @@ namespace GFGGame
                     }
                     else
                     {
-                        UpdateFadeProgressSingle(_printIndex, _vertIndex);
+                        UpdateFadeProgressSingle(_printIndex, _vertIndex, _cancellationTokenSource.Token);
                         ++_printIndex;
                         if(_printIndex < listCnt - 1)
                         {
@@ -231,9 +243,10 @@ namespace GFGGame
             }
         }
 
-        async Task UpdateFadeProgressSingle(int printIndex, int vertIndex)
+        async Task UpdateFadeProgressSingle(int printIndex, int vertIndex, CancellationToken cancellationToken)
         {
             float _currentCharFadeTime = 0;
+
             while (true)
             {
                 if (!_started)
@@ -251,7 +264,7 @@ namespace GFGGame
                     byte alpha = (byte)(progress * 255);
                     PrintFade(printIndex, alpha, vertIndex);
                 }
-                await Task.Delay(16);
+                await Task.Delay(16, cancellationToken);
             }
         }
 
@@ -269,6 +282,16 @@ namespace GFGGame
             charFadeDuration = showNextWordInternal + 0.05f;
         }
 
+        // 取消异步函数
+        public void StopMyAsyncFunction()
+        {
+            if (_cancellationTokenSource != null)
+            {
+                _cancellationTokenSource.Cancel();
+                _cancellationTokenSource.Dispose();
+                _cancellationTokenSource = null;
+            }
+        }
     }
 
 }

BIN
GameClient/Assets/ResIn/UI/FieldGuide/FieldGuide_fui.bytes