예제 #1
0
    private void TaskItemClick(UnityEngine.GameObject go)
    {
        if (go != null)
        {
            foreach (int id in finishtask)
            {
                if (taskDic.ContainsKey(id))
                {
                    UnityEngine.GameObject godic = taskDic[id];
                    if (godic != null && godic == go)
                    {
                        // by leeQ
                        UIManager.Instance.ShowWindowByName("TaskAward");
                        UnityEngine.GameObject god = UIManager.Instance.GetWindowGoByName("TaskAward");
                        if (god != null)
                        {
                            TaskAward ta = god.GetComponent <TaskAward>();
                            if (ta != null)
                            {
                                ta.SetAwardProperty(id);
                                ta.InitTaskId(id, TaskCompleteType.T_common);
                            }
                        }
                        ////发送已读消息
                        //ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_read_finish", "lobby", id);
                        //LogicSystem.EventChannelForGfx.Publish("ge_ui_award_finished", "ui");//通关副本按钮
                        //UIManager.Instance.HideWindowByName("GameTask");
                        //GfxSystem.PublishGfxEvent("ge_ui_connect_hint", "ui", false, true);
                        return;
                    }
                }
            }
        }
        CloseGameTask();

        foreach (int key in taskDic.Keys)
        {
            if (taskDic[key] == go)
            {
                ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(key);
                if (GotoTargetUI(missionconfig))
                {
                    break;
                }
            }
        }
    }
예제 #2
0
    private void GetTaskIdAndOperator(int id, ArkCrossEngine.MissionOperationType oper, string schedule)
    {
        try
        {
            ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(id);
            ArkCrossEngine.RoleInfo      ri            = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
            if (missionconfig != null && ri != null && ri.Level < missionconfig.LevelLimit)
            {
                return;
            }
            switch (oper)
            {
            case ArkCrossEngine.MissionOperationType.ADD:
                AddTask(id, schedule);
                break;

            case ArkCrossEngine.MissionOperationType.FINISH:
                if (!finishtask.Contains(id))
                {
                    if (!taskDic.ContainsKey(id))
                    {
                        AddTask(id, schedule);
                    }
                    else
                    {
                        SetTaskInfo(taskDic[id], id, schedule);
                    }

                    UnityEngine.Transform tf = taskDic[id].transform.Find("New");
                    if (tf != null)
                    {
                        UISprite us = tf.gameObject.GetComponent <UISprite>();
                        if (us != null)
                        {
                            us.spriteName = "lingj";
                        }
                    }
                    tf = taskDic[id].transform.Find("Schedule");
                    if (tf != null)
                    {
                        NGUITools.SetActive(tf.gameObject, false);
                    }
                    finishtask.Add(id);
                }
                if (missionconfig.MissionType == 1)
                {
                    UIManager.Instance.ShowWindowByName("TaskAward");
                    UnityEngine.GameObject god = UIManager.Instance.GetWindowGoByName("TaskAward");
                    if (god != null)
                    {
                        TaskAward ta = god.GetComponent <TaskAward>();
                        if (ta != null)
                        {
                            ta.SetAwardProperty(id);
                            ta.InitTaskId(id, TaskCompleteType.T_common);
                        }
                    }
                }
                break;

            case ArkCrossEngine.MissionOperationType.DELETE:
                DeleteTask(id);
                if (missionconfig.MissionType == 1)
                {
                    UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("TaskAward");
                    if (!NGUITools.GetActive(go))
                    {
                        if (go != null)
                        {
                            TaskAward ta = go.GetComponent <TaskAward>();
                            if (ta != null && ta.TaskId != id)
                            {
                                ta.SetAwardProperty(id);
                                UIManager.Instance.HideWindowByName("GameTask");
                                UIManager.Instance.ShowWindowByName("TaskAward");
                            }
                        }
                    }
                    else
                    {
                        TaskAward ta = go.GetComponent <TaskAward>();
                        if (ta.TaskId != id)
                        {
                            awardtask.Add(id);
                        }
                    }
                }
                break;

            case ArkCrossEngine.MissionOperationType.UPDATA:
                break;

            default:
                break;
            }
            CheckHasFinish();
        }
        catch (Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
        }
    }