/// <summary> /// 取消任务。 /// </summary> /// <param name="task">要取消的任务。</param> /// <param name="reason">任务取消的原因。</param> /// <returns>是否取消任务成功。</returns> public bool CancelTask(TaskBase task, string reason) { if (task == null) { throw new GameFrameworkException("Task is invalid."); } return(CancelTask(task.SerialId, reason)); }