| | |
| | | }
|
| | | 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;
|
| | | }
|
| | |
|
| | | 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++)
|
| | |
| | | taskType.ClearTaskName();
|
| | | obj.SetActive(false);
|
| | | 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;
|
| | |
|
| | | for (int j = 0; j < Content.childCount; j++)
|
| | | {
|
| | | GameObject obj = Content.GetChild(j).gameObject;
|
| | | TaskType taskType = obj.GetComponent<TaskType>();
|
| | | if (taskType.TaskID != 0 && _list.Contains(taskType.TaskID))
|
| | | 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);
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | |
|