2025-09-29 09:34:15 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Dialogue
|
|
|
|
|
|
{
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
|
public enum RuntimeDialogueNodeType
|
|
|
|
|
|
{
|
|
|
|
|
|
Dialogue,
|
|
|
|
|
|
WaitOnPuzzleStep,
|
|
|
|
|
|
WaitOnPickup,
|
|
|
|
|
|
WaitOnSlot,
|
|
|
|
|
|
WaitOnCombination,
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
2025-10-08 09:34:58 +00:00
|
|
|
|
// Basic dialogue - legacy text-only field
|
|
|
|
|
|
[HideInInspector]
|
2025-09-29 09:34:15 +00:00
|
|
|
|
public List<string> dialogueLines = new List<string>();
|
|
|
|
|
|
public bool loopThroughLines;
|
|
|
|
|
|
|
2025-10-08 09:34:58 +00:00
|
|
|
|
// New mixed content field that supports both text and images
|
|
|
|
|
|
public List<DialogueContent> dialogueContent = new List<DialogueContent>();
|
|
|
|
|
|
|
2025-09-29 09:34:15 +00:00
|
|
|
|
// Conditional nodes
|
|
|
|
|
|
public string puzzleStepID; // For WaitOnPuzzleStep
|
|
|
|
|
|
public string pickupItemID; // For WaitOnPickup
|
|
|
|
|
|
public string slotItemID; // For WaitOnSlot
|
|
|
|
|
|
public string combinationResultItemID; // For WaitOnCombination
|
|
|
|
|
|
|
2025-10-27 16:06:47 +01:00
|
|
|
|
// Auto-play dialogue when condition is met (for item-related nodes)
|
|
|
|
|
|
public bool shouldAutoPlay;
|
|
|
|
|
|
|
2025-09-29 09:34:15 +00:00
|
|
|
|
// For WaitOnSlot - different responses
|
2025-10-08 09:34:58 +00:00
|
|
|
|
[HideInInspector]
|
2025-09-29 09:34:15 +00:00
|
|
|
|
public List<string> incorrectItemLines = new List<string>();
|
|
|
|
|
|
public bool loopThroughIncorrectLines;
|
2025-10-08 09:34:58 +00:00
|
|
|
|
public List<DialogueContent> incorrectItemContent = new List<DialogueContent>();
|
|
|
|
|
|
|
|
|
|
|
|
[HideInInspector]
|
2025-09-29 09:34:15 +00:00
|
|
|
|
public List<string> forbiddenItemLines = new List<string>();
|
|
|
|
|
|
public bool loopThroughForbiddenLines;
|
2025-10-08 09:34:58 +00:00
|
|
|
|
public List<DialogueContent> forbiddenItemContent = new List<DialogueContent>();
|
2025-09-29 09:34:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|