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