Beispiel #1
0
 /// <summary>
 /// Returns the current message, if it is a message node.
 /// </summary>
 /// <returns></returns>
 public QD_Message GetMessage()
 {
     if (currentMessageInfo.Type != QD_NodeType.Message)
     {
         return(null);
     }
     return(dialogue.GetMessage(currentMessageInfo.ID));
 }
Beispiel #2
0
 /// <summary>
 /// The function called to modify the node's data whenever a node connects.
 /// </summary>
 /// <param name="dialogue">The dialogue data.</param>
 /// <param name="connectionType">The type of the connecting node.</param>
 /// <param name="connectionID">The id of the connecting node.</param>
 /// <param name="connectionKnobID">The id of the connecting knob.</param>
 /// <param name="knobID">The id of this node's knob.</param>
 /// <param name="knobType">The type of this node's knob.</param>
 public void OnConnect(QD_Dialogue dialogue, QD_NodeType connectionType, int connectionID, int connectionKnobID, int knobID, QD_KnobType knobType)
 {
     if (knobType == QD_KnobType.Input)
     {
         if (connectionKnobID == 0 && knobID == 0)
         {
             if (connectionType == QD_NodeType.Speaker)
             {
                 QD_Speaker speaker = dialogue.GetSpeaker(connectionID);
                 Speaker     = speaker.ID;
                 SpeakerName = speaker.Name;
             }
             else if (connectionType == QD_NodeType.Message)
             {
                 QD_Message message = dialogue.GetMessage(connectionID);
                 Speaker     = message.Speaker;
                 SpeakerName = message.SpeakerName;
             }
         }
         else if (PreviousMessage != connectionID && connectionKnobID == 1 && knobID == 1)
         {
             PreviousMessage = connectionID;
         }
     }
     else if (knobType == QD_KnobType.Output)
     {
         if (NextMessage != connectionID && knobID == 1)
         {
             NextMessage = connectionID;
         }
     }
 }