UI Elements
Learn about the UI elements provided by the Neocortex Unity SDK
After setting up the Neocortex SDK in your Unity project, you can start using the UI elements provided by the SDK to simplify the integration process. The UI elements are designed to provide a seamless integration experience with the Neocortex project.
Adding UI Elements to the Scene
To add the UI elements to your scene, follow these steps:
- Right click on the
Hierarchy
panel - Select
Neocortex
menu and choose the UI element you want to add - The selected UI element will be added to the scene existing canvas or a new canvas will be created
Thinking Indicator
The Thinking Indicator
is a UI element that shows a loading animation when the Neocortex Smart Agent is processing a request.
Methods
Display
Displays the thinking indicator.
- Parameters:
- show: A boolean value to show or hide the thinking indicator.
Chat Panel
The Chat Panel
is a UI element that displays the chat messages between the user and the Neocortex Smart Agent.
Chat Panel component inherits from ScrollRect
and can be used to display chat messages in a scrollable view.
Methods
AddMessage
Adds a message to the chat panel.
- Parameters:
- message: Text message to display in the chat panel.
- isUser: A boolean value to indicate if the message is from the user. This will change the message alignment and color.
Text Chat Input
The Text Chat Input
is a UI element that allows the user to input text messages to send to the Neocortex Smart Agent.
Events
OnSendButtonClicked
Event that is triggered when the send button is clicked.
- Arguments:
- message: The text message entered by the user.
Audio Chat Input
The Audio Chat Input
is a UI element that allows the user to record audio messages to send to the Neocortex Smart Agent.
In the editor mode, this component will display both Push To Talk button and Microphone timer.
However, depending on the Audio Receiver component's configuration, it will display only the Push To Talk button or the Microphone timer, when the game is running.
From left to right:
- Amplitude Indicator: Shows the amplitude of the audio input.
- Microphone Timer: Timer to show the stop time duration of the audio recording.
- Push To Talk Button: Button to start recording audio.
In push to talk mode, the user needs to press and hold the button to record the audio message. And the audio message will be sent to the Neocortex Smart Agent when the button is released. Transcription of the audio message will be displayed in the chat panel.
In continuous mode, audio recording will start when the user starts speaking and will stop when the user stops speaking. The audio message will be sent to the Neocortex Smart Agent when the user stops speaking. Transcription of the audio message will be displayed in the chat panel.