/// <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; } } }
/// <summary> /// Sets a speaker with the given id. /// </summary> /// <param name="id"></param> /// <param name="speaker"></param> /// <returns></returns> public void SetSpeaker(int id, QD_Speaker speaker) { Speakers[GetSpeakerIndex(id)] = speaker; }