Browse Source

剧情对话支持半身像显示指定套装

guodong 2 years ago
parent
commit
52c5f3719a

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Controller/ScreenBlackController.cs

@@ -48,7 +48,7 @@ namespace GFGGame
             _gGraph.alpha = 0;
             _gTween = _gGraph.TweenFade(1, fadeDuration);
             _gTween.OnComplete(OnFadeInComplete);
-            _gTween.OnUpdate(() => { Debug.LogFormat("alpha{0}", _gGraph.alpha); });
+            //_gTween.OnUpdate(() => { Debug.LogFormat("alpha{0}", _gGraph.alpha); });
         }
 
         public void HideBlack()

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

@@ -381,9 +381,9 @@ namespace GFGGame
             {
                 _dialogListLookBack.Add("[color=#FDA2B1]" + roleName + "[/color]");
             }
-            if (!string.IsNullOrEmpty(headAniRes))
+            if (!string.IsNullOrEmpty(headAniRes) || storyDialogCfg.suitId > 0)
             {
-                var headAniCfg = HeadAniCfgArray.Instance.GetCfg(headAniRes);
+                //显示对话框半身像
                 _ui.m_dialogText.target.visible = false;
                 _ui.m_dialogName.target.visible = false;
                 _ui.m_dialogHead.target.visible = true;
@@ -391,21 +391,8 @@ namespace GFGGame
                 _ui.m_dialogHead.m_comphead.m_head.visible = false;
                 _ui.m_dialogHead.m_comphead.m_holder.visible = true;
 
-                if (headAniCfg.faceId > 0)
-                {
-                    //换装表情
-                    _ui.m_dialogHead.m_compDressUp.target.visible = true;
-                    _ui.m_dialogHead.m_comphead.target.visible = false;
-                    _dressUpObjUI.ResetSceneObj(80, true, false, null, false);
-                    _dressUpObjUI.dressUpObj.PutOnDressUpData(CustomSuitDataManager.GetCurrentSuitData().dressUpData);
-                    if (_dressUpObjUI.dressUpObj.actionId > 0)
-                    {
-                        _dressUpObjUI.dressUpObj.CancelAction(true);
-                    }
-                    _dressUpObjUI.dressUpObj.AddOrRemove(headAniCfg.faceId, false);
-                    _dressUpObjUI.UpdateWrapper(_ui.m_dialogHead.m_compDressUp.m_holder);
-                }
-                else
+                var headAniCfg = HeadAniCfgArray.Instance.GetCfg(headAniRes);
+                if(headAniCfg != null && !string.IsNullOrEmpty(headAniCfg.headAni))
                 {
                     //独立动画
                     _ui.m_dialogHead.m_compDressUp.target.visible = false;
@@ -413,7 +400,31 @@ namespace GFGGame
                     string resPath = ResPathUtil.GetViewEffectPath("ui_nzbq", headAniCfg.headAni);
                     SceneController.AddObjectToView(null, _npcWrapper, _ui.m_dialogHead.m_comphead.m_holder, resPath, out _npcHead, out _npcWrapper);
                 }
-
+                else
+                {
+                    //换装
+                    _ui.m_dialogHead.m_compDressUp.target.visible = true;
+                    _ui.m_dialogHead.m_comphead.target.visible = false;
+                    _dressUpObjUI.ResetSceneObj(80, true, false, null, false);
+                    if(storyDialogCfg.suitId > 0)
+                    {
+                        _dressUpObjUI.dressUpObj.PutOnSuitCfg(storyDialogCfg.suitId, false, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
+                    }
+                    else
+                    {
+                        _dressUpObjUI.dressUpObj.PutOnDressUpData(CustomSuitDataManager.GetCurrentSuitData().dressUpData);
+                        if (_dressUpObjUI.dressUpObj.actionId > 0)
+                        {
+                            _dressUpObjUI.dressUpObj.CancelAction(true);
+                        }
+                    }
+                    if (headAniCfg != null && headAniCfg.faceId > 0)
+                    {
+                        //表情
+                        _dressUpObjUI.dressUpObj.AddOrRemove(headAniCfg.faceId, false);
+                        _dressUpObjUI.UpdateWrapper(_ui.m_dialogHead.m_compDressUp.m_holder);
+                    }
+                }
                 _wordTextField = _ui.m_dialogHead.m_txtContent;
                 _arrow = _ui.m_dialogHead.m_iconNext;
             }