Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers;
using PixelCrushers.QuestMachine;
using PixelCrushers.DialogueSystem;
public class QuestScenePortal : ScenePortal
{
[Header("Quest Items")]
[Tooltip("The Quest ID as STRING.")]
public string QuestID;
[Tooltip("The Quest Node ID as STRING.")]
public string NodeID;
[Tooltip("The Quest Node must be in this state.")]
public QuestNodeState RequiredState = QuestNodeState.Active;
[Header("Conversation Items")]
[Tooltip("The conversation to show if Quest not Active as STRING")]
[ConversationPopup]
public string ConversationTitle;
[Tooltip("The conversation entry point as INT")]
public int ConversationEntryID=0;
public override void UsePortal()
{
if (QuestMachine.GetQuestNodeState(QuestID, NodeID) == RequiredState)
{
base.UsePortal();
}
else
{
PixelCrushers.DialogueSystem.DialogueManager.StartConversation(ConversationTitle,null,null,ConversationEntryID);
}
}
}