36 lines
909 B
C#
36 lines
909 B
C#
|
|
using System;
|
||
|
|
using OTGIntegrated.Quests;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace OTGIntegrated.Dialogue
|
||
|
|
{
|
||
|
|
[CreateAssetMenu(fileName = "DialogueNode", menuName = "OTG Integrated/Dialogue Node")]
|
||
|
|
public sealed class DialogueNode : ScriptableObject
|
||
|
|
{
|
||
|
|
public string nodeId;
|
||
|
|
public string speakerName;
|
||
|
|
[TextArea(3, 8)] public string npcLine;
|
||
|
|
public DialogueResponse[] responses;
|
||
|
|
public bool isEndNode;
|
||
|
|
|
||
|
|
private void OnValidate()
|
||
|
|
{
|
||
|
|
if (string.IsNullOrWhiteSpace(nodeId))
|
||
|
|
{
|
||
|
|
nodeId = name;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[Serializable]
|
||
|
|
public sealed class DialogueResponse
|
||
|
|
{
|
||
|
|
public string responseText;
|
||
|
|
public DialogueNode nextNode;
|
||
|
|
public bool endsDialogue;
|
||
|
|
public QuestData questToStart;
|
||
|
|
public QuestData questToComplete;
|
||
|
|
public bool openCrafting;
|
||
|
|
}
|
||
|
|
}
|