Просмотр исходного кода

对话框左下角人物 和 聊天男主角 问题

HDY 4 месяцев назад
Родитель
Сommit
74b9fd7a69

+ 12 - 2
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -12,6 +12,8 @@ namespace GFGGame
 {
     public class SceneController
     {
+        private static GameObject currentAnimObj;  //保存obj
+
         public static void UpdateMainScene(GameObject sceneObj)
         {
             //背景0
@@ -262,11 +264,9 @@ namespace GFGGame
             else
             {
                 // 使用局部变量捕获当前animObj的值
-                GameObject currentAnimObj = animObj;
                 value = string.Format("DressUp/{0}", value);
                 string res = value.Split('/')[1];
                 string path = ResPathUtil.GetStoryDialogCGPath(value, res);
-
                 PrefabManager.Instance.InstantiateAsync(
                     path,
                     (go) =>
@@ -279,6 +279,7 @@ namespace GFGGame
                         if (go != null)
                         {
                             animObj = go;
+                            currentAnimObj = animObj;
                             animObj.transform.position = new Vector3(0, -9, 0);
                             animObj.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f);
                         }
@@ -292,6 +293,15 @@ namespace GFGGame
             }
         }
 
+        public static void DeleteAnimObj()
+        {
+            if (currentAnimObj != null)
+            {
+                PrefabManager.Instance.Restore(currentAnimObj);
+                currentAnimObj = null;
+            }
+        }
+
         public static void UpdateEmojiAni(string value, ref GameObject animObj)
         {
             if (value == "0")

+ 3 - 0
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -60,6 +60,9 @@ namespace GFGGame
         //提示过的版本不再提示
         public static string promotedVersion;
 
+        public static bool ShowPainting = true;
+
+
         public static void Init()
         {
             cfgName = LauncherConfig.cfgName + "_in";

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

@@ -77,6 +77,8 @@ namespace GFGGame
                 _animObject = null;
             }
 
+            SceneController.DeleteAnimObj();
+
             _wordTextField = null;
             _arrow = null;
             _isShowLetters = false;
@@ -256,6 +258,8 @@ namespace GFGGame
                 _animObject = null;
             }
 
+            SceneController.DeleteAnimObj();
+
             EffectUIPool.Recycle(_effect);
             _effect = null;
 
@@ -692,11 +696,13 @@ namespace GFGGame
                             }
                         }
 
-                        if (headAniCfg != null && headAniCfg.FaceId > 0)
-                        {
-                            //表情
-                            _dressUpObj.AddOrRemove(headAniCfg.FaceId, true);
-                            Timers.inst.Add(0.1f, 1, OnTimerUpDate, storyDialogCfg);
+                        if (!GameGlobal.ShowPainting) { 
+                            if (headAniCfg != null && headAniCfg.FaceId > 0)
+                            {
+                                //表情
+                                _dressUpObj.AddOrRemove(headAniCfg.FaceId, true);
+                                Timers.inst.Add(0.1f, 1, OnTimerUpDate, storyDialogCfg);
+                            }
                         }
                         _ui.m_dialogHead.m_compDressUp.target.visible = true ;
                     }
@@ -950,7 +956,7 @@ namespace GFGGame
         {
             if (EmojiRes.Length > 0 && !IsTeaParty)
             {
-                SceneController.UpdateEmojiAni(EmojiRes, ref  _animObject);
+                SceneController.UpdateEmojiAni(EmojiRes,  _animObject);
             }
         }