44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using UnityEngine;
|
|
using OctoCore.Localization;
|
|
|
|
namespace OctoCore.Dialogue
|
|
{
|
|
/// <summary>
|
|
/// Dialogue choice with condition and next dialogue.
|
|
/// </summary>
|
|
[System.Serializable]
|
|
public class OctoDialogueChoice
|
|
{
|
|
/// <summary>
|
|
/// Localized text for this choice.
|
|
/// </summary>
|
|
[Tooltip("Localized text for this choice")]
|
|
public OctoLocalizedTextData Text;
|
|
|
|
/// <summary>
|
|
/// Condition to display this choice.
|
|
/// If null or condition is true, choice is available.
|
|
/// </summary>
|
|
[Tooltip("Condition to display this choice (null = always show)")]
|
|
public OctoDialogueCondition Condition;
|
|
|
|
/// <summary>
|
|
/// Next dialogue to load when this choice is selected.
|
|
/// If null, dialogue ends.
|
|
/// </summary>
|
|
[Tooltip("Next dialogue when selected (null = end dialogue)")]
|
|
public Data.OctoDialogueData NextDialogue;
|
|
|
|
/// <summary>
|
|
/// Check if this choice should be available.
|
|
/// </summary>
|
|
public bool IsAvailable()
|
|
{
|
|
if (Condition == null)
|
|
return true;
|
|
|
|
return Condition.Evaluate();
|
|
}
|
|
}
|
|
}
|