Browse Source

剧情头像添加动画

zhaoyang 3 years ago
parent
commit
c396ed13fe

+ 1 - 0
FGUIProject/assets/Main/componentsDialog/Component1.xml

@@ -2,5 +2,6 @@
 <component size="290,408">
   <displayList>
     <loader id="n14_nmnb" name="head" xy="0,0" pivot="0.5,0" size="290,408" aspect="true" scale="-1,1" url="ui://mfvz4q8kndrd7i" align="center"/>
+    <graph id="n15_94m1" name="holder" xy="144,203" size="1,1" scale="-1,1" touchable="false"/>
   </displayList>
 </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_Component1.cs

@@ -8,6 +8,7 @@ namespace UI.Main
     {
         public GComponent target;
         public GLoader m_head;
+        public GGraph m_holder;
         public const string URL = "ui://mfvz4q8kndrd7j";
         public const string PACKAGE_NAME = "Main";
         public const string RES_NAME = "Component1";
@@ -56,10 +57,12 @@ namespace UI.Main
         private void Init(GComponent comp)
         {
             m_head = (GLoader)comp.GetChild("head");
+            m_holder = (GGraph)comp.GetChild("holder");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_head = null;
+            m_holder = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

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

@@ -15,6 +15,8 @@ namespace GFGGame
         private UI_CompArrow _arrow;
         private GameObject _sceneObject;
         private GameObject _scenePrefab;
+        private GameObject _npcHead;
+        private GoWrapper _npcWrapper;
         private GTextField _wordTextField;
         //žçÇéÍęłÉťŘľ÷
         private OnCompleteStoryDialogCall _onCompleteStoryDialogCall;
@@ -46,7 +48,10 @@ namespace GFGGame
             _wordTextField = null;
             _arrow = null;
             _isShowLetters = false;
+            SceneController.DestroyObjectFromView(_npcHead);
+
             Timers.inst.Remove(UpdateLetters);
+
         }
 
         protected override void Init()
@@ -310,6 +315,7 @@ namespace GFGGame
             string words = content;
             string roleName = storyDialogCfg.name;
             string headRes = storyDialogCfg.head;
+            string headAniRes = storyDialogCfg.headAni;
             if (roleName == "self")
             {
                 roleName = RoleDataManager.roleName;
@@ -319,12 +325,29 @@ namespace GFGGame
             {
                 _dialogListLookBack.Add("[color=#FDA2B1]" + roleName + "[/color]");
             }
-            if (!string.IsNullOrEmpty(headRes))
+            if (!string.IsNullOrEmpty(headAniRes))
             {
                 _ui.m_dialogText.target.visible = false;
                 _ui.m_dialogName.target.visible = false;
                 _ui.m_dialogHead.target.visible = true;
                 _ui.m_dialogHead.m_txtName.text = roleName;
+                _ui.m_dialogHead.m_comphead.m_head.visible = false;
+                _ui.m_dialogHead.m_comphead.m_holder.visible = true;
+                string resPath = ResPathUtil.GetViewEffectPath("ui_nzbq", headAniRes);
+                SceneController.AddObjectToView(_npcHead, _npcWrapper, _ui.m_dialogHead.m_comphead.m_holder, resPath, out _npcHead, out _npcWrapper);
+                _npcHead.transform.localScale = new Vector3(-100, 100, 100);
+                _wordTextField = _ui.m_dialogHead.m_txtContent;
+                _arrow = _ui.m_dialogHead.m_iconNext;
+            }
+            else if (!string.IsNullOrEmpty(headRes))
+            {
+                _ui.m_dialogText.target.visible = false;
+                _ui.m_dialogName.target.visible = false;
+                _ui.m_dialogHead.target.visible = true;
+                _ui.m_dialogHead.m_txtName.text = roleName;
+                _ui.m_dialogHead.m_comphead.m_head.visible = true;
+                _ui.m_dialogHead.m_comphead.m_holder.visible = false;
+
                 _ui.m_dialogHead.m_comphead.m_head.url = ResPathUtil.GetNpcHeadPath(headRes);
                 _wordTextField = _ui.m_dialogHead.m_txtContent;
                 _arrow = _ui.m_dialogHead.m_iconNext;

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes