From c5a1b1eb5f845f72b0b3e48fc8c7ccf75cee5831 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 09 十月 2018 10:30:32 +0800
Subject: [PATCH] Merge branch 'master' into 3687天赋功能

---
 System/MainInterfacePanel/TaskListTip.cs |  119 +++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 70 insertions(+), 49 deletions(-)

diff --git a/System/MainInterfacePanel/TaskListTip.cs b/System/MainInterfacePanel/TaskListTip.cs
index 59a580f..5e25378 100644
--- a/System/MainInterfacePanel/TaskListTip.cs
+++ b/System/MainInterfacePanel/TaskListTip.cs
@@ -141,20 +141,6 @@
         {
            
         }
-        private void TaskIdUpdate(int taskId)
-        {
-            int leng = Content.childCount;
-            for (int i = 0; i < leng; i++)
-            {
-                GameObject childObj = Content.GetChild(i).gameObject;
-                TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
-                if (childObj.activeSelf && childObjTaskType.TaskID == taskId)
-                {
-                    childObj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(taskId);
-                }
-            }
-        }
-
         private void CardLevelChangeEvent(int taskID)//鍗$骇鐘舵�佹敼鍙�
         {
             if (taskmodel.allMissionDict.ContainsKey(taskID) && taskmodel.allMissionDict[taskID].Type == 3)
@@ -166,9 +152,9 @@
         }
         private void MainCardLevelChange(int _id)//涓荤嚎浠诲姟鍗$骇鐘舵�佹敼鍙�
         {
-            TaskScheduling();
-            ChangeSort();
-            TaskJump(_id);
+            //TaskScheduling();
+            //ChangeSort();
+            //TaskJump(_id);
         }
 
         private void SetLength()
@@ -215,35 +201,23 @@
         }
         void TaskToAdd(int MissionID, int MissionState, int DiscriptionIndex)//娣诲姞浠诲姟
         {
-            TaskScheduling();
+          
             var inDungeon = IsDungeon();
+            TaskScheduling();
             if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() && !inDungeon)
             {
-                TaskAddAndDelete();
+                if (MissionState != 0 && MissionID!=1 && _list.Contains(MissionID))
+                {          
+                    TaskAddAndDelete(MissionID);
+                    TaskJump(MissionID);
+                    return;
+                }
+              
             }
-            TaskJump(MissionID);
+         
         }
 
-        void LodingDelTask(int TaskID)
-        {
-            int LengChild = Content.childCount;
-            for (int i = 0; i < LengChild; i++)
-            {
-                TaskType taskType = Content.GetChild(i).GetComponent<TaskType>();
-                FlyingShoesTask flyingShoesTask = Content.GetChild(i).GetComponent<FlyingShoesTask>();
-                if (taskType.TaskID == TaskID && taskType.gameObject.activeSelf)
-                {
-                    taskType.gameObject.SetActive(false);
-                    if (TaskID != taskmodel.GetNowTaskID && flyingShoesTask.ImgSelected.activeSelf)
-                    {
-                        flyingShoesTask.ImgSelected.SetActive(false);
-                    }
-                    flyingShoesTask.UIEffect.Play();
-                }
-            }
-            SetLength();
-        }
-        private void TaskAddAndDelete()
+        private void TaskAddAndDelete(int TaskID)
         {
             for (int i = 0; i < Content.childCount; i++)
             {
@@ -268,8 +242,30 @@
                         childObj.SetActive(false);
                     }
                 }
-              
+
             }
+            //for (int i = 0; i < Content.childCount; i++)
+            //{
+            //    if (i < _list.Count)
+            //    {
+            //        GameObject obj = Content.GetChild(i).gameObject;
+            //        TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
+            //        if (childObjTaskType.TaskID == TaskID)
+            //        {
+            //            return;
+            //        }
+            //        if (childObjTaskType.TaskID == 0)
+            //        {
+            //            obj.SetActive(true);
+            //            childObjTaskType.TaskID = TaskID;
+            //            childObjTaskType.IsGameObjectName(TaskID);
+            //            childObjTaskType.IsMysteriousTask();
+            //            obj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(TaskID);
+            //        }
+            //    }
+
+            //}
+            ChangeSort();//鍏充簬浠诲姟鍙樻洿鎺掑簭
             SetLength();
         }
 
@@ -322,22 +318,39 @@
                     taskType.TaskID = 0;
                     taskType.ClearTaskName();
                     obj.SetActive(false);
-                    obj.transform.SetAsLastSibling();                   
+                    obj.transform.SetAsLastSibling();
+                    return;
                 }
             }
         }
         private void ChangeSort()//鍏充簬浠诲姟鍙樻洿鎺掑簭
         {
-            for (int i = 0; i < Content.childCount; i++)
+
+            for (int i = 0; i < _list.Count; i++)
             {
-                GameObject obj = Content.GetChild(i).gameObject;
-                TaskType taskType = obj.GetComponent<TaskType>();
-                if (taskType.TaskID != 0 && _list.Contains(taskType.TaskID))
+
+                for (int j = 0; j < Content.childCount; j++)
                 {
-                    int Inedx = _list.IndexOf(taskType.TaskID);
-                    obj.transform.SetSiblingIndex(Inedx);
+                    GameObject obj = Content.GetChild(j).gameObject;
+                    TaskType taskType = obj.GetComponent<TaskType>();
+                    if (taskType.TaskID != 0 && taskType.TaskID == _list[i])
+                    {
+                        int Inedx = _list.IndexOf(taskType.TaskID);
+                        obj.transform.SetSiblingIndex(Inedx);
+                    }
                 }
+
             }
+            //for (int i = 0; i < Content.childCount; i++)
+            //{
+            //    GameObject obj = Content.GetChild(i).gameObject;
+            //    TaskType taskType = obj.GetComponent<TaskType>();
+            //    if (taskType.TaskID != 0 && _list.Contains(taskType.TaskID))
+            //    {
+            //        int Inedx = _list.IndexOf(taskType.TaskID);
+            //        obj.transform.SetSiblingIndex(Inedx);
+            //    }
+            //}
         }
 
 
@@ -493,7 +506,15 @@
             }
             else
             {
-                var _position = (_list.Count - type) * m_SizeHeight + (_list.Count - type - 1) * 2;
+                float _position = 0f;
+                if (_list.Count >= 12)
+                {
+                    _position = (12 - type) * m_SizeHeight + (12 - type - 1) * 2;
+                }
+                else
+                {
+                    _position = (_list.Count - type) * m_SizeHeight + (_list.Count - type - 1) * 2;
+                }
                 _position -= 196;
                 m_ScrollRect.verticalNormalizedPosition = Mathf.Clamp01(_position / ((Content as RectTransform).sizeDelta.y - 196));
             }

--
Gitblit v1.8.0