Exemplo n.º 1
0
 void OnVictory()
 {
     GameOverPanel.Instance.Show("游戏胜利");
     foreach (Task task in TaskManager._instance.GetTaskList())
     {
         if (task.TaskProgress == TaskProgress.Accept)
         {
             if (task.IdTranscript == transcriptID)
             {
                 task.TaskProgress = TaskProgress.Reward; //修改任务状态为领取奖励状态
                 TaskDB taskDB = task.TaskDB;
                 taskDB.State = (int)TaskState.Reward;
                 taskDBController.UpdateTaskDB(taskDB);
             }
         }
     }
 }
Exemplo n.º 2
0
    void OnGameSuccess()
    {
        tween.PlayForward();
        message.text = "游戏胜利";
        legend.gameObject.SetActive(true);  //传说
        angel.gameObject.SetActive(false);

        foreach (var task in TaskManager.instance.taskList)  //更新任务进度
        {
            if (task.Progress == TaskProgress.Accept)
            {
                if (task.BookId == GameController.Instance.transcriptId)
                {
                    TaskDB taskDB = task.TaskDB;
                    taskDB.State = (int)TaskState.Reward;
                    controller.UpdateTaskDB(taskDB);
                    return;
                }
            }
        }
    }