LiuQilin 7 年之前
父节点
当前提交
30c0bff727

+ 0 - 1
Assets/Script/Label/ResourceLabel.cs

@@ -41,7 +41,6 @@ public class ResourceLabel
     public static string Firework = "Firework";
     public static string AchieveItem = "AchieveItem";
     public static string SkillItem = "SkillItem";
-    public static string ShowComment = "ShowComment"; 
     public static string CommentItem = "CommentItem";
     public static string RankItem = "RankItem";
     public static string HudText = "HudText";

+ 1 - 1
Assets/Script/Manage/FashionShowHttp/CommentShowHttp.cs

@@ -35,7 +35,7 @@ public class CommentShowHttp
 
     private static void Callback(JsonData data)
     {
-        Debug.Log(data.ToJson());
+        //Debug.Log(data.ToJson());
         int errorCode = (int)data["error"];
         if (errorCode == 0)
         {

+ 3 - 1
Assets/Script/Manage/FashionShowHttp/ShowCommentsHttp.cs

@@ -53,7 +53,7 @@ public class ShowCommentsHttp
         Get(0, 46, null, null);
     }
 
-    public static void Get(int page, int showId, Action<object> succeedCallback, Action failedCallback)
+    public static ShowCommentsHttp Get(int page, int showId, Action<object> succeedCallback, Action failedCallback)
     {
         ShowCommentsHttp http = new ShowCommentsHttp();
 
@@ -69,5 +69,7 @@ public class ShowCommentsHttp
 
         //URLRequest.CreateStrURLRequest(true, HttpManager.GetShowCommentListURL, requestData,
         //    http.Callback, URLRequest.Method.POST);
+
+        return http;
     }
 }

+ 1 - 1
Assets/Script/Manage/HttpManager.cs

@@ -187,7 +187,7 @@ public class HttpManager : Regist
 
     public void Awake()
     {
-        ShowCommentsHttp.Test();
+        //ShowCommentsHttp.Test();
         //DeleteShowHttp.Delete(1709207727231988804, 17, null, null);
 
         //URLRequestData urlData = new URLRequestData();

+ 20 - 3
Assets/Script/Manage/ResourceManager.cs

@@ -288,9 +288,16 @@ public class ResourceManager : Regist
         
         if (ObjectPool.TryGetValue(objType, out traList))
         {
-            if (traList.Count > 0)
+            for (int i = 0; i < traList.Count; i++)
             {
-                Transform tra = traList[0];
+                Transform tra = traList[i];
+
+                if (tra == null)
+                {
+                    traList.RemoveAt(i);
+                    i--;
+                    continue;
+                }
 
                 tra.SetActive(true);
 
@@ -298,6 +305,16 @@ public class ResourceManager : Regist
 
                 return tra.transform;
             }
+            //if (traList.Count > 0)
+            //{
+            //    Transform tra = traList[0];
+
+            //    tra.SetActive(true);
+
+            //    traList.RemoveAt(0);
+
+            //    return tra.transform;
+            //}
         }
 
         return null;
@@ -793,7 +810,7 @@ public class ResourceManager : Regist
 
     public static ShowComment GetShowComment(ShowCommentData data)
     {
-        Transform tra = Get(ResourceLabel.ShowComment, Folder.UI, false, Get(CanvasLabel.Ph_Grid), false, 
+        Transform tra = Get(ResourceLabel.CommentItem, Folder.UI, false, Get(CanvasLabel.Ph_Grid), false, 
             ObjType.ShowComment, typeof(ShowComment));
 
         ShowComment comment = tra.GetComponent<ShowComment>();

+ 2 - 1
Assets/Script/Object/Comment/BaseComment.cs

@@ -83,7 +83,8 @@ public class BaseComment : Regist
         {
             OnHaveNewMessage(accountData.SerialNumber);
         }
-
+        //Debug.Log(accountData.SerialNumber);
+        //Debug.Log(HttpManager.SerialNumber);
         if (accountData.SerialNumber == HttpManager.SerialNumber)
         {
             VisitButton.SetActive(false);

+ 19 - 2
Assets/Script/Object/Comment/ShowComment.cs

@@ -14,7 +14,7 @@ public class ShowCommentData
     {
         id = (int) data["id"];
         content = (string) data["content"];
-        long playerId = (long) data["user_id"];
+        long playerId = long.Parse((string) data["user_id"]);
         string nickname = (string) data["nickname"];
         accountData = new AccountData(nickname, playerId.ToString());
     }
@@ -22,5 +22,22 @@ public class ShowCommentData
 
 public class ShowComment : BaseComment
 {
-    
+    public override void Visit()
+    {
+        FashionShowCommentPanel.HidePanel();
+        FashionShowEditPage.HidePanel();
+        FashionShowEditPage.HidePanel();
+        DelayCall.Call(1f, () =>
+        {
+            //FashionShowHomePage.HideSidePanel();
+            FashionShowHomePage.HidePanel();
+        });
+        //TweenVec tweenVec = FashionShowEditPage.Panel.GetTweenVec();
+        //tweenVec.AddEventOnetime(EventType.BackwardFinish, () =>
+        //{
+        //    FashionShowHomePage.HideSidePanel();
+        //    FashionShowHomePage.HidePanel();
+        //});
+        base.Visit();
+    }
 }

+ 33 - 89
Assets/Script/Object/Player.cs

@@ -1578,6 +1578,39 @@ public class Player : Regist , IPointerClickHandler
 
     public void ResetDepth()
     {
+        UAC.transform.SetLZ(0.7f);
+        SetSlotLocalZ(WingSlot, 0.00003f);
+        SetSlotLocalZ(EyeSlot, -0.00001f);
+        SetSlotLocalZ(TopSlot, -0.00003f);
+        SetSlotLocalZ(MouseSlot, -0.00001f);
+        SetSlotLocalZ(HeadWearSlot, -0.00001f);
+        SetSlotLocalZ(LeftShoeSlot, -0.00001f);
+        SetSlotLocalZ(RightShoeSlot, -0.00001f);
+        SetSlotLocalZ(LeftLegSlot, 0);
+        SetSlotLocalZ(RightLegSlot, 0);
+        SetSlotLocalZ(NeckSlot, 0.00001f);
+        SetSlotLocalZ(LeftHandSlot, -0.00001f);
+        SetSlotLocalZ(RightHandSlot, -0.00001f);
+        SetSlotLocalZ(LeftShortSleeveSlot, -0.000015f);
+        SetSlotLocalZ(RightShortSleeveSlot, -0.000015f);
+
+        SetSlotLocalZ(HeadSlot, 0);
+        if (HeadSlot.UnityTransform != null && HeadSlot.UnityTransform.childCount > 1)
+        {
+            HeadSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
+            HeadSlot.UnityTransform.GetChild(1).SetLZ(0f);
+        }
+
+        SetSlotLocalZ(DressSlot, -0.00002f);
+        if (DressSlot.UnityTransform != null && DressSlot.UnityTransform.childCount > 1)
+        {
+            DressSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
+            DressSlot.UnityTransform.GetChild(1).SetLZ(0f);
+        }
+
+        LeftLongSleeveUAC.transform.SetLZ(-0.000015f);
+        RightLongSleeveUAC.transform.SetLZ(-0.000015f);
+
         if (IsDisplayInUGUI)
         {
             SetSlotAsFirstChild(TopSlot);
@@ -1599,95 +1632,6 @@ public class Player : Regist , IPointerClickHandler
             SetSlotAsFirstChild(NeckSlot);
             SetSlotAsFirstChild(WingSlot);
         }
-        else
-        {
-            //UAC.transform.SetLZ(2.5f);
-            UAC.transform.SetLZ(0.7f);
-            SetSlotLocalZ(WingSlot, 0.00003f);
-            SetSlotLocalZ(EyeSlot, -0.00001f);
-            SetSlotLocalZ(TopSlot, -0.00003f);
-            SetSlotLocalZ(MouseSlot, -0.00001f);
-            SetSlotLocalZ(HeadWearSlot, -0.00001f);
-            SetSlotLocalZ(LeftShoeSlot, -0.00001f);
-            SetSlotLocalZ(RightShoeSlot, -0.00001f);
-            SetSlotLocalZ(LeftLegSlot, 0);
-            SetSlotLocalZ(RightLegSlot, 0);
-            SetSlotLocalZ(NeckSlot, 0.00001f);
-            SetSlotLocalZ(LeftHandSlot, -0.00001f);
-            SetSlotLocalZ(RightHandSlot, -0.00001f);
-            SetSlotLocalZ(LeftShortSleeveSlot, -0.000015f);
-            SetSlotLocalZ(RightShortSleeveSlot, -0.000015f);
-
-            SetSlotLocalZ(HeadSlot, 0);
-            if (HeadSlot.UnityTransform != null && HeadSlot.UnityTransform.childCount > 1)
-            {
-                HeadSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
-                HeadSlot.UnityTransform.GetChild(1).SetLZ(0f);
-            }
-
-            SetSlotLocalZ(DressSlot, -0.00002f);
-            if (DressSlot.UnityTransform != null && DressSlot.UnityTransform.childCount > 1)
-            {
-                DressSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
-                DressSlot.UnityTransform.GetChild(1).SetLZ(0f);
-            }
-
-            LeftLongSleeveUAC.transform.SetLZ(-0.000015f);
-            RightLongSleeveUAC.transform.SetLZ(-0.000015f);
-
-            //UAC.transform.SetLZ(2.5f);
-
-            //WingSlot.UnityTransform.SetLZ(0);
-            //EyeSlot.UnityTransform.SetLZ(0);
-            //TopSlot.UnityTransform.SetLZ(0);
-            //MouseSlot.UnityTransform.SetLZ(0);
-            //HeadWearSlot.UnityTransform.SetLZ(0);
-            //LeftShoeSlot.UnityTransform.SetLZ(0);
-            //RightShoeSlot.UnityTransform.SetLZ(0);
-            //LeftLegSlot.UnityTransform.SetLZ(0);
-            //RightLegSlot.UnityTransform.SetLZ(0);
-            //NeckSlot.UnityTransform.SetLZ(0);
-            //LeftHandSlot.UnityTransform.SetLZ(0);
-            //RightHandSlot.UnityTransform.SetLZ(0);
-            //LeftShortSleeveSlot.UnityTransform.SetLZ(0);
-            //RightShortSleeveSlot.UnityTransform.SetLZ(0);
-
-            //WingSlot.SetLZ(0.00003f);
-            //EyeSlot.SetLZ(-0.00001f);
-            //TopSlot.SetLZ(-0.00003f);
-            //MouseSlot.SetLZ(-0.00001f);
-            //HeadWearSlot.SetLZ(-0.00001f);
-
-            //HeadSlot.UnityTransform.SetLZ(0);
-            //if (HeadSlot.UnityTransform.childCount > 1)
-            //{
-            //    HeadSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
-            //    HeadSlot.UnityTransform.GetChild(1).SetLZ(0f);
-            //}
-
-            //DressSlot.UnityTransform.SetLZ(-0.00002f);
-
-            //if (DressSlot.UnityTransform.childCount > 1)
-            //{
-            //    DressSlot.UnityTransform.GetChild(0).SetLZ(0.00002f);
-            //    DressSlot.UnityTransform.GetChild(1).SetLZ(0f);
-            //}
-
-            //LeftShoeSlot.SetLZ(-0.00001f);
-            //RightShoeSlot.SetLZ(-0.00001f);
-
-            //LeftLegSlot.SetLZ(0);
-            //RightLegSlot.SetLZ(0);
-            //NeckSlot.SetLZ(0.00001f);
-            //LeftHandSlot.SetLZ(-0.00001f);
-            //RightHandSlot.SetLZ(-0.00001f);
-
-            //LeftShortSleeveSlot.SetLZ(-0.000015f);
-            //RightShortSleeveSlot.SetLZ(-0.000015f);
-
-            //LeftLongSleeveUAC.transform.SetLZ(-0.000015f);
-            //RightLongSleeveUAC.transform.SetLZ(-0.000015f);
-        }
     }
 
     private void SetSlotLocalZ(DragonBones.Slot slot, float z)

+ 6 - 3
Assets/Script/Social/FashionShowCloseBox.cs

@@ -28,7 +28,7 @@ public class FashionShowCloseCell
         DisplayButton.onClick.AddListener(OnDisplayButtonClick);
     }
 
-    public void Init(float scale, GetFashionShowData data)
+    public void Init(float uiScale, Vector3 playerScale, GetFashionShowData data)
     {
         FashionShowData = data;
         RefreshPraiseButton();
@@ -38,12 +38,13 @@ public class FashionShowCloseCell
         Player.transform.SetParent(DisplayButton.transform);
         Player.transform.SetSiblingIndex(1);
         Player.transform.localPosition = Vector3.zero;
+        Player.transform.localScale = playerScale;
         foreach (var closeID in data.GetCloseIds())
         {
             CloseItem closeItem = PlayerManager.CloseItemDictionary[closeID];
             closeItem.ChangeDress(Player, false);
         }
-        DelayCall.Call(1, ()=> { Player.DisplayInUI(scale); Player.ResetDepth(); });
+        DelayCall.Call(1, ()=> { Player.DisplayInUI(uiScale); Player.ResetDepth(); });
     }
 
     public void Save()
@@ -176,8 +177,10 @@ public class FashionShowCloseBox : VirtualScrollRectItem
     public void SetNextCell(GetFashionShowData data)
     {
         float scale = UnusedCells.Count == 5 ? 37.5f : 17.5f;
+        Vector3 playerScale = UnusedCells.Count == 5 ? new Vector3(0.8442904f, 0.8442904f, 0.8442904f) : 
+            new Vector3(1.763814f, 1.763814f, 1.763814f); 
         FashionShowCloseCell cell = UnusedCells.Forward(0, true);
-        cell.Init(scale, data);
+        cell.Init(scale, playerScale, data);
     }
 
     public void reset()

+ 105 - 18
Assets/Script/Social/FashionShowCommentPanel.cs

@@ -8,22 +8,26 @@ public class FashionShowCommentPanel : Regist
 {
     #region Config
 
-    //StartMark-Used by LabelUtility-Do not remove
     private static Text NicknameTitle;
     private static Text ContentTitle;
     private static Text Title;
     private static Text CloseButtonText;
     private static Text SendCommentButtonText;
     private static Text Placeholder;
-    //private static Text PlaceholderText;
-    //private static Text Tip;
     private static Button CloseButton;
     private static Button SendCommentButton;
-    //EndMark-Used by LabelUtility-Do not remove
-
     private static Transform Mask;
+    private static InputField commentInputField;
     private static VirtualScrollRectPlus VirtualScrollRectPlus;
 
+    private static int currentCommentPage;
+    private static int currentCommentIndex;
+    private static bool requesting;
+    private static ShowCommentsHttp commentDataHttp;
+    private static GetFashionShowData showData;
+    private static List<ShowCommentData> commentDatas = new List<ShowCommentData>();
+    private static List<ShowComment> commentItems = new List<ShowComment>();
+
     #endregion
 
     public override void RegistReference()
@@ -36,12 +40,10 @@ public class FashionShowCommentPanel : Regist
         CloseButtonText = ResourceManager.Get<Text>(CanvasLabel.Ph_CloseButtonText);
         SendCommentButtonText = ResourceManager.Get<Text>(CanvasLabel.Ph_SendCommentButtonText);
         Placeholder = ResourceManager.Get<Text>(CanvasLabel.Ph_Placeholder);
-        //PlaceholderText = ResourceManager.Get<Text>(CanvasLabel.Ph_PlaceholderText);
-        //Tip = ResourceManager.Get<Text>(CanvasLabel.Ph_Tip);
         CloseButton = ResourceManager.Get<Button>(CanvasLabel.Ph_CloseButton);
         SendCommentButton = ResourceManager.Get<Button>(CanvasLabel.Ph_SendCommentButton);
-
         Mask = ResourceManager.Get(CanvasLabel.Ph_CommentMask);
+        commentInputField = ResourceManager.Get<InputField>(CanvasLabel.Ph_InputField);
         VirtualScrollRectPlus = ResourceManager.Get<VirtualScrollRectPlus>(CanvasLabel.Ph_ScrollRect);
 
         LanguageManager.Add(Title, new MulLanStr(LanguageLabel.UI__Ph_Tit));
@@ -52,20 +54,36 @@ public class FashionShowCommentPanel : Regist
         LanguageManager.Add(Placeholder, new MulLanStr(LanguageLabel.UI__Ph_Placeholder));
 
         Mask.CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
-        VirtualScrollRectPlus.OnSaveItem += OnSaveItem;
-        VirtualScrollRectPlus.OnGetNextItem += OnGetNextItem;
-        VirtualScrollRectPlus.OnGetPreviousItem += OnGetPreviousItem;
 
+        VirtualScrollRectPlus.Init(1, 1000000);
+        VirtualScrollRectPlus.OnGetNextItem += OnGetNextItem;
         CloseButton.onClick.AddListener(OnCloseButtonClick);
         SendCommentButton.onClick.AddListener(OnSendCommentButtonClick);
     }
 
 
-    public static void ShowPanel()
+    public static void ShowPanel(GetFashionShowData data)
     {
+        ResetPanel(data);
         Mask.TweenForCG();
     }
 
+    private static void ResetPanel(GetFashionShowData data)
+    {
+        showData = data;
+        requesting = false;
+        currentCommentPage = 0;
+        currentCommentIndex = 0;
+        commentDatas = new List<ShowCommentData>();
+        foreach (var commentItem in commentItems)
+        {
+            DestroyImmediate(commentItem.gameObject);
+        }
+        commentItems = new List<ShowComment>();
+        commentInputField.text = "";
+        OnGetNextItem(0);
+    }
+
     public static void HidePanel()
     {
         Mask.TweenBacCG();
@@ -74,29 +92,98 @@ public class FashionShowCommentPanel : Regist
 
     private static void OnCloseButtonClick()
     {
+        if (commentDataHttp != null)
+        {
+            commentDataHttp.disable = true;
+        }
         AudioManager.PlayClip(ResourceLabel.CloseClip);
         HidePanel();
     }
 
+
+    private static VirtualScrollRectItem OnGetNextItem(int index)
+    {
+        if (commentDatas.Count > currentCommentIndex)
+        {
+            ShowCommentData data = commentDatas[currentCommentIndex];
+            ShowComment item = ResourceManager.GetShowComment(data);
+            commentItems.Add(item);
+            currentCommentIndex++;
+            return null;
+        }
+        else
+        {
+            GetCommentData();
+            return null;
+        }
+    }
+
+
     private static void OnSendCommentButtonClick()
     {
         AudioManager.PlayClip(ResourceLabel.BtnClip);
+        SendComment();
+    }
 
+    private static void SendComment()
+    {
+        string comment = commentInputField.text;
+        if (StringFilter.ContainSensitiveWord(comment))
+        {
+            Bubble.Show(null, Language.GetStr(LanguageLabel.Common__ContainSensitiveWord));
+            return;
+        }
+        SendCommentButton.interactable = false;
+        long playerId = HttpManager.GetPlayerId();
+        CommentShowHttp.Comment(playerId, showData.showId, comment, 
+            OnSendCommentSuccees, OnSendCommentFail);
     }
 
+    private static void OnSendCommentSuccees()
+    {
+        commentInputField.text = "";
+        SendCommentButton.interactable = true;
+        ResetPanel(showData);
+    }
 
-    private static void OnSaveItem(int index, VirtualScrollRectItem item)
+    private static void OnSendCommentFail()
     {
-        
+        SendCommentButton.interactable = true;
     }
 
-    private static VirtualScrollRectItem OnGetNextItem(int index)
+
+    private static void GetCommentData()
+    {
+        if (requesting)
+        {
+            return;
+        }
+        requesting = true;
+        commentDataHttp = ShowCommentsHttp.Get(currentCommentPage, showData.showId, 
+            OnGetCommentDataSuccess, OnGetCommentDataFail);
+    }
+
+    private static void OnGetCommentDataSuccess(object obj)
     {
-        return null;
+        requesting = false;
+        currentCommentPage++;
+        List<ShowCommentData> datas = (List<ShowCommentData>) obj;
+        foreach (var data in datas)
+        {
+            commentDatas.AddUnique(data, (data0, data1) => data0.id == data1.id);
+        }
+        if (commentItems.Count == 0)
+        {
+            OnGetNextItem(0);
+            OnGetNextItem(0);
+            OnGetNextItem(0);
+            OnGetNextItem(0);
+            OnGetNextItem(0);
+        }
     }
 
-    private static VirtualScrollRectItem OnGetPreviousItem(int index)
+    private static void OnGetCommentDataFail()
     {
-        return null;
+        requesting = false;
     }
 }

+ 10 - 5
Assets/Script/Social/FashionShowEditPage.cs

@@ -55,7 +55,7 @@ public class FashionShowEditPage : Regist
 
     private static Text BuyAllButtonText;
     private static Button BuyAllButton;
-    private static Transform Panel;
+    public static Transform Panel;
     private static Transform ChangeDressPanel;
     private static Transform DisplayBackground;
     private static Transform CuteRateBackground;
@@ -409,10 +409,15 @@ public class FashionShowEditPage : Regist
         }
         else
         {
-            DisplayPlayer.DisplayInScene();
-            ResourceManager.Save(DisplayPlayer);
+            DestroyImmediate(DisplayPlayer.gameObject);
+
+            //DisplayPlayer.DisplayInScene();
+            //ResourceManager.Save(DisplayPlayer);
 
-            PlayerTween.StartForward();
+            if (PlayerTween != null)
+            {
+                PlayerTween.StartForward();
+            }
 
             Panel.GetTweenVec().AddEventOnetime(EventType.BackwardFinish, () => { ChangeDressPanel.TweenForCG(); });
             Panel.TweenBacVec();
@@ -470,7 +475,7 @@ public class FashionShowEditPage : Regist
     private static void OnCommentButtonClick()
     {
         AudioManager.PlayClip(ResourceLabel.BtnClip);
-        FashionShowCommentPanel.ShowPanel();
+        FashionShowCommentPanel.ShowPanel(FashionShowData);
     }
 
     private static void OnShareButtonClick()

+ 2 - 2
Assets/Script/Social/FashionShowHomePage.cs

@@ -169,7 +169,7 @@ public class FashionShowHomePage : Regist
         MineScrollRect.OnGetPreviousItem += OnGetPreviousItem;
     }
 
-    private static void ShowPanel()
+    public static void ShowPanel()
     {
         TweenRoot tween = Panel.TweenForVec();
         tween.AddEventOnetime
@@ -186,7 +186,7 @@ public class FashionShowHomePage : Regist
         OnTabButtonClick(CurrentTabButton);
     }
 
-    private static void HidePanel()
+    public static void HidePanel()
     {
         TweenRoot tween = Panel.GetTweenVec();
         tween.AddEventOnetime

+ 10 - 2
Assets/Script/Social/VirtualScrollRectPlus.cs

@@ -204,7 +204,11 @@ public class VirtualScrollRectPlus : ScrollRect
         for (int i = 0; i < MaxRollAmount; i++)
         {
             int dataIndex = Children.Count == 0 ? 0 : LastIndex + 1;
-            VirtualScrollRectItem item = OnGetNextItem.Invoke(dataIndex);
+            VirtualScrollRectItem item = null;
+            if (OnGetNextItem != null)
+            {
+                item = OnGetNextItem.Invoke(dataIndex);
+            }
             if (item == null)
             {
                 break;
@@ -230,7 +234,11 @@ public class VirtualScrollRectPlus : ScrollRect
         List<VirtualScrollRectItem> rolledItems = new List<VirtualScrollRectItem>();
         for (int i = 0; i < MaxRollAmount; i++)
         {
-            VirtualScrollRectItem item = OnGetPreviousItem.Invoke(FirstIndex-1);
+            VirtualScrollRectItem item = null;
+            if (OnGetPreviousItem != null)
+            {
+                item = OnGetPreviousItem.Invoke(FirstIndex - 1);
+            }
             if (item == null)
             {
                 break;

+ 6 - 0
第五期.txt

@@ -1,3 +1,5 @@
+UI_Player头发和脖子的层级
+
 上衣1的Offset
 
 进入搭配秀界面蜜蜂动画会死机
@@ -8,6 +10,10 @@
 
 点击换小游戏卡住
 
+好友系统
+
+聊天系统
+
 
 
 //关闭DebugMode 开启CatchException