53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Dialogue
|
|
{
|
|
[Serializable]
|
|
public enum RuntimeDialogueNodeType
|
|
{
|
|
Dialogue,
|
|
WaitOnPuzzleStep,
|
|
WaitOnPickup,
|
|
WaitOnSlot,
|
|
End
|
|
}
|
|
|
|
[Serializable]
|
|
public class RuntimeDialogueGraph : ScriptableObject
|
|
{
|
|
public string entryNodeID;
|
|
public string speakerName;
|
|
public List<RuntimeDialogueNode> allNodes = new List<RuntimeDialogueNode>();
|
|
|
|
// Helper method to find a node by ID
|
|
public RuntimeDialogueNode GetNodeByID(string id)
|
|
{
|
|
return allNodes.Find(n => n.nodeID == id);
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class RuntimeDialogueNode
|
|
{
|
|
public string nodeID;
|
|
public RuntimeDialogueNodeType nodeType;
|
|
public string nextNodeID;
|
|
|
|
// Basic dialogue
|
|
public List<string> dialogueLines = new List<string>();
|
|
public bool loopThroughLines;
|
|
|
|
// Conditional nodes
|
|
public string puzzleStepID; // For WaitOnPuzzleStep
|
|
public string pickupItemID; // For WaitOnPickup
|
|
public string slotItemID; // For WaitOnSlot
|
|
|
|
// For WaitOnSlot - different responses
|
|
public List<string> incorrectItemLines = new List<string>();
|
|
public bool loopThroughIncorrectLines;
|
|
public List<string> forbiddenItemLines = new List<string>();
|
|
public bool loopThroughForbiddenLines;
|
|
}
|
|
} |