Class NonPlayerCharacter
Inheritance
NonPlayerCharacter
Assembly: cs.temp.dll.dll
Syntax
public class NonPlayerCharacter : MonoBehaviour
Fields
audioSourceQueue
Audio source queue that plays generated speech on the fly one-by-one.
Declaration
public AudioSourceQueue audioSourceQueue
Field Value
Type |
Description |
AudioSourceQueue |
|
character
Characters assigned to this NPC.
Declaration
public Character character
Field Value
defaultThreshold
Default semantic similarity threshold for dialogue tree triggers.
Declaration
public float defaultThreshold
Field Value
dialogueSystem
Dialogue System integration.
Declaration
public AbstractDialogueSystem dialogueSystem
Field Value
history
Declaration
public List<ChatLine> history
Field Value
maxLines
Declaration
Field Value
OnDialogueEnd
Event called when dialogue ends
Declaration
public UnityEvent OnDialogueEnd
Field Value
Type |
Description |
UnityEvent |
|
OnDialogueLine
Event called when new line is added to history
where parameters are (ChatLine newLine, bool scriptedLine)
Declaration
public UnityEvent<ChatLine, bool> OnDialogueLine
Field Value
OnDialogueStart
Dialogue start event (triggered when the NPC starts talking)
Declaration
public UnityEvent OnDialogueStart
Field Value
Type |
Description |
UnityEvent |
|
OnProcessingEnd
Event called in the end of an input processing
Declaration
public UnityEvent OnProcessingEnd
Field Value
Type |
Description |
UnityEvent |
|
OnProcessingStart
Event called in the beginning of an input processing
Declaration
public UnityEvent OnProcessingStart
Field Value
Type |
Description |
UnityEvent |
|
OnTopicHintsUpdate
Event called when new dialogue topic hints appear
Declaration
public UnityEvent<List<string>> OnTopicHintsUpdate
Field Value
testLocation
Declaration
public Location testLocation
Field Value
testOtherCharacter
Declaration
public Character testOtherCharacter
Field Value
voiceId
Voice ID of the character for TTS.
Declaration
Field Value
Methods
EndDialogue()
Declaration
public void EndDialogue()
GenerateAndPlaySpeech(String)
Coroutine to generate speech from text.
Declaration
public IEnumerator GenerateAndPlaySpeech(string line)
Parameters
Type |
Name |
Description |
String |
line |
|
Returns
GenerateReply(String, String, String)
Run Chatbot API and generate and play speech
Declaration
public IEnumerator GenerateReply(string otherName, string otherPersona, string line)
Parameters
Type |
Name |
Description |
String |
otherName |
Other conversant name
|
String |
otherPersona |
Other conversant persona
|
String |
line |
Utterance to generate reply to.
|
Returns
HandleLine(String, String, String)
Step dialogue by line from player.
Declaration
public void HandleLine(string otherName, string otherPersona, string line)
Parameters
HandleLineCoroutine(String, String, String)
Declaration
public IEnumerator HandleLineCoroutine(string otherName, string otherPersona, string line)
Parameters
Returns
HandlePlayerLineCoroutine(String, String, String)
Player line handling coroutine
Declaration
public IEnumerator HandlePlayerLineCoroutine(string otherName, string otherPersona, string line)
Parameters
Returns
SayNPCLines()
Scan dialogue tree and say all scripted NPC lines
Declaration
public IEnumerator SayNPCLines()
Returns
StartDialogue()
Declaration
public void StartDialogue()