Browse Source

修改好友界面显示bug
添加剧情打字机显示的判空

leiyasi 1 năm trước cách đây
mục cha
commit
0577163cb3

+ 19 - 9
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -2,6 +2,7 @@ using UnityEngine;
 using FairyGUI;
 using UI.Friend;
 using UI.CommonGame;
+using System.Collections;
 
 namespace GFGGame
 {
@@ -73,7 +74,7 @@ namespace GFGGame
             {
                 CustomSuitData customSuit = CustomSuitDataManager.GetSuitList(CustomSuitDataManager.currentIndex);
                 _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneFriend"));
-                _dressUpObj.setSceneObj(_sceneObject);
+                _dressUpObj.setSceneObj(_sceneObject, false,true,null,true, DressUpAction);
                 _dressUpObj.AddOrRemove(customSuit.dressUpData.bgId, true);
             }
             FriendDataManager.Instance.UpdateFriendList(true);
@@ -89,19 +90,19 @@ namespace GFGGame
                         {
                             _ui.m_list.selectedIndex = i;
                             _ui.m_list.ScrollToView(i);
-                            ReqFriendDetialInfo(i);
+                            ReqFriendDetailInfo(i);
                         }
                     }
                 }
                 else
                 {
                     _ui.m_list.selectedIndex = 0;
-                    ReqFriendDetialInfo(0);
+                    ReqFriendDetailInfo(0);
                 }
             }
             else
             {
-                ReqFriendDetialInfo(-1);
+                ReqFriendDetailInfo(-1);
             }
 
             RefreshView();
@@ -185,7 +186,7 @@ namespace GFGGame
         {
             GObject item = context.data as GObject;
             int index = (int)item.data;
-            ReqFriendDetialInfo(index);
+            ReqFriendDetailInfo(index);
         }
 
 
@@ -235,7 +236,7 @@ namespace GFGGame
             {
                 index = -1;//无好友
             }
-            ReqFriendDetialInfo(index);
+            ReqFriendDetailInfo(index);
             _ui.m_txtCount.text = string.Format("好友数:{0}/{1}", _ui.m_list.numItems, GlobalCfgArray.globalCfg.maxFriendCount);
         }
 
@@ -245,6 +246,7 @@ namespace GFGGame
             int selectedIndex = 0;
             if (_ui.m_list.numItems > 0)
             {
+                _ui.m_list.ScrollToView(_ui.m_list.selectedIndex);
                 int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
                 if (childIndex < 0) return;
                 GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;
@@ -253,12 +255,12 @@ namespace GFGGame
             }
             _ui.m_list.numItems = FriendDataManager.Instance.FriendDatas.Count;
             _ui.m_list.selectedIndex = selectedIndex;
-            ReqFriendDetialInfo(selectedIndex);
+            ReqFriendDetailInfo(selectedIndex);
 
             _ui.m_txtCount.text = string.Format("好友数:{0}/{1}", _ui.m_list.numItems, GlobalCfgArray.globalCfg.maxFriendCount);
         }
 
-        private async void ReqFriendDetialInfo(int index)
+        private async void ReqFriendDetailInfo(int index)
         {
             if (index >= 0)
             {
@@ -278,6 +280,9 @@ namespace GFGGame
         }
         private void UpdateScene(CustomSuitData suitSavedData)
         {
+            Transform transform = _sceneObject.transform.Find("Role");
+            transform.localScale = Vector3.zero;
+
             if (suitSavedData != null)
             {
                 _dressUpObj.PutOnDressUpData(suitSavedData.dressUpData);
@@ -286,11 +291,16 @@ namespace GFGGame
             {
                 _dressUpObj.PutOnDefaultDressUpData();
             }
+            //transform.localPosition = new Vector3(-2, transform.localPosition.y, 0);
+        }
+
+        private void DressUpAction()
+        {
             Transform transform = _sceneObject.transform.Find("Role");
             transform.localPosition = new Vector3(-2, transform.localPosition.y, 0);
+            transform.localScale = Vector3.one;
         }
 
-
         private void OnBtnInfoClick()
         {
             if (_friendRoleId == 0)

+ 11 - 8
GameClient/Assets/Game/HotUpdate/Views/MainStory/TypingFadeEffectPro.cs

@@ -202,12 +202,6 @@ namespace GFGGame
             int listCnt = charPositions.Count;
             float timer = 0;
 
-            //for(int i = 0; i < listCnt - 1; i++)
-            //{
-            //    PrintFade(i, 0, charPositions[i].vertCount);
-            //    yield return new WaitForEndOfFrame();
-            //}
-
             while (true)
             {
                 if (!_started)
@@ -226,12 +220,21 @@ namespace GFGGame
                     {
                         UpdateFadeProgressSingle(_printIndex, _vertIndex);
                         ++_printIndex;
-                        _vertIndex += charPositions[_printIndex].vertCount;
+                        if(_printIndex == listCnt - 1)
+                        {
+                            Cancel();
+                            typeFinishedAction.Invoke();
+                            break;
+                        }
+                        else
+                        {
+                            _vertIndex += charPositions[_printIndex].vertCount;
+                        }
+                        
                     }
                 }
                 timer += Time.deltaTime;
                 yield return new WaitForEndOfFrame();
-                //yield return new WaitForSeconds(progressShowNextWord);
             }
         }