| | |
| | | {
|
| | |
|
| | | }
|
| | | 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)
|
| | |
| | | }
|
| | | 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++)
|
| | | {
|
| | | GameObject childObj = Content.GetChild(i).gameObject;
|
| | | TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
|
| | | if (i < _list.Count)
|
| | | {
|
| | | if (!childObj.activeSelf)
|
| | | {
|
| | | childObj.SetActive(true);
|
| | | }
|
| | | childObjTaskType.TaskID = _list[i];
|
| | | childObjTaskType.IsGameObjectName(_list[i]);
|
| | | childObjTaskType.IsMysteriousTask();
|
| | | childObj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(_list[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | childObjTaskType.ClearTaskName();
|
| | | if (childObj.activeSelf)
|
| | | {
|
| | | childObj.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | //for (int i = 0; i < Content.childCount; i++)
|
| | | //{
|
| | | // GameObject childObj = Content.GetChild(i).gameObject;
|
| | | // TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
|
| | | // if (i < _list.Count)
|
| | | // {
|
| | | // if (!childObj.activeSelf)
|
| | | // GameObject obj = Content.GetChild(i).gameObject;
|
| | | // TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
|
| | | // if (childObjTaskType.TaskID == TaskID)
|
| | | // {
|
| | | // childObj.SetActive(true);
|
| | | // return;
|
| | | // }
|
| | | // childObjTaskType.TaskID = _list[i];
|
| | | // childObjTaskType.IsGameObjectName(_list[i]);
|
| | | // childObjTaskType.IsMysteriousTask();
|
| | | // childObj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(_list[i]);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // childObjTaskType.ClearTaskName();
|
| | | // if (childObj.activeSelf)
|
| | | // if (childObjTaskType.TaskID == 0)
|
| | | // {
|
| | | // childObj.SetActive(false);
|
| | | // obj.SetActive(true);
|
| | | // childObjTaskType.TaskID = TaskID;
|
| | | // childObjTaskType.IsGameObjectName(TaskID);
|
| | | // childObjTaskType.IsMysteriousTask();
|
| | | // obj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(TaskID);
|
| | | // }
|
| | | // }
|
| | |
|
| | | //}
|
| | | 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();
|
| | | }
|
| | |
| | | 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);
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | |
|