34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
![]() |
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Data.Common;
|
||
|
using BITKit;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using Microsoft.Extensions.Logging;
|
||
|
using Net.Project.B.Quest;
|
||
|
using NodeCanvas.Framework;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class CompleteQuestNode : ActionTask
|
||
|
{
|
||
|
public BBParameter<int> QuestIdentity;
|
||
|
public BBParameter<QuestState> QuestState;
|
||
|
|
||
|
protected override void OnExecute()
|
||
|
{
|
||
|
var questService = BITApp.ServiceProvider.GetRequiredService<IQuestService>();
|
||
|
|
||
|
if (questService.Quests.TryGetValue(QuestIdentity.value, out var quest))
|
||
|
{
|
||
|
if (quest is QuestData questData)
|
||
|
{
|
||
|
questData.IsCompleted = true;
|
||
|
questData.CurrentState = QuestState.value;
|
||
|
|
||
|
questService.AddOrUpdateQuest(questData);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
EndAction();
|
||
|
}
|
||
|
}
|