Example #1
0
 private void OnTaskFinished(int taskId, ArkCrossEngine.MissionOperationType opType, string schedule)
 {
     try
     {
         if (opType == ArkCrossEngine.MissionOperationType.FINISH)
         {
             MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(taskId);
             if (missionconfig == null)
             {
                 return;
             }
             if (missionconfig.MissionType == 1)
             {
                 //主线任务完成
                 if (goAwardHint != null)
                 {
                     NGUITools.SetActive(goAwardHint, true);
                 }
                 m_IsCopy = false;
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
Example #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);
        }
    }