少年修仙传客户端代码仓库
client_linchunjie
2018-10-09 c5a1b1eb5f845f72b0b3e48fc8c7ccf75cee5831
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));
            }