StartDialogueQuestAction.cs
Code: Select all
using UnityEngine;
using PixelCrushers;
using PixelCrushers.QuestMachine;
public class StartDialogueQuestAction : QuestAction
{
public StringField questGiverID;
public override void Execute()
{
base.Execute();
var go = QuestMachineMessages.FindGameObjectWithID(questGiverID);
var questGiver = (go != null) ? go.GetComponent<QuestGiver>() : null;
if (questGiver != null)
{
questGiver.StartSpecifiedQuestDialogueWithPlayer(StringField.GetStringValue(quest.id));
}
else
{
Debug.LogWarning($"Can't locate Quest Giver '{questGiverID}' to start dialogue");
}
}
}