PlayerController
Module: Inworld.AI. Namespace: Inworld.Sample.
This singleton gameObject is the demo example for how to interact with Inworld. For developers please feel free to create your own.
Variables
Variable | Description |
---|---|
UIKey | The KeyCode for opening the global chat panel. By default it's the ~ key. |
OptionKey | The KeyCode for opening the config panel. By default it's the ESC key. |
SkipKey | The KeyCode for enabling skip utterances globally. By default it's not set. |
ContinueKey | The KeyCode to manually move to the next sentence in a conversation. By default it's not set. |
PushToTalk | Determines whether push to talk is allowed. |
PushToTalkKey | The hot key used to enable push-to-talk. By default is C . |
InputField | The input field for players to input texts. |
DropDown | The drop down button for selecting InworldCharacters in the global chat panel. |
SendButton | The button to send texts. |
RecordButton | The button hold to push-to-talk, and release to send the audio. |
Events
Events | Description |
---|---|
onPlayerSpeaks | Triggers when the text was sent by player, or when the speech-to-text was received. |
API
Function | Description | Parameters |
---|---|---|
SendText | Send target message in the input field. | |
SelectCharacterByDropDown | Select the character by the default dropdown component. | nIndex: the index of the character selecting drop down. |
OpenFeedback | Interface for opening the feedback dialog. It'll be implemented in several Inworld child classes. | interactionID: the InteractionID of the target Interaction. correlationID: the CorrelationID of the target Interaction. |
Related Classes
PlayerController2D
Module: Inworld.AI. Namespace: Inworld.Sample. Inherited from PlayerController.
This is the demo player controller used in 2D sample scene.
PlayerController3D
Module: Inworld.AI. Namespace: Inworld.Sample. Inherited from PlayerController.
This is the demo player controller used in 3D sample scene.
Variable | Description |
---|---|
ChatCanvas | The global chat panel gameObject. |
StatusCanvas | The status canvas gameObject. |
FeedbackCanvas | The feedback canvas gameObject. |
OptionCanvas | The config canvas gameObject. |
BubblePanel | The panel to render chatbubbles or other bubble layouts. |