From 7bd169aec531959daad345c37edcd250c381b8d1 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期六, 29 九月 2018 22:57:06 +0800
Subject: [PATCH] 2077 【BUG】【主干】引导出现错误

---
 System/MainInterfacePanel/TaskListTip.cs |   61 +++++++++++++++---------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/System/MainInterfacePanel/TaskListTip.cs b/System/MainInterfacePanel/TaskListTip.cs
index 12767f1..7796909 100644
--- a/System/MainInterfacePanel/TaskListTip.cs
+++ b/System/MainInterfacePanel/TaskListTip.cs
@@ -215,38 +215,22 @@
         }
         void TaskToAdd(int MissionID, int MissionState, int DiscriptionIndex)//娣诲姞浠诲姟
         {
-            TaskScheduling();
+          
             var inDungeon = IsDungeon();
+            TaskScheduling();
             if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() && !inDungeon)
             {
-                if (MissionState != 0)
-                {
+                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(int TaskID)
         {
             //for (int i = 0; i < Content.childCount; i++)
@@ -348,22 +332,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);
+            //    }
+            //}
         }
 
 

--
Gitblit v1.8.0