//================ 任务流程 ------------------------ // public void TravelTaskIDRes(int taskid) { // this.SetVisible(false); GUIGuoChang.Show(); GUIGameOutcome guiGameOutcome = Globals.Instance.MGUIManager.GetGUIWindow <GUIGameOutcome>(); if (guiGameOutcome != null) { guiGameOutcome.IsReturnMainScene = false; guiGameOutcome.Close(); } GUITravel guiTravel = Globals.Instance.MGUIManager.GetGUIWindow <GUITravel>(); if (guiTravel != null) { guiTravel.IsReturnMainScene = false; guiTravel.Close(); } GUIPhotoGraph guiPhotoGraph = Globals.Instance.MGUIManager.GetGUIWindow <GUIPhotoGraph>(); if (guiPhotoGraph != null) { guiPhotoGraph.IsReturnMainScene = false; guiPhotoGraph.Close(); } GUIMemory guiMemory = Globals.Instance.MGUIManager.GetGUIWindow <GUIMemory>(); if (guiMemory != null) { NGUITools.SetActive(guiMemory.gameObject, false); } Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>(delegate(GUITaskTalkView gui){ TaskConfig tk = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>(); TaskConfig.TaskObject element = null; bool hasData = tk.GetTaskObject(taskid, out element); if (!hasData) { return; } gui.PlayLocalTalk(element.Task_Talk_ID, delegate() { TaskAcceptDeal(taskid); }); }); }
public void StartNextTask(int id, bool isSpendDiamond = false, int fatherTaskId = 0) { if (Globals.Instance.MGameDataManager.MActorData.starData.IsTimeborrowing) { GUIGuoChang.Hide(); return; } if (CheckGuideTask(id)) { // 如果新手引导 不需要接任务就先加到缓存里面 -- // if (id > 0) { bool ishave = false; foreach (sg.GS2C_Task_GetRunning_Res.GetRunning_TaskItem taskitem in Globals.Instance.MGameDataManager.MActorData.MainTaskIDList) { if (taskitem.taskId == id) { ishave = true; } } if (!ishave) { sg.GS2C_Task_GetRunning_Res.GetRunning_TaskItem taskitem = new sg.GS2C_Task_GetRunning_Res.GetRunning_TaskItem(); taskitem.taskId = id; taskitem.taskState = 1; taskitem.taskLastLevel = 0; Globals.Instance.MGameDataManager.MActorData.MainTaskIDList.Add(taskitem); } } GUITaskTalkView taskview = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTalkView>(); if (taskview != null) { taskview.DestroyThisGUI(); } GUIGuoChang.Hide(); return; } if (id == 0) { GUITravel guiTravel = Globals.Instance.MGUIManager.GetGUIWindow <GUITravel>(); if (guiTravel != null) { guiTravel.Close(); } else { GUIMain main = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>(); if (main != null) { main.SetVisible(true); Globals.Instance.MSceneManager.mMainCamera.enabled = true; } } GUIGuoChang.Hide(); Globals.Instance.MTaskManager.mTaskDailyData.NextTaskId = 0; return; } NetSender.Instance.RequestTaskAcceptReq(id, isSpendDiamond, 0, fatherTaskId); }