コード例 #1
0
 /// <summary>
 /// 设置任务cleared(完成且领取了奖励)
 /// </summary>
 /// <param name="taskId"></param>
 public void SetTaskCleared(int taskId)
 {
     GuideMissionPlayerDataMSS.TaskStateMSS taskState = GetTaskState(taskId);
     if (taskState != null)
     {
         taskState.isCleared = 1;
     }
 }
コード例 #2
0
 /// <summary>
 /// 设置任务进程
 /// </summary>
 /// <param name="taskId"></param>
 /// <param name="progress"></param>
 public void SetTaskProgress(int taskId, int progress)
 {
     GuideMissionPlayerDataMSS.TaskStateMSS taskState = GetTaskState(taskId);
     if (taskState == null)
     {
         taskState = new GuideMissionPlayerDataMSS.TaskStateMSS()
         {
             taskId = taskId, progress = progress, isCleared = 0
         };
         missionPlayerData.taskStates.Add(taskState);
     }
     taskState.progress = Mathf.Min(progress, GetTaskGoal(taskId));
 }
コード例 #3
0
 /// <summary>
 /// 获取某个任务进度
 /// </summary>
 /// <returns></returns>
 public bool GetTaskProgress(int taskId, out int progress, out int goal)
 {
     progress = 0;
     goal     = GetTaskGoal(taskId);
     Config.missionCell missionCell = GetTaskCell(taskId);
     if (missionCell != null)
     {
         goal = missionCell.need;
     }
     GuideMissionPlayerDataMSS.TaskStateMSS taskState = GetTaskState(taskId);
     if (taskState != null)
     {
         progress = taskState.progress;
     }
     return(progress >= goal);
 }
コード例 #4
0
 /// <summary>
 /// 任务是否Cleared
 /// </summary>
 /// <param name="taskId"></param>
 /// <returns></returns>
 public bool IsTaskCleared(int taskId)
 {
     GuideMissionPlayerDataMSS.TaskStateMSS taskState = GetTaskState(taskId);
     return(taskState == null ? false : taskState.isCleared > 0);
 }