using EasyTalk.Nodes.Core; using System; using UnityEngine; namespace EasyTalk.Nodes.Flow { /// /// A node which waits for a period of time before allowing dialogue flow to continue. /// [SerializeField] public class WaitNode : Node, DialogueFlowNode { /// /// The string value for the amount of time to wait, in seconds. /// [SerializeField] private string waitTime = "1.0"; /// /// Creates a new WaitNode. /// public WaitNode() { this.name = "WAIT"; this.nodeType = NodeType.WAIT; } /// public NodeConnection GetFlowInput() { return Inputs[0]; } /// public NodeConnection GetFlowOutput() { return Outputs[0]; } /// /// Gets or sets the string value for the wait time (in seconds). /// public string WaitTime { get { return waitTime; } set { waitTime = value; } } /// /// Gets the amount of time to wait (in seconds). /// /// The amount of time to wait (in seconds). public float GetWaitTime() { if (waitTime == null || waitTime.Length == 0) { return 0.0f; } else { return Convert.ToSingle(waitTime); } } } }