Переглянути джерело

提交立绘切换时 脸自动消失

leiyasi 1 рік тому
батько
коміт
a92ce477bb

+ 10 - 0
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -102,6 +102,7 @@ namespace GFGGame
             }
         }
 
+        public static string _lastDialogPic;
         public static async void UpdateDialogPic(string value, GameObject sceneObj)
         {
             StoryDialogDataManager.Instance.waitPicFade = false;
@@ -110,6 +111,14 @@ namespace GFGGame
 
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
             SpriteRenderer sprFace = face.GetComponent<SpriteRenderer>();
+
+            // 立绘切换 脸消失
+            if(_lastDialogPic != value)
+            {
+                SpriteHelper.RemoveSpriteFrom(sprFace);
+            }
+            _lastDialogPic = value;
+
             if (value == "0")
             {
                 SpriteHelper.RemoveSpriteFrom(spr);
@@ -151,6 +160,7 @@ namespace GFGGame
                     StoryDialogDataManager.Instance.waitPicFade = false;
                 }
             }
+
         }
 
         public static void UpdateDialogAnim(string value, ref GameObject animObj)

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

@@ -797,15 +797,15 @@ namespace GFGGame
                 return;
             }
 
-            if(faceValue.Length > 0)
-            {
-                SceneController.InitPicFace(faceValue, _sceneObject);
-
-            }
             if (value.Length > 0)
             {
                 SceneController.UpdateDialogPic(value, _sceneObject);
             }
+
+            if (faceValue.Length > 0)
+            {
+                SceneController.InitPicFace(faceValue, _sceneObject);
+            }
         }
 
         private void UpdateAnim(string value)