Ejemplo n.º 1
0
    protected int RefreshTask(TaskType _type, int _startIndex)
    {
		TaskMng taskMng = GameCenter.taskMng;
		Dictionary<int, TaskInfo> taskDic = taskMng.GetTaskDic(_type);
        int index = _startIndex; 
        foreach (TaskInfo item in taskDic.Values)
        {
            if (_type == TaskType.Trial && (item.TaskState == TaskStateType.UnTake || item.TaskState == TaskStateType.ENDED)) continue;//未接取的试炼任务不显示(显示特殊任务)
            if (_type == TaskType.Ring && (taskMng.IsShowSpecislRingTask() || taskMng.FinishAllRingTask)) continue;//未接取的环任务不显示(显示特殊任务)
            if (_type == TaskType.Ring && !taskMng.IsShowThisRingTask(item.StarLevel)) continue;
            if(_type == TaskType.Special && !item.SpecialTaskCanShow)continue;//特殊任务显示有等级要求
            if (_type == TaskType.Special && item.ID == 10001 && (!taskMng.IsShowSpecislRingTask() || taskMng.FinishAllRingTask)) continue;//身上有环任务or所有环任务已完成,不显示特殊(环)任务
			if(_type == TaskType.Special && item.ID == 10002 && (taskMng.HaveTrialTask() || (taskMng.FinishAllTrialTask() && GameCenter.taskMng.TrialTaskRestRewardTimes <= 0)))continue;//身上有试炼任务,不显示特殊(试炼)任务
            if (taskList.Count < index + 1)
            {
                TaskListSingle single = taskListSingleInstance.CreateNew(taskParent.transform, index);
                taskList.Add(single);
                taskParent.AddChild(single.transform);
                UIEventListener.Get(taskList[index].gameObject).onClick -= OnClickTaskBtn;
                UIEventListener.Get(taskList[index].gameObject).onClick += OnClickTaskBtn;
            }
  
            if (taskList[index] != null)
            {
                taskList[index].gameObject.SetActive(true);
                taskList[index].MyTaskInfo = item;
                
            }
            index++;
            
        }
        return index;
    }
Ejemplo n.º 2
0
    void Awake()
    {
        if (dissolveTeamBtn != null) UIEventListener.Get(dissolveTeamBtn).onClick = OnClickDissolveTeamBtn;
        GameObject obj = exResources.GetResource(ResourceType.GUI, "mainUI/TeamInstance") as GameObject;
		if(obj != null)teamMemberInstance = obj.GetComponent<TeamMemberListSingle>();
        obj = null;


        obj = exResources.GetResource(ResourceType.GUI, "mainUI/TaskInstance") as GameObject;
		if(obj != null)taskListSingleInstance = obj.GetComponent<TaskListSingle>();
        obj = null;

		obj = exResources.GetResource(ResourceType.GUI,"") as GameObject;
		if(obj != null)otherListSingleInstance = obj.GetComponent<OtherPlayerListSingle>();
        obj = null;

        if (toggle1Boss != null) EventDelegate.Add(toggle1Boss.onChange,OnChangeBoss);
        if (toggle2Boss != null) EventDelegate.Add(toggle2Boss.onChange, OnChangeBoss);
    }
Ejemplo n.º 3
0
    protected void OnClickTaskBtn(GameObject _obj)
    {

        TaskListSingle taskUI = _obj.GetComponent<TaskListSingle>();
        if (taskUI == null) return;
        GameCenter.curMainPlayer.GoNormal();
        TaskInfo info = taskUI.MyTaskInfo;
        if (info == null) return;
        if (info.TaskType == TaskType.Ring)//打开环任务
        {
            GameCenter.taskMng.curRingTaskType = info.StarLevel;
            if (GameCenter.taskMng.GetRingAutoFinish(GameCenter.taskMng.curRingTaskType))
            {
                GameCenter.curMainPlayer.StopForNextMove();
                GameCenter.taskMng.SetRingAutoFinishType(GameCenter.taskMng.curRingTaskType, false);
            } 
            GameCenter.uIMng.SwitchToUI(GUIType.RINGTASK);
            return;
        }
        GameCenter.taskMng.CurfocusTask = info;

        GameCenter.taskMng.TraceToAction(info);
    }