Browse Source

剧情对话人物显示修改

HDY 4 tháng trước cách đây
mục cha
commit
f53ed20009

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

@@ -229,6 +229,7 @@ namespace GFGGame
             base.OnHide();
             _work = false;
 
+            Timers.inst.Remove(OnTimerUpDate);
             Timers.inst.Remove(UpdateShake);
             Timers.inst.Remove(OnScreenEffectComplete);
             Timers.inst.Remove(OnWait);
@@ -556,6 +557,30 @@ namespace GFGGame
             _ui.m_list.visible = false;
         }
 
+
+        private void OnTimerUpDate(object param = null)
+        {
+            StoryDialogCfg storyDialogCfg = (StoryDialogCfg)param;
+            string headAniRes = storyDialogCfg.HeadAni;
+            var headAniCfg = CommonDataManager.Tables.TblHeadAniCfg.GetOrDefault(headAniRes);
+            if (storyDialogCfg.SuitId > 0)
+            {
+                _dressUpObj.PutOnSuitCfg(storyDialogCfg.SuitId, false,
+                    new int[] { ConstDressUpItemType.SHOU_CHI_WU }, false, false);
+            }
+            else
+            {
+                _dressUpObj.PutOnDressUpData(CustomSuitDataManager.GetCurrentSuitData().dressUpData,
+                    new int[] { ConstDressUpItemType.SHOU_CHI_WU });
+                if (_dressUpObj.actionId > 0)
+                {
+                    _dressUpObj.CancelAction(true, new int[] { ConstDressUpItemType.SHOU_CHI_WU });
+                }
+            }
+
+            _dressUpObj.AddOrRemove(headAniCfg.FaceId, true);
+        }
+
         /// <summary>
         /// 初始化对话框/语音/CG等
         /// </summary>
@@ -664,9 +689,9 @@ namespace GFGGame
                         {
                             //表情
                             _dressUpObj.AddOrRemove(headAniCfg.FaceId, true);
+                            Timers.inst.Add(0.01f, 1, OnTimerUpDate, storyDialogCfg);
                         }
-
-                        _ui.m_dialogHead.m_compDressUp.target.visible = true;
+                        _ui.m_dialogHead.m_compDressUp.target.visible = true ;
                     }
 
                     _ui.m_dialogHead.target.visible = true;
@@ -1221,7 +1246,6 @@ namespace GFGGame
                                     RawImage rawImage = _selfHeadImgObj.transform.Find("mask/RawImage")
                                         .GetComponent<RawImage>();
                                     rawImage.texture = renderTexure;
-
                                     // 将RawImg放在FGUI上
                                     GoWrapper goWrapper = new GoWrapper(_selfHeadImgObj);
                                     _ui.m_dialogHead.m_compDressUp.m_holder.SetNativeObject(goWrapper);