Explorar el Código

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

zhaoyang hace 2 años
padre
commit
667a7b3303

+ 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()

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

@@ -4,6 +4,7 @@ using UI.Main;
 using System.Collections;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
+using System;
 
 namespace GFGGame
 {
@@ -36,6 +37,9 @@ namespace GFGGame
         private string _currentWords;
         private string _stroyStartID;
 
+        //屏幕效果中
+        private Action<object> _onScreenEffectComplete;
+
 
 
         public override void Dispose()
@@ -54,7 +58,7 @@ namespace GFGGame
             _arrow = null;
             _isShowLetters = false;
             SceneController.DestroyObjectFromView(_npcHead, _npcWrapper);
-
+            _onScreenEffectComplete = null;
             Timers.inst.Remove(UpdateLetters);
             if (_ui != null)
             {
@@ -177,7 +181,15 @@ namespace GFGGame
         private void OnClickBtnNext()
         {
             // StopAutoPlay();
-            ShowNextWords();
+            if(_onScreenEffectComplete != null)
+            {
+                Timers.inst.Remove(OnScreenEffectComplete);
+                _onScreenEffectComplete.Invoke(null);
+            }
+            else
+            {
+                ShowNextWords();
+            }
         }
 
         private void OnClickBtnLookBack()
@@ -285,6 +297,7 @@ namespace GFGGame
             {
                 //转换成秒
                 delay = delay / 1000f;
+                _onScreenEffectComplete = OnScreenEffectComplete;
                 Timers.inst.Add(delay, 1, OnScreenEffectComplete);
             }
             else
@@ -295,6 +308,7 @@ namespace GFGGame
 
         private void OnScreenEffectComplete(object param = null)
         {
+            _onScreenEffectComplete = null;
             if (_nextStepId == "0")
             {
                 Over();
@@ -367,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;
@@ -377,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;
@@ -399,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;
             }