예제 #1
0
    private void TaskAcceptDeal(int taskid)
    {
        TaskConfig.TaskObject element = null;
        TaskConfig            task    = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>();
        bool hasData = task.GetTaskObject(taskid, out element);

        if (!hasData)
        {
            return;
        }
        GUIGuoChang.Show();
        if (element.Progress_Count <= 0)
        {
            GUIRadarScan.Show();
            if (element.Is_End == 1)
            {
                if (element.Is_Perfect_End == 1)
                {
                    NetSender.Instance.RequestTaskCompleteReq(taskid);
                }
                else
                {
                    GUITaskTalkView taskview = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTalkView>();
                    if (taskview != null)
                    {
                        taskview.DestroyThisGUI();
                    }
                    Globals.Instance.MGUIManager.CreateWindow <GUIGameOutcome>(delegate(GUIGameOutcome guiGameOutcome) {
                        guiGameOutcome.EnterGameOutcome(taskid);

                        GUIGuoChang.SetTweenPlay(0, delegate() {});
                    });
                }
            }
            else
            {
                NetSender.Instance.RequestTaskCompleteReq(taskid);
            }
        }
        else
        {
            GUITaskTalkView taskview = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTalkView>();
            if (taskview != null)
            {
                taskview.DestroyThisGUI();
            }
            Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph gui) {
                GUIGuoChang.SetTweenPlay(0, delegate() {
//					EliminationMgr.Instance.GameFieldAnimationEndStartGame ();
                });
                GUIMain guimain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>();
                if (guimain != null)
                {
                    guimain.SetVisible(false);
                }
                gui.DrawReadyView();
            });
        }
    }
예제 #2
0
    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);
    }